From 3bd5d2c13b06ba6191126111aaa7a2e95d172d3c Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 19 Oct 2023 17:43:02 +0300
Subject: [PATCH 01/28] website for our cnf
to run need to call ./run-cnf-suites.sh -l lifecycle -s true
-s new filed mean if i want to run that from the website
---
cnf-certification-test/amalpro/index.html | 247 ++++++++++++++
cnf-certification-test/amalpro/logs.js | 13 +
cnf-certification-test/amalpro/submit.js | 48 +++
cnf-certification-test/amalpro/toast.js | 53 +++
cnf-certification-test/index.html | 260 ++++++++++++++
cnf-certification-test/log.log | 395 ++++++++++++++++++++++
cnf-certification-test/suite_test.go | 353 +++++++++++++++++--
7 files changed, 1340 insertions(+), 29 deletions(-)
create mode 100644 cnf-certification-test/amalpro/index.html
create mode 100644 cnf-certification-test/amalpro/logs.js
create mode 100644 cnf-certification-test/amalpro/submit.js
create mode 100644 cnf-certification-test/amalpro/toast.js
create mode 100644 cnf-certification-test/index.html
create mode 100644 cnf-certification-test/log.log
diff --git a/cnf-certification-test/amalpro/index.html b/cnf-certification-test/amalpro/index.html
new file mode 100644
index 000000000..14b632651
--- /dev/null
+++ b/cnf-certification-test/amalpro/index.html
@@ -0,0 +1,247 @@
+
+
+
+
+
+ CNF Certification Test
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CNF Certification Test
+
+
+ Show Log
+
+
+
+ Logs
+ No Logs Found
+ Close
+
+
+
+
+ Red Hat legal and privacy links
+
+ © 2022 Red Hat, Inc.
+ Red Hat legal and privacy links
+
+
+
+ ({ ...acc,
+ [key]: key in acc ? [acc[key], val] : val
+ }), {});
+
+ delete fields.submit;
+ console.log(fields);
+
+ // Send an HTTP request to the server to run the function
+ let heading;
+ let message;
+ let state = 'success';
+
+ try {
+ const data = await fetch('/runFunction', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', },
+ body: JSON.stringify(fields),
+ }).then(response => {
+ if (response.ok) {
+ return response.json();
+ } else {
+ throw new Error(response.statusText);
+ }
+ });
+
+ heading = 'Success';
+ message = data.Message;
+
+ console.log(data);
+ } catch (error) {
+ console.error(error);
+ heading = 'Error'
+ message = error.message;
+ state = 'danger';
+ } finally {
+ form.elements.submit.disabled = false;
+ for (const el of form.elements) if (el instanceof HTMLFieldSetElement) el.disabled = false
+ }
+
+ return { heading, message, state };
+ }
\ No newline at end of file
diff --git a/cnf-certification-test/amalpro/toast.js b/cnf-certification-test/amalpro/toast.js
new file mode 100644
index 000000000..1516826de
--- /dev/null
+++ b/cnf-certification-test/amalpro/toast.js
@@ -0,0 +1,53 @@
+import '@rhds/elements/rh-alert/rh-alert.js';
+
+export async function toast({
+ heading,
+ message,
+ state = 'info',
+ timeout = 8_000,
+}) {
+ await import('@rhds/elements/rh-alert/rh-alert.js');
+ const h2 = document.createElement('h2');
+ h2.textContent = heading;
+ h2.slot = 'header';
+ const alert = document.createElement('rh-alert');
+ alert.setAttribute('aria-live', 'polite');
+ alert.dismissable = true;
+ alert.state = state;
+ alert.classList.add('toast');
+ alert.style.position = 'fixed';
+ alert.style.margin = '0';
+ alert.style.setProperty('z-index', '1000');
+ alert.style.setProperty('inset-inline-end', 'var(--rh-space-xl, 24px)');
+ alert.style.setProperty('inset-block-start', 'var(--rh-space-xl, 24px)');
+ alert.append(h2);
+ if (message) {
+ const p = document.createElement('p');
+ p.textContent = message;
+ alert.append(message);
+ }
+
+ alert.animate({ translate: ['100% 0', '0 0'] }, { duration: 200 });
+
+ await Promise.all(Array.from(document.querySelectorAll('rh-alert.toast'), toast =>
+ // TODO: handle more than 2 toasts
+ toast.animate({
+ translate: [
+ '0 auto',
+ '0 calc(100% + 20px)',
+ ],
+ }, {
+ duration: 200,
+ composite: 'accumulate',
+ rangeEnd: '100%',
+ fill: 'forwards',
+ }).finished));
+
+ setTimeout(() => {
+ if (alert.isConnected) {
+ alert.remove();
+ }
+ }, timeout);
+
+ document.body.append(alert);
+}
\ No newline at end of file
diff --git a/cnf-certification-test/index.html b/cnf-certification-test/index.html
new file mode 100644
index 000000000..f4e096447
--- /dev/null
+++ b/cnf-certification-test/index.html
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+ Run Function
+
+
+
+
+
+
+
+
+
+ CNF CERTIFICATION TEST WEBPAGE
+
+
+
+
+
+ Environment Configuration
+
+
+
+
+
+
+ TNF Configuration
+
+
+
+
+
+
+
+
+ Selecet a Test
+
+
+
+
+
+
+ Click Run Certification Test
+ Run Certification Test
+ Show Certification Test log
+ Show Log
+
+
+
+
+
+
+
+
+
+ © 2022 Red Hat, Inc.
+
+
+
\ No newline at end of file
diff --git a/cnf-certification-test/log.log b/cnf-certification-test/log.log
new file mode 100644
index 000000000..f68b6425e
--- /dev/null
+++ b/cnf-certification-test/log.log
@@ -0,0 +1,395 @@
+[36mINFO [0m[Oct 19 17:05:52.390][suite_test.go: 398] KUBECONFIG : /Users/amal/Downloads/kubeconfig.3nodes
+[36mINFO [0m[Oct 19 17:05:52.390][suite_test.go: 400] Labels filter : lifecycle
+[36mINFO [0m[Oct 19 17:05:52.390][suite_test.go: 436] /Users/amal/Downloads/kubeconfig.3nodes
+[36mINFO [0m[Oct 19 17:05:52.390][utils.go: 66] Saving environment variables & parameters.
+[36mINFO [0m[Oct 19 17:05:52.390][utils.go: 71] Environment: {Home:/Users/amal Kubeconfig:/Users/amal/Downloads/kubeconfig.3nodes ConfigurationPath:tnf_config.yml NonIntrusiveOnly:false LogLevel:debug OfflineDB: AllowPreflightInsecure:false PfltDockerconfig: IncludeWebFilesInOutputFolder:false OmitArtifactsZipFile:false EnableDataCollection:false}
+[36mINFO [0m[Oct 19 17:05:52.390][suite_test.go: 122] Log level set to: debug
+[36mINFO [0m[Oct 19 17:05:52.391][suite_test.go: 452] Ginkgo Version : 2.12.1
+[36mINFO [0m[Oct 19 17:05:52.391][suite_test.go: 453] Labels filter : lifecycle
+[36mINFO [0m[Oct 19 17:05:52.391][suite_test.go: 128] &{/Users/amal /Users/amal/Downloads/kubeconfig.3nodes tnf_config.yml false debug false false false false}
+[36mINFO [0m[Oct 19 17:05:52.391][clientsholder.go: 169] Creating k8s go-clients holder.
+[36mINFO [0m[Oct 19 17:05:53.857][utils.go: 42] Loading config from file: tnf_config.yml
+[33mWARNING[0m[Oct 19 17:05:53.858][utils.go: 55] No namespace configured for the debug DaemonSet. Defaulting to namespace cnf-suite
+[36mINFO [0m[Oct 19 17:06:05.785][main.go: 436] namespace cnf-suite deleted
+[36mINFO [0m[Oct 19 17:06:06.411][main.go: 175] Checking if the daemonset exists
+[36mINFO [0m[Oct 19 17:06:06.566][main.go: 178] daemonset tnf-debug does not exist, err=daemonsets.apps "tnf-debug" not found
+[36mINFO [0m[Oct 19 17:06:06.566][main.go: 226] Creating daemonset tnf-debug
+[36mINFO [0m[Oct 19 17:06:07.344][main.go: 264] Waiting for (3) daemonset pods to be ready: {CurrentNumberScheduled:3 NumberMisscheduled:0 DesiredNumberScheduled:3 NumberReady:0 ObservedGeneration:1 UpdatedNumberScheduled:3 NumberAvailable:0 NumberUnavailable:3 CollisionCount: Conditions:[]}
+[36mINFO [0m[Oct 19 17:06:12.502][main.go: 264] Waiting for (3) daemonset pods to be ready: {CurrentNumberScheduled:3 NumberMisscheduled:0 DesiredNumberScheduled:3 NumberReady:3 ObservedGeneration:1 UpdatedNumberScheduled:3 NumberAvailable:3 NumberUnavailable:0 CollisionCount: Conditions:[]}
+[36mINFO [0m[Oct 19 17:06:12.502][main.go: 281] All the debug pods are ready.
+[36mINFO [0m[Oct 19 17:06:12.502][main.go: 237] Daemonset is ready
+[36mINFO [0m[Oct 19 17:06:12.811][main.go: 243] Successfully created daemonset tnf-debug
+[36mINFO [0m[Oct 19 17:06:13.283][main.go: 264] Waiting for (3) daemonset pods to be ready: {CurrentNumberScheduled:3 NumberMisscheduled:0 DesiredNumberScheduled:3 NumberReady:3 ObservedGeneration:1 UpdatedNumberScheduled:3 NumberAvailable:3 NumberUnavailable:0 CollisionCount: Conditions:[]}
+[36mINFO [0m[Oct 19 17:06:13.283][main.go: 281] All the debug pods are ready.
+[36mINFO [0m[Oct 19 17:06:13.441][autodiscover.go: 154] parsed pods under test labels: [{LabelKey:test-network-function.com/generic LabelValue:target}]
+[36mINFO [0m[Oct 19 17:06:13.441][autodiscover.go: 155] parsed operators under test labels: [{LabelKey:test-network-function.com/operator1 LabelValue:new} {LabelKey:test-network-function.com/operator LabelValue:}]
+[37mDEBUG [0m[Oct 19 17:06:13.609][autodiscover_operators.go: 135] Searching subscriptions in namespace All Namespaces
+[36mINFO [0m[Oct 19 17:06:13.764][autodiscover_operators.go: 144] Found 2 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:06:13.764][autodiscover_operators.go: 146] Subscriptions name: lvms-operator (ns: openshift-storage)
+[36mINFO [0m[Oct 19 17:06:13.764][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[37mDEBUG [0m[Oct 19 17:06:13.764][autodiscover_operators.go: 112] Searching CSVs in namespace All
+[36mINFO [0m[Oct 19 17:06:13.932][autodiscover_operators.go: 121] Found 2 CSVs:
+[36mINFO [0m[Oct 19 17:06:13.932][autodiscover_operators.go: 123] CSV name: packageserver (ns: openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:06:13.932][autodiscover_operators.go: 123] CSV name: lvms-operator.v4.13.1 (ns: openshift-storage)
+[37mDEBUG [0m[Oct 19 17:06:14.253][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/generic=target
+[37mDEBUG [0m[Oct 19 17:06:14.583][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/app=tnf-debug
+[36mINFO [0m[Oct 19 17:06:16.090][autodiscover_scales.go: 40] Target CRD crdexamples.test-network-function.com is not scalable. Skipping search of scalable CRs.
+[37mDEBUG [0m[Oct 19 17:06:16.090][autodiscover_operators.go: 69] Searching CSVs in namespace {tnf}
+[37mDEBUG [0m[Oct 19 17:06:16.090][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator1=new
+[37mDEBUG [0m[Oct 19 17:06:16.243][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator
+[36mINFO [0m[Oct 19 17:06:16.398][autodiscover_operators.go: 91] Found 0 CSVs:
+[37mDEBUG [0m[Oct 19 17:06:16.398][autodiscover_operators.go: 135] Searching subscriptions in namespace tnf
+[36mINFO [0m[Oct 19 17:06:16.551][autodiscover_operators.go: 144] Found 1 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:06:16.551][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[36mINFO [0m[Oct 19 17:06:17.018][autodiscover.go: 276] OpenShift Version found: 4.13.0
+[36mINFO [0m[Oct 19 17:06:17.324][autodiscover_podset.go: 80] Deployment test found in ns tnf
+[36mINFO [0m[Oct 19 17:06:17.478][autodiscover_podset.go: 113] StatefulSet test found in ns tnf
+[36mINFO [0m[Oct 19 17:06:18.760][operators.go: 130] Found 2 unique CSVs
+[36mINFO [0m[Oct 19 17:06:18.760][operators.go: 132] CSV: packageserver
+[36mINFO [0m[Oct 19 17:06:18.761][operators.go: 132] CSV: lvms-operator.v4.13.1
+[36mINFO [0m[Oct 19 17:06:18.914][operators.go: 185] Getting installplans for op lvms-operator.v4.13.1 (subs lvms-operator ns openshift-storage)
+[33mWARNING[0m[Oct 19 17:06:18.914][operators.go: 183] Subscription not found for CSV: packageserver (ns openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:06:18.914][operators.go: 185] Getting installplans for op packageserver (subs ns )
+[36mINFO [0m[Oct 19 17:06:18.914][provider.go: 566] Node clus0-0 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:06:19.091][provider.go: 566] Node clus0-1 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:06:19.265][provider.go: 566] Node clus0-2 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[36mINFO [0m[Oct 19 17:06:19.437][operators.go: 130] Found 0 unique CSVs
+[36mINFO [0m[Oct 19 17:06:19.437][provider.go: 299] Operators found: 0
+[36mINFO [0m[Oct 19 17:06:19.437][provider.go: 311] Completed the test environment build process in 25.58 seconds
+This will be written to the log file.
+[37mDEBUG [0m[Oct 19 17:06:36.971][utils.go: 38] config file already loaded, return previous element
+[36mINFO [0m[Oct 19 17:06:37.282][autodiscover.go: 154] parsed pods under test labels: [{LabelKey:test-network-function.com/generic LabelValue:target}]
+[36mINFO [0m[Oct 19 17:06:37.282][autodiscover.go: 155] parsed operators under test labels: [{LabelKey:test-network-function.com/operator1 LabelValue:new} {LabelKey:test-network-function.com/operator LabelValue:}]
+[37mDEBUG [0m[Oct 19 17:06:37.601][autodiscover_operators.go: 135] Searching subscriptions in namespace All Namespaces
+[36mINFO [0m[Oct 19 17:06:37.757][autodiscover_operators.go: 144] Found 2 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:06:37.757][autodiscover_operators.go: 146] Subscriptions name: lvms-operator (ns: openshift-storage)
+[36mINFO [0m[Oct 19 17:06:37.757][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[37mDEBUG [0m[Oct 19 17:06:37.757][autodiscover_operators.go: 112] Searching CSVs in namespace All
+[36mINFO [0m[Oct 19 17:06:38.081][autodiscover_operators.go: 121] Found 2 CSVs:
+[36mINFO [0m[Oct 19 17:06:38.081][autodiscover_operators.go: 123] CSV name: packageserver (ns: openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:06:38.081][autodiscover_operators.go: 123] CSV name: lvms-operator.v4.13.1 (ns: openshift-storage)
+[37mDEBUG [0m[Oct 19 17:06:38.398][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/generic=target
+[37mDEBUG [0m[Oct 19 17:06:38.727][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/app=tnf-debug
+[36mINFO [0m[Oct 19 17:06:40.202][autodiscover_scales.go: 40] Target CRD crdexamples.test-network-function.com is not scalable. Skipping search of scalable CRs.
+[37mDEBUG [0m[Oct 19 17:06:40.202][autodiscover_operators.go: 69] Searching CSVs in namespace {tnf}
+[37mDEBUG [0m[Oct 19 17:06:40.202][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator1=new
+[37mDEBUG [0m[Oct 19 17:06:40.396][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator
+[36mINFO [0m[Oct 19 17:06:40.554][autodiscover_operators.go: 91] Found 0 CSVs:
+[37mDEBUG [0m[Oct 19 17:06:40.554][autodiscover_operators.go: 135] Searching subscriptions in namespace tnf
+[36mINFO [0m[Oct 19 17:06:40.712][autodiscover_operators.go: 144] Found 1 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:06:40.712][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[36mINFO [0m[Oct 19 17:06:41.179][autodiscover.go: 276] OpenShift Version found: 4.13.0
+[36mINFO [0m[Oct 19 17:06:41.497][autodiscover_podset.go: 80] Deployment test found in ns tnf
+[36mINFO [0m[Oct 19 17:06:41.652][autodiscover_podset.go: 113] StatefulSet test found in ns tnf
+[36mINFO [0m[Oct 19 17:06:42.947][operators.go: 130] Found 2 unique CSVs
+[36mINFO [0m[Oct 19 17:06:42.947][operators.go: 132] CSV: packageserver
+[36mINFO [0m[Oct 19 17:06:42.948][operators.go: 132] CSV: lvms-operator.v4.13.1
+[36mINFO [0m[Oct 19 17:06:43.101][operators.go: 185] Getting installplans for op lvms-operator.v4.13.1 (subs lvms-operator ns openshift-storage)
+[33mWARNING[0m[Oct 19 17:06:43.101][operators.go: 183] Subscription not found for CSV: packageserver (ns openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:06:43.101][operators.go: 185] Getting installplans for op packageserver (subs ns )
+[36mINFO [0m[Oct 19 17:06:43.101][provider.go: 566] Node clus0-0 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:06:43.269][provider.go: 566] Node clus0-1 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:06:43.438][provider.go: 566] Node clus0-2 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[37mDEBUG [0m[Oct 19 17:06:43.613][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[36mINFO [0m[Oct 19 17:06:43.614][operators.go: 130] Found 0 unique CSVs
+[36mINFO [0m[Oct 19 17:06:43.614][provider.go: 299] Operators found: 0
+[36mINFO [0m[Oct 19 17:06:43.614][provider.go: 311] Completed the test environment build process in 6.64 seconds
+[37mDEBUG [0m[Oct 19 17:06:43.614][suite.go: 60] Entering access-control suite
+[37mDEBUG [0m[Oct 19 17:06:43.614][suite.go: 46] Entering affiliated-certification suite
+[37mDEBUG [0m[Oct 19 17:06:43.614][suite.go: 54] Entering lifecycle suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 34] Entering manageability suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 52] Entering networking suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 40] Entering observability suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 35] Entering operator suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 49] Entering platform-alteration suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 34] Entering preflight suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 43] Skipping the preflight suite because the Docker Config file is not provided.
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 44] Entering performance suite
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 204] check container container: test pod: test-0 ns: tnf pre stop lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 204] check container container: test pod: test-1 ns: tnf pre stop lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 204] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf pre stop lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 204] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf pre stop lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 220] check container container: test pod: test-0 ns: tnf post start lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 220] check container container: test pod: test-1 ns: tnf post start lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 220] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf post start lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 220] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf post start lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 237] check container container: test pod: test-0 ns: tnf pull policy, should be IfNotPresent
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 237] check container container: test pod: test-1 ns: tnf pull policy, should be IfNotPresent
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 237] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf pull policy, should be IfNotPresent
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 237] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf pull policy, should be IfNotPresent
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 252] check container container: test pod: test-0 ns: tnf readiness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 252] check container container: test pod: test-1 ns: tnf readiness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 252] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf readiness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 252] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf readiness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 267] check container container: test pod: test-0 ns: tnf liveness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 267] check container container: test pod: test-1 ns: tnf liveness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 267] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf liveness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 267] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf liveness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 282] check container container: test pod: test-0 ns: tnf startup probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 282] check container container: test pod: test-1 ns: tnf startup probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 282] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf startup probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 282] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf startup probe
+[37mDEBUG [0m[Oct 19 17:06:43.618][suite.go: 298] check pod tnf test-0 owner reference
+[37mDEBUG [0m[Oct 19 17:06:43.618][suite.go: 298] check pod tnf test-1 owner reference
+[37mDEBUG [0m[Oct 19 17:06:43.618][suite.go: 298] check pod tnf test-d78fbf8d6-2fk6c owner reference
+[37mDEBUG [0m[Oct 19 17:06:43.618][suite.go: 298] check pod tnf test-d78fbf8d6-wmj2m owner reference
+[36mINFO [0m[Oct 19 17:06:43.618][podsets.go: 190] Waiting 9m0s for 2 podsets to be ready.
+[36mINFO [0m[Oct 19 17:06:43.618][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[37mDEBUG [0m[Oct 19 17:06:43.773][podsets.go: 152] deployment: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:06:43.773][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[37mDEBUG [0m[Oct 19 17:06:43.933][podsets.go: 175] statefulset: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:06:43.933][podsets.go: 198] Not ready Deployments: []
+[36mINFO [0m[Oct 19 17:06:43.933][podsets.go: 199] Not ready StatefulSets: []
+[37mDEBUG [0m[Oct 19 17:06:43.933][loghelper.go: 40] Not ready Deployments: []
+[37mDEBUG [0m[Oct 19 17:06:43.933][loghelper.go: 40] Not ready StatefulSets: []
+[36mINFO [0m[Oct 19 17:06:43.933][podrecreation.go: 51] Performing cordon operation on node clus0-2
+[37mDEBUG [0m[Oct 19 17:06:44.405][suite.go: 570] node: clus0-2 cordoned
+[37mDEBUG [0m[Oct 19 17:06:44.406][suite.go: 576] draining node: clus0-2 with timeout: 8m0s
+[37mDEBUG [0m[Oct 19 17:06:44.406][podrecreation.go: 113] deleting ns=tnf pod=test-0 with deleteForeground mode
+[37mDEBUG [0m[Oct 19 17:06:45.574][podrecreation.go: 159] ns=tnf pod=test-0 deleted
+[36mINFO [0m[Oct 19 17:06:45.574][podsets.go: 190] Waiting 8m0s for 2 podsets to be ready.
+[36mINFO [0m[Oct 19 17:06:45.575][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[37mDEBUG [0m[Oct 19 17:06:45.730][podsets.go: 152] deployment: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:06:45.730][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[36mINFO [0m[Oct 19 17:06:45.888][podsets.go: 198] Not ready Deployments: []
+[36mINFO [0m[Oct 19 17:06:45.888][podsets.go: 199] Not ready StatefulSets: [tnf:test]
+[36mINFO [0m[Oct 19 17:07:00.888][podsets.go: 192] Checking Deployments readiness of Deployments []
+[36mINFO [0m[Oct 19 17:07:00.889][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[37mDEBUG [0m[Oct 19 17:07:01.055][podsets.go: 175] statefulset: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:07:01.056][podsets.go: 198] Not ready Deployments: []
+[36mINFO [0m[Oct 19 17:07:01.056][podsets.go: 199] Not ready StatefulSets: []
+[37mDEBUG [0m[Oct 19 17:07:01.056][loghelper.go: 40] Not ready Deployments: []
+[37mDEBUG [0m[Oct 19 17:07:01.056][loghelper.go: 40] Not ready StatefulSets: []
+[36mINFO [0m[Oct 19 17:07:01.056][podrecreation.go: 51] Performing uncordon operation on node clus0-2
+[36mINFO [0m[Oct 19 17:07:02.642][podrecreation.go: 51] Performing cordon operation on node clus0-0
+[37mDEBUG [0m[Oct 19 17:07:03.963][suite.go: 570] node: clus0-0 cordoned
+[37mDEBUG [0m[Oct 19 17:07:03.964][suite.go: 576] draining node: clus0-0 with timeout: 9m0s
+[37mDEBUG [0m[Oct 19 17:07:03.964][podrecreation.go: 113] deleting ns=tnf pod=test-1 with deleteForeground mode
+[37mDEBUG [0m[Oct 19 17:07:04.299][podrecreation.go: 113] deleting ns=tnf pod=test-d78fbf8d6-wmj2m with deleteForeground mode
+[37mDEBUG [0m[Oct 19 17:07:06.065][podrecreation.go: 159] ns=tnf pod=test-d78fbf8d6-wmj2m deleted
+[37mDEBUG [0m[Oct 19 17:07:06.233][podrecreation.go: 159] ns=tnf pod=test-1 deleted
+[36mINFO [0m[Oct 19 17:07:06.233][podsets.go: 190] Waiting 9m0s for 2 podsets to be ready.
+[36mINFO [0m[Oct 19 17:07:06.233][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[36mINFO [0m[Oct 19 17:07:06.400][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[36mINFO [0m[Oct 19 17:07:06.572][podsets.go: 198] Not ready Deployments: [tnf:test]
+[36mINFO [0m[Oct 19 17:07:06.572][podsets.go: 199] Not ready StatefulSets: [tnf:test]
+[36mINFO [0m[Oct 19 17:07:21.573][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[37mDEBUG [0m[Oct 19 17:07:21.738][podsets.go: 152] deployment: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:07:21.738][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[37mDEBUG [0m[Oct 19 17:07:21.907][podsets.go: 175] statefulset: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:07:21.907][podsets.go: 198] Not ready Deployments: []
+[36mINFO [0m[Oct 19 17:07:21.907][podsets.go: 199] Not ready StatefulSets: []
+[37mDEBUG [0m[Oct 19 17:07:21.907][loghelper.go: 40] Not ready Deployments: []
+[37mDEBUG [0m[Oct 19 17:07:21.907][loghelper.go: 40] Not ready StatefulSets: []
+[36mINFO [0m[Oct 19 17:07:21.907][podrecreation.go: 51] Performing uncordon operation on node clus0-0
+[36mINFO [0m[Oct 19 17:07:22.734][podrecreation.go: 51] Performing cordon operation on node clus0-1
+[37mDEBUG [0m[Oct 19 17:07:24.042][suite.go: 570] node: clus0-1 cordoned
+[37mDEBUG [0m[Oct 19 17:07:24.054][suite.go: 576] draining node: clus0-1 with timeout: 8m0s
+[37mDEBUG [0m[Oct 19 17:07:24.054][podrecreation.go: 113] deleting ns=tnf pod=test-d78fbf8d6-2fk6c with deleteForeground mode
+[37mDEBUG [0m[Oct 19 17:07:26.465][podrecreation.go: 159] ns=tnf pod=test-d78fbf8d6-2fk6c deleted
+[36mINFO [0m[Oct 19 17:07:26.465][podsets.go: 190] Waiting 8m0s for 2 podsets to be ready.
+[36mINFO [0m[Oct 19 17:07:26.465][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[36mINFO [0m[Oct 19 17:07:26.631][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[37mDEBUG [0m[Oct 19 17:07:26.797][podsets.go: 175] statefulset: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:07:26.797][podsets.go: 198] Not ready Deployments: [tnf:test]
+[36mINFO [0m[Oct 19 17:07:26.797][podsets.go: 199] Not ready StatefulSets: []
+[36mINFO [0m[Oct 19 17:07:41.798][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[37mDEBUG [0m[Oct 19 17:07:41.957][podsets.go: 152] deployment: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:07:41.957][podsets.go: 195] Checking StatefulSets readiness of StatefulSets []
+[36mINFO [0m[Oct 19 17:07:41.957][podsets.go: 198] Not ready Deployments: []
+[36mINFO [0m[Oct 19 17:07:41.957][podsets.go: 199] Not ready StatefulSets: []
+[37mDEBUG [0m[Oct 19 17:07:41.957][loghelper.go: 40] Not ready Deployments: []
+[37mDEBUG [0m[Oct 19 17:07:41.957][loghelper.go: 40] Not ready StatefulSets: []
+[36mINFO [0m[Oct 19 17:07:41.957][podrecreation.go: 51] Performing uncordon operation on node clus0-1
+[36mINFO [0m[Oct 19 17:07:43.096][podrecreation.go: 51] Performing uncordon operation on node clus0-1
+[36mINFO [0m[Oct 19 17:07:43.579][podrecreation.go: 51] Performing uncordon operation on node clus0-0
+[36mINFO [0m[Oct 19 17:07:44.056][podrecreation.go: 51] Performing uncordon operation on node clus0-2
+[37mDEBUG [0m[Oct 19 17:07:44.692][utils.go: 38] config file already loaded, return previous element
+[36mINFO [0m[Oct 19 17:07:45.020][autodiscover.go: 154] parsed pods under test labels: [{LabelKey:test-network-function.com/generic LabelValue:target}]
+[36mINFO [0m[Oct 19 17:07:45.020][autodiscover.go: 155] parsed operators under test labels: [{LabelKey:test-network-function.com/operator1 LabelValue:new} {LabelKey:test-network-function.com/operator LabelValue:}]
+[37mDEBUG [0m[Oct 19 17:07:45.193][autodiscover_operators.go: 135] Searching subscriptions in namespace All Namespaces
+[36mINFO [0m[Oct 19 17:07:45.355][autodiscover_operators.go: 144] Found 2 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:07:45.355][autodiscover_operators.go: 146] Subscriptions name: lvms-operator (ns: openshift-storage)
+[36mINFO [0m[Oct 19 17:07:45.355][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[37mDEBUG [0m[Oct 19 17:07:45.355][autodiscover_operators.go: 112] Searching CSVs in namespace All
+[36mINFO [0m[Oct 19 17:07:45.678][autodiscover_operators.go: 121] Found 2 CSVs:
+[36mINFO [0m[Oct 19 17:07:45.678][autodiscover_operators.go: 123] CSV name: packageserver (ns: openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:07:45.678][autodiscover_operators.go: 123] CSV name: lvms-operator.v4.13.1 (ns: openshift-storage)
+[37mDEBUG [0m[Oct 19 17:07:46.004][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/generic=target
+[37mDEBUG [0m[Oct 19 17:07:46.340][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/app=tnf-debug
+[36mINFO [0m[Oct 19 17:07:47.722][autodiscover_scales.go: 40] Target CRD crdexamples.test-network-function.com is not scalable. Skipping search of scalable CRs.
+[37mDEBUG [0m[Oct 19 17:07:47.723][autodiscover_operators.go: 69] Searching CSVs in namespace {tnf}
+[37mDEBUG [0m[Oct 19 17:07:47.723][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator1=new
+[37mDEBUG [0m[Oct 19 17:07:47.881][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator
+[36mINFO [0m[Oct 19 17:07:48.038][autodiscover_operators.go: 91] Found 0 CSVs:
+[37mDEBUG [0m[Oct 19 17:07:48.055][autodiscover_operators.go: 135] Searching subscriptions in namespace tnf
+[36mINFO [0m[Oct 19 17:07:48.213][autodiscover_operators.go: 144] Found 1 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:07:48.213][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[36mINFO [0m[Oct 19 17:07:48.678][autodiscover.go: 276] OpenShift Version found: 4.13.0
+[36mINFO [0m[Oct 19 17:07:48.997][autodiscover_podset.go: 80] Deployment test found in ns tnf
+[36mINFO [0m[Oct 19 17:07:49.152][autodiscover_podset.go: 113] StatefulSet test found in ns tnf
+[36mINFO [0m[Oct 19 17:07:50.462][operators.go: 130] Found 2 unique CSVs
+[36mINFO [0m[Oct 19 17:07:50.463][operators.go: 132] CSV: packageserver
+[36mINFO [0m[Oct 19 17:07:50.463][operators.go: 132] CSV: lvms-operator.v4.13.1
+[36mINFO [0m[Oct 19 17:07:50.630][operators.go: 185] Getting installplans for op lvms-operator.v4.13.1 (subs lvms-operator ns openshift-storage)
+[33mWARNING[0m[Oct 19 17:07:50.630][operators.go: 183] Subscription not found for CSV: packageserver (ns openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:07:50.630][operators.go: 185] Getting installplans for op packageserver (subs ns )
+[36mINFO [0m[Oct 19 17:07:50.630][provider.go: 566] Node clus0-0 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:07:50.810][provider.go: 566] Node clus0-1 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:07:51.020][provider.go: 566] Node clus0-2 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[37mDEBUG [0m[Oct 19 17:07:51.390][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[36mINFO [0m[Oct 19 17:07:51.391][operators.go: 130] Found 0 unique CSVs
+[36mINFO [0m[Oct 19 17:07:51.391][provider.go: 299] Operators found: 0
+[36mINFO [0m[Oct 19 17:07:51.391][provider.go: 311] Completed the test environment build process in 6.70 seconds
+[36mINFO [0m[Oct 19 17:07:53.160][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:07:54.315][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:07:55.476][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:07:56.632][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:07:57.841][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:07:59.000][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:00.160][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:01.317][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:02.473][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:03.631][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:04.789][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:05.945][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:07.100][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[37mDEBUG [0m[Oct 19 17:08:08.254][utils.go: 38] config file already loaded, return previous element
+[36mINFO [0m[Oct 19 17:08:08.561][autodiscover.go: 154] parsed pods under test labels: [{LabelKey:test-network-function.com/generic LabelValue:target}]
+[36mINFO [0m[Oct 19 17:08:08.561][autodiscover.go: 155] parsed operators under test labels: [{LabelKey:test-network-function.com/operator1 LabelValue:new} {LabelKey:test-network-function.com/operator LabelValue:}]
+[37mDEBUG [0m[Oct 19 17:08:08.725][autodiscover_operators.go: 135] Searching subscriptions in namespace All Namespaces
+[36mINFO [0m[Oct 19 17:08:08.880][autodiscover_operators.go: 144] Found 2 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:08:08.880][autodiscover_operators.go: 146] Subscriptions name: lvms-operator (ns: openshift-storage)
+[36mINFO [0m[Oct 19 17:08:08.880][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[37mDEBUG [0m[Oct 19 17:08:08.881][autodiscover_operators.go: 112] Searching CSVs in namespace All
+[36mINFO [0m[Oct 19 17:08:09.199][autodiscover_operators.go: 121] Found 2 CSVs:
+[36mINFO [0m[Oct 19 17:08:09.200][autodiscover_operators.go: 123] CSV name: packageserver (ns: openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:08:09.200][autodiscover_operators.go: 123] CSV name: lvms-operator.v4.13.1 (ns: openshift-storage)
+[37mDEBUG [0m[Oct 19 17:08:09.526][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/generic=target
+[37mDEBUG [0m[Oct 19 17:08:09.880][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/app=tnf-debug
+[36mINFO [0m[Oct 19 17:08:11.375][autodiscover_scales.go: 40] Target CRD crdexamples.test-network-function.com is not scalable. Skipping search of scalable CRs.
+[37mDEBUG [0m[Oct 19 17:08:11.375][autodiscover_operators.go: 69] Searching CSVs in namespace {tnf}
+[37mDEBUG [0m[Oct 19 17:08:11.375][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator1=new
+[37mDEBUG [0m[Oct 19 17:08:11.531][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator
+[36mINFO [0m[Oct 19 17:08:11.687][autodiscover_operators.go: 91] Found 0 CSVs:
+[37mDEBUG [0m[Oct 19 17:08:11.687][autodiscover_operators.go: 135] Searching subscriptions in namespace tnf
+[36mINFO [0m[Oct 19 17:08:11.842][autodiscover_operators.go: 144] Found 1 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:08:11.842][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[36mINFO [0m[Oct 19 17:08:12.314][autodiscover.go: 276] OpenShift Version found: 4.13.0
+[36mINFO [0m[Oct 19 17:08:12.622][autodiscover_podset.go: 80] Deployment test found in ns tnf
+[36mINFO [0m[Oct 19 17:08:12.776][autodiscover_podset.go: 113] StatefulSet test found in ns tnf
+[36mINFO [0m[Oct 19 17:08:14.078][operators.go: 130] Found 2 unique CSVs
+[36mINFO [0m[Oct 19 17:08:14.079][operators.go: 132] CSV: packageserver
+[36mINFO [0m[Oct 19 17:08:14.079][operators.go: 132] CSV: lvms-operator.v4.13.1
+[36mINFO [0m[Oct 19 17:08:14.236][operators.go: 185] Getting installplans for op lvms-operator.v4.13.1 (subs lvms-operator ns openshift-storage)
+[33mWARNING[0m[Oct 19 17:08:14.236][operators.go: 183] Subscription not found for CSV: packageserver (ns openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:08:14.236][operators.go: 185] Getting installplans for op packageserver (subs ns )
+[36mINFO [0m[Oct 19 17:08:14.236][provider.go: 566] Node clus0-0 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:08:14.408][provider.go: 566] Node clus0-1 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:08:14.580][provider.go: 566] Node clus0-2 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.784][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.784][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.784][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[36mINFO [0m[Oct 19 17:08:14.784][operators.go: 130] Found 0 unique CSVs
+[36mINFO [0m[Oct 19 17:08:14.784][provider.go: 299] Operators found: 0
+[36mINFO [0m[Oct 19 17:08:14.784][provider.go: 311] Completed the test environment build process in 6.53 seconds
+[37mDEBUG [0m[Oct 19 17:08:16.369][utils.go: 38] config file already loaded, return previous element
+[36mINFO [0m[Oct 19 17:08:16.678][autodiscover.go: 154] parsed pods under test labels: [{LabelKey:test-network-function.com/generic LabelValue:target}]
+[36mINFO [0m[Oct 19 17:08:16.678][autodiscover.go: 155] parsed operators under test labels: [{LabelKey:test-network-function.com/operator1 LabelValue:new} {LabelKey:test-network-function.com/operator LabelValue:}]
+[37mDEBUG [0m[Oct 19 17:08:16.844][autodiscover_operators.go: 135] Searching subscriptions in namespace All Namespaces
+[36mINFO [0m[Oct 19 17:08:17.001][autodiscover_operators.go: 144] Found 2 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:08:17.001][autodiscover_operators.go: 146] Subscriptions name: lvms-operator (ns: openshift-storage)
+[36mINFO [0m[Oct 19 17:08:17.001][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[37mDEBUG [0m[Oct 19 17:08:17.001][autodiscover_operators.go: 112] Searching CSVs in namespace All
+[36mINFO [0m[Oct 19 17:08:17.169][autodiscover_operators.go: 121] Found 2 CSVs:
+[36mINFO [0m[Oct 19 17:08:17.169][autodiscover_operators.go: 123] CSV name: packageserver (ns: openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:08:17.169][autodiscover_operators.go: 123] CSV name: lvms-operator.v4.13.1 (ns: openshift-storage)
+[37mDEBUG [0m[Oct 19 17:08:17.485][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/generic=target
+[37mDEBUG [0m[Oct 19 17:08:17.810][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/app=tnf-debug
+[36mINFO [0m[Oct 19 17:08:19.152][autodiscover_scales.go: 40] Target CRD crdexamples.test-network-function.com is not scalable. Skipping search of scalable CRs.
+[37mDEBUG [0m[Oct 19 17:08:19.152][autodiscover_operators.go: 69] Searching CSVs in namespace {tnf}
+[37mDEBUG [0m[Oct 19 17:08:19.152][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator1=new
+[37mDEBUG [0m[Oct 19 17:08:19.305][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator
+[36mINFO [0m[Oct 19 17:08:19.458][autodiscover_operators.go: 91] Found 0 CSVs:
+[37mDEBUG [0m[Oct 19 17:08:19.458][autodiscover_operators.go: 135] Searching subscriptions in namespace tnf
+[36mINFO [0m[Oct 19 17:08:19.614][autodiscover_operators.go: 144] Found 1 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:08:19.614][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[36mINFO [0m[Oct 19 17:08:20.082][autodiscover.go: 276] OpenShift Version found: 4.13.0
+[36mINFO [0m[Oct 19 17:08:20.391][autodiscover_podset.go: 80] Deployment test found in ns tnf
+[36mINFO [0m[Oct 19 17:08:20.547][autodiscover_podset.go: 113] StatefulSet test found in ns tnf
+[36mINFO [0m[Oct 19 17:08:21.850][operators.go: 130] Found 2 unique CSVs
+[36mINFO [0m[Oct 19 17:08:21.850][operators.go: 132] CSV: packageserver
+[36mINFO [0m[Oct 19 17:08:21.850][operators.go: 132] CSV: lvms-operator.v4.13.1
+[36mINFO [0m[Oct 19 17:08:22.004][operators.go: 185] Getting installplans for op lvms-operator.v4.13.1 (subs lvms-operator ns openshift-storage)
+[33mWARNING[0m[Oct 19 17:08:22.004][operators.go: 183] Subscription not found for CSV: packageserver (ns openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:08:22.004][operators.go: 185] Getting installplans for op packageserver (subs ns )
+[36mINFO [0m[Oct 19 17:08:22.004][provider.go: 566] Node clus0-0 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:08:22.179][provider.go: 566] Node clus0-1 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:08:22.351][provider.go: 566] Node clus0-2 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.531][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.531][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[36mINFO [0m[Oct 19 17:08:22.531][operators.go: 130] Found 0 unique CSVs
+[36mINFO [0m[Oct 19 17:08:22.531][provider.go: 299] Operators found: 0
+[36mINFO [0m[Oct 19 17:08:22.531][provider.go: 311] Completed the test environment build process in 6.16 seconds
+[37mDEBUG [0m[Oct 19 17:08:22.531][isolation.go: 71] container: test pod: test-0 ns: tnf has CPU requests 250 (milli) that has to be a whole unit.
+[37mDEBUG [0m[Oct 19 17:08:22.531][isolation.go: 71] container: test pod: test-1 ns: tnf has CPU requests 250 (milli) that has to be a whole unit.
+[37mDEBUG [0m[Oct 19 17:08:22.531][isolation.go: 71] container: test pod: test-d78fbf8d6-rtxbr ns: tnf has CPU requests 250 (milli) that has to be a whole unit.
+[37mDEBUG [0m[Oct 19 17:08:22.531][isolation.go: 71] container: test pod: test-d78fbf8d6-vvlwx ns: tnf has CPU requests 250 (milli) that has to be a whole unit.
+[36mINFO [0m[Oct 19 17:08:22.636][archiver.go: 45] Compressing results artifacts into /Users/amal/Documents/GitHub/cnf-certification-test/cnf-certification-test/20231019-170822-cnf-test-results.tar.gz
+[37mDEBUG [0m[Oct 19 17:08:22.637][archiver.go: 59] Zipping file /Users/amal/Documents/GitHub/cnf-certification-test/cnf-certification-test/claim.json
+[37mDEBUG [0m[Oct 19 17:08:22.666][archiver.go: 59] Zipping file /Users/amal/Documents/GitHub/cnf-certification-test/cnf-certification-test/cnf-certification-tests_junit.xml
+[37mDEBUG [0m[Oct 19 17:08:22.667][archiver.go: 59] Zipping file /Users/amal/Documents/GitHub/cnf-certification-test/cnf-certification-test/claimjson.js
+[37mDEBUG [0m[Oct 19 17:08:22.700][archiver.go: 59] Zipping file /Users/amal/Documents/GitHub/cnf-certification-test/cnf-certification-test/results.html
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 22a900793..782e94368 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -17,14 +17,20 @@
package suite
import (
+ "bufio"
_ "embed"
+ "encoding/json"
"flag"
+ "fmt"
+ "net/http"
"os"
"path/filepath"
"testing"
"time"
+ "github.com/gorilla/websocket"
"github.com/onsi/ginkgo/v2"
+ "github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/test-network-function/cnf-certification-test/cnf-certification-test/results"
"github.com/test-network-function/cnf-certification-test/pkg/claimhelper"
@@ -56,8 +62,10 @@ const (
defaultClaimPath = ".."
defaultCliArgValue = ""
junitFlagKey = "junit"
+ serverRun = "runserver"
TNFReportKey = "cnf-certification-test"
extraInfoKey = "testsExtraInfo"
+ defaultServerRun = false
)
var (
@@ -77,13 +85,28 @@ var (
// ClaimFormat is the current version for the claim file format to be produced by the TNF test suite.
// A client decoding this claim file must support decoding its specific version.
ClaimFormatVersion string
+ serveRun *bool
)
+//go:embed amalpro/index.html
+var indexHTML []byte
+
+//go:embed amalpro/submit.js
+var submit []byte
+
+//go:embed amalpro/logs.js
+var logs []byte
+
+//go:embed amalpro/toast.js
+var toast []byte
+
func init() {
claimPath = flag.String(claimPathFlagKey, defaultClaimPath,
"the path where the claimfile will be output")
junitPath = flag.String(junitFlagKey, defaultCliArgValue,
"the path for the junit format report")
+ serveRun = flag.Bool(serverRun, defaultServerRun,
+ "the path for the junit format report")
}
// setLogLevel sets the log level for logrus based on the "TNF_LOG_LEVEL" environment variable
@@ -102,6 +125,7 @@ func setLogLevel() {
func getK8sClientsConfigFileNames() []string {
params := configuration.GetTestParameters()
+ logrus.Info(params)
fileNames := []string{}
if params.Kubeconfig != "" {
fileNames = append(fileNames, params.Kubeconfig)
@@ -126,6 +150,59 @@ func getGitVersion() string {
return gitDisplayRelease + " ( " + GitCommit + " )"
}
+func startServer() {
+ log.Info("inside starting the server")
+
+ http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
+ // Set the content type to "text/html".
+ w.Header().Set("Content-Type", "text/html")
+ // Write the embedded HTML content to the response.
+ _, err := w.Write(indexHTML)
+ if err != nil {
+ http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ }
+ })
+
+ http.HandleFunc("/submit.js", func(w http.ResponseWriter, r *http.Request) {
+ // Set the content type to "application/javascript".
+ w.Header().Set("Content-Type", "application/javascript")
+ // Write the embedded JavaScript content to the response.
+ _, err := w.Write(submit)
+ if err != nil {
+ http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ }
+ })
+
+ http.HandleFunc("/logs.js", func(w http.ResponseWriter, r *http.Request) {
+ // Set the content type to "application/javascript".
+ w.Header().Set("Content-Type", "application/javascript")
+ // Write the embedded JavaScript content to the response.
+ _, err := w.Write(logs)
+ if err != nil {
+ http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ }
+ })
+
+ http.HandleFunc("/toast.js", func(w http.ResponseWriter, r *http.Request) {
+ // Set the content type to "application/javascript".
+ w.Header().Set("Content-Type", "application/javascript")
+ // Write the embedded JavaScript content to the response.
+ _, err := w.Write(toast)
+ if err != nil {
+ http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ }
+ })
+
+ http.HandleFunc("/runFunction", runHandler)
+ // Serve the static HTML file
+ http.HandleFunc("/logstream", logStreamHandler)
+
+ fmt.Println("Server is running on :8080...")
+ if err := http.ListenAndServe(":8080", nil); err != nil {
+ panic(err)
+ }
+}
+
// TestTest invokes the CNF Certification Test Suite.
func TestTest(t *testing.T) {
// When running unit tests, skip the suite
@@ -147,43 +224,55 @@ func TestTest(t *testing.T) {
log.Infof("Claim Format Version: %s", ClaimFormatVersion)
log.Infof("Ginkgo Version : %v", ginkgo.GINKGO_VERSION)
log.Infof("Labels filter : %v", ginkgoConfig.LabelFilter)
+ log.Infof("*serveRun : %v", *serveRun)
+ log.Info("starting the server")
+
+ go startServer()
+ // Keep the main program running
// Diagnostic functions will run when no labels are provided.
- var diagnosticMode bool
- if ginkgoConfig.LabelFilter == "" {
- log.Infof("TNF will run in diagnostic mode so no test case will be launched.")
- diagnosticMode = true
- }
+ if !*serveRun {
+ var diagnosticMode bool
+ if ginkgoConfig.LabelFilter == "" {
+ log.Infof("TNF will run in diagnostic mode so no test case will be launched.")
+ diagnosticMode = true
+ }
- // Set clientsholder singleton with the filenames from the env vars.
- _ = clientsholder.GetClientsHolder(getK8sClientsConfigFileNames()...)
+ // Set clientsholder singleton with the filenames from the env vars.
+ _ = clientsholder.GetClientsHolder(getK8sClientsConfigFileNames()...)
- // Initialize the claim with the start time, tnf version, etc.
- claimRoot := claimhelper.CreateClaimRoot()
- claimData := claimRoot.Claim
- claimData.Configurations = make(map[string]interface{})
- claimData.Nodes = make(map[string]interface{})
- incorporateVersions(claimData)
+ // Initialize the claim with the start time, tnf version, etc.
+ claimRoot := claimhelper.CreateClaimRoot()
+ claimData := claimRoot.Claim
+ claimData.Configurations = make(map[string]interface{})
+ claimData.Nodes = make(map[string]interface{})
+ incorporateVersions(claimData)
- configurations, err := claimhelper.MarshalConfigurations()
- if err != nil {
- log.Errorf("Configuration node missing because of: %s", err)
- t.FailNow()
- }
+ configurations, err := claimhelper.MarshalConfigurations()
+ if err != nil {
+ log.Errorf("Configuration node missing because of: %s", err)
+ t.FailNow()
+ }
- claimData.Nodes = claimhelper.GenerateNodes()
- claimhelper.UnmarshalConfigurations(configurations, claimData.Configurations)
+ claimData.Nodes = claimhelper.GenerateNodes()
+ claimhelper.UnmarshalConfigurations(configurations, claimData.Configurations)
- // initialize abort flag
- testhelper.AbortTrigger = ""
+ // initialize abort flag
+ testhelper.AbortTrigger = ""
- // Run tests specs only if not in diagnostic mode, otherwise all TSs would run.
- var env provider.TestEnvironment
- if !diagnosticMode {
- env.SetNeedsRefresh()
- env = provider.GetTestEnvironment()
- ginkgo.RunSpecs(t, CnfCertificationTestSuiteName)
+ // Run tests specs only if not in diagnostic mode, otherwise all TSs would run.
+ var env provider.TestEnvironment
+ if !diagnosticMode {
+ env.SetNeedsRefresh()
+ env = provider.GetTestEnvironment()
+ ginkgo.RunSpecs(t, CnfCertificationTestSuiteName)
+ }
+ continueRun(t, diagnosticMode, env, claimData, claimRoot)
}
+ select {}
+}
+
+func continueRun(t *testing.T, diagnosticMode bool, env provider.TestEnvironment, claimData *claim.Claim, claimRoot *claim.Root) {
endTime := time.Now()
claimData.Metadata.EndTime = endTime.UTC().Format(claimhelper.DateTimeFormatDirective)
@@ -211,7 +300,7 @@ func TestTest(t *testing.T) {
// Send claim file to the collector if specified by env var
if configuration.GetTestParameters().EnableDataCollection {
- err = collector.SendClaimFileToCollector(env.CollectorAppEndPoint, claimOutputFile, env.ExecutedBy, env.PartnerName, env.CollectorAppPassword)
+ err := collector.SendClaimFileToCollector(env.CollectorAppEndPoint, claimOutputFile, env.ExecutedBy, env.PartnerName, env.CollectorAppPassword)
if err != nil {
log.Errorf("Failed to send post request to the collector: %v", err)
}
@@ -264,3 +353,209 @@ func incorporateVersions(claimData *claim.Claim) {
ClaimFormat: ClaimFormatVersion,
}
}
+
+var upgrader = websocket.Upgrader{
+ CheckOrigin: func(r *http.Request) bool {
+ return true
+ },
+}
+
+// Define an HTTP handler that triggers Ginkgo tests
+func runHandler(w http.ResponseWriter, r *http.Request) {
+ // Run Ginkgo tests
+ var requestData RequestData
+ //var responseData ResponseData
+ // Parse JSON data from the request body
+ err := json.NewDecoder(r.Body).Decode(&requestData)
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusBadRequest)
+ return
+ }
+ // Create or open a log file
+ filename := "log.log"
+ if _, err := os.Stat(filename); err == nil {
+ // If it exists, truncate it to remove the contents
+ file, err := os.OpenFile(filename, os.O_TRUNC, 0)
+ if err != nil {
+ // Handle the error if necessary
+ panic(err)
+ }
+ file.Close()
+ }
+ logFile, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
+ if err != nil {
+ panic(err)
+ }
+ logrus.SetOutput(logFile)
+ originalStdout := os.Stdout
+ os.Stdout = logFile
+ // Read the YAML file
+ defer func() {
+ os.Stdout = originalStdout
+ logFile.Close()
+ }()
+ os.Setenv("KUBECONFIG", requestData.KubeConfigPath)
+ logrus.Infof("KUBECONFIG : %v", requestData.KubeConfigPath)
+
+ logrus.Infof("Labels filter : %v", requestData.SelectedOptions)
+
+ // Set the output of the logger to the log file
+
+ /*data, err := os.ReadFile("tnf_config.yml")
+ if err != nil {
+ log.Fatalf("Error reading YAML file: %v", err)
+ }
+
+ // Unmarshal the YAML data into a Config struct
+ var config configuration.TestConfiguration
+
+ err = yaml.Unmarshal(data, &config)
+ if err != nil {
+ log.Fatalf("Error unmarshaling YAML: %v", err)
+ }
+
+ // Modify the configuration
+ var namespace []configuration.Namespace
+ namespace = append(namespace, configuration.Namespace{Name: requestData.Field3})
+
+ config.TargetNameSpaces = namespace // Change the port to a new value
+
+ // Serialize the modified config back to YAML format
+ newData, err := yaml.Marshal(&config)
+ if err != nil {
+ log.Fatalf("Error marshaling YAML: %v", err)
+ }
+
+ // Write the modified YAML data back to the file
+ err = os.WriteFile("tnf_config.yml", newData, os.ModePerm)
+ if err != nil {
+ log.Fatalf("Error writing YAML file: %v", err)
+ }
+ */
+ t := testing.T{}
+ logrus.Infof(os.Getenv("KUBECONFIG"))
+ // When running unit tests, skip the suite
+ if os.Getenv("UNIT_TEST") != "" {
+ t.Skip("Skipping test suite when running unit tests")
+ }
+
+ err = configuration.LoadEnvironmentVariables()
+ if err != nil {
+ log.Fatalf("could not load the environment variables, error: %v", err)
+ }
+
+ // Set up logging params for logrus
+ loghelper.SetLogFormat()
+ setLogLevel()
+
+ ginkgoConfig, _ := ginkgo.GinkgoConfiguration()
+ log.Infof("Ginkgo Version : %v", ginkgo.GINKGO_VERSION)
+ log.Infof("Labels filter : %v", ginkgoConfig.LabelFilter)
+ // Set clientsholder singleton with the filenames from the env vars.
+ _ = clientsholder.GetClientsHolder(getK8sClientsConfigFileNames()...)
+
+ // Initialize the claim with the start time, tnf version, etc.
+ claimRoot := claimhelper.CreateClaimRoot()
+ claimData := claimRoot.Claim
+ claimData.Configurations = make(map[string]interface{})
+ claimData.Nodes = make(map[string]interface{})
+ incorporateVersions(claimData)
+
+ configurations, err := claimhelper.MarshalConfigurations()
+ if err != nil {
+ log.Errorf("Configuration node missing because of: %s", err)
+ t.FailNow()
+ }
+ claimData.Nodes = claimhelper.GenerateNodes()
+ claimhelper.UnmarshalConfigurations(configurations, claimData.Configurations)
+
+ // initialize abort flag
+ testhelper.AbortTrigger = ""
+
+ fmt.Println("This will be written to the log file.")
+ var env provider.TestEnvironment
+ env.SetNeedsRefresh()
+ env = provider.GetTestEnvironment()
+ // fetch the current config
+ suiteConfig, reporterConfig := ginkgo.GinkgoConfiguration()
+ // adjust it
+ suiteConfig.SkipStrings = []string{"NEVER-RUN"}
+ reporterConfig.FullTrace = true
+ reporterConfig.JUnitReport = "cnf-certification-tests_junit.xml"
+ // pass it in to RunSpecs
+ suiteConfig.LabelFilter = requestData.SelectedOptions
+ ginkgo.RunSpecs(&t, CnfCertificationTestSuiteName, suiteConfig, reporterConfig)
+
+ continueRun(&t, false, env, claimData, claimRoot)
+ // Return the result as JSON
+ response := struct {
+ Message string `json:"Message"`
+ }{
+ Message: fmt.Sprintf("Sucsses to run %s", requestData.SelectedOptions),
+ }
+ // Serialize the response data to JSON
+ jsonResponse, err := json.Marshal(response)
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+ // Set the Content-Type header to specify that the response is JSON
+ w.Header().Set("Content-Type", "application/json")
+
+ // Write the JSON response to the client
+ _, err = w.Write(jsonResponse)
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+
+}
+
+func logStreamHandler(w http.ResponseWriter, r *http.Request) {
+ conn, err := upgrader.Upgrade(w, r, nil)
+ if err != nil {
+ log.Printf("WebSocket upgrade error: %v", err)
+ return
+ }
+ defer conn.Close()
+
+ filePath := "log.log"
+
+ // Open the log file
+ file, err := os.Open(filePath)
+ if err != nil {
+ log.Println(err)
+ return
+ }
+ defer file.Close()
+
+ // Create a scanner to read the log file line by line
+ for {
+ scanner := bufio.NewScanner(file)
+ for scanner.Scan() {
+ line := scanner.Text() + "\n"
+ // Send each log line to the client
+ if err := conn.WriteMessage(websocket.TextMessage, []byte(line)); err != nil {
+ fmt.Println(err)
+ //return
+ }
+
+ // Sleep for a short duration to simulate real-time updates
+ time.Sleep(100 * time.Millisecond)
+ }
+ if err := scanner.Err(); err != nil {
+ log.Printf("Error reading log file: %v", err)
+ }
+
+ time.Sleep(1 * time.Second)
+ }
+
+}
+
+type RequestData struct {
+ KubeConfigPath string `json:"kubeConfigPath"`
+ SelectedOptions string `json:"selectedOptions"`
+}
+type ResponseData struct {
+ Message string `json:"message"`
+}
From 2bfd874aa10e523f2a671df9783e374d631d60d7 Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Mon, 23 Oct 2023 12:27:58 +0300
Subject: [PATCH 02/28] a few changes(add upload file) and added the -s for
server
---
cnf-certification-test/amalpro/index.html | 18 +-
cnf-certification-test/amalpro/logs.js | 2 -
cnf-certification-test/amalpro/submit.js | 6 +-
cnf-certification-test/log.log | 395 ----------------------
cnf-certification-test/suite_test.go | 83 ++++-
go.mod | 1 +
go.sum | 1 +
run-cnf-suites.sh | 17 +-
8 files changed, 94 insertions(+), 429 deletions(-)
delete mode 100644 cnf-certification-test/log.log
diff --git a/cnf-certification-test/amalpro/index.html b/cnf-certification-test/amalpro/index.html
index 14b632651..dbac2fdbb 100644
--- a/cnf-certification-test/amalpro/index.html
+++ b/cnf-certification-test/amalpro/index.html
@@ -137,16 +137,12 @@
const { toast } = await import('./toast.js');
await toast({ heading, message, state, timeout: 20_000 });
});
- document.getElementById('show-logs').addEventListener('click', function(event) {
- const socket = new WebSocket('ws://localhost:8080/logstream');
+ document.getElementById('show-logs').addEventListener('click', async function(event) {
const code = document
- .getElementById('logs')
- .querySelector('rh-code-block');
+ .getElementById('logs')
+ .querySelector('rh-code-block');
code.textContent = '';
- // Handle incoming log messages
- socket.addEventListener('message', function (event) {
- code.textContent += event.data + '\n';
- });
+ await import('./logs.js')
});
@@ -168,11 +164,9 @@ CNF Certification Test
diff --git a/cnf-certification-test/webserver/logs.js b/cnf-certification-test/webserver/logs.js
index a3624f210..4de5b4968 100644
--- a/cnf-certification-test/webserver/logs.js
+++ b/cnf-certification-test/webserver/logs.js
@@ -1,6 +1,6 @@
import '@rhds/elements/rh-code-block/rh-code-block.js';
-const socket = new WebSocket('ws://localhost:8080/logstream');
+const socket = new WebSocket('ws://localhost:8084/logstream');
const code = document
.getElementById('logs')
.querySelector('rh-code-block');
diff --git a/cnf-certification-test/webserver_function.go b/cnf-certification-test/webserver_function.go
index 30bb3e787..5cbeac9f0 100644
--- a/cnf-certification-test/webserver_function.go
+++ b/cnf-certification-test/webserver_function.go
@@ -2,11 +2,10 @@ package suite
import (
"bufio"
+ "bytes"
_ "embed"
"fmt"
"net/http"
- "os"
- "time"
"github.com/gorilla/websocket"
@@ -24,6 +23,8 @@ var logs []byte
//go:embed webserver/toast.js
var toast []byte
+var Buf *bytes.Buffer
+var aString string
var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
@@ -38,36 +39,23 @@ func logStreamHandler(w http.ResponseWriter, r *http.Request) {
return
}
defer conn.Close()
-
- filePath := "log.log"
-
- // Open the log file
- file, err := os.Open(filePath)
- if err != nil {
- logrus.Println(err)
- return
- }
- defer file.Close()
-
// Create a scanner to read the log file line by line
for {
- scanner := bufio.NewScanner(file)
+ scanner := bufio.NewScanner(Buf)
for scanner.Scan() {
line := scanner.Text() + "\n"
// Send each log line to the client
if err := conn.WriteMessage(websocket.TextMessage, []byte(line)); err != nil {
fmt.Println(err)
- //return
+ return
}
- // Sleep for a short duration to simulate real-time updates
- time.Sleep(100 * time.Millisecond)
}
if err := scanner.Err(); err != nil {
logrus.Printf("Error reading log file: %v", err)
+ return
}
- time.Sleep(1 * time.Second)
}
}
From c65f25a354af94bd7c4140b4342d548762a391f3 Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 2 Nov 2023 12:15:05 +0200
Subject: [PATCH 08/28] add bufer implemntation fir logs
---
cnf-certification-test/suite_test.go | 3 ++-
cnf-certification-test/webserver/logs.js | 2 +-
cnf-certification-test/webserver_function.go | 8 +++++---
go.mod | 2 ++
go.sum | 21 ++++++++++++++++++++
5 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 12a7b4bd9..47949fc25 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -23,6 +23,7 @@ import (
"flag"
"fmt"
"io"
+ logl "log"
"net/http"
"os"
"path/filepath"
@@ -311,7 +312,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
Buf = bytes.NewBufferString(aString)
logrus.SetOutput(Buf)
-
+ logl.SetOutput(Buf)
jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
logrus.Info(jsonData)
var data RequstedData
diff --git a/cnf-certification-test/webserver/logs.js b/cnf-certification-test/webserver/logs.js
index 4de5b4968..81b3f4c05 100644
--- a/cnf-certification-test/webserver/logs.js
+++ b/cnf-certification-test/webserver/logs.js
@@ -7,5 +7,5 @@ const code = document
code.textContent = '';
// Handle incoming log messages
socket.addEventListener('message', function (event) {
- code.textContent += event.data + '\n';
+ code.innerHTML += event.data + '\n';
});
\ No newline at end of file
diff --git a/cnf-certification-test/webserver_function.go b/cnf-certification-test/webserver_function.go
index 5cbeac9f0..1d9975ec7 100644
--- a/cnf-certification-test/webserver_function.go
+++ b/cnf-certification-test/webserver_function.go
@@ -8,7 +8,7 @@ import (
"net/http"
"github.com/gorilla/websocket"
-
+ "github.com/robert-nix/ansihtml"
"github.com/sirupsen/logrus"
)
@@ -43,9 +43,11 @@ func logStreamHandler(w http.ResponseWriter, r *http.Request) {
for {
scanner := bufio.NewScanner(Buf)
for scanner.Scan() {
- line := scanner.Text() + "\n"
+ line := scanner.Bytes()
+ line = append(ansihtml.ConvertToHTML(line), []byte("
")...)
+
// Send each log line to the client
- if err := conn.WriteMessage(websocket.TextMessage, []byte(line)); err != nil {
+ if err := conn.WriteMessage(websocket.TextMessage, line); err != nil {
fmt.Println(err)
return
}
diff --git a/go.mod b/go.mod
index bdcde7895..b23000178 100644
--- a/go.mod
+++ b/go.mod
@@ -216,8 +216,10 @@ require (
github.com/gorilla/websocket v1.4.2
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0
github.com/manifoldco/promptui v0.9.0
+ github.com/onsi/ginkgo v1.16.5
github.com/openshift/machine-config-operator v0.0.1-0.20230515070935-49f32d46538e
github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20231018165107-f04b78186455
+ github.com/robert-nix/ansihtml v1.0.1
github.com/test-network-function/oct v0.0.2
github.com/test-network-function/privileged-daemonset v1.0.13
gopkg.in/yaml.v3 v3.0.1
diff --git a/go.sum b/go.sum
index 3b5137cd1..e7bc701a9 100644
--- a/go.sum
+++ b/go.sum
@@ -189,6 +189,8 @@ github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6
github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
@@ -223,6 +225,7 @@ github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU=
@@ -350,6 +353,7 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
@@ -467,12 +471,17 @@ github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7P
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
+github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
@@ -533,6 +542,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qq
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/robert-nix/ansihtml v1.0.1 h1:VTiyQ6/+AxSJoSSLsMecnkh8i0ZqOEdiRl/odOc64fc=
+github.com/robert-nix/ansihtml v1.0.1/go.mod h1:CJwclxYaTPc2RfcxtanEACsYuTksh4yDXcNeHHKZINE=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
@@ -705,6 +716,7 @@ golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -727,6 +739,7 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
@@ -769,6 +782,7 @@ golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -780,7 +794,10 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -801,6 +818,7 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -888,6 +906,7 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
@@ -1017,6 +1036,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
@@ -1026,6 +1046,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
From f36b1664d42b7f6a18018407f0884e57bdc9416f Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 2 Nov 2023 13:18:11 +0200
Subject: [PATCH 09/28] update the flag
---
cnf-certification-test/suite_test.go | 11 +++++------
run-cnf-suites.sh | 4 ++--
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 47949fc25..3eba1c2e6 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -32,7 +32,6 @@ import (
"time"
"github.com/onsi/ginkgo/v2"
- "github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/test-network-function/cnf-certification-test/cnf-certification-test/results"
"github.com/test-network-function/cnf-certification-test/pkg/claimhelper"
@@ -64,7 +63,7 @@ const (
defaultClaimPath = ".."
defaultCliArgValue = ""
junitFlagKey = "junit"
- serverModeFlag = "server-mode"
+ serverModeFlag = "serverMode"
TNFReportKey = "cnf-certification-test"
extraInfoKey = "testsExtraInfo"
defaultServerMode = "false"
@@ -311,10 +310,10 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
Buf = bytes.NewBufferString(aString)
- logrus.SetOutput(Buf)
+ log.SetOutput(Buf)
logl.SetOutput(Buf)
jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
- logrus.Info(jsonData)
+ log.Info(jsonData)
var data RequstedData
if err := json.Unmarshal([]byte(jsonData), &data); err != nil {
fmt.Println("Error:", err)
@@ -348,9 +347,9 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
// Copy the uploaded file to the server file
os.Setenv("KUBECONFIG", handler.Filename)
- logrus.Infof("KUBECONFIG : %v", handler.Filename)
+ log.Infof("KUBECONFIG : %v", handler.Filename)
- logrus.Infof("Labels filter : %v", flattenedOptions)
+ log.Infof("Labels filter : %v", flattenedOptions)
// Set the output of the logger to the log file
diff --git a/run-cnf-suites.sh b/run-cnf-suites.sh
index 7be443e4b..197a51c84 100755
--- a/run-cnf-suites.sh
+++ b/run-cnf-suites.sh
@@ -95,9 +95,9 @@ fi
# Specify Junit report file name.
GINKGO_ARGS="\
--ginkgo.timeout=$TIMEOUT \
+-serverMode $SERVER_RUN \
-junit $OUTPUT_LOC \
-claimloc $OUTPUT_LOC \
--server-mode $SERVER_RUN \
--ginkgo.junit-report $OUTPUT_LOC/cnf-certification-tests_junit.xml \
-ginkgo.v \
-test.v\
@@ -112,7 +112,7 @@ echo "Report will be output to '$OUTPUT_LOC'"
echo "ginkgo arguments '${GINKGO_ARGS}'"
LABEL_STRING=''
-if [ -z "$LABEL" ]; then
+if [ -z "$LABEL" ] && ([ -z "$SERVER_RUN" ] || [ $SERVER_RUN == false ]); then
echo "No test label (-l) was set, so only diagnostic functions will run."
else
LABEL_STRING="-ginkgo.label-filter=${LABEL}"
From 0d1debacb0eb76d8d1d20e28b26f6a154a1bea18 Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 2 Nov 2023 13:39:15 +0200
Subject: [PATCH 10/28] few changes for linter
---
cnf-certification-test/suite_test.go | 58 ++++----------------
cnf-certification-test/webserver_function.go | 10 ++--
go.mod | 1 -
go.sum | 21 -------
4 files changed, 15 insertions(+), 75 deletions(-)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 3eba1c2e6..5b94a6a45 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -174,7 +174,6 @@ func PreRun(t *testing.T) (claimData *claim.Claim, claimRoot *claim.Root) {
log.Errorf("Configuration node missing because of: %s", err)
t.FailNow()
}
-
claimData.Nodes = claimhelper.GenerateNodes()
claimhelper.UnmarshalConfigurations(configurations, claimData.Configurations)
return claimData, claimRoot
@@ -182,8 +181,6 @@ func PreRun(t *testing.T) (claimData *claim.Claim, claimRoot *claim.Root) {
// TestTest invokes the CNF Certification Test Suite.
func TestTest(t *testing.T) {
-
- // Keep the main program running
ginkgoConfig, _ := ginkgo.GinkgoConfiguration()
if *serverMode == "false" {
claimData, claimRoot := PreRun(t)
@@ -205,15 +202,14 @@ func TestTest(t *testing.T) {
env = provider.GetTestEnvironment()
ginkgo.RunSpecs(t, CnfCertificationTestSuiteName)
}
- ContinueRun(t, diagnosticMode, env, claimData, claimRoot)
+ ContinueRun(diagnosticMode, &env, claimData, claimRoot)
} else {
go StartServer()
select {}
}
}
-func ContinueRun(t *testing.T, diagnosticMode bool, env provider.TestEnvironment, claimData *claim.Claim, claimRoot *claim.Root) {
-
+func ContinueRun(diagnosticMode bool, env *provider.TestEnvironment, claimData *claim.Claim, claimRoot *claim.Root) {
endTime := time.Now()
claimData.Metadata.EndTime = endTime.UTC().Format(claimhelper.DateTimeFormatDirective)
@@ -294,24 +290,28 @@ func incorporateVersions(claimData *claim.Claim) {
}
}
func StartServer() {
-
+ server := &http.Server{
+ Addr: ":8084", // Server address
+ ReadTimeout: 10 * time.Second, // Maximum duration for reading the entire request
+ WriteTimeout: 10 * time.Second, // Maximum duration for writing the entire response
+ IdleTimeout: 120 * time.Second, // Maximum idle duration before closing the connection
+ }
HandlereqFunc()
http.HandleFunc("/runFunction", RunHandler)
fmt.Println("Server is running on :8084...")
- if err := http.ListenAndServe(":8084", nil); err != nil {
+ if err := server.ListenAndServe(); err != nil {
panic(err)
}
}
// Define an HTTP handler that triggers Ginkgo tests
func RunHandler(w http.ResponseWriter, r *http.Request) {
-
Buf = bytes.NewBufferString(aString)
-
log.SetOutput(Buf)
logl.SetOutput(Buf)
+
jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
log.Info(jsonData)
var data RequstedData
@@ -350,40 +350,6 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
log.Infof("KUBECONFIG : %v", handler.Filename)
log.Infof("Labels filter : %v", flattenedOptions)
-
- // Set the output of the logger to the log file
-
- /*data, err := os.ReadFile("tnf_config.yml")
- if err != nil {
- log.Fatalf("Error reading YAML file: %v", err)
- }
-
- // Unmarshal the YAML data into a Config struct
- var config configuration.TestConfiguration
-
- err = yaml.Unmarshal(data, &config)
- if err != nil {
- log.Fatalf("Error unmarshaling YAML: %v", err)
- }
-
- // Modify the configuration
- var namespace []configuration.Namespace
- namespace = append(namespace, configuration.Namespace{Name: requestData.Field3})
-
- config.TargetNameSpaces = namespace // Change the port to a new value
-
- // Serialize the modified config back to YAML format
- newData, err := yaml.Marshal(&config)
- if err != nil {
- log.Fatalf("Error marshaling YAML: %v", err)
- }
-
- // Write the modified YAML data back to the file
- err = os.WriteFile("tnf_config.yml", newData, os.ModePerm)
- if err != nil {
- log.Fatalf("Error writing YAML file: %v", err)
- }
- */
t := testing.T{}
claimData, claimRoot := PreRun(&t)
var env provider.TestEnvironment
@@ -400,7 +366,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
suiteConfig.LabelFilter = strings.Join(flattenedOptions, "")
ginkgo.RunSpecs(&t, CnfCertificationTestSuiteName, suiteConfig, reporterConfig)
- ContinueRun(&t, false, env, claimData, claimRoot)
+ ContinueRun(false, &env, claimData, claimRoot)
// Return the result as JSON
response := struct {
Message string `json:"Message"`
@@ -415,12 +381,10 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
}
// Set the Content-Type header to specify that the response is JSON
w.Header().Set("Content-Type", "application/json")
-
// Write the JSON response to the client
_, err = w.Write(jsonResponse)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
-
}
diff --git a/cnf-certification-test/webserver_function.go b/cnf-certification-test/webserver_function.go
index 1d9975ec7..cbc942081 100644
--- a/cnf-certification-test/webserver_function.go
+++ b/cnf-certification-test/webserver_function.go
@@ -51,15 +51,12 @@ func logStreamHandler(w http.ResponseWriter, r *http.Request) {
fmt.Println(err)
return
}
-
}
if err := scanner.Err(); err != nil {
logrus.Printf("Error reading log file: %v", err)
return
}
-
}
-
}
type RequstedData struct {
@@ -88,7 +85,6 @@ func flattenData(data interface{}, result []string) []string {
return result
}
func HandlereqFunc() {
-
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
// Set the content type to "text/html".
w.Header().Set("Content-Type", "text/html")
@@ -96,6 +92,7 @@ func HandlereqFunc() {
_, err := w.Write(indexHTML)
if err != nil {
http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ return
}
})
@@ -106,6 +103,7 @@ func HandlereqFunc() {
_, err := w.Write(submit)
if err != nil {
http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ return
}
})
@@ -116,6 +114,7 @@ func HandlereqFunc() {
_, err := w.Write(logs)
if err != nil {
http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ return
}
})
@@ -126,10 +125,9 @@ func HandlereqFunc() {
_, err := w.Write(toast)
if err != nil {
http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ return
}
})
-
// Serve the static HTML file
http.HandleFunc("/logstream", logStreamHandler)
-
}
diff --git a/go.mod b/go.mod
index fc2ba4694..2aacac0db 100644
--- a/go.mod
+++ b/go.mod
@@ -214,7 +214,6 @@ require (
github.com/gorilla/websocket v1.4.2
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0
github.com/manifoldco/promptui v0.9.0
- github.com/onsi/ginkgo v1.16.5
github.com/openshift/machine-config-operator v0.0.1-0.20230515070935-49f32d46538e
github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20231018165107-f04b78186455
github.com/robert-nix/ansihtml v1.0.1
diff --git a/go.sum b/go.sum
index 5a39a64a1..3f1c70661 100644
--- a/go.sum
+++ b/go.sum
@@ -178,8 +178,6 @@ github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6
github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
-github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
-github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
@@ -214,7 +212,6 @@ github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU=
@@ -337,7 +334,6 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
-github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
@@ -455,17 +451,12 @@ github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7P
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
-github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
-github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
-github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
@@ -528,7 +519,6 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/robert-nix/ansihtml v1.0.1 h1:VTiyQ6/+AxSJoSSLsMecnkh8i0ZqOEdiRl/odOc64fc=
github.com/robert-nix/ansihtml v1.0.1/go.mod h1:CJwclxYaTPc2RfcxtanEACsYuTksh4yDXcNeHHKZINE=
-github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
@@ -696,7 +686,6 @@ golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -719,7 +708,6 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
@@ -760,7 +748,6 @@ golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -772,10 +759,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -796,7 +780,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -881,7 +864,6 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
@@ -1004,7 +986,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
-gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
@@ -1013,8 +994,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
From de14d5978b460793645054093af29b1f346bf10c Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 2 Nov 2023 13:48:56 +0200
Subject: [PATCH 11/28] Update run-cnf-suites.sh
---
run-cnf-suites.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/run-cnf-suites.sh b/run-cnf-suites.sh
index 197a51c84..e533eae2b 100755
--- a/run-cnf-suites.sh
+++ b/run-cnf-suites.sh
@@ -112,7 +112,7 @@ echo "Report will be output to '$OUTPUT_LOC'"
echo "ginkgo arguments '${GINKGO_ARGS}'"
LABEL_STRING=''
-if [ -z "$LABEL" ] && ([ -z "$SERVER_RUN" ] || [ $SERVER_RUN == false ]); then
+if [ -z "$LABEL" ] && { [ -z "$SERVER_RUN" ] || [ "$SERVER_RUN" == "false" ]; }; then
echo "No test label (-l) was set, so only diagnostic functions will run."
else
LABEL_STRING="-ginkgo.label-filter=${LABEL}"
From 154f4816e2be664d324e432774825619e1341afd Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 2 Nov 2023 13:53:48 +0200
Subject: [PATCH 12/28] udpate typos
---
cnf-certification-test/suite_test.go | 2 +-
cnf-certification-test/webserver_function.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 5b94a6a45..f543f2ef7 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -314,7 +314,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
log.Info(jsonData)
- var data RequstedData
+ var data RequestedData
if err := json.Unmarshal([]byte(jsonData), &data); err != nil {
fmt.Println("Error:", err)
}
diff --git a/cnf-certification-test/webserver_function.go b/cnf-certification-test/webserver_function.go
index cbc942081..d804a2938 100644
--- a/cnf-certification-test/webserver_function.go
+++ b/cnf-certification-test/webserver_function.go
@@ -59,7 +59,7 @@ func logStreamHandler(w http.ResponseWriter, r *http.Request) {
}
}
-type RequstedData struct {
+type RequestedData struct {
SelectedOptions interface{} `json:"selectedOptions"`
}
type ResponseData struct {
From 8e4ae74b14c1df4a9b86e4ff804269036c279a19 Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Tue, 7 Nov 2023 12:34:28 +0200
Subject: [PATCH 13/28] david comments
---
cnf-certification-test/suite_test.go | 15 ++++++++-------
.../{ => webserver}/webserver_function.go | 19 +++++++++----------
run-cnf-suites.sh | 8 +-------
3 files changed, 18 insertions(+), 24 deletions(-)
rename cnf-certification-test/{ => webserver}/webserver_function.go (90%)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index f543f2ef7..7f1b1a12a 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -23,7 +23,7 @@ import (
"flag"
"fmt"
"io"
- logl "log"
+ rlog "log"
"net/http"
"os"
"path/filepath"
@@ -52,6 +52,7 @@ import (
_ "github.com/test-network-function/cnf-certification-test/cnf-certification-test/performance"
_ "github.com/test-network-function/cnf-certification-test/cnf-certification-test/platform"
_ "github.com/test-network-function/cnf-certification-test/cnf-certification-test/preflight"
+ "github.com/test-network-function/cnf-certification-test/cnf-certification-test/webserver"
"github.com/test-network-function/cnf-certification-test/internal/clientsholder"
"github.com/test-network-function/cnf-certification-test/pkg/configuration"
"github.com/test-network-function/cnf-certification-test/pkg/diagnostics"
@@ -296,7 +297,7 @@ func StartServer() {
WriteTimeout: 10 * time.Second, // Maximum duration for writing the entire response
IdleTimeout: 120 * time.Second, // Maximum idle duration before closing the connection
}
- HandlereqFunc()
+ webserver.HandlereqFunc()
http.HandleFunc("/runFunction", RunHandler)
@@ -308,18 +309,18 @@ func StartServer() {
// Define an HTTP handler that triggers Ginkgo tests
func RunHandler(w http.ResponseWriter, r *http.Request) {
- Buf = bytes.NewBufferString(aString)
- log.SetOutput(Buf)
- logl.SetOutput(Buf)
+ webserver.Buf = bytes.NewBufferString("")
+ log.SetOutput(webserver.Buf)
+ rlog.SetOutput(webserver.Buf)
jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
log.Info(jsonData)
- var data RequestedData
+ var data webserver.RequestedData
if err := json.Unmarshal([]byte(jsonData), &data); err != nil {
fmt.Println("Error:", err)
}
var flattenedOptions []string
- flattenedOptions = flattenData(data.SelectedOptions, flattenedOptions)
+ flattenedOptions = webserver.FlattenData(data.SelectedOptions, flattenedOptions)
// Get the file from the request
file, handler, err := r.FormFile("kubeConfigPath") // "fileInput" is the name of the file input field
diff --git a/cnf-certification-test/webserver_function.go b/cnf-certification-test/webserver/webserver_function.go
similarity index 90%
rename from cnf-certification-test/webserver_function.go
rename to cnf-certification-test/webserver/webserver_function.go
index d804a2938..1069432f6 100644
--- a/cnf-certification-test/webserver_function.go
+++ b/cnf-certification-test/webserver/webserver_function.go
@@ -1,4 +1,4 @@
-package suite
+package webserver
import (
"bufio"
@@ -12,19 +12,18 @@ import (
"github.com/sirupsen/logrus"
)
-//go:embed webserver/index.html
+//go:embed index.html
var indexHTML []byte
-//go:embed webserver/submit.js
+//go:embed submit.js
var submit []byte
-//go:embed webserver/logs.js
+//go:embed logs.js
var logs []byte
-//go:embed webserver/toast.js
+//go:embed toast.js
var toast []byte
var Buf *bytes.Buffer
-var aString string
var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
@@ -66,20 +65,20 @@ type ResponseData struct {
Message string `json:"message"`
}
-func flattenData(data interface{}, result []string) []string {
+func FlattenData(data interface{}, result []string) []string {
switch v := data.(type) {
case string:
result = append(result, v)
case []interface{}:
for _, item := range v {
- result = flattenData(item, result)
+ result = FlattenData(item, result)
}
case map[string]interface{}:
for key, item := range v {
if key == "selectedOptions" {
- result = flattenData(item, result)
+ result = FlattenData(item, result)
}
- result = flattenData(item, result)
+ result = FlattenData(item, result)
}
}
return result
diff --git a/run-cnf-suites.sh b/run-cnf-suites.sh
index e533eae2b..17e48283e 100755
--- a/run-cnf-suites.sh
+++ b/run-cnf-suites.sh
@@ -52,13 +52,7 @@ while [[ $1 == -* ]]; do
fi
;;
-s)
- if (($# > 1)); then
- SERVER_RUN=$2
- shift
- else
- echo >&2 '-s requires an argument'
- exit 1
- fi
+ SERVER_RUN=true
;;
-l | --label)
while (("$#" >= 2)) && ! [[ $2 = --* ]] && ! [[ $2 = -* ]]; do
From 2fbd6a785baa32572fbefb5c17fb8dd6ea019292 Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Tue, 7 Nov 2023 13:14:09 +0200
Subject: [PATCH 14/28] update the flag
---
cnf-certification-test/suite_test.go | 9 ++++-----
run-cnf-suites.sh | 5 ++++-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 7f1b1a12a..60b2325c4 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -67,7 +67,7 @@ const (
serverModeFlag = "serverMode"
TNFReportKey = "cnf-certification-test"
extraInfoKey = "testsExtraInfo"
- defaultServerMode = "false"
+ defaultServerMode = false
)
var (
@@ -87,7 +87,7 @@ var (
// ClaimFormat is the current version for the claim file format to be produced by the TNF test suite.
// A client decoding this claim file must support decoding its specific version.
ClaimFormatVersion string
- serverMode *string
+ serverMode *bool
)
func init() {
@@ -95,8 +95,7 @@ func init() {
"the path where the claimfile will be output")
junitPath = flag.String(junitFlagKey, defaultCliArgValue,
"the path for the junit format report")
- serverMode = flag.String(serverModeFlag, defaultServerMode,
- "run test with webserver")
+ serverMode = flag.Bool("serverMode", defaultServerMode, "run test with webserver")
}
// setLogLevel sets the log level for logrus based on the "TNF_LOG_LEVEL" environment variable
@@ -183,7 +182,7 @@ func PreRun(t *testing.T) (claimData *claim.Claim, claimRoot *claim.Root) {
// TestTest invokes the CNF Certification Test Suite.
func TestTest(t *testing.T) {
ginkgoConfig, _ := ginkgo.GinkgoConfiguration()
- if *serverMode == "false" {
+ if !*serverMode {
claimData, claimRoot := PreRun(t)
var diagnosticMode bool
// Diagnostic functions will run when no labels are provided.
diff --git a/run-cnf-suites.sh b/run-cnf-suites.sh
index 17e48283e..625be8052 100755
--- a/run-cnf-suites.sh
+++ b/run-cnf-suites.sh
@@ -89,7 +89,6 @@ fi
# Specify Junit report file name.
GINKGO_ARGS="\
--ginkgo.timeout=$TIMEOUT \
--serverMode $SERVER_RUN \
-junit $OUTPUT_LOC \
-claimloc $OUTPUT_LOC \
--ginkgo.junit-report $OUTPUT_LOC/cnf-certification-tests_junit.xml \
@@ -97,6 +96,10 @@ GINKGO_ARGS="\
-test.v\
"
+if [ "$SERVER_RUN" = "true" ]; then
+ GINKGO_ARGS="$GINKGO_ARGS -serverMode"
+fi
+
if [[ $LABEL == "all" ]]; then
LABEL='common,extended,faredge,telco'
fi
From d4524a80405fb525f19db38070b00019a23ccffa Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 19 Oct 2023 17:43:02 +0300
Subject: [PATCH 15/28] website for our cnf
to run need to call ./run-cnf-suites.sh -l lifecycle -s true
-s new filed mean if i want to run that from the website
---
cnf-certification-test/amalpro/index.html | 247 ++++++++++++++
cnf-certification-test/amalpro/logs.js | 13 +
cnf-certification-test/amalpro/submit.js | 48 +++
cnf-certification-test/amalpro/toast.js | 53 +++
cnf-certification-test/index.html | 260 ++++++++++++++
cnf-certification-test/log.log | 395 ++++++++++++++++++++++
cnf-certification-test/suite_test.go | 353 +++++++++++++++++--
7 files changed, 1340 insertions(+), 29 deletions(-)
create mode 100644 cnf-certification-test/amalpro/index.html
create mode 100644 cnf-certification-test/amalpro/logs.js
create mode 100644 cnf-certification-test/amalpro/submit.js
create mode 100644 cnf-certification-test/amalpro/toast.js
create mode 100644 cnf-certification-test/index.html
create mode 100644 cnf-certification-test/log.log
diff --git a/cnf-certification-test/amalpro/index.html b/cnf-certification-test/amalpro/index.html
new file mode 100644
index 000000000..14b632651
--- /dev/null
+++ b/cnf-certification-test/amalpro/index.html
@@ -0,0 +1,247 @@
+
+
+
+
+
+ CNF Certification Test
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ CNF Certification Test
+
+
+ Show Log
+
+
+
+ Logs
+ No Logs Found
+ Close
+
+
+
+
+ Red Hat legal and privacy links
+
+ © 2022 Red Hat, Inc.
+ Red Hat legal and privacy links
+
+
+
+ ({ ...acc,
+ [key]: key in acc ? [acc[key], val] : val
+ }), {});
+
+ delete fields.submit;
+ console.log(fields);
+
+ // Send an HTTP request to the server to run the function
+ let heading;
+ let message;
+ let state = 'success';
+
+ try {
+ const data = await fetch('/runFunction', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json', },
+ body: JSON.stringify(fields),
+ }).then(response => {
+ if (response.ok) {
+ return response.json();
+ } else {
+ throw new Error(response.statusText);
+ }
+ });
+
+ heading = 'Success';
+ message = data.Message;
+
+ console.log(data);
+ } catch (error) {
+ console.error(error);
+ heading = 'Error'
+ message = error.message;
+ state = 'danger';
+ } finally {
+ form.elements.submit.disabled = false;
+ for (const el of form.elements) if (el instanceof HTMLFieldSetElement) el.disabled = false
+ }
+
+ return { heading, message, state };
+ }
\ No newline at end of file
diff --git a/cnf-certification-test/amalpro/toast.js b/cnf-certification-test/amalpro/toast.js
new file mode 100644
index 000000000..1516826de
--- /dev/null
+++ b/cnf-certification-test/amalpro/toast.js
@@ -0,0 +1,53 @@
+import '@rhds/elements/rh-alert/rh-alert.js';
+
+export async function toast({
+ heading,
+ message,
+ state = 'info',
+ timeout = 8_000,
+}) {
+ await import('@rhds/elements/rh-alert/rh-alert.js');
+ const h2 = document.createElement('h2');
+ h2.textContent = heading;
+ h2.slot = 'header';
+ const alert = document.createElement('rh-alert');
+ alert.setAttribute('aria-live', 'polite');
+ alert.dismissable = true;
+ alert.state = state;
+ alert.classList.add('toast');
+ alert.style.position = 'fixed';
+ alert.style.margin = '0';
+ alert.style.setProperty('z-index', '1000');
+ alert.style.setProperty('inset-inline-end', 'var(--rh-space-xl, 24px)');
+ alert.style.setProperty('inset-block-start', 'var(--rh-space-xl, 24px)');
+ alert.append(h2);
+ if (message) {
+ const p = document.createElement('p');
+ p.textContent = message;
+ alert.append(message);
+ }
+
+ alert.animate({ translate: ['100% 0', '0 0'] }, { duration: 200 });
+
+ await Promise.all(Array.from(document.querySelectorAll('rh-alert.toast'), toast =>
+ // TODO: handle more than 2 toasts
+ toast.animate({
+ translate: [
+ '0 auto',
+ '0 calc(100% + 20px)',
+ ],
+ }, {
+ duration: 200,
+ composite: 'accumulate',
+ rangeEnd: '100%',
+ fill: 'forwards',
+ }).finished));
+
+ setTimeout(() => {
+ if (alert.isConnected) {
+ alert.remove();
+ }
+ }, timeout);
+
+ document.body.append(alert);
+}
\ No newline at end of file
diff --git a/cnf-certification-test/index.html b/cnf-certification-test/index.html
new file mode 100644
index 000000000..f4e096447
--- /dev/null
+++ b/cnf-certification-test/index.html
@@ -0,0 +1,260 @@
+
+
+
+
+
+
+
+
+
+
+ Run Function
+
+
+
+
+
+
+
+
+
+ CNF CERTIFICATION TEST WEBPAGE
+
+
+
+
+
+ Environment Configuration
+
+
+
+
+
+
+ TNF Configuration
+
+
+
+
+
+
+
+
+ Selecet a Test
+
+
+
+
+
+
+ Click Run Certification Test
+ Run Certification Test
+ Show Certification Test log
+ Show Log
+
+
+
+
+
+
+
+
+
+ © 2022 Red Hat, Inc.
+
+
+
\ No newline at end of file
diff --git a/cnf-certification-test/log.log b/cnf-certification-test/log.log
new file mode 100644
index 000000000..f68b6425e
--- /dev/null
+++ b/cnf-certification-test/log.log
@@ -0,0 +1,395 @@
+[36mINFO [0m[Oct 19 17:05:52.390][suite_test.go: 398] KUBECONFIG : /Users/amal/Downloads/kubeconfig.3nodes
+[36mINFO [0m[Oct 19 17:05:52.390][suite_test.go: 400] Labels filter : lifecycle
+[36mINFO [0m[Oct 19 17:05:52.390][suite_test.go: 436] /Users/amal/Downloads/kubeconfig.3nodes
+[36mINFO [0m[Oct 19 17:05:52.390][utils.go: 66] Saving environment variables & parameters.
+[36mINFO [0m[Oct 19 17:05:52.390][utils.go: 71] Environment: {Home:/Users/amal Kubeconfig:/Users/amal/Downloads/kubeconfig.3nodes ConfigurationPath:tnf_config.yml NonIntrusiveOnly:false LogLevel:debug OfflineDB: AllowPreflightInsecure:false PfltDockerconfig: IncludeWebFilesInOutputFolder:false OmitArtifactsZipFile:false EnableDataCollection:false}
+[36mINFO [0m[Oct 19 17:05:52.390][suite_test.go: 122] Log level set to: debug
+[36mINFO [0m[Oct 19 17:05:52.391][suite_test.go: 452] Ginkgo Version : 2.12.1
+[36mINFO [0m[Oct 19 17:05:52.391][suite_test.go: 453] Labels filter : lifecycle
+[36mINFO [0m[Oct 19 17:05:52.391][suite_test.go: 128] &{/Users/amal /Users/amal/Downloads/kubeconfig.3nodes tnf_config.yml false debug false false false false}
+[36mINFO [0m[Oct 19 17:05:52.391][clientsholder.go: 169] Creating k8s go-clients holder.
+[36mINFO [0m[Oct 19 17:05:53.857][utils.go: 42] Loading config from file: tnf_config.yml
+[33mWARNING[0m[Oct 19 17:05:53.858][utils.go: 55] No namespace configured for the debug DaemonSet. Defaulting to namespace cnf-suite
+[36mINFO [0m[Oct 19 17:06:05.785][main.go: 436] namespace cnf-suite deleted
+[36mINFO [0m[Oct 19 17:06:06.411][main.go: 175] Checking if the daemonset exists
+[36mINFO [0m[Oct 19 17:06:06.566][main.go: 178] daemonset tnf-debug does not exist, err=daemonsets.apps "tnf-debug" not found
+[36mINFO [0m[Oct 19 17:06:06.566][main.go: 226] Creating daemonset tnf-debug
+[36mINFO [0m[Oct 19 17:06:07.344][main.go: 264] Waiting for (3) daemonset pods to be ready: {CurrentNumberScheduled:3 NumberMisscheduled:0 DesiredNumberScheduled:3 NumberReady:0 ObservedGeneration:1 UpdatedNumberScheduled:3 NumberAvailable:0 NumberUnavailable:3 CollisionCount: Conditions:[]}
+[36mINFO [0m[Oct 19 17:06:12.502][main.go: 264] Waiting for (3) daemonset pods to be ready: {CurrentNumberScheduled:3 NumberMisscheduled:0 DesiredNumberScheduled:3 NumberReady:3 ObservedGeneration:1 UpdatedNumberScheduled:3 NumberAvailable:3 NumberUnavailable:0 CollisionCount: Conditions:[]}
+[36mINFO [0m[Oct 19 17:06:12.502][main.go: 281] All the debug pods are ready.
+[36mINFO [0m[Oct 19 17:06:12.502][main.go: 237] Daemonset is ready
+[36mINFO [0m[Oct 19 17:06:12.811][main.go: 243] Successfully created daemonset tnf-debug
+[36mINFO [0m[Oct 19 17:06:13.283][main.go: 264] Waiting for (3) daemonset pods to be ready: {CurrentNumberScheduled:3 NumberMisscheduled:0 DesiredNumberScheduled:3 NumberReady:3 ObservedGeneration:1 UpdatedNumberScheduled:3 NumberAvailable:3 NumberUnavailable:0 CollisionCount: Conditions:[]}
+[36mINFO [0m[Oct 19 17:06:13.283][main.go: 281] All the debug pods are ready.
+[36mINFO [0m[Oct 19 17:06:13.441][autodiscover.go: 154] parsed pods under test labels: [{LabelKey:test-network-function.com/generic LabelValue:target}]
+[36mINFO [0m[Oct 19 17:06:13.441][autodiscover.go: 155] parsed operators under test labels: [{LabelKey:test-network-function.com/operator1 LabelValue:new} {LabelKey:test-network-function.com/operator LabelValue:}]
+[37mDEBUG [0m[Oct 19 17:06:13.609][autodiscover_operators.go: 135] Searching subscriptions in namespace All Namespaces
+[36mINFO [0m[Oct 19 17:06:13.764][autodiscover_operators.go: 144] Found 2 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:06:13.764][autodiscover_operators.go: 146] Subscriptions name: lvms-operator (ns: openshift-storage)
+[36mINFO [0m[Oct 19 17:06:13.764][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[37mDEBUG [0m[Oct 19 17:06:13.764][autodiscover_operators.go: 112] Searching CSVs in namespace All
+[36mINFO [0m[Oct 19 17:06:13.932][autodiscover_operators.go: 121] Found 2 CSVs:
+[36mINFO [0m[Oct 19 17:06:13.932][autodiscover_operators.go: 123] CSV name: packageserver (ns: openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:06:13.932][autodiscover_operators.go: 123] CSV name: lvms-operator.v4.13.1 (ns: openshift-storage)
+[37mDEBUG [0m[Oct 19 17:06:14.253][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/generic=target
+[37mDEBUG [0m[Oct 19 17:06:14.583][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/app=tnf-debug
+[36mINFO [0m[Oct 19 17:06:16.090][autodiscover_scales.go: 40] Target CRD crdexamples.test-network-function.com is not scalable. Skipping search of scalable CRs.
+[37mDEBUG [0m[Oct 19 17:06:16.090][autodiscover_operators.go: 69] Searching CSVs in namespace {tnf}
+[37mDEBUG [0m[Oct 19 17:06:16.090][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator1=new
+[37mDEBUG [0m[Oct 19 17:06:16.243][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator
+[36mINFO [0m[Oct 19 17:06:16.398][autodiscover_operators.go: 91] Found 0 CSVs:
+[37mDEBUG [0m[Oct 19 17:06:16.398][autodiscover_operators.go: 135] Searching subscriptions in namespace tnf
+[36mINFO [0m[Oct 19 17:06:16.551][autodiscover_operators.go: 144] Found 1 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:06:16.551][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[36mINFO [0m[Oct 19 17:06:17.018][autodiscover.go: 276] OpenShift Version found: 4.13.0
+[36mINFO [0m[Oct 19 17:06:17.324][autodiscover_podset.go: 80] Deployment test found in ns tnf
+[36mINFO [0m[Oct 19 17:06:17.478][autodiscover_podset.go: 113] StatefulSet test found in ns tnf
+[36mINFO [0m[Oct 19 17:06:18.760][operators.go: 130] Found 2 unique CSVs
+[36mINFO [0m[Oct 19 17:06:18.760][operators.go: 132] CSV: packageserver
+[36mINFO [0m[Oct 19 17:06:18.761][operators.go: 132] CSV: lvms-operator.v4.13.1
+[36mINFO [0m[Oct 19 17:06:18.914][operators.go: 185] Getting installplans for op lvms-operator.v4.13.1 (subs lvms-operator ns openshift-storage)
+[33mWARNING[0m[Oct 19 17:06:18.914][operators.go: 183] Subscription not found for CSV: packageserver (ns openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:06:18.914][operators.go: 185] Getting installplans for op packageserver (subs ns )
+[36mINFO [0m[Oct 19 17:06:18.914][provider.go: 566] Node clus0-0 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:06:19.091][provider.go: 566] Node clus0-1 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:06:19.265][provider.go: 566] Node clus0-2 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:19.436][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[36mINFO [0m[Oct 19 17:06:19.437][operators.go: 130] Found 0 unique CSVs
+[36mINFO [0m[Oct 19 17:06:19.437][provider.go: 299] Operators found: 0
+[36mINFO [0m[Oct 19 17:06:19.437][provider.go: 311] Completed the test environment build process in 25.58 seconds
+This will be written to the log file.
+[37mDEBUG [0m[Oct 19 17:06:36.971][utils.go: 38] config file already loaded, return previous element
+[36mINFO [0m[Oct 19 17:06:37.282][autodiscover.go: 154] parsed pods under test labels: [{LabelKey:test-network-function.com/generic LabelValue:target}]
+[36mINFO [0m[Oct 19 17:06:37.282][autodiscover.go: 155] parsed operators under test labels: [{LabelKey:test-network-function.com/operator1 LabelValue:new} {LabelKey:test-network-function.com/operator LabelValue:}]
+[37mDEBUG [0m[Oct 19 17:06:37.601][autodiscover_operators.go: 135] Searching subscriptions in namespace All Namespaces
+[36mINFO [0m[Oct 19 17:06:37.757][autodiscover_operators.go: 144] Found 2 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:06:37.757][autodiscover_operators.go: 146] Subscriptions name: lvms-operator (ns: openshift-storage)
+[36mINFO [0m[Oct 19 17:06:37.757][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[37mDEBUG [0m[Oct 19 17:06:37.757][autodiscover_operators.go: 112] Searching CSVs in namespace All
+[36mINFO [0m[Oct 19 17:06:38.081][autodiscover_operators.go: 121] Found 2 CSVs:
+[36mINFO [0m[Oct 19 17:06:38.081][autodiscover_operators.go: 123] CSV name: packageserver (ns: openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:06:38.081][autodiscover_operators.go: 123] CSV name: lvms-operator.v4.13.1 (ns: openshift-storage)
+[37mDEBUG [0m[Oct 19 17:06:38.398][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/generic=target
+[37mDEBUG [0m[Oct 19 17:06:38.727][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/app=tnf-debug
+[36mINFO [0m[Oct 19 17:06:40.202][autodiscover_scales.go: 40] Target CRD crdexamples.test-network-function.com is not scalable. Skipping search of scalable CRs.
+[37mDEBUG [0m[Oct 19 17:06:40.202][autodiscover_operators.go: 69] Searching CSVs in namespace {tnf}
+[37mDEBUG [0m[Oct 19 17:06:40.202][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator1=new
+[37mDEBUG [0m[Oct 19 17:06:40.396][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator
+[36mINFO [0m[Oct 19 17:06:40.554][autodiscover_operators.go: 91] Found 0 CSVs:
+[37mDEBUG [0m[Oct 19 17:06:40.554][autodiscover_operators.go: 135] Searching subscriptions in namespace tnf
+[36mINFO [0m[Oct 19 17:06:40.712][autodiscover_operators.go: 144] Found 1 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:06:40.712][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[36mINFO [0m[Oct 19 17:06:41.179][autodiscover.go: 276] OpenShift Version found: 4.13.0
+[36mINFO [0m[Oct 19 17:06:41.497][autodiscover_podset.go: 80] Deployment test found in ns tnf
+[36mINFO [0m[Oct 19 17:06:41.652][autodiscover_podset.go: 113] StatefulSet test found in ns tnf
+[36mINFO [0m[Oct 19 17:06:42.947][operators.go: 130] Found 2 unique CSVs
+[36mINFO [0m[Oct 19 17:06:42.947][operators.go: 132] CSV: packageserver
+[36mINFO [0m[Oct 19 17:06:42.948][operators.go: 132] CSV: lvms-operator.v4.13.1
+[36mINFO [0m[Oct 19 17:06:43.101][operators.go: 185] Getting installplans for op lvms-operator.v4.13.1 (subs lvms-operator ns openshift-storage)
+[33mWARNING[0m[Oct 19 17:06:43.101][operators.go: 183] Subscription not found for CSV: packageserver (ns openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:06:43.101][operators.go: 185] Getting installplans for op packageserver (subs ns )
+[36mINFO [0m[Oct 19 17:06:43.101][provider.go: 566] Node clus0-0 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:06:43.269][provider.go: 566] Node clus0-1 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:06:43.438][provider.go: 566] Node clus0-2 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[37mDEBUG [0m[Oct 19 17:06:43.613][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:06:43.614][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[36mINFO [0m[Oct 19 17:06:43.614][operators.go: 130] Found 0 unique CSVs
+[36mINFO [0m[Oct 19 17:06:43.614][provider.go: 299] Operators found: 0
+[36mINFO [0m[Oct 19 17:06:43.614][provider.go: 311] Completed the test environment build process in 6.64 seconds
+[37mDEBUG [0m[Oct 19 17:06:43.614][suite.go: 60] Entering access-control suite
+[37mDEBUG [0m[Oct 19 17:06:43.614][suite.go: 46] Entering affiliated-certification suite
+[37mDEBUG [0m[Oct 19 17:06:43.614][suite.go: 54] Entering lifecycle suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 34] Entering manageability suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 52] Entering networking suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 40] Entering observability suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 35] Entering operator suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 49] Entering platform-alteration suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 34] Entering preflight suite
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 43] Skipping the preflight suite because the Docker Config file is not provided.
+[37mDEBUG [0m[Oct 19 17:06:43.615][suite.go: 44] Entering performance suite
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 204] check container container: test pod: test-0 ns: tnf pre stop lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 204] check container container: test pod: test-1 ns: tnf pre stop lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 204] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf pre stop lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 204] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf pre stop lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 220] check container container: test pod: test-0 ns: tnf post start lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 220] check container container: test pod: test-1 ns: tnf post start lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 220] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf post start lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 220] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf post start lifecycle
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 237] check container container: test pod: test-0 ns: tnf pull policy, should be IfNotPresent
+[37mDEBUG [0m[Oct 19 17:06:43.616][suite.go: 237] check container container: test pod: test-1 ns: tnf pull policy, should be IfNotPresent
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 237] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf pull policy, should be IfNotPresent
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 237] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf pull policy, should be IfNotPresent
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 252] check container container: test pod: test-0 ns: tnf readiness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 252] check container container: test pod: test-1 ns: tnf readiness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 252] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf readiness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 252] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf readiness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 267] check container container: test pod: test-0 ns: tnf liveness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 267] check container container: test pod: test-1 ns: tnf liveness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 267] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf liveness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 267] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf liveness probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 282] check container container: test pod: test-0 ns: tnf startup probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 282] check container container: test pod: test-1 ns: tnf startup probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 282] check container container: test pod: test-d78fbf8d6-2fk6c ns: tnf startup probe
+[37mDEBUG [0m[Oct 19 17:06:43.617][suite.go: 282] check container container: test pod: test-d78fbf8d6-wmj2m ns: tnf startup probe
+[37mDEBUG [0m[Oct 19 17:06:43.618][suite.go: 298] check pod tnf test-0 owner reference
+[37mDEBUG [0m[Oct 19 17:06:43.618][suite.go: 298] check pod tnf test-1 owner reference
+[37mDEBUG [0m[Oct 19 17:06:43.618][suite.go: 298] check pod tnf test-d78fbf8d6-2fk6c owner reference
+[37mDEBUG [0m[Oct 19 17:06:43.618][suite.go: 298] check pod tnf test-d78fbf8d6-wmj2m owner reference
+[36mINFO [0m[Oct 19 17:06:43.618][podsets.go: 190] Waiting 9m0s for 2 podsets to be ready.
+[36mINFO [0m[Oct 19 17:06:43.618][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[37mDEBUG [0m[Oct 19 17:06:43.773][podsets.go: 152] deployment: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:06:43.773][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[37mDEBUG [0m[Oct 19 17:06:43.933][podsets.go: 175] statefulset: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:06:43.933][podsets.go: 198] Not ready Deployments: []
+[36mINFO [0m[Oct 19 17:06:43.933][podsets.go: 199] Not ready StatefulSets: []
+[37mDEBUG [0m[Oct 19 17:06:43.933][loghelper.go: 40] Not ready Deployments: []
+[37mDEBUG [0m[Oct 19 17:06:43.933][loghelper.go: 40] Not ready StatefulSets: []
+[36mINFO [0m[Oct 19 17:06:43.933][podrecreation.go: 51] Performing cordon operation on node clus0-2
+[37mDEBUG [0m[Oct 19 17:06:44.405][suite.go: 570] node: clus0-2 cordoned
+[37mDEBUG [0m[Oct 19 17:06:44.406][suite.go: 576] draining node: clus0-2 with timeout: 8m0s
+[37mDEBUG [0m[Oct 19 17:06:44.406][podrecreation.go: 113] deleting ns=tnf pod=test-0 with deleteForeground mode
+[37mDEBUG [0m[Oct 19 17:06:45.574][podrecreation.go: 159] ns=tnf pod=test-0 deleted
+[36mINFO [0m[Oct 19 17:06:45.574][podsets.go: 190] Waiting 8m0s for 2 podsets to be ready.
+[36mINFO [0m[Oct 19 17:06:45.575][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[37mDEBUG [0m[Oct 19 17:06:45.730][podsets.go: 152] deployment: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:06:45.730][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[36mINFO [0m[Oct 19 17:06:45.888][podsets.go: 198] Not ready Deployments: []
+[36mINFO [0m[Oct 19 17:06:45.888][podsets.go: 199] Not ready StatefulSets: [tnf:test]
+[36mINFO [0m[Oct 19 17:07:00.888][podsets.go: 192] Checking Deployments readiness of Deployments []
+[36mINFO [0m[Oct 19 17:07:00.889][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[37mDEBUG [0m[Oct 19 17:07:01.055][podsets.go: 175] statefulset: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:07:01.056][podsets.go: 198] Not ready Deployments: []
+[36mINFO [0m[Oct 19 17:07:01.056][podsets.go: 199] Not ready StatefulSets: []
+[37mDEBUG [0m[Oct 19 17:07:01.056][loghelper.go: 40] Not ready Deployments: []
+[37mDEBUG [0m[Oct 19 17:07:01.056][loghelper.go: 40] Not ready StatefulSets: []
+[36mINFO [0m[Oct 19 17:07:01.056][podrecreation.go: 51] Performing uncordon operation on node clus0-2
+[36mINFO [0m[Oct 19 17:07:02.642][podrecreation.go: 51] Performing cordon operation on node clus0-0
+[37mDEBUG [0m[Oct 19 17:07:03.963][suite.go: 570] node: clus0-0 cordoned
+[37mDEBUG [0m[Oct 19 17:07:03.964][suite.go: 576] draining node: clus0-0 with timeout: 9m0s
+[37mDEBUG [0m[Oct 19 17:07:03.964][podrecreation.go: 113] deleting ns=tnf pod=test-1 with deleteForeground mode
+[37mDEBUG [0m[Oct 19 17:07:04.299][podrecreation.go: 113] deleting ns=tnf pod=test-d78fbf8d6-wmj2m with deleteForeground mode
+[37mDEBUG [0m[Oct 19 17:07:06.065][podrecreation.go: 159] ns=tnf pod=test-d78fbf8d6-wmj2m deleted
+[37mDEBUG [0m[Oct 19 17:07:06.233][podrecreation.go: 159] ns=tnf pod=test-1 deleted
+[36mINFO [0m[Oct 19 17:07:06.233][podsets.go: 190] Waiting 9m0s for 2 podsets to be ready.
+[36mINFO [0m[Oct 19 17:07:06.233][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[36mINFO [0m[Oct 19 17:07:06.400][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[36mINFO [0m[Oct 19 17:07:06.572][podsets.go: 198] Not ready Deployments: [tnf:test]
+[36mINFO [0m[Oct 19 17:07:06.572][podsets.go: 199] Not ready StatefulSets: [tnf:test]
+[36mINFO [0m[Oct 19 17:07:21.573][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[37mDEBUG [0m[Oct 19 17:07:21.738][podsets.go: 152] deployment: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:07:21.738][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[37mDEBUG [0m[Oct 19 17:07:21.907][podsets.go: 175] statefulset: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:07:21.907][podsets.go: 198] Not ready Deployments: []
+[36mINFO [0m[Oct 19 17:07:21.907][podsets.go: 199] Not ready StatefulSets: []
+[37mDEBUG [0m[Oct 19 17:07:21.907][loghelper.go: 40] Not ready Deployments: []
+[37mDEBUG [0m[Oct 19 17:07:21.907][loghelper.go: 40] Not ready StatefulSets: []
+[36mINFO [0m[Oct 19 17:07:21.907][podrecreation.go: 51] Performing uncordon operation on node clus0-0
+[36mINFO [0m[Oct 19 17:07:22.734][podrecreation.go: 51] Performing cordon operation on node clus0-1
+[37mDEBUG [0m[Oct 19 17:07:24.042][suite.go: 570] node: clus0-1 cordoned
+[37mDEBUG [0m[Oct 19 17:07:24.054][suite.go: 576] draining node: clus0-1 with timeout: 8m0s
+[37mDEBUG [0m[Oct 19 17:07:24.054][podrecreation.go: 113] deleting ns=tnf pod=test-d78fbf8d6-2fk6c with deleteForeground mode
+[37mDEBUG [0m[Oct 19 17:07:26.465][podrecreation.go: 159] ns=tnf pod=test-d78fbf8d6-2fk6c deleted
+[36mINFO [0m[Oct 19 17:07:26.465][podsets.go: 190] Waiting 8m0s for 2 podsets to be ready.
+[36mINFO [0m[Oct 19 17:07:26.465][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[36mINFO [0m[Oct 19 17:07:26.631][podsets.go: 195] Checking StatefulSets readiness of StatefulSets [tnf:test]
+[37mDEBUG [0m[Oct 19 17:07:26.797][podsets.go: 175] statefulset: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:07:26.797][podsets.go: 198] Not ready Deployments: [tnf:test]
+[36mINFO [0m[Oct 19 17:07:26.797][podsets.go: 199] Not ready StatefulSets: []
+[36mINFO [0m[Oct 19 17:07:41.798][podsets.go: 192] Checking Deployments readiness of Deployments [tnf:test]
+[37mDEBUG [0m[Oct 19 17:07:41.957][podsets.go: 152] deployment: test ns: tnf is ready.
+[36mINFO [0m[Oct 19 17:07:41.957][podsets.go: 195] Checking StatefulSets readiness of StatefulSets []
+[36mINFO [0m[Oct 19 17:07:41.957][podsets.go: 198] Not ready Deployments: []
+[36mINFO [0m[Oct 19 17:07:41.957][podsets.go: 199] Not ready StatefulSets: []
+[37mDEBUG [0m[Oct 19 17:07:41.957][loghelper.go: 40] Not ready Deployments: []
+[37mDEBUG [0m[Oct 19 17:07:41.957][loghelper.go: 40] Not ready StatefulSets: []
+[36mINFO [0m[Oct 19 17:07:41.957][podrecreation.go: 51] Performing uncordon operation on node clus0-1
+[36mINFO [0m[Oct 19 17:07:43.096][podrecreation.go: 51] Performing uncordon operation on node clus0-1
+[36mINFO [0m[Oct 19 17:07:43.579][podrecreation.go: 51] Performing uncordon operation on node clus0-0
+[36mINFO [0m[Oct 19 17:07:44.056][podrecreation.go: 51] Performing uncordon operation on node clus0-2
+[37mDEBUG [0m[Oct 19 17:07:44.692][utils.go: 38] config file already loaded, return previous element
+[36mINFO [0m[Oct 19 17:07:45.020][autodiscover.go: 154] parsed pods under test labels: [{LabelKey:test-network-function.com/generic LabelValue:target}]
+[36mINFO [0m[Oct 19 17:07:45.020][autodiscover.go: 155] parsed operators under test labels: [{LabelKey:test-network-function.com/operator1 LabelValue:new} {LabelKey:test-network-function.com/operator LabelValue:}]
+[37mDEBUG [0m[Oct 19 17:07:45.193][autodiscover_operators.go: 135] Searching subscriptions in namespace All Namespaces
+[36mINFO [0m[Oct 19 17:07:45.355][autodiscover_operators.go: 144] Found 2 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:07:45.355][autodiscover_operators.go: 146] Subscriptions name: lvms-operator (ns: openshift-storage)
+[36mINFO [0m[Oct 19 17:07:45.355][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[37mDEBUG [0m[Oct 19 17:07:45.355][autodiscover_operators.go: 112] Searching CSVs in namespace All
+[36mINFO [0m[Oct 19 17:07:45.678][autodiscover_operators.go: 121] Found 2 CSVs:
+[36mINFO [0m[Oct 19 17:07:45.678][autodiscover_operators.go: 123] CSV name: packageserver (ns: openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:07:45.678][autodiscover_operators.go: 123] CSV name: lvms-operator.v4.13.1 (ns: openshift-storage)
+[37mDEBUG [0m[Oct 19 17:07:46.004][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/generic=target
+[37mDEBUG [0m[Oct 19 17:07:46.340][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/app=tnf-debug
+[36mINFO [0m[Oct 19 17:07:47.722][autodiscover_scales.go: 40] Target CRD crdexamples.test-network-function.com is not scalable. Skipping search of scalable CRs.
+[37mDEBUG [0m[Oct 19 17:07:47.723][autodiscover_operators.go: 69] Searching CSVs in namespace {tnf}
+[37mDEBUG [0m[Oct 19 17:07:47.723][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator1=new
+[37mDEBUG [0m[Oct 19 17:07:47.881][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator
+[36mINFO [0m[Oct 19 17:07:48.038][autodiscover_operators.go: 91] Found 0 CSVs:
+[37mDEBUG [0m[Oct 19 17:07:48.055][autodiscover_operators.go: 135] Searching subscriptions in namespace tnf
+[36mINFO [0m[Oct 19 17:07:48.213][autodiscover_operators.go: 144] Found 1 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:07:48.213][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[36mINFO [0m[Oct 19 17:07:48.678][autodiscover.go: 276] OpenShift Version found: 4.13.0
+[36mINFO [0m[Oct 19 17:07:48.997][autodiscover_podset.go: 80] Deployment test found in ns tnf
+[36mINFO [0m[Oct 19 17:07:49.152][autodiscover_podset.go: 113] StatefulSet test found in ns tnf
+[36mINFO [0m[Oct 19 17:07:50.462][operators.go: 130] Found 2 unique CSVs
+[36mINFO [0m[Oct 19 17:07:50.463][operators.go: 132] CSV: packageserver
+[36mINFO [0m[Oct 19 17:07:50.463][operators.go: 132] CSV: lvms-operator.v4.13.1
+[36mINFO [0m[Oct 19 17:07:50.630][operators.go: 185] Getting installplans for op lvms-operator.v4.13.1 (subs lvms-operator ns openshift-storage)
+[33mWARNING[0m[Oct 19 17:07:50.630][operators.go: 183] Subscription not found for CSV: packageserver (ns openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:07:50.630][operators.go: 185] Getting installplans for op packageserver (subs ns )
+[36mINFO [0m[Oct 19 17:07:50.630][provider.go: 566] Node clus0-0 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:07:50.810][provider.go: 566] Node clus0-1 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:07:51.020][provider.go: 566] Node clus0-2 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[37mDEBUG [0m[Oct 19 17:07:51.390][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:07:51.391][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[36mINFO [0m[Oct 19 17:07:51.391][operators.go: 130] Found 0 unique CSVs
+[36mINFO [0m[Oct 19 17:07:51.391][provider.go: 299] Operators found: 0
+[36mINFO [0m[Oct 19 17:07:51.391][provider.go: 311] Completed the test environment build process in 6.70 seconds
+[36mINFO [0m[Oct 19 17:07:53.160][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:07:54.315][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:07:55.476][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:07:56.632][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:07:57.841][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:07:59.000][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:00.160][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:01.317][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:02.473][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:03.631][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:04.789][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:05.945][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[36mINFO [0m[Oct 19 17:08:07.100][podsets.go: 44] deployment: test ns: tnf is not ready yet
+[37mDEBUG [0m[Oct 19 17:08:08.254][utils.go: 38] config file already loaded, return previous element
+[36mINFO [0m[Oct 19 17:08:08.561][autodiscover.go: 154] parsed pods under test labels: [{LabelKey:test-network-function.com/generic LabelValue:target}]
+[36mINFO [0m[Oct 19 17:08:08.561][autodiscover.go: 155] parsed operators under test labels: [{LabelKey:test-network-function.com/operator1 LabelValue:new} {LabelKey:test-network-function.com/operator LabelValue:}]
+[37mDEBUG [0m[Oct 19 17:08:08.725][autodiscover_operators.go: 135] Searching subscriptions in namespace All Namespaces
+[36mINFO [0m[Oct 19 17:08:08.880][autodiscover_operators.go: 144] Found 2 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:08:08.880][autodiscover_operators.go: 146] Subscriptions name: lvms-operator (ns: openshift-storage)
+[36mINFO [0m[Oct 19 17:08:08.880][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[37mDEBUG [0m[Oct 19 17:08:08.881][autodiscover_operators.go: 112] Searching CSVs in namespace All
+[36mINFO [0m[Oct 19 17:08:09.199][autodiscover_operators.go: 121] Found 2 CSVs:
+[36mINFO [0m[Oct 19 17:08:09.200][autodiscover_operators.go: 123] CSV name: packageserver (ns: openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:08:09.200][autodiscover_operators.go: 123] CSV name: lvms-operator.v4.13.1 (ns: openshift-storage)
+[37mDEBUG [0m[Oct 19 17:08:09.526][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/generic=target
+[37mDEBUG [0m[Oct 19 17:08:09.880][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/app=tnf-debug
+[36mINFO [0m[Oct 19 17:08:11.375][autodiscover_scales.go: 40] Target CRD crdexamples.test-network-function.com is not scalable. Skipping search of scalable CRs.
+[37mDEBUG [0m[Oct 19 17:08:11.375][autodiscover_operators.go: 69] Searching CSVs in namespace {tnf}
+[37mDEBUG [0m[Oct 19 17:08:11.375][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator1=new
+[37mDEBUG [0m[Oct 19 17:08:11.531][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator
+[36mINFO [0m[Oct 19 17:08:11.687][autodiscover_operators.go: 91] Found 0 CSVs:
+[37mDEBUG [0m[Oct 19 17:08:11.687][autodiscover_operators.go: 135] Searching subscriptions in namespace tnf
+[36mINFO [0m[Oct 19 17:08:11.842][autodiscover_operators.go: 144] Found 1 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:08:11.842][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[36mINFO [0m[Oct 19 17:08:12.314][autodiscover.go: 276] OpenShift Version found: 4.13.0
+[36mINFO [0m[Oct 19 17:08:12.622][autodiscover_podset.go: 80] Deployment test found in ns tnf
+[36mINFO [0m[Oct 19 17:08:12.776][autodiscover_podset.go: 113] StatefulSet test found in ns tnf
+[36mINFO [0m[Oct 19 17:08:14.078][operators.go: 130] Found 2 unique CSVs
+[36mINFO [0m[Oct 19 17:08:14.079][operators.go: 132] CSV: packageserver
+[36mINFO [0m[Oct 19 17:08:14.079][operators.go: 132] CSV: lvms-operator.v4.13.1
+[36mINFO [0m[Oct 19 17:08:14.236][operators.go: 185] Getting installplans for op lvms-operator.v4.13.1 (subs lvms-operator ns openshift-storage)
+[33mWARNING[0m[Oct 19 17:08:14.236][operators.go: 183] Subscription not found for CSV: packageserver (ns openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:08:14.236][operators.go: 185] Getting installplans for op packageserver (subs ns )
+[36mINFO [0m[Oct 19 17:08:14.236][provider.go: 566] Node clus0-0 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:08:14.408][provider.go: 566] Node clus0-1 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:08:14.580][provider.go: 566] Node clus0-2 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.783][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.784][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.784][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:14.784][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[36mINFO [0m[Oct 19 17:08:14.784][operators.go: 130] Found 0 unique CSVs
+[36mINFO [0m[Oct 19 17:08:14.784][provider.go: 299] Operators found: 0
+[36mINFO [0m[Oct 19 17:08:14.784][provider.go: 311] Completed the test environment build process in 6.53 seconds
+[37mDEBUG [0m[Oct 19 17:08:16.369][utils.go: 38] config file already loaded, return previous element
+[36mINFO [0m[Oct 19 17:08:16.678][autodiscover.go: 154] parsed pods under test labels: [{LabelKey:test-network-function.com/generic LabelValue:target}]
+[36mINFO [0m[Oct 19 17:08:16.678][autodiscover.go: 155] parsed operators under test labels: [{LabelKey:test-network-function.com/operator1 LabelValue:new} {LabelKey:test-network-function.com/operator LabelValue:}]
+[37mDEBUG [0m[Oct 19 17:08:16.844][autodiscover_operators.go: 135] Searching subscriptions in namespace All Namespaces
+[36mINFO [0m[Oct 19 17:08:17.001][autodiscover_operators.go: 144] Found 2 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:08:17.001][autodiscover_operators.go: 146] Subscriptions name: lvms-operator (ns: openshift-storage)
+[36mINFO [0m[Oct 19 17:08:17.001][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[37mDEBUG [0m[Oct 19 17:08:17.001][autodiscover_operators.go: 112] Searching CSVs in namespace All
+[36mINFO [0m[Oct 19 17:08:17.169][autodiscover_operators.go: 121] Found 2 CSVs:
+[36mINFO [0m[Oct 19 17:08:17.169][autodiscover_operators.go: 123] CSV name: packageserver (ns: openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:08:17.169][autodiscover_operators.go: 123] CSV name: lvms-operator.v4.13.1 (ns: openshift-storage)
+[37mDEBUG [0m[Oct 19 17:08:17.485][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/generic=target
+[37mDEBUG [0m[Oct 19 17:08:17.810][autodiscover_pods.go: 34] Searching Pods with label test-network-function.com/app=tnf-debug
+[36mINFO [0m[Oct 19 17:08:19.152][autodiscover_scales.go: 40] Target CRD crdexamples.test-network-function.com is not scalable. Skipping search of scalable CRs.
+[37mDEBUG [0m[Oct 19 17:08:19.152][autodiscover_operators.go: 69] Searching CSVs in namespace {tnf}
+[37mDEBUG [0m[Oct 19 17:08:19.152][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator1=new
+[37mDEBUG [0m[Oct 19 17:08:19.305][autodiscover_operators.go: 76] Searching CSVs with label test-network-function.com/operator
+[36mINFO [0m[Oct 19 17:08:19.458][autodiscover_operators.go: 91] Found 0 CSVs:
+[37mDEBUG [0m[Oct 19 17:08:19.458][autodiscover_operators.go: 135] Searching subscriptions in namespace tnf
+[36mINFO [0m[Oct 19 17:08:19.614][autodiscover_operators.go: 144] Found 1 subscriptions in the target namespaces
+[36mINFO [0m[Oct 19 17:08:19.614][autodiscover_operators.go: 146] Subscriptions name: test-subscription (ns: tnf)
+[36mINFO [0m[Oct 19 17:08:20.082][autodiscover.go: 276] OpenShift Version found: 4.13.0
+[36mINFO [0m[Oct 19 17:08:20.391][autodiscover_podset.go: 80] Deployment test found in ns tnf
+[36mINFO [0m[Oct 19 17:08:20.547][autodiscover_podset.go: 113] StatefulSet test found in ns tnf
+[36mINFO [0m[Oct 19 17:08:21.850][operators.go: 130] Found 2 unique CSVs
+[36mINFO [0m[Oct 19 17:08:21.850][operators.go: 132] CSV: packageserver
+[36mINFO [0m[Oct 19 17:08:21.850][operators.go: 132] CSV: lvms-operator.v4.13.1
+[36mINFO [0m[Oct 19 17:08:22.004][operators.go: 185] Getting installplans for op lvms-operator.v4.13.1 (subs lvms-operator ns openshift-storage)
+[33mWARNING[0m[Oct 19 17:08:22.004][operators.go: 183] Subscription not found for CSV: packageserver (ns openshift-operator-lifecycle-manager)
+[36mINFO [0m[Oct 19 17:08:22.004][operators.go: 185] Getting installplans for op packageserver (subs ns )
+[36mINFO [0m[Oct 19 17:08:22.004][provider.go: 566] Node clus0-0 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:08:22.179][provider.go: 566] Node clus0-1 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[36mINFO [0m[Oct 19 17:08:22.351][provider.go: 566] Node clus0-2 - mc name: rendered-master-87e86cb409fb5f914d4c94bee99ef373
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.530][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.531][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[37mDEBUG [0m[Oct 19 17:08:22.531][provider.go: 424] parsed image, repo: quay.io, name:testnetworkfunction/cnf-test-partner, tag: latest, digest: sha256:cca46b755479e1ca7390c9b824ca50057e14375405c2294efb7907d7a0a20c6d
+[36mINFO [0m[Oct 19 17:08:22.531][operators.go: 130] Found 0 unique CSVs
+[36mINFO [0m[Oct 19 17:08:22.531][provider.go: 299] Operators found: 0
+[36mINFO [0m[Oct 19 17:08:22.531][provider.go: 311] Completed the test environment build process in 6.16 seconds
+[37mDEBUG [0m[Oct 19 17:08:22.531][isolation.go: 71] container: test pod: test-0 ns: tnf has CPU requests 250 (milli) that has to be a whole unit.
+[37mDEBUG [0m[Oct 19 17:08:22.531][isolation.go: 71] container: test pod: test-1 ns: tnf has CPU requests 250 (milli) that has to be a whole unit.
+[37mDEBUG [0m[Oct 19 17:08:22.531][isolation.go: 71] container: test pod: test-d78fbf8d6-rtxbr ns: tnf has CPU requests 250 (milli) that has to be a whole unit.
+[37mDEBUG [0m[Oct 19 17:08:22.531][isolation.go: 71] container: test pod: test-d78fbf8d6-vvlwx ns: tnf has CPU requests 250 (milli) that has to be a whole unit.
+[36mINFO [0m[Oct 19 17:08:22.636][archiver.go: 45] Compressing results artifacts into /Users/amal/Documents/GitHub/cnf-certification-test/cnf-certification-test/20231019-170822-cnf-test-results.tar.gz
+[37mDEBUG [0m[Oct 19 17:08:22.637][archiver.go: 59] Zipping file /Users/amal/Documents/GitHub/cnf-certification-test/cnf-certification-test/claim.json
+[37mDEBUG [0m[Oct 19 17:08:22.666][archiver.go: 59] Zipping file /Users/amal/Documents/GitHub/cnf-certification-test/cnf-certification-test/cnf-certification-tests_junit.xml
+[37mDEBUG [0m[Oct 19 17:08:22.667][archiver.go: 59] Zipping file /Users/amal/Documents/GitHub/cnf-certification-test/cnf-certification-test/claimjson.js
+[37mDEBUG [0m[Oct 19 17:08:22.700][archiver.go: 59] Zipping file /Users/amal/Documents/GitHub/cnf-certification-test/cnf-certification-test/results.html
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 22a900793..782e94368 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -17,14 +17,20 @@
package suite
import (
+ "bufio"
_ "embed"
+ "encoding/json"
"flag"
+ "fmt"
+ "net/http"
"os"
"path/filepath"
"testing"
"time"
+ "github.com/gorilla/websocket"
"github.com/onsi/ginkgo/v2"
+ "github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/test-network-function/cnf-certification-test/cnf-certification-test/results"
"github.com/test-network-function/cnf-certification-test/pkg/claimhelper"
@@ -56,8 +62,10 @@ const (
defaultClaimPath = ".."
defaultCliArgValue = ""
junitFlagKey = "junit"
+ serverRun = "runserver"
TNFReportKey = "cnf-certification-test"
extraInfoKey = "testsExtraInfo"
+ defaultServerRun = false
)
var (
@@ -77,13 +85,28 @@ var (
// ClaimFormat is the current version for the claim file format to be produced by the TNF test suite.
// A client decoding this claim file must support decoding its specific version.
ClaimFormatVersion string
+ serveRun *bool
)
+//go:embed amalpro/index.html
+var indexHTML []byte
+
+//go:embed amalpro/submit.js
+var submit []byte
+
+//go:embed amalpro/logs.js
+var logs []byte
+
+//go:embed amalpro/toast.js
+var toast []byte
+
func init() {
claimPath = flag.String(claimPathFlagKey, defaultClaimPath,
"the path where the claimfile will be output")
junitPath = flag.String(junitFlagKey, defaultCliArgValue,
"the path for the junit format report")
+ serveRun = flag.Bool(serverRun, defaultServerRun,
+ "the path for the junit format report")
}
// setLogLevel sets the log level for logrus based on the "TNF_LOG_LEVEL" environment variable
@@ -102,6 +125,7 @@ func setLogLevel() {
func getK8sClientsConfigFileNames() []string {
params := configuration.GetTestParameters()
+ logrus.Info(params)
fileNames := []string{}
if params.Kubeconfig != "" {
fileNames = append(fileNames, params.Kubeconfig)
@@ -126,6 +150,59 @@ func getGitVersion() string {
return gitDisplayRelease + " ( " + GitCommit + " )"
}
+func startServer() {
+ log.Info("inside starting the server")
+
+ http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
+ // Set the content type to "text/html".
+ w.Header().Set("Content-Type", "text/html")
+ // Write the embedded HTML content to the response.
+ _, err := w.Write(indexHTML)
+ if err != nil {
+ http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ }
+ })
+
+ http.HandleFunc("/submit.js", func(w http.ResponseWriter, r *http.Request) {
+ // Set the content type to "application/javascript".
+ w.Header().Set("Content-Type", "application/javascript")
+ // Write the embedded JavaScript content to the response.
+ _, err := w.Write(submit)
+ if err != nil {
+ http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ }
+ })
+
+ http.HandleFunc("/logs.js", func(w http.ResponseWriter, r *http.Request) {
+ // Set the content type to "application/javascript".
+ w.Header().Set("Content-Type", "application/javascript")
+ // Write the embedded JavaScript content to the response.
+ _, err := w.Write(logs)
+ if err != nil {
+ http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ }
+ })
+
+ http.HandleFunc("/toast.js", func(w http.ResponseWriter, r *http.Request) {
+ // Set the content type to "application/javascript".
+ w.Header().Set("Content-Type", "application/javascript")
+ // Write the embedded JavaScript content to the response.
+ _, err := w.Write(toast)
+ if err != nil {
+ http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ }
+ })
+
+ http.HandleFunc("/runFunction", runHandler)
+ // Serve the static HTML file
+ http.HandleFunc("/logstream", logStreamHandler)
+
+ fmt.Println("Server is running on :8080...")
+ if err := http.ListenAndServe(":8080", nil); err != nil {
+ panic(err)
+ }
+}
+
// TestTest invokes the CNF Certification Test Suite.
func TestTest(t *testing.T) {
// When running unit tests, skip the suite
@@ -147,43 +224,55 @@ func TestTest(t *testing.T) {
log.Infof("Claim Format Version: %s", ClaimFormatVersion)
log.Infof("Ginkgo Version : %v", ginkgo.GINKGO_VERSION)
log.Infof("Labels filter : %v", ginkgoConfig.LabelFilter)
+ log.Infof("*serveRun : %v", *serveRun)
+ log.Info("starting the server")
+
+ go startServer()
+ // Keep the main program running
// Diagnostic functions will run when no labels are provided.
- var diagnosticMode bool
- if ginkgoConfig.LabelFilter == "" {
- log.Infof("TNF will run in diagnostic mode so no test case will be launched.")
- diagnosticMode = true
- }
+ if !*serveRun {
+ var diagnosticMode bool
+ if ginkgoConfig.LabelFilter == "" {
+ log.Infof("TNF will run in diagnostic mode so no test case will be launched.")
+ diagnosticMode = true
+ }
- // Set clientsholder singleton with the filenames from the env vars.
- _ = clientsholder.GetClientsHolder(getK8sClientsConfigFileNames()...)
+ // Set clientsholder singleton with the filenames from the env vars.
+ _ = clientsholder.GetClientsHolder(getK8sClientsConfigFileNames()...)
- // Initialize the claim with the start time, tnf version, etc.
- claimRoot := claimhelper.CreateClaimRoot()
- claimData := claimRoot.Claim
- claimData.Configurations = make(map[string]interface{})
- claimData.Nodes = make(map[string]interface{})
- incorporateVersions(claimData)
+ // Initialize the claim with the start time, tnf version, etc.
+ claimRoot := claimhelper.CreateClaimRoot()
+ claimData := claimRoot.Claim
+ claimData.Configurations = make(map[string]interface{})
+ claimData.Nodes = make(map[string]interface{})
+ incorporateVersions(claimData)
- configurations, err := claimhelper.MarshalConfigurations()
- if err != nil {
- log.Errorf("Configuration node missing because of: %s", err)
- t.FailNow()
- }
+ configurations, err := claimhelper.MarshalConfigurations()
+ if err != nil {
+ log.Errorf("Configuration node missing because of: %s", err)
+ t.FailNow()
+ }
- claimData.Nodes = claimhelper.GenerateNodes()
- claimhelper.UnmarshalConfigurations(configurations, claimData.Configurations)
+ claimData.Nodes = claimhelper.GenerateNodes()
+ claimhelper.UnmarshalConfigurations(configurations, claimData.Configurations)
- // initialize abort flag
- testhelper.AbortTrigger = ""
+ // initialize abort flag
+ testhelper.AbortTrigger = ""
- // Run tests specs only if not in diagnostic mode, otherwise all TSs would run.
- var env provider.TestEnvironment
- if !diagnosticMode {
- env.SetNeedsRefresh()
- env = provider.GetTestEnvironment()
- ginkgo.RunSpecs(t, CnfCertificationTestSuiteName)
+ // Run tests specs only if not in diagnostic mode, otherwise all TSs would run.
+ var env provider.TestEnvironment
+ if !diagnosticMode {
+ env.SetNeedsRefresh()
+ env = provider.GetTestEnvironment()
+ ginkgo.RunSpecs(t, CnfCertificationTestSuiteName)
+ }
+ continueRun(t, diagnosticMode, env, claimData, claimRoot)
}
+ select {}
+}
+
+func continueRun(t *testing.T, diagnosticMode bool, env provider.TestEnvironment, claimData *claim.Claim, claimRoot *claim.Root) {
endTime := time.Now()
claimData.Metadata.EndTime = endTime.UTC().Format(claimhelper.DateTimeFormatDirective)
@@ -211,7 +300,7 @@ func TestTest(t *testing.T) {
// Send claim file to the collector if specified by env var
if configuration.GetTestParameters().EnableDataCollection {
- err = collector.SendClaimFileToCollector(env.CollectorAppEndPoint, claimOutputFile, env.ExecutedBy, env.PartnerName, env.CollectorAppPassword)
+ err := collector.SendClaimFileToCollector(env.CollectorAppEndPoint, claimOutputFile, env.ExecutedBy, env.PartnerName, env.CollectorAppPassword)
if err != nil {
log.Errorf("Failed to send post request to the collector: %v", err)
}
@@ -264,3 +353,209 @@ func incorporateVersions(claimData *claim.Claim) {
ClaimFormat: ClaimFormatVersion,
}
}
+
+var upgrader = websocket.Upgrader{
+ CheckOrigin: func(r *http.Request) bool {
+ return true
+ },
+}
+
+// Define an HTTP handler that triggers Ginkgo tests
+func runHandler(w http.ResponseWriter, r *http.Request) {
+ // Run Ginkgo tests
+ var requestData RequestData
+ //var responseData ResponseData
+ // Parse JSON data from the request body
+ err := json.NewDecoder(r.Body).Decode(&requestData)
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusBadRequest)
+ return
+ }
+ // Create or open a log file
+ filename := "log.log"
+ if _, err := os.Stat(filename); err == nil {
+ // If it exists, truncate it to remove the contents
+ file, err := os.OpenFile(filename, os.O_TRUNC, 0)
+ if err != nil {
+ // Handle the error if necessary
+ panic(err)
+ }
+ file.Close()
+ }
+ logFile, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
+ if err != nil {
+ panic(err)
+ }
+ logrus.SetOutput(logFile)
+ originalStdout := os.Stdout
+ os.Stdout = logFile
+ // Read the YAML file
+ defer func() {
+ os.Stdout = originalStdout
+ logFile.Close()
+ }()
+ os.Setenv("KUBECONFIG", requestData.KubeConfigPath)
+ logrus.Infof("KUBECONFIG : %v", requestData.KubeConfigPath)
+
+ logrus.Infof("Labels filter : %v", requestData.SelectedOptions)
+
+ // Set the output of the logger to the log file
+
+ /*data, err := os.ReadFile("tnf_config.yml")
+ if err != nil {
+ log.Fatalf("Error reading YAML file: %v", err)
+ }
+
+ // Unmarshal the YAML data into a Config struct
+ var config configuration.TestConfiguration
+
+ err = yaml.Unmarshal(data, &config)
+ if err != nil {
+ log.Fatalf("Error unmarshaling YAML: %v", err)
+ }
+
+ // Modify the configuration
+ var namespace []configuration.Namespace
+ namespace = append(namespace, configuration.Namespace{Name: requestData.Field3})
+
+ config.TargetNameSpaces = namespace // Change the port to a new value
+
+ // Serialize the modified config back to YAML format
+ newData, err := yaml.Marshal(&config)
+ if err != nil {
+ log.Fatalf("Error marshaling YAML: %v", err)
+ }
+
+ // Write the modified YAML data back to the file
+ err = os.WriteFile("tnf_config.yml", newData, os.ModePerm)
+ if err != nil {
+ log.Fatalf("Error writing YAML file: %v", err)
+ }
+ */
+ t := testing.T{}
+ logrus.Infof(os.Getenv("KUBECONFIG"))
+ // When running unit tests, skip the suite
+ if os.Getenv("UNIT_TEST") != "" {
+ t.Skip("Skipping test suite when running unit tests")
+ }
+
+ err = configuration.LoadEnvironmentVariables()
+ if err != nil {
+ log.Fatalf("could not load the environment variables, error: %v", err)
+ }
+
+ // Set up logging params for logrus
+ loghelper.SetLogFormat()
+ setLogLevel()
+
+ ginkgoConfig, _ := ginkgo.GinkgoConfiguration()
+ log.Infof("Ginkgo Version : %v", ginkgo.GINKGO_VERSION)
+ log.Infof("Labels filter : %v", ginkgoConfig.LabelFilter)
+ // Set clientsholder singleton with the filenames from the env vars.
+ _ = clientsholder.GetClientsHolder(getK8sClientsConfigFileNames()...)
+
+ // Initialize the claim with the start time, tnf version, etc.
+ claimRoot := claimhelper.CreateClaimRoot()
+ claimData := claimRoot.Claim
+ claimData.Configurations = make(map[string]interface{})
+ claimData.Nodes = make(map[string]interface{})
+ incorporateVersions(claimData)
+
+ configurations, err := claimhelper.MarshalConfigurations()
+ if err != nil {
+ log.Errorf("Configuration node missing because of: %s", err)
+ t.FailNow()
+ }
+ claimData.Nodes = claimhelper.GenerateNodes()
+ claimhelper.UnmarshalConfigurations(configurations, claimData.Configurations)
+
+ // initialize abort flag
+ testhelper.AbortTrigger = ""
+
+ fmt.Println("This will be written to the log file.")
+ var env provider.TestEnvironment
+ env.SetNeedsRefresh()
+ env = provider.GetTestEnvironment()
+ // fetch the current config
+ suiteConfig, reporterConfig := ginkgo.GinkgoConfiguration()
+ // adjust it
+ suiteConfig.SkipStrings = []string{"NEVER-RUN"}
+ reporterConfig.FullTrace = true
+ reporterConfig.JUnitReport = "cnf-certification-tests_junit.xml"
+ // pass it in to RunSpecs
+ suiteConfig.LabelFilter = requestData.SelectedOptions
+ ginkgo.RunSpecs(&t, CnfCertificationTestSuiteName, suiteConfig, reporterConfig)
+
+ continueRun(&t, false, env, claimData, claimRoot)
+ // Return the result as JSON
+ response := struct {
+ Message string `json:"Message"`
+ }{
+ Message: fmt.Sprintf("Sucsses to run %s", requestData.SelectedOptions),
+ }
+ // Serialize the response data to JSON
+ jsonResponse, err := json.Marshal(response)
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+ // Set the Content-Type header to specify that the response is JSON
+ w.Header().Set("Content-Type", "application/json")
+
+ // Write the JSON response to the client
+ _, err = w.Write(jsonResponse)
+ if err != nil {
+ http.Error(w, err.Error(), http.StatusInternalServerError)
+ return
+ }
+
+}
+
+func logStreamHandler(w http.ResponseWriter, r *http.Request) {
+ conn, err := upgrader.Upgrade(w, r, nil)
+ if err != nil {
+ log.Printf("WebSocket upgrade error: %v", err)
+ return
+ }
+ defer conn.Close()
+
+ filePath := "log.log"
+
+ // Open the log file
+ file, err := os.Open(filePath)
+ if err != nil {
+ log.Println(err)
+ return
+ }
+ defer file.Close()
+
+ // Create a scanner to read the log file line by line
+ for {
+ scanner := bufio.NewScanner(file)
+ for scanner.Scan() {
+ line := scanner.Text() + "\n"
+ // Send each log line to the client
+ if err := conn.WriteMessage(websocket.TextMessage, []byte(line)); err != nil {
+ fmt.Println(err)
+ //return
+ }
+
+ // Sleep for a short duration to simulate real-time updates
+ time.Sleep(100 * time.Millisecond)
+ }
+ if err := scanner.Err(); err != nil {
+ log.Printf("Error reading log file: %v", err)
+ }
+
+ time.Sleep(1 * time.Second)
+ }
+
+}
+
+type RequestData struct {
+ KubeConfigPath string `json:"kubeConfigPath"`
+ SelectedOptions string `json:"selectedOptions"`
+}
+type ResponseData struct {
+ Message string `json:"message"`
+}
From d4dc99f18052cb82d1a7421f969524203622ca5c Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Mon, 23 Oct 2023 12:27:58 +0300
Subject: [PATCH 16/28] a few changes(add upload file) and added the -s for
server
---
cnf-certification-test/amalpro/index.html | 18 +-
cnf-certification-test/amalpro/logs.js | 2 -
cnf-certification-test/amalpro/submit.js | 6 +-
cnf-certification-test/log.log | 395 ----------------------
cnf-certification-test/suite_test.go | 83 ++++-
go.mod | 1 +
go.sum | 1 +
run-cnf-suites.sh | 17 +-
8 files changed, 94 insertions(+), 429 deletions(-)
delete mode 100644 cnf-certification-test/log.log
diff --git a/cnf-certification-test/amalpro/index.html b/cnf-certification-test/amalpro/index.html
index 14b632651..dbac2fdbb 100644
--- a/cnf-certification-test/amalpro/index.html
+++ b/cnf-certification-test/amalpro/index.html
@@ -137,16 +137,12 @@
const { toast } = await import('./toast.js');
await toast({ heading, message, state, timeout: 20_000 });
});
- document.getElementById('show-logs').addEventListener('click', function(event) {
- const socket = new WebSocket('ws://localhost:8080/logstream');
+ document.getElementById('show-logs').addEventListener('click', async function(event) {
const code = document
- .getElementById('logs')
- .querySelector('rh-code-block');
+ .getElementById('logs')
+ .querySelector('rh-code-block');
code.textContent = '';
- // Handle incoming log messages
- socket.addEventListener('message', function (event) {
- code.textContent += event.data + '\n';
- });
+ await import('./logs.js')
});
@@ -168,11 +164,9 @@ CNF Certification Test
diff --git a/cnf-certification-test/webserver/logs.js b/cnf-certification-test/webserver/logs.js
index a3624f210..4de5b4968 100644
--- a/cnf-certification-test/webserver/logs.js
+++ b/cnf-certification-test/webserver/logs.js
@@ -1,6 +1,6 @@
import '@rhds/elements/rh-code-block/rh-code-block.js';
-const socket = new WebSocket('ws://localhost:8080/logstream');
+const socket = new WebSocket('ws://localhost:8084/logstream');
const code = document
.getElementById('logs')
.querySelector('rh-code-block');
diff --git a/cnf-certification-test/webserver_function.go b/cnf-certification-test/webserver_function.go
index 30bb3e787..5cbeac9f0 100644
--- a/cnf-certification-test/webserver_function.go
+++ b/cnf-certification-test/webserver_function.go
@@ -2,11 +2,10 @@ package suite
import (
"bufio"
+ "bytes"
_ "embed"
"fmt"
"net/http"
- "os"
- "time"
"github.com/gorilla/websocket"
@@ -24,6 +23,8 @@ var logs []byte
//go:embed webserver/toast.js
var toast []byte
+var Buf *bytes.Buffer
+var aString string
var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
@@ -38,36 +39,23 @@ func logStreamHandler(w http.ResponseWriter, r *http.Request) {
return
}
defer conn.Close()
-
- filePath := "log.log"
-
- // Open the log file
- file, err := os.Open(filePath)
- if err != nil {
- logrus.Println(err)
- return
- }
- defer file.Close()
-
// Create a scanner to read the log file line by line
for {
- scanner := bufio.NewScanner(file)
+ scanner := bufio.NewScanner(Buf)
for scanner.Scan() {
line := scanner.Text() + "\n"
// Send each log line to the client
if err := conn.WriteMessage(websocket.TextMessage, []byte(line)); err != nil {
fmt.Println(err)
- //return
+ return
}
- // Sleep for a short duration to simulate real-time updates
- time.Sleep(100 * time.Millisecond)
}
if err := scanner.Err(); err != nil {
logrus.Printf("Error reading log file: %v", err)
+ return
}
- time.Sleep(1 * time.Second)
}
}
From 9827cefdb6ca01004e97ced4008667959de6bc54 Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 2 Nov 2023 12:15:05 +0200
Subject: [PATCH 22/28] add bufer implemntation fir logs
---
cnf-certification-test/suite_test.go | 3 ++-
cnf-certification-test/webserver/logs.js | 2 +-
cnf-certification-test/webserver_function.go | 8 ++++---
go.mod | 2 ++
go.sum | 23 ++++++++++++++++++++
5 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 12a7b4bd9..47949fc25 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -23,6 +23,7 @@ import (
"flag"
"fmt"
"io"
+ logl "log"
"net/http"
"os"
"path/filepath"
@@ -311,7 +312,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
Buf = bytes.NewBufferString(aString)
logrus.SetOutput(Buf)
-
+ logl.SetOutput(Buf)
jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
logrus.Info(jsonData)
var data RequstedData
diff --git a/cnf-certification-test/webserver/logs.js b/cnf-certification-test/webserver/logs.js
index 4de5b4968..81b3f4c05 100644
--- a/cnf-certification-test/webserver/logs.js
+++ b/cnf-certification-test/webserver/logs.js
@@ -7,5 +7,5 @@ const code = document
code.textContent = '';
// Handle incoming log messages
socket.addEventListener('message', function (event) {
- code.textContent += event.data + '\n';
+ code.innerHTML += event.data + '\n';
});
\ No newline at end of file
diff --git a/cnf-certification-test/webserver_function.go b/cnf-certification-test/webserver_function.go
index 5cbeac9f0..1d9975ec7 100644
--- a/cnf-certification-test/webserver_function.go
+++ b/cnf-certification-test/webserver_function.go
@@ -8,7 +8,7 @@ import (
"net/http"
"github.com/gorilla/websocket"
-
+ "github.com/robert-nix/ansihtml"
"github.com/sirupsen/logrus"
)
@@ -43,9 +43,11 @@ func logStreamHandler(w http.ResponseWriter, r *http.Request) {
for {
scanner := bufio.NewScanner(Buf)
for scanner.Scan() {
- line := scanner.Text() + "\n"
+ line := scanner.Bytes()
+ line = append(ansihtml.ConvertToHTML(line), []byte("
")...)
+
// Send each log line to the client
- if err := conn.WriteMessage(websocket.TextMessage, []byte(line)); err != nil {
+ if err := conn.WriteMessage(websocket.TextMessage, line); err != nil {
fmt.Println(err)
return
}
diff --git a/go.mod b/go.mod
index 7ed22398d..c9014ca42 100644
--- a/go.mod
+++ b/go.mod
@@ -214,10 +214,12 @@ require (
github.com/gorilla/websocket v1.4.2
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0
github.com/manifoldco/promptui v0.9.0
+ github.com/onsi/ginkgo v1.16.5
github.com/openshift/machine-config-operator v0.0.1-0.20230515070935-49f32d46538e
github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20231018165107-f04b78186455
github.com/test-network-function/oct v0.0.3
github.com/test-network-function/privileged-daemonset v1.0.14
+ github.com/robert-nix/ansihtml v1.0.1
gopkg.in/yaml.v3 v3.0.1
gotest.tools/v3 v3.5.1
k8s.io/kubectl v0.28.3
diff --git a/go.sum b/go.sum
index 272ee988f..5842ef9d8 100644
--- a/go.sum
+++ b/go.sum
@@ -179,6 +179,8 @@ github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6
github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
@@ -213,6 +215,7 @@ github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU=
@@ -335,6 +338,7 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
@@ -452,12 +456,17 @@ github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7P
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
+github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
@@ -518,6 +527,9 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qq
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/robert-nix/ansihtml v1.0.1 h1:VTiyQ6/+AxSJoSSLsMecnkh8i0ZqOEdiRl/odOc64fc=
+github.com/robert-nix/ansihtml v1.0.1/go.mod h1:CJwclxYaTPc2RfcxtanEACsYuTksh4yDXcNeHHKZINE=
+github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
@@ -685,6 +697,7 @@ golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -707,6 +720,7 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
@@ -747,6 +761,7 @@ golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -758,7 +773,10 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -779,6 +797,7 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -863,6 +882,7 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
@@ -985,6 +1005,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
@@ -993,6 +1014,8 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
From 7ce8b09c9cef1ca83e0d2a18e55c96637c492fca Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 2 Nov 2023 13:18:11 +0200
Subject: [PATCH 23/28] update the flag
---
cnf-certification-test/suite_test.go | 11 +++++------
run-cnf-suites.sh | 4 ++--
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 47949fc25..3eba1c2e6 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -32,7 +32,6 @@ import (
"time"
"github.com/onsi/ginkgo/v2"
- "github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
"github.com/test-network-function/cnf-certification-test/cnf-certification-test/results"
"github.com/test-network-function/cnf-certification-test/pkg/claimhelper"
@@ -64,7 +63,7 @@ const (
defaultClaimPath = ".."
defaultCliArgValue = ""
junitFlagKey = "junit"
- serverModeFlag = "server-mode"
+ serverModeFlag = "serverMode"
TNFReportKey = "cnf-certification-test"
extraInfoKey = "testsExtraInfo"
defaultServerMode = "false"
@@ -311,10 +310,10 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
Buf = bytes.NewBufferString(aString)
- logrus.SetOutput(Buf)
+ log.SetOutput(Buf)
logl.SetOutput(Buf)
jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
- logrus.Info(jsonData)
+ log.Info(jsonData)
var data RequstedData
if err := json.Unmarshal([]byte(jsonData), &data); err != nil {
fmt.Println("Error:", err)
@@ -348,9 +347,9 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
// Copy the uploaded file to the server file
os.Setenv("KUBECONFIG", handler.Filename)
- logrus.Infof("KUBECONFIG : %v", handler.Filename)
+ log.Infof("KUBECONFIG : %v", handler.Filename)
- logrus.Infof("Labels filter : %v", flattenedOptions)
+ log.Infof("Labels filter : %v", flattenedOptions)
// Set the output of the logger to the log file
diff --git a/run-cnf-suites.sh b/run-cnf-suites.sh
index 7be443e4b..197a51c84 100755
--- a/run-cnf-suites.sh
+++ b/run-cnf-suites.sh
@@ -95,9 +95,9 @@ fi
# Specify Junit report file name.
GINKGO_ARGS="\
--ginkgo.timeout=$TIMEOUT \
+-serverMode $SERVER_RUN \
-junit $OUTPUT_LOC \
-claimloc $OUTPUT_LOC \
--server-mode $SERVER_RUN \
--ginkgo.junit-report $OUTPUT_LOC/cnf-certification-tests_junit.xml \
-ginkgo.v \
-test.v\
@@ -112,7 +112,7 @@ echo "Report will be output to '$OUTPUT_LOC'"
echo "ginkgo arguments '${GINKGO_ARGS}'"
LABEL_STRING=''
-if [ -z "$LABEL" ]; then
+if [ -z "$LABEL" ] && ([ -z "$SERVER_RUN" ] || [ $SERVER_RUN == false ]); then
echo "No test label (-l) was set, so only diagnostic functions will run."
else
LABEL_STRING="-ginkgo.label-filter=${LABEL}"
From f6fcba63ea8aa05a8b326b8057ca5e690a133703 Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 2 Nov 2023 13:39:15 +0200
Subject: [PATCH 24/28] few changes for linter
---
cnf-certification-test/suite_test.go | 58 ++++----------------
cnf-certification-test/webserver_function.go | 10 ++--
go.mod | 1 -
go.sum | 21 -------
4 files changed, 15 insertions(+), 75 deletions(-)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 3eba1c2e6..5b94a6a45 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -174,7 +174,6 @@ func PreRun(t *testing.T) (claimData *claim.Claim, claimRoot *claim.Root) {
log.Errorf("Configuration node missing because of: %s", err)
t.FailNow()
}
-
claimData.Nodes = claimhelper.GenerateNodes()
claimhelper.UnmarshalConfigurations(configurations, claimData.Configurations)
return claimData, claimRoot
@@ -182,8 +181,6 @@ func PreRun(t *testing.T) (claimData *claim.Claim, claimRoot *claim.Root) {
// TestTest invokes the CNF Certification Test Suite.
func TestTest(t *testing.T) {
-
- // Keep the main program running
ginkgoConfig, _ := ginkgo.GinkgoConfiguration()
if *serverMode == "false" {
claimData, claimRoot := PreRun(t)
@@ -205,15 +202,14 @@ func TestTest(t *testing.T) {
env = provider.GetTestEnvironment()
ginkgo.RunSpecs(t, CnfCertificationTestSuiteName)
}
- ContinueRun(t, diagnosticMode, env, claimData, claimRoot)
+ ContinueRun(diagnosticMode, &env, claimData, claimRoot)
} else {
go StartServer()
select {}
}
}
-func ContinueRun(t *testing.T, diagnosticMode bool, env provider.TestEnvironment, claimData *claim.Claim, claimRoot *claim.Root) {
-
+func ContinueRun(diagnosticMode bool, env *provider.TestEnvironment, claimData *claim.Claim, claimRoot *claim.Root) {
endTime := time.Now()
claimData.Metadata.EndTime = endTime.UTC().Format(claimhelper.DateTimeFormatDirective)
@@ -294,24 +290,28 @@ func incorporateVersions(claimData *claim.Claim) {
}
}
func StartServer() {
-
+ server := &http.Server{
+ Addr: ":8084", // Server address
+ ReadTimeout: 10 * time.Second, // Maximum duration for reading the entire request
+ WriteTimeout: 10 * time.Second, // Maximum duration for writing the entire response
+ IdleTimeout: 120 * time.Second, // Maximum idle duration before closing the connection
+ }
HandlereqFunc()
http.HandleFunc("/runFunction", RunHandler)
fmt.Println("Server is running on :8084...")
- if err := http.ListenAndServe(":8084", nil); err != nil {
+ if err := server.ListenAndServe(); err != nil {
panic(err)
}
}
// Define an HTTP handler that triggers Ginkgo tests
func RunHandler(w http.ResponseWriter, r *http.Request) {
-
Buf = bytes.NewBufferString(aString)
-
log.SetOutput(Buf)
logl.SetOutput(Buf)
+
jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
log.Info(jsonData)
var data RequstedData
@@ -350,40 +350,6 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
log.Infof("KUBECONFIG : %v", handler.Filename)
log.Infof("Labels filter : %v", flattenedOptions)
-
- // Set the output of the logger to the log file
-
- /*data, err := os.ReadFile("tnf_config.yml")
- if err != nil {
- log.Fatalf("Error reading YAML file: %v", err)
- }
-
- // Unmarshal the YAML data into a Config struct
- var config configuration.TestConfiguration
-
- err = yaml.Unmarshal(data, &config)
- if err != nil {
- log.Fatalf("Error unmarshaling YAML: %v", err)
- }
-
- // Modify the configuration
- var namespace []configuration.Namespace
- namespace = append(namespace, configuration.Namespace{Name: requestData.Field3})
-
- config.TargetNameSpaces = namespace // Change the port to a new value
-
- // Serialize the modified config back to YAML format
- newData, err := yaml.Marshal(&config)
- if err != nil {
- log.Fatalf("Error marshaling YAML: %v", err)
- }
-
- // Write the modified YAML data back to the file
- err = os.WriteFile("tnf_config.yml", newData, os.ModePerm)
- if err != nil {
- log.Fatalf("Error writing YAML file: %v", err)
- }
- */
t := testing.T{}
claimData, claimRoot := PreRun(&t)
var env provider.TestEnvironment
@@ -400,7 +366,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
suiteConfig.LabelFilter = strings.Join(flattenedOptions, "")
ginkgo.RunSpecs(&t, CnfCertificationTestSuiteName, suiteConfig, reporterConfig)
- ContinueRun(&t, false, env, claimData, claimRoot)
+ ContinueRun(false, &env, claimData, claimRoot)
// Return the result as JSON
response := struct {
Message string `json:"Message"`
@@ -415,12 +381,10 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
}
// Set the Content-Type header to specify that the response is JSON
w.Header().Set("Content-Type", "application/json")
-
// Write the JSON response to the client
_, err = w.Write(jsonResponse)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
-
}
diff --git a/cnf-certification-test/webserver_function.go b/cnf-certification-test/webserver_function.go
index 1d9975ec7..cbc942081 100644
--- a/cnf-certification-test/webserver_function.go
+++ b/cnf-certification-test/webserver_function.go
@@ -51,15 +51,12 @@ func logStreamHandler(w http.ResponseWriter, r *http.Request) {
fmt.Println(err)
return
}
-
}
if err := scanner.Err(); err != nil {
logrus.Printf("Error reading log file: %v", err)
return
}
-
}
-
}
type RequstedData struct {
@@ -88,7 +85,6 @@ func flattenData(data interface{}, result []string) []string {
return result
}
func HandlereqFunc() {
-
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
// Set the content type to "text/html".
w.Header().Set("Content-Type", "text/html")
@@ -96,6 +92,7 @@ func HandlereqFunc() {
_, err := w.Write(indexHTML)
if err != nil {
http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ return
}
})
@@ -106,6 +103,7 @@ func HandlereqFunc() {
_, err := w.Write(submit)
if err != nil {
http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ return
}
})
@@ -116,6 +114,7 @@ func HandlereqFunc() {
_, err := w.Write(logs)
if err != nil {
http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ return
}
})
@@ -126,10 +125,9 @@ func HandlereqFunc() {
_, err := w.Write(toast)
if err != nil {
http.Error(w, "Failed to write response", http.StatusInternalServerError)
+ return
}
})
-
// Serve the static HTML file
http.HandleFunc("/logstream", logStreamHandler)
-
}
diff --git a/go.mod b/go.mod
index c9014ca42..73e581748 100644
--- a/go.mod
+++ b/go.mod
@@ -214,7 +214,6 @@ require (
github.com/gorilla/websocket v1.4.2
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.4.0
github.com/manifoldco/promptui v0.9.0
- github.com/onsi/ginkgo v1.16.5
github.com/openshift/machine-config-operator v0.0.1-0.20230515070935-49f32d46538e
github.com/redhat-openshift-ecosystem/openshift-preflight v0.0.0-20231018165107-f04b78186455
github.com/test-network-function/oct v0.0.3
diff --git a/go.sum b/go.sum
index 5842ef9d8..43965e69d 100644
--- a/go.sum
+++ b/go.sum
@@ -179,8 +179,6 @@ github.com/foxcpp/go-mockdns v1.0.0 h1:7jBqxd3WDWwi/6WhDvacvH1XsN3rOLXyHM1uhvIx6
github.com/foxcpp/go-mockdns v1.0.0/go.mod h1:lgRN6+KxQBawyIghpnl5CezHFGS9VLzvtVlwxvzXTQ4=
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
-github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
-github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
@@ -215,7 +213,6 @@ github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/gobuffalo/logger v1.0.6 h1:nnZNpxYo0zx+Aj9RfMPBm+x9zAU2OayFh/xrAWi34HU=
@@ -338,7 +335,6 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l
github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
-github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
@@ -456,17 +452,12 @@ github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7P
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
-github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
-github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
-github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
-github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
@@ -529,7 +520,6 @@ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/robert-nix/ansihtml v1.0.1 h1:VTiyQ6/+AxSJoSSLsMecnkh8i0ZqOEdiRl/odOc64fc=
github.com/robert-nix/ansihtml v1.0.1/go.mod h1:CJwclxYaTPc2RfcxtanEACsYuTksh4yDXcNeHHKZINE=
-github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
@@ -697,7 +687,6 @@ golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -720,7 +709,6 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
-golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
@@ -761,7 +749,6 @@ golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -773,10 +760,7 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -797,7 +781,6 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@@ -882,7 +865,6 @@ golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82u
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
-golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
@@ -1005,7 +987,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
-gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
@@ -1014,8 +995,6 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
-gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
From 2bcec7d2d000a2533cf85113ca001a0ae260a711 Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 2 Nov 2023 13:48:56 +0200
Subject: [PATCH 25/28] Update run-cnf-suites.sh
---
run-cnf-suites.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/run-cnf-suites.sh b/run-cnf-suites.sh
index 197a51c84..e533eae2b 100755
--- a/run-cnf-suites.sh
+++ b/run-cnf-suites.sh
@@ -112,7 +112,7 @@ echo "Report will be output to '$OUTPUT_LOC'"
echo "ginkgo arguments '${GINKGO_ARGS}'"
LABEL_STRING=''
-if [ -z "$LABEL" ] && ([ -z "$SERVER_RUN" ] || [ $SERVER_RUN == false ]); then
+if [ -z "$LABEL" ] && { [ -z "$SERVER_RUN" ] || [ "$SERVER_RUN" == "false" ]; }; then
echo "No test label (-l) was set, so only diagnostic functions will run."
else
LABEL_STRING="-ginkgo.label-filter=${LABEL}"
From f10d536d244100ea4a0b172aa7417e177d5f6101 Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Thu, 2 Nov 2023 13:53:48 +0200
Subject: [PATCH 26/28] udpate typos
---
cnf-certification-test/suite_test.go | 2 +-
cnf-certification-test/webserver_function.go | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 5b94a6a45..f543f2ef7 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -314,7 +314,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
log.Info(jsonData)
- var data RequstedData
+ var data RequestedData
if err := json.Unmarshal([]byte(jsonData), &data); err != nil {
fmt.Println("Error:", err)
}
diff --git a/cnf-certification-test/webserver_function.go b/cnf-certification-test/webserver_function.go
index cbc942081..d804a2938 100644
--- a/cnf-certification-test/webserver_function.go
+++ b/cnf-certification-test/webserver_function.go
@@ -59,7 +59,7 @@ func logStreamHandler(w http.ResponseWriter, r *http.Request) {
}
}
-type RequstedData struct {
+type RequestedData struct {
SelectedOptions interface{} `json:"selectedOptions"`
}
type ResponseData struct {
From ab9c71d6f82efc51f990021037b2bd7b0302fa6d Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Tue, 7 Nov 2023 12:34:28 +0200
Subject: [PATCH 27/28] david comments
---
cnf-certification-test/suite_test.go | 15 ++++++++-------
.../{ => webserver}/webserver_function.go | 19 +++++++++----------
run-cnf-suites.sh | 8 +-------
3 files changed, 18 insertions(+), 24 deletions(-)
rename cnf-certification-test/{ => webserver}/webserver_function.go (90%)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index f543f2ef7..7f1b1a12a 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -23,7 +23,7 @@ import (
"flag"
"fmt"
"io"
- logl "log"
+ rlog "log"
"net/http"
"os"
"path/filepath"
@@ -52,6 +52,7 @@ import (
_ "github.com/test-network-function/cnf-certification-test/cnf-certification-test/performance"
_ "github.com/test-network-function/cnf-certification-test/cnf-certification-test/platform"
_ "github.com/test-network-function/cnf-certification-test/cnf-certification-test/preflight"
+ "github.com/test-network-function/cnf-certification-test/cnf-certification-test/webserver"
"github.com/test-network-function/cnf-certification-test/internal/clientsholder"
"github.com/test-network-function/cnf-certification-test/pkg/configuration"
"github.com/test-network-function/cnf-certification-test/pkg/diagnostics"
@@ -296,7 +297,7 @@ func StartServer() {
WriteTimeout: 10 * time.Second, // Maximum duration for writing the entire response
IdleTimeout: 120 * time.Second, // Maximum idle duration before closing the connection
}
- HandlereqFunc()
+ webserver.HandlereqFunc()
http.HandleFunc("/runFunction", RunHandler)
@@ -308,18 +309,18 @@ func StartServer() {
// Define an HTTP handler that triggers Ginkgo tests
func RunHandler(w http.ResponseWriter, r *http.Request) {
- Buf = bytes.NewBufferString(aString)
- log.SetOutput(Buf)
- logl.SetOutput(Buf)
+ webserver.Buf = bytes.NewBufferString("")
+ log.SetOutput(webserver.Buf)
+ rlog.SetOutput(webserver.Buf)
jsonData := r.FormValue("jsonData") // "jsonData" is the name of the JSON input field
log.Info(jsonData)
- var data RequestedData
+ var data webserver.RequestedData
if err := json.Unmarshal([]byte(jsonData), &data); err != nil {
fmt.Println("Error:", err)
}
var flattenedOptions []string
- flattenedOptions = flattenData(data.SelectedOptions, flattenedOptions)
+ flattenedOptions = webserver.FlattenData(data.SelectedOptions, flattenedOptions)
// Get the file from the request
file, handler, err := r.FormFile("kubeConfigPath") // "fileInput" is the name of the file input field
diff --git a/cnf-certification-test/webserver_function.go b/cnf-certification-test/webserver/webserver_function.go
similarity index 90%
rename from cnf-certification-test/webserver_function.go
rename to cnf-certification-test/webserver/webserver_function.go
index d804a2938..1069432f6 100644
--- a/cnf-certification-test/webserver_function.go
+++ b/cnf-certification-test/webserver/webserver_function.go
@@ -1,4 +1,4 @@
-package suite
+package webserver
import (
"bufio"
@@ -12,19 +12,18 @@ import (
"github.com/sirupsen/logrus"
)
-//go:embed webserver/index.html
+//go:embed index.html
var indexHTML []byte
-//go:embed webserver/submit.js
+//go:embed submit.js
var submit []byte
-//go:embed webserver/logs.js
+//go:embed logs.js
var logs []byte
-//go:embed webserver/toast.js
+//go:embed toast.js
var toast []byte
var Buf *bytes.Buffer
-var aString string
var upgrader = websocket.Upgrader{
CheckOrigin: func(r *http.Request) bool {
@@ -66,20 +65,20 @@ type ResponseData struct {
Message string `json:"message"`
}
-func flattenData(data interface{}, result []string) []string {
+func FlattenData(data interface{}, result []string) []string {
switch v := data.(type) {
case string:
result = append(result, v)
case []interface{}:
for _, item := range v {
- result = flattenData(item, result)
+ result = FlattenData(item, result)
}
case map[string]interface{}:
for key, item := range v {
if key == "selectedOptions" {
- result = flattenData(item, result)
+ result = FlattenData(item, result)
}
- result = flattenData(item, result)
+ result = FlattenData(item, result)
}
}
return result
diff --git a/run-cnf-suites.sh b/run-cnf-suites.sh
index e533eae2b..17e48283e 100755
--- a/run-cnf-suites.sh
+++ b/run-cnf-suites.sh
@@ -52,13 +52,7 @@ while [[ $1 == -* ]]; do
fi
;;
-s)
- if (($# > 1)); then
- SERVER_RUN=$2
- shift
- else
- echo >&2 '-s requires an argument'
- exit 1
- fi
+ SERVER_RUN=true
;;
-l | --label)
while (("$#" >= 2)) && ! [[ $2 = --* ]] && ! [[ $2 = -* ]]; do
From 93a323874ab2af1ef25464abdb7d4fdc1c5c0216 Mon Sep 17 00:00:00 2001
From: aabughosh <88486034+aabughosh@users.noreply.github.com>
Date: Tue, 7 Nov 2023 13:14:09 +0200
Subject: [PATCH 28/28] update the flag
---
cnf-certification-test/suite_test.go | 9 ++++-----
run-cnf-suites.sh | 5 ++++-
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/cnf-certification-test/suite_test.go b/cnf-certification-test/suite_test.go
index 7f1b1a12a..60b2325c4 100644
--- a/cnf-certification-test/suite_test.go
+++ b/cnf-certification-test/suite_test.go
@@ -67,7 +67,7 @@ const (
serverModeFlag = "serverMode"
TNFReportKey = "cnf-certification-test"
extraInfoKey = "testsExtraInfo"
- defaultServerMode = "false"
+ defaultServerMode = false
)
var (
@@ -87,7 +87,7 @@ var (
// ClaimFormat is the current version for the claim file format to be produced by the TNF test suite.
// A client decoding this claim file must support decoding its specific version.
ClaimFormatVersion string
- serverMode *string
+ serverMode *bool
)
func init() {
@@ -95,8 +95,7 @@ func init() {
"the path where the claimfile will be output")
junitPath = flag.String(junitFlagKey, defaultCliArgValue,
"the path for the junit format report")
- serverMode = flag.String(serverModeFlag, defaultServerMode,
- "run test with webserver")
+ serverMode = flag.Bool("serverMode", defaultServerMode, "run test with webserver")
}
// setLogLevel sets the log level for logrus based on the "TNF_LOG_LEVEL" environment variable
@@ -183,7 +182,7 @@ func PreRun(t *testing.T) (claimData *claim.Claim, claimRoot *claim.Root) {
// TestTest invokes the CNF Certification Test Suite.
func TestTest(t *testing.T) {
ginkgoConfig, _ := ginkgo.GinkgoConfiguration()
- if *serverMode == "false" {
+ if !*serverMode {
claimData, claimRoot := PreRun(t)
var diagnosticMode bool
// Diagnostic functions will run when no labels are provided.
diff --git a/run-cnf-suites.sh b/run-cnf-suites.sh
index 17e48283e..625be8052 100755
--- a/run-cnf-suites.sh
+++ b/run-cnf-suites.sh
@@ -89,7 +89,6 @@ fi
# Specify Junit report file name.
GINKGO_ARGS="\
--ginkgo.timeout=$TIMEOUT \
--serverMode $SERVER_RUN \
-junit $OUTPUT_LOC \
-claimloc $OUTPUT_LOC \
--ginkgo.junit-report $OUTPUT_LOC/cnf-certification-tests_junit.xml \
@@ -97,6 +96,10 @@ GINKGO_ARGS="\
-test.v\
"
+if [ "$SERVER_RUN" = "true" ]; then
+ GINKGO_ARGS="$GINKGO_ARGS -serverMode"
+fi
+
if [[ $LABEL == "all" ]]; then
LABEL='common,extended,faredge,telco'
fi