Skip to content

Commit 4b43358

Browse files
author
Konstantin Yarovoy
committed
output: Add test name before and after the test execution
Ref: cnti-testcatalog#1958 Add information of which test is starting to the console output Add test name to test result console output Signed-off-by: Konstantin Yarovoy <konstantin.yarovoy@tietoevry.com>
1 parent f812650 commit 4b43358

27 files changed

+132
-131
lines changed

spec/5g/core_spec.cr

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe "Core" do
1717
$?.success?.should be_true
1818
response_s = `./cnf-testsuite smf_upf_heartbeat verbose`
1919
Log.info {"response: #{response_s}"}
20-
(/PASSED: Chaos service degradation is less than 50%/ =~ response_s).should_not be_nil
20+
(/(PASSED).*(Chaos service degradation is less than 50%)/ =~ response_s).should_not be_nil
2121
ensure
2222
Log.info {`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample_open5gs/cnf-testsuite.yml`}
2323
$?.success?.should be_true
@@ -30,7 +30,7 @@ describe "Core" do
3030
$?.success?.should be_true
3131
response_s = `./cnf-testsuite smf_upf_heartbeat verbose baseline_count=300`
3232
Log.info {"response: #{response_s}"}
33-
(/FAILED: Chaos service degradation is more than 50%/ =~ response_s).should_not be_nil
33+
(/(FAILED).*(Chaos service degradation is more than 50%)/ =~ response_s).should_not be_nil
3434
ensure
3535
Log.info {`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample_open5gs/cnf-testsuite.yml`}
3636
$?.success?.should be_true
@@ -43,7 +43,7 @@ describe "Core" do
4343
$?.success?.should be_true
4444
response_s = `./cnf-testsuite suci_enabled verbose`
4545
Log.info {"response: #{response_s}"}
46-
(/PASSED: Core uses SUCI 5g authentication/ =~ response_s).should_not be_nil
46+
(/(PASSED).*(Core uses SUCI 5g authentication)/ =~ response_s).should_not be_nil
4747
ensure
4848
Log.info {`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample_open5gs/cnf-testsuite.yml`}
4949
$?.success?.should be_true
@@ -56,7 +56,7 @@ describe "Core" do
5656
$?.success?.should be_true
5757
response_s = `./cnf-testsuite suci_enabled verbose`
5858
Log.info {"response: #{response_s}"}
59-
(/FAILED: Core does not use SUCI 5g authentication/ =~ response_s).should_not be_nil
59+
(/(FAILED).*(Core does not use SUCI 5g authentication)/ =~ response_s).should_not be_nil
6060
ensure
6161
Log.info {`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample_open5gs_no_auth/cnf-testsuite.yml`}
6262
$?.success?.should be_true

spec/5g/ran_spec.cr

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe "5g" do
2121
$?.success?.should be_true
2222
response_s = `./cnf-testsuite oran_e2_connection verbose`
2323
Log.info {"response: #{response_s}"}
24-
(/PASSED: RAN connects to a RIC using the e2 standard interface/ =~ response_s).should_not be_nil
24+
(/(PASSED).*(RAN connects to a RIC using the e2 standard interface)/ =~ response_s).should_not be_nil
2525
ensure
2626
Log.info {`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample-oran-ric/cnf-testsuite.yml`}
2727
$?.success?.should be_true
@@ -38,7 +38,7 @@ describe "5g" do
3838
$?.success?.should be_true
3939
response_s = `./cnf-testsuite oran_e2_connection verbose`
4040
Log.info {"response: #{response_s}"}
41-
(/FAILED: RAN does not connect to a RIC using the e2 standard interface/ =~ response_s).should_not be_nil
41+
(/(FAILED).*(RAN does not connect to a RIC using the e2 standard interface)/ =~ response_s).should_not be_nil
4242
ensure
4343
Log.info {`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample_open5gs/cnf-testsuite.yml`}
4444
$?.success?.should be_true

