Skip to content
Snippets Groups Projects
Commit 7113773c authored by nimrod's avatar nimrod
Browse files

No more Makefile and a little cleanup.

parent 79611f53
No related branches found
No related tags found
No related merge requests found
......@@ -46,8 +46,4 @@ dist/
*.lock
*.env
.bundle/
debian
ubuntu
centos
fedora
alpine
*.touch
......@@ -7,7 +7,7 @@ services:
- docker
script:
- make test clean
- bats test.bats
notifications:
email: false
......
.PHONY: test clean
test:
bats test.bats
clean:
docker image ls --format '{{.ID}}' runas-* | xargs -r docker image rm
rm -f debian fedora ubuntu alpine
test.bats 100644 → 100755
......@@ -5,9 +5,14 @@ _test () {
tag="${2:-latest}"
userland="${3:-gnu}"
docker build -t "runas-$name" --build-arg "image=$name:$tag" --build-arg "userland=$userland" ./
docker run --rm -v "$BATS_TEST_DIRNAME:/volume" "runas-$name" touch "$name"
test "$(id -u)" = "$(stat -c '%u' $name)"
test "$(id -g)" = "$(stat -c '%g' $name)"
docker run --rm -v "$BATS_TEST_DIRNAME:/volume" "runas-$name" touch "$name.touch"
test "$(id -u)" = "$(stat -c '%u' $name.touch)"
test "$(id -g)" = "$(stat -c '%g' $name.touch)"
}
teardown () {
docker image ls --format '{{.ID}}' runas-* | xargs -r docker image rm
rm -f *.touch
}
@test "ubuntu" { _test; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment