@@ -11,7 +11,7 @@ describe "Platform" do
11
11
it " 'control_plane_hardening' should pass if the control plane has been hardened" , tags: [" platform:security" ] do
12
12
response_s = ` ./cnf-testsuite platform:control_plane_hardening`
13
13
Log .info { response_s }
14
- (/(PASSED: Control plane hardened) / =~ response_s).should_not be_nil
14
+ (/(PASSED) .* ( Control plane hardened) / =~ response_s).should_not be_nil
15
15
end
16
16
17
17
it " 'cluster_admin' should fail on a cnf that uses a cluster admin binding" , tags: [" platform:security" ] do
@@ -21,7 +21,7 @@ describe "Platform" do
21
21
response_s = ` ./cnf-testsuite platform:cluster_admin`
22
22
LOGGING .info response_s
23
23
$? .success?.should be_true
24
- (/FAILED: Users with cluster admin role found/ =~ response_s).should_not be_nil
24
+ (/( FAILED) .* ( Users with cluster admin role found) / =~ response_s).should_not be_nil
25
25
# ensure
26
26
# `./cnf-testsuite cnf_cleanup cnf-config=./sample-cnfs/sample-privilege-escalation/cnf-testsuite.yml`
27
27
end
@@ -32,7 +32,7 @@ describe "Platform" do
32
32
begin
33
33
# Run the exposed_dashboard test to confirm no vulnerability before dashboard is installed
34
34
response_s = ` ./cnf-testsuite platform:exposed_dashboard`
35
- (/PASSED: No exposed dashboard found in the cluster/ =~ response_s).should_not be_nil
35
+ (/( PASSED) .* ( No exposed dashboard found in the cluster) / =~ response_s).should_not be_nil
36
36
37
37
# Install the dashboard version 2.0.0.
38
38
# According to the kubescape rule, anything less than v2.0.1 would fail.
@@ -59,7 +59,7 @@ describe "Platform" do
59
59
response_s = ` ./cnf-testsuite platform:exposed_dashboard`
60
60
Log .info { response_s }
61
61
$? .success?.should be_true
62
- (/FAILED: Found exposed dashboard in the cluster/ =~ response_s).should_not be_nil
62
+ (/( FAILED) .* ( Found exposed dashboard in the cluster) / =~ response_s).should_not be_nil
63
63
ensure
64
64
# Ensure to remove the Kubectl dashboard after the test
65
65
KubectlClient ::Delete .file(dashboard_install_url)
@@ -71,7 +71,7 @@ describe "Platform" do
71
71
KubectlClient ::Get .resource_wait_for_install(" pod" , " tiller" )
72
72
response_s = ` ./cnf-testsuite platform:helm_tiller`
73
73
$? .success?.should be_true
74
- (/FAILED: Containers with the Helm Tiller image are running/ =~ response_s).should_not be_nil
74
+ (/( FAILED) .* ( Containers with the Helm Tiller image are running) / =~ response_s).should_not be_nil
75
75
ensure
76
76
KubectlClient ::Delete .command(" pod/tiller" )
77
77
KubectlClient ::Get .resource_wait_for_uninstall(" pod" , " tiller" )
@@ -81,6 +81,6 @@ describe "Platform" do
81
81
# By default we have nothing to setup for this task to pass since Helm v3 does not use Tiller.
82
82
response_s = ` ./cnf-testsuite platform:helm_tiller`
83
83
$? .success?.should be_true
84
- (/PASSED: No Helm Tiller containers are running/ =~ response_s).should_not be_nil
84
+ (/( PASSED) .* ( No Helm Tiller containers are running) / =~ response_s).should_not be_nil
85
85
end
86
86
end
0 commit comments