xci: Record distribution and NFVI information for scenarios 59/49559/3
authorMarkos Chandras <mchandras@suse.de>
Fri, 22 Dec 2017 10:36:27 +0000 (10:36 +0000)
committerMarkos Chandras <mchandras@suse.de>
Wed, 3 Jan 2018 09:53:28 +0000 (09:53 +0000)
A scenario may only support certain NFVIs or distributions so we
need a mapping with all these things so we know what can be tested
and where.

Change-Id: Ibf1b640b762085f58627e05e1d2ca13edfc4d716
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/opnfv-scenario-requirements.yml
xci/playbooks/get-opnfv-scenario-requirements.yml

index 036a8a7..a250974 100644 (file)
   src: https://gerrit.opnfv.org/gerrit/sfc
   version: master
   role: scenarios/os-odl-sfc/role/os-odl-sfc
-  flavors:
-    - ha
-    - mini
-    - noha
+  nfvis:
+    - nfvi: osa
+      flavors:
+        - ha
+        - mini
+        - noha
+      distros:
+        - opensuse
+        - ubuntu
+
 - scenario: os-nosdn-nofeature
   scm: git
   src: https://git.opnfv.org/releng-xci
   version: master
   role: xci/scenarios/os-nosdn-nofeature/role/os-nosdn-nofeature
-  flavors:
-    - ha
-    - mini
-    - noha
+  nfvis:
+    - nfvi: osa
+      flavors:
+        - ha
+        - mini
+        - noha
+      distros:
+        - opensuse
+        - ubuntu
+
 - scenario: os-odl-nofeature
   scm: git
   src: https://git.opnfv.org/releng-xci
   version: master
   role: xci/scenarios/os-odl-nofeature/role/os-odl-nofeature
-  flavors:
-    - ha
-    - mini
-    - noha
+  nfvis:
+    - nfvi: osa
+      flavors:
+        - ha
+        - mini
+        - noha
+      distros:
+        - opensuse
+        - ubuntu
index b44c50b..f515c25 100644 (file)
       loop_control:
         label: "{{ item.item.scenario }}"
 
-    - name: Determine if selected {{ DEPLOY_SCENARIO }} scenario can be deployed
+    - name: Gather information about the selected {{ DEPLOY_SCENARIO }} scenario
       set_fact:
-        deploy_scenario_on_flavor: "{{ (XCI_FLAVOR in item.flavors) | ternary(True, False) }}"
-      when: DEPLOY_SCENARIO == item.scenario
+        deploy_scenario: "{{ item }}"
       with_items: "{{ scenarios }}"
       loop_control:
         label: "{{ item.scenario }}"
+      when: DEPLOY_SCENARIO | lower == item.scenario
 
-    - name: Fail if {{ XCI_FLAVOR }} is not supported in {{ DEPLOY_SCENARIO }}
+    - name: Determine if the selected {{ DEPLOY_SCENARIO }} scenario can be deployed
+      block:
+        - set_fact:
+            deploy_scenario_nfvi: "{{ item }}"
+          with_items: "{{ deploy_scenario.nfvis }}"
+          loop_control:
+            label: "{{ item.nfvi }}"
+          when: item.nfvi == XCI_NFVI
+        - set_fact:
+            deploy_scenario_flavor: "{{ (XCI_FLAVOR in deploy_scenario_nfvi.flavors) | bool }}"
+          when:
+            - deploy_scenario_nfvi
+        - set_fact:
+            deploy_scenario_distro: "{{ (XCI_DISTRO in deploy_scenario_nfvi.distros) | bool }}"
+          when:
+            - deploy_scenario_nfvi
+            - deploy_scenario_flavor
+      when: deploy_scenario is defined
+
+    - name: Fail if {{ DEPLOY_SCENARIO }} is not supported
       fail:
         msg:
           - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-          - ERROR! The {{ DEPLOY_SCENARIO }} scenario does not support the {{ XCI_FLAVOR }}
+          - ERROR! The {{ DEPLOY_SCENARIO }} scenario can't be deployed. This is because
+          - the {{ XCI_NFVI }} NFVI or the {{ XCI_FLAVOR }} flavor or the {{ XCI_DISTRO }}
+          - distribution is not supported by this scenario. It may also be possible that
+          - this scenario doesn't exist at all or it's not listed in {{ scenario_file }}.
           - ''
           - This is a great chance for you to contribute to XCI ;-)
           - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
           - ''
       when:
-        - not deploy_scenario_on_flavor
+        - deploy_scenario is not defined or not deploy_scenario_distro
 
   vars:
     ansible_python_interpreter: "/usr/bin/python"