mirror of
https://github.com/clearlinux/dockerfiles.git
synced 2026-09-01 02:35:02 +00:00
Test case naming rules clean up
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
+6
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user