spec/platform/hardware_and_scheduler_spec.cr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe "Platform" do
1515
it "'oci_compliant' should pass if all runtimes are oci_compliant", tags: ["platform:oci_compliant"] do
1616
response_s = `./cnf-testsuite platform:oci_compliant`
1717
LOGGING.info response_s
18-
(/(PASSED){1}.*(which are OCI compliant runtimes){1}/ =~ response_s).should_not be_nil
18+
(/(PASSED).*(which are OCI compliant runtimes)/ =~ response_s).should_not be_nil
1919
end
2020
end
2121

spec/platform/observability_spec.cr

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe "Platform Observability" do
2121

2222
response_s = `./cnf-testsuite platform:kube_state_metrics poc`
2323
LOGGING.info response_s
24-
(/(PASSED){1}.*(Your platform is using the){1}.*(release for kube state metrics){1}/ =~ response_s).should_not be_nil
24+
(/(PASSED).*(Your platform is using the).*(release for kube state metrics)/ =~ response_s).should_not be_nil
2525
ensure
2626
resp = `#{helm} delete kube-state-metrics`
2727
LOGGING.info resp
@@ -47,7 +47,7 @@ describe "Platform Observability" do
4747
response_s = `./cnf-testsuite platform:node_exporter poc`
4848
LOGGING.info response_s
4949
if check_containerd
50-
(/(PASSED){1}.*(Your platform is using the node exporter){1}/ =~ response_s).should_not be_nil
50+
(/(PASSED).*(Your platform is using the node exporter)/ =~ response_s).should_not be_nil
5151
else
5252
(/skipping node_exporter: This test only supports the Containerd Runtime./ =~ response_s).should_not be_nil
5353
end
@@ -71,7 +71,7 @@ describe "Platform Observability" do
7171

7272
response_s = `./cnf-testsuite platform:prometheus_adapter poc`
7373
Log.info { response_s }
74-
(/(PASSED){1}.*(Your platform is using the prometheus adapter){1}/ =~ response_s).should_not be_nil
74+
(/(PASSED).*(Your platform is using the prometheus adapter)/ =~ response_s).should_not be_nil
7575
ensure
7676
resp = Helm.uninstall("prometheus-adapter")
7777
end
@@ -90,7 +90,7 @@ describe "Platform Observability" do
9090
KubectlClient::Get.wait_for_install(deployment_name: "metrics-server")
9191
response_s = `./cnf-testsuite platform:metrics_server poc`
9292
LOGGING.info response_s
93-
(/(PASSED){1}.*(Your platform is using the metrics server){1}/ =~ response_s).should_not be_nil
93+
(/(PASSED).*(Your platform is using the metrics server)/ =~ response_s).should_not be_nil
9494
ensure
9595
resp = Helm.uninstall("metrics-server")
9696
LOGGING.info resp

spec/platform/platform_spec.cr

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe "Platform" do
3636
it "'k8s_conformance' should pass if the sonobuoy tests pass", tags: ["platform"] do
3737
response_s = `./cnf-testsuite k8s_conformance`
3838
LOGGING.info response_s
39-
(/PASSED: K8s conformance test has no failures/ =~ response_s).should_not be_nil
39+
(/(PASSED).*(K8s conformance test has no failures)/ =~ response_s).should_not be_nil
4040
end
4141

4242
it "individual tasks like 'platform:control_plane_hardening' should not require an installed cnf to run", tags: ["platform"] do

spec/platform/resilience_spec.cr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe "Platform" do
1212
puts "Tests running in destructive mode".colorize(:red)
1313
response_s = `./cnf-testsuite platform:worker_reboot_recovery destructive`
1414
LOGGING.info response_s
15-
(/(PASSED: Node came back online)/ =~ response_s).should_not be_nil
15+
(/(PASSED).*(Node came back online)/ =~ response_s).should_not be_nil
1616
else
1717
response_s = `./cnf-testsuite platform:worker_reboot_recovery`
1818
LOGGING.info response_s

