From e68b554e6601acbddfe2d19604f5d636a9148d28 Mon Sep 17 00:00:00 2001 From: Alexei Ledenev Date: Wed, 18 May 2016 12:51:10 +0300 Subject: [PATCH] fix flag in help (-r for creating test results folder); also do not mount whole /etc (in README.md example), but only required sub directoris (otherwise term does not work as expected in Alpine) --- README.md | 10 +++++++--- bats.Dockerfile | 2 +- run_tests.sh | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 80dbf42..c93e36a 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Command line switches are optional. The following switches are recognized. -g --Generates all CIS Bats tests without execution. No further functions are performed. -p --Show results in pretty format. -t --Show results in TAP format. This is the default format. --t --Create test results files: tests_.tap in test result folder. +-r --Create test results files: tests_.tap in test result folder. -o --Specify test result folder. Default to /var/docker-bench/results. -h --Displays this help message. No further functions are performed. @@ -74,8 +74,12 @@ docker run -it --net host --pid host --cap-add audit_control \ -v /var/lib:/var/lib \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /usr/lib/systemd:/usr/lib/systemd \ - -v /var/docker-bench:/var/docker-bench - -v /etc:/etc --label docker_bench_security \ + -v /var/docker-bench:/var/docker-bench \ + -v /etc/fstab:/etc/fstab \ + -v /etc/docker:/etc/docker \ + -v /etc/default/docker:/etc/default/docker \ + -v /etc/group:/etc/group \ + --label docker_bench_security \ docker-bench-tests ``` diff --git a/bats.Dockerfile b/bats.Dockerfile index 224bebe..8ae749a 100644 --- a/bats.Dockerfile +++ b/bats.Dockerfile @@ -10,7 +10,7 @@ ENV BATS_SHA_256 480d8d64f1681eee78d1002527f3f06e1ac01e173b761bc73d0cf33f4dc1d8d LABEL docker_bench_security=true -RUN apk --update add curl bash \ +RUN apk --update add curl bash ncurses \ && rm -rf /var/lib/apt/lists/* \ && rm /var/cache/apk/* diff --git a/run_tests.sh b/run_tests.sh index 214490b..cb8ac8a 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -39,7 +39,7 @@ HELP() { echo -e "${REV}-g${NORM} --Generates all CIS Bats tests without execution. No further functions are performed." echo -e "${REV}-p${NORM} --Show results in pretty format." echo -e "${REV}-t${NORM} --Show results in TAP format. This is the default format." - echo -e "${REV}-t${NORM} --Create test results files: ${BOLD}tests_.tap${NORM} in test result folder." + echo -e "${REV}-r${NORM} --Create test results files: ${BOLD}tests_.tap${NORM} in test result folder." echo -e "${REV}-o${NORM} --Specify test result folder. Default to ${BOLD}$TEST_RESULTS${NORM}." echo -e "${REV}-h${NORM} --Displays this help message. No further functions are performed."\\n echo -e "Example: ${BOLD}$SCRIPT -t -o $TEST_RESULTS${NORM}"\\n