Skip to content

Commit f450b81

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 675c9de commit f450b81

26 files changed

+130
-129
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:exposed_dashboard' 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

+6-6
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: Control plane hardened)/ =~ response_s).should_not be_nil
14+
(/(PASSED).*(Control plane hardened)/ =~ 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 role found/ =~ response_s).should_not be_nil
24+
(/(FAILED).*(Users with cluster admin role 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
begin
3333
# Run the exposed_dashboard test to confirm no vulnerability before dashboard is installed
3434
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
3636

3737
# Install the dashboard version 2.0.0.
3838
# According to the kubescape rule, anything less than v2.0.1 would fail.
@@ -59,7 +59,7 @@ describe "Platform" do
5959
response_s = `./cnf-testsuite platform:exposed_dashboard`
6060
Log.info { response_s }
6161
$?.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
6363
ensure
6464
# Ensure to remove the Kubectl dashboard after the test
6565
KubectlClient::Delete.file(dashboard_install_url)
@@ -71,7 +71,7 @@ describe "Platform" do
7171
KubectlClient::Get.resource_wait_for_install("pod", "tiller")
7272
response_s = `./cnf-testsuite platform:helm_tiller`
7373
$?.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
7575
ensure
7676
KubectlClient::Delete.command("pod/tiller")
7777
KubectlClient::Get.resource_wait_for_uninstall("pod", "tiller")
@@ -81,6 +81,6 @@ describe "Platform" do
8181
# By default we have nothing to setup for this task to pass since Helm v3 does not use Tiller.
8282
response_s = `./cnf-testsuite platform:helm_tiller`
8383
$?.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
8585
end
8686
end

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)