spec/platform/security_spec.cr

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe "Platform" do
1111
it "'control_plane_hardening' should pass if the control plane has been hardened", tags: ["platform:security"] do
1212
response_s = `./cnf-testsuite platform:control_plane_hardening`
1313
Log.info { response_s }
14-
(/(PASSED: Insecure port of Kubernetes API server is not enabled)/ =~ response_s).should_not be_nil
14+
(/(PASSED).*(Insecure port of Kubernetes API server is not enabled)/ =~ response_s).should_not be_nil
1515
end
1616

1717
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
2121
response_s = `./cnf-testsuite platform:cluster_admin`
2222
LOGGING.info response_s
2323
$?.success?.should be_true
24-
(/FAILED: Users with cluster-admin RBAC permissions found/ =~ response_s).should_not be_nil
24+
(/(FAILED).*(Users with cluster-admin RBAC permissions found)/ =~ response_s).should_not be_nil
2525
# ensure
2626
# `./cnf-testsuite cnf_cleanup cnf-config=./sample-cnfs/sample-privilege-escalation/cnf-testsuite.yml`
2727
end
@@ -32,7 +32,7 @@ describe "Platform" do
3232
KubectlClient::Get.resource_wait_for_install("pod", "tiller")
3333
response_s = `./cnf-testsuite platform:helm_tiller`
3434
$?.success?.should be_true
35-
(/FAILED: Containers with the Helm Tiller image are running/ =~ response_s).should_not be_nil
35+
(/(FAILED).*(Containers with the Helm Tiller image are running)/ =~ response_s).should_not be_nil
3636
ensure
3737
KubectlClient::Delete.command("pod/tiller")
3838
KubectlClient::Get.resource_wait_for_uninstall("pod", "tiller")
@@ -42,6 +42,6 @@ describe "Platform" do
4242
# By default we have nothing to setup for this task to pass since Helm v3 does not use Tiller.
4343
response_s = `./cnf-testsuite platform:helm_tiller`
4444
$?.success?.should be_true
45-
(/PASSED: No Helm Tiller containers are running/ =~ response_s).should_not be_nil
45+
(/(PASSED).*(No Helm Tiller containers are running)/ =~ response_s).should_not be_nil
4646
end
4747
end

spec/utils/utils_spec.cr

+3-3
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ describe "Utils" do
196196
Log.info {response_s}
197197
response_s = `./cnf-testsuite cnf_setup cnf-config=sample-cnfs/sample_privileged_cnf/cnf-testsuite.yml`
198198
Log.info {response_s}
199-
resp = `./cnf-testsuite privileged`
200-
Log.info { resp }
201-
(resp).includes?("FAILED: Found 1 privileged containers").should be_true
199+
response_s = `./cnf-testsuite privileged`
200+
Log.info { response_s}
201+
(/(FAILED).*(Found 1 privileged containers)/ =~ response_s).should_not be_nil
202202
ensure
203203
response_s = `./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample-generic-cnf/cnf-testsuite.yml`
204204
Log.info { response_s }

spec/workload/compatibility_spec.cr

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe "Compatibility" do
2626
retries = retries + 1
2727
end
2828
Log.info {"Status: #{response_s}"}
29-
(/PASSED: CNF compatible with both Calico and Cilium/ =~ response_s).should_not be_nil
29+
(/(PASSED).*(CNF compatible with both Calico and Cilium)/ =~ response_s).should_not be_nil
3030
ensure
3131
`./cnf-testsuite cnf_cleanup cnf-config=sample-cnfs/sample-coredns-cnf/cnf-testsuite.yml`
3232
$?.success?.should be_true
@@ -40,7 +40,7 @@ describe "Compatibility" do
4040
response_s = `./cnf-testsuite increase_decrease_capacity verbose`
4141
LOGGING.info response_s
4242
$?.success?.should be_true
43-
(/PASSED: Replicas increased to/ =~ response_s).should_not be_nil
43+
(/(PASSED).*(Replicas increased to)/ =~ response_s).should_not be_nil
4444
ensure
4545
`./cnf-testsuite cnf_cleanup cnf-config=./sample-cnfs/sample_coredns/cnf-testsuite.yml`
4646
end

0 commit comments

Comments
 (0)