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/ ...@@ -46,8 +46,4 @@ dist/
*.lock *.lock
*.env *.env
.bundle/ .bundle/
debian *.touch
ubuntu
centos
fedora
alpine
...@@ -7,7 +7,7 @@ services: ...@@ -7,7 +7,7 @@ services:
- docker - docker
script: script:
- make test clean - bats test.bats
notifications: notifications:
email: false 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 () { ...@@ -5,9 +5,14 @@ _test () {
tag="${2:-latest}" tag="${2:-latest}"
userland="${3:-gnu}" userland="${3:-gnu}"
docker build -t "runas-$name" --build-arg "image=$name:$tag" --build-arg "userland=$userland" ./ 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" docker run --rm -v "$BATS_TEST_DIRNAME:/volume" "runas-$name" touch "$name.touch"
test "$(id -u)" = "$(stat -c '%u' $name)" test "$(id -u)" = "$(stat -c '%u' $name.touch)"
test "$(id -g)" = "$(stat -c '%g' $name)" 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; } @test "ubuntu" { _test; }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment