Commit 7113773c authored by nimrod's avatar nimrod
Browse files

No more Makefile and a little cleanup.

parent 79611f53
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -46,8 +46,4 @@ dist/
*.lock
*.env
.bundle/
debian
ubuntu
centos
fedora
alpine
*.touch
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ services:
  - docker

script:
  - make test clean
  - bats test.bats

notifications:
  email: false

Makefile

deleted100644 → 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
@@ -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; }