-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathruby-security.bats
executable file
·53 lines (44 loc) · 1.26 KB
/
ruby-security.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env bats
# Copyright (C) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
load ../utils
load ../security
@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_1191 clearlinux/ruby
[ "$output" == "pass" ]
# stop the container
docker rm -f ruby-server
sleep 3
run check_container_status ruby-server
[ "$status" -eq 1 ]
}
@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_1195 clearlinux/ruby
[ "$output" == "pass" ]
# stop the container
docker rm -f ruby-server
sleep 3
run check_container_status ruby-server
[ "$status" -eq 1 ]
}
@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_1215 clearlinux/ruby
[ "$output" == "pass" ]
# stop the container
docker rm -f ruby-server
sleep 3
run check_container_status ruby-server
[ "$status" -eq 1 ]
}