From af3a81e48e489e0d2fef8d393f74624f9085d685 Mon Sep 17 00:00:00 2001 From: Kenta Tada Date: Mon, 27 Aug 2018 14:44:38 +0900 Subject: [PATCH] Add rootless testpath in Makefile This commit modifies Makefile for rootless test to select testpath. Signed-off-by: Kenta Tada --- Makefile | 2 +- README.md | 6 ++++++ tests/rootless.sh | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 81db9d9c..c4273f51 100644 --- a/Makefile +++ b/Makefile @@ -79,7 +79,7 @@ localintegration: all bats -t tests/integration${TESTPATH} rootlessintegration: runcimage - $(CONTAINER_ENGINE) run ${CONTAINER_ENGINE_RUN_FLAGS} -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localrootlessintegration + $(CONTAINER_ENGINE) run -e ROOTLESS_TESTPATH ${CONTAINER_ENGINE_RUN_FLAGS} -t --privileged --rm -v $(CURDIR):/go/src/$(PROJECT) $(RUNC_IMAGE) make localrootlessintegration localrootlessintegration: all tests/rootless.sh diff --git a/README.md b/README.md index 972673e8..4588c5b2 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,12 @@ You can run a specific integration test by setting the `TESTPATH` variable. # make test TESTPATH="/checkpoint.bats" ``` +You can run a specific rootless integration test by setting the `ROOTLESS_TESTPATH` variable. + +```bash +# make test ROOTLESS_TESTPATH="/checkpoint.bats" +``` + You can run a test using your container engine's flags by setting `CONTAINER_ENGINE_BUILD_FLAGS` and `CONTAINER_ENGINE_RUN_FLAGS` variables. ```bash diff --git a/tests/rootless.sh b/tests/rootless.sh index 847c286a..d6092d04 100755 --- a/tests/rootless.sh +++ b/tests/rootless.sh @@ -120,6 +120,6 @@ do set -e echo path: $PATH export ROOTLESS_FEATURES="$enabled_features" - sudo -HE -u rootless PATH="$PATH" bats -t "$ROOT/tests/integration$TESTFLAGS" + sudo -HE -u rootless PATH="$PATH" bats -t "$ROOT/tests/integration$ROOTLESS_TESTPATH" set +e done