Loading .gitignore +1 −5 Original line number Diff line number Diff line Loading @@ -46,8 +46,4 @@ dist/ *.lock *.env .bundle/ debian ubuntu centos fedora alpine *.touch .travis.yml +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ services: - docker script: - make test clean - bats test.bats notifications: email: false Loading Makefiledeleted 100644 → 0 +0 −8 Original line number Diff line number Diff line .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 +8 −3 Original line number Diff line number Diff line Loading @@ -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; } Loading Loading
.gitignore +1 −5 Original line number Diff line number Diff line Loading @@ -46,8 +46,4 @@ dist/ *.lock *.env .bundle/ debian ubuntu centos fedora alpine *.touch
.travis.yml +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ services: - docker script: - make test clean - bats test.bats notifications: email: false Loading
Makefiledeleted 100644 → 0 +0 −8 Original line number Diff line number Diff line .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 +8 −3 Original line number Diff line number Diff line Loading @@ -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; } Loading