Add a new testcase: cnf_testsuite_workload 36/74736/3
authorCédric Ollivier <cedric.ollivier@orange.com>
Tue, 28 Jan 2025 14:15:04 +0000 (15:15 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Tue, 28 Jan 2025 15:01:24 +0000 (16:01 +0100)
It runs all the workload test plan vs the example coredns.
Please note criteria is arbitrary set to 50%. Testing vs coredns
is about 80% and envoy 70%.

It also add extra processing to calculate results in
the main 3 cases (cert, workload and single tag).

Change-Id: I5e161727cab40228991ab97a061b13b335f87b4c
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
docker/cnf/testcases.yaml
functest_kubernetes/cnf_conformance/conformance.py

index be28963..704f2e9 100644 (file)
@@ -30,6 +30,9 @@ tiers:
 
       - case_name: cnf_testsuite
         project_name: functest
+        # https://github.com/lfn-cnti/certification/blob/main/docs/CNTiCertification-2.0-beta.md
+        # V2.0-beta certification requires passing at least 15 of
+        # the 19 total Essential tests.
         criteria: 15
         blocking: false
         description: >-
@@ -43,3 +46,18 @@ tiers:
           args:
             cnf-config: example-cnfs/coredns/cnf-testsuite.yml
             tag: cert
+      - case_name: cnf_testsuite_workload
+        project_name: functest
+        criteria: 50
+        blocking: false
+        description: >-
+          Enable interoperability of Cloud native Network
+          Functions (CNFs) as proposed by
+          https://github.com/cnti-testcatalog/testsuite
+        dependencies:
+          - DEPLOY_SCENARIO: "k8-*"
+        run:
+          name: cnf_testsuite
+          args:
+            cnf-config: example-cnfs/coredns/cnf-testsuite.yml
+            tag: workload
index b6fc8e4..5d1c1f5 100644 (file)
@@ -115,13 +115,21 @@ class CNFConformance(testcase.TestCase):
                     self.__logger.warning(
                         "%s %s", item['name'], item['status'])
             self.__logger.info("\n\n%s\n", msg.get_string())
-        grp = re.search(
-            r'(\d+) of (\d+) essential tests passed', output.decode("utf-8"))
-        if grp:
-            # https://github.com/cncf/cnf-certification/blob/main/reviewing.md
-            self.result = int(grp.group(1))
+        if kwargs.get("tag", self.default_tag) == 'cert':
+            grp = re.search(
+                r'(\d+) of (\d+) essential tests passed',
+                output.decode("utf-8"))
+            if grp:
+                self.result = int(grp.group(1))
+            else:
+                self.result = 0
         else:
-            self.result = 0
+            grp = re.search(
+                r'Final .* score: (\d+) of (\d+)', output.decode("utf-8"))
+            if grp:
+                self.result = int(grp.group(1)) / int(grp.group(2)) * 100
+            else:
+                self.result = item_criteria / len(self.details['items']) * 100
         if not os.path.exists(self.res_dir):
             os.makedirs(self.res_dir)
         shutil.copy2(