From 1fea66056620d74c5e1512842ea0bf9fcca14b52 Mon Sep 17 00:00:00 2001 From: "Liu,Bijun" Date: Wed, 15 Jan 2020 11:14:31 +0800 Subject: [PATCH] Test case naming rules clean up --- tests/memcached/memcached-security.bats | 12 ++++++------ tests/nginx/nginx-security.bats | 12 ++++++------ tests/python/python-security.bats | 12 ++++++------ tests/redis/redis-security.bats | 12 ++++++------ tests/ruby/ruby-security.bats | 12 ++++++------ tests/security.bash | 12 ++++++------ 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/tests/memcached/memcached-security.bats b/tests/memcached/memcached-security.bats index ccfbf1f..de7172d 100755 --- a/tests/memcached/memcached-security.bats +++ b/tests/memcached/memcached-security.bats @@ -5,12 +5,12 @@ load ../utils load ../security -@test "SDL T1191 test" { +@test "1191 test" { # start container first docker run --name memcached-server --detach clearlinux/memcached run check_container_status memcached-server [ "$status" -eq 0 ] - run Test_SDL_T1191 clearlinux/memcached + run Test_1191 clearlinux/memcached [ "$output" == "pass" ] # stop the container @@ -20,12 +20,12 @@ load ../security [ "$status" -eq 1 ] } -@test "SDL T1195 test" { +@test "1195 test" { # start container first docker run --name memcached-server --detach clearlinux/memcached run check_container_status memcached-server [ "$status" -eq 0 ] - run Test_SDL_T1195 clearlinux/memcached + run Test_1195 clearlinux/memcached [ "$output" == "pass" ] # stop the container @@ -35,12 +35,12 @@ load ../security [ "$status" -eq 1 ] } -@test "SDL T1215 test" { +@test "1215 test" { # start container first docker run --name memcached-server --detach --security-opt=no-new-privileges clearlinux/memcached run check_container_status memcached-server [ "$status" -eq 0 ] - run Test_SDL_T1215 clearlinux/memcached + run Test_1215 clearlinux/memcached [ "$output" == "pass" ] # stop the container diff --git a/tests/nginx/nginx-security.bats b/tests/nginx/nginx-security.bats index 094e92a..0190010 100755 --- a/tests/nginx/nginx-security.bats +++ b/tests/nginx/nginx-security.bats @@ -5,12 +5,12 @@ load ../utils load ../security -@test "SDL T1191 test" { +@test "1191 test" { # start container first docker run --name nginx-server --detach clearlinux/nginx run check_container_status nginx-server [ "$status" -eq 0 ] - run Test_SDL_T1191 clearlinux/nginx + run Test_1191 clearlinux/nginx [ "$output" == "pass" ] # stop the container @@ -20,12 +20,12 @@ load ../security [ "$status" -eq 1 ] } -@test "SDL T1195 test" { +@test "1195 test" { # start container first docker run --name nginx-server --detach clearlinux/nginx run check_container_status nginx-server [ "$status" -eq 0 ] - run Test_SDL_T1195 clearlinux/nginx + run Test_1195 clearlinux/nginx [ "$output" == "pass" ] # stop the container @@ -35,12 +35,12 @@ load ../security [ "$status" -eq 1 ] } -@test "SDL T1215 test" { +@test "1215 test" { # start container first docker run --name nginx-server --detach --security-opt=no-new-privileges clearlinux/nginx run check_container_status nginx-server [ "$status" -eq 0 ] - run Test_SDL_T1215 clearlinux/nginx + run Test_1215 clearlinux/nginx [ "$output" == "pass" ] # stop the container diff --git a/tests/python/python-security.bats b/tests/python/python-security.bats index 21f8b33..d0f3786 100755 --- a/tests/python/python-security.bats +++ b/tests/python/python-security.bats @@ -5,12 +5,12 @@ load ../utils load ../security -@test "SDL T1191 test" { +@test "1191 test" { # start container first docker run --name python-server --detach clearlinux/python sleep 60 run check_container_status python-server [ "$status" -eq 0 ] - run Test_SDL_T1191 clearlinux/python + run Test_1191 clearlinux/python [ "$output" == "pass" ] # stop the container @@ -20,12 +20,12 @@ load ../security [ "$status" -eq 1 ] } -@test "SDL T1195 test" { +@test "1195 test" { # start container first docker run --name python-server --detach clearlinux/python sleep 60 run check_container_status python-server [ "$status" -eq 0 ] - run Test_SDL_T1195 clearlinux/python + run Test_1195 clearlinux/python [ "$output" == "pass" ] # stop the container @@ -35,12 +35,12 @@ load ../security [ "$status" -eq 1 ] } -@test "SDL T1215 test" { +@test "1215 test" { # start container first docker run --name python-server --detach --security-opt=no-new-privileges clearlinux/python sleep 60 run check_container_status python-server [ "$status" -eq 0 ] - run Test_SDL_T1215 clearlinux/python + run Test_1215 clearlinux/python [ "$output" == "pass" ] # stop the container diff --git a/tests/redis/redis-security.bats b/tests/redis/redis-security.bats index 8bf5acd..7dd7005 100755 --- a/tests/redis/redis-security.bats +++ b/tests/redis/redis-security.bats @@ -5,12 +5,12 @@ load ../utils load ../security -@test "SDL T1191 test" { +@test "1191 test" { # start container first docker run --name redis-server --detach clearlinux/redis run check_container_status redis-server [ "$status" -eq 0 ] - run Test_SDL_T1191 clearlinux/redis + run Test_1191 clearlinux/redis [ "$output" == "pass" ] # stop the container @@ -20,12 +20,12 @@ load ../security [ "$status" -eq 1 ] } -@test "SDL T1195 test" { +@test "1195 test" { # start container first docker run --name redis-server --detach clearlinux/redis run check_container_status redis-server [ "$status" -eq 0 ] - run Test_SDL_T1195 clearlinux/redis + run Test_1195 clearlinux/redis [ "$output" == "pass" ] # stop the container @@ -35,12 +35,12 @@ load ../security [ "$status" -eq 1 ] } -@test "SDL T1215 test" { +@test "1215 test" { # start container first docker run --name redis-server --detach --security-opt=no-new-privileges clearlinux/redis run check_container_status redis-server [ "$status" -eq 0 ] - run Test_SDL_T1215 clearlinux/redis + run Test_1215 clearlinux/redis [ "$output" == "pass" ] # stop the container diff --git a/tests/ruby/ruby-security.bats b/tests/ruby/ruby-security.bats index 5326ae3..97824c2 100755 --- a/tests/ruby/ruby-security.bats +++ b/tests/ruby/ruby-security.bats @@ -5,12 +5,12 @@ load ../utils load ../security -@test "SDL T1191 test" { +@test "1191 test" { # start container first docker run --name ruby-server -it --detach clearlinux/ruby run check_container_status ruby-server [ "$status" -eq 0 ] - run Test_SDL_T1191 clearlinux/ruby + run Test_1191 clearlinux/ruby [ "$output" == "pass" ] # stop the container @@ -20,12 +20,12 @@ load ../security [ "$status" -eq 1 ] } -@test "SDL T1195 test" { +@test "1195 test" { # start container first docker run --name ruby-server -it --detach clearlinux/ruby run check_container_status ruby-server [ "$status" -eq 0 ] - run Test_SDL_T1195 clearlinux/ruby + run Test_1195 clearlinux/ruby [ "$output" == "pass" ] # stop the container @@ -35,12 +35,12 @@ load ../security [ "$status" -eq 1 ] } -@test "SDL T1215 test" { +@test "1215 test" { # start container first docker run --name ruby-server -it --detach --security-opt=no-new-privileges clearlinux/ruby run check_container_status ruby-server [ "$status" -eq 0 ] - run Test_SDL_T1215 clearlinux/ruby + run Test_1215 clearlinux/ruby [ "$output" == "pass" ] # stop the container diff --git a/tests/security.bash b/tests/security.bash index 6c8ebda..d01b96a 100644 --- a/tests/security.bash +++ b/tests/security.bash @@ -1,8 +1,8 @@ # Defines helper functions used across a variety of tests. #Start security test -#SDL_T1191:Test if Linux Kernel Capabilities are restricted within containers (Docker) -Test_SDL_T1191() { +#1191:Test if Linux Kernel Capabilities are restricted within containers (Docker) +Test_1191() { if [ -n $1 ]; then local container_id=`docker ps --format "table {{.ID}} {{.Image}}" | grep $1 | awk '{print $1}'` else @@ -17,8 +17,8 @@ Test_SDL_T1191() { fi } -#SDL_T1195: Test if SSH is running within containers (Docker) -Test_SDL_T1195() { +#1195: Test if SSH is running within containers (Docker) +Test_1195() { if [ -n $1 ]; then local container_id=`docker ps --format "table {{.ID}} {{.Image}}" | grep $1 | awk '{print $1}'` else @@ -32,8 +32,8 @@ Test_SDL_T1195() { fi } -#SDL_T1215: Verify that containers are restricted from acquiring additional privileges (Docker) -Test_SDL_T1215() { +#1215: Verify that containers are restricted from acquiring additional privileges (Docker) +Test_1215() { if [ -n $1 ]; then local container_id=`docker ps --format "table {{.ID}} {{.Image}}" | grep $1 | awk '{print $1}'` else