Fix Bug 2313: Development of User Management environmental variable
[osm/NBI.git] / osm_nbi / tests / test_pkg_descriptors.py
index 39c28fe..4dea8e4 100644 (file)
@@ -118,7 +118,17 @@ db_vnfds_text = """
                 position: 2
                 virtual-interface:
                   type: VIRTIO
-      - id: dataVM
+      - alarm:
+        - actions:
+            alarm:
+            - url: https://webhook.site
+            insufficient-data:
+            - url: https://webhook.site
+            ok:
+            - url: https://webhook.site
+          alarm-id: alarm-1
+          vnf-monitoring-param-ref: dataVM_cpu_util
+        id: dataVM
         name: dataVM
         sw-image-desc: hackfest3-mgmt
         virtual-compute-desc: data-compute
@@ -179,7 +189,7 @@ db_vnfds_text = """
               deltas:
                 - id: delta1
                   vdu-delta:
-                    - id: vdudelta1
+                    - id: dataVM
                       number-of-instances: 1
             scaling-policy:
               - name: auto_cpu_util_above_threshold
@@ -199,6 +209,15 @@ db_vnfds_text = """
                 vnf-config-primitive-name-ref: touch
               - trigger: pre-scale-in
                 vnf-config-primitive-name-ref: touch
+        healing-aspect:
+          - id: heal_dataVM
+            healing-policy:
+            - vdu-id: dataVM
+              event-name: heal-alarm
+              recovery-type: automatic
+              action-on-recovery: REDEPLOY_ONLY
+              cooldown-time: 180
+              day1: false
         lcm-operations-configuration:
           operate-vnf-op-config:
             day1-2:
@@ -295,3 +314,77 @@ db_nsds_text = """
                   - constituent-base-element-id: hackfest_vnf2
                     constituent-cpd-id: vnf-data-ext
 """
+
+db_sfc_nsds_text = """
+- _admin:
+    userDefinedData: {}
+    revision: 1
+    created: 1683713524.2696395
+    modified: 1683713524.3553684
+    projects_read:
+      - 93601899-b310-4a56-a765-91539d5f675d
+    projects_write:
+      - 93601899-b310-4a56-a765-91539d5f675d
+    onboardingState: ONBOARDED
+    operationalState: ENABLED
+    usageState: NOT_IN_USE
+    storage:
+      fs: mongo
+      path: /app/storage/
+      folder: '2eb45633-03e3-4909-a87d-a564f5943948:1'
+      pkg-dir: cirros_vnffg_ns
+      descriptor: cirros_vnffg_ns/cirros_vnffg_nsd.yaml
+      zipfile: package.tar.gz
+  _id: 2eb45633-03e3-4909-a87d-a564f5943948
+  id: cirros_vnffg-ns
+  designer: OSM
+  version: '1.0'
+  name: cirros_vnffg-ns
+
+  vnfd-id:
+    - cirros_vnffg-vnf
+
+  virtual-link-desc:
+    - id: osm-ext
+      mgmt-network: true
+
+  vnffgd:
+    - id: vnffg1
+      vnf-profile-id:
+        - Mid-vnf1
+      nfpd:
+        - id: forwardingpath1
+          position-desc-id:
+            - id: position1
+              cp-profile-id:
+                - id: cpprofile2
+                  constituent-profile-elements:
+                    - id: vnf1
+                      order: 0
+                      constituent-base-element-id: Mid-vnf1
+                      ingress-constituent-cpd-id: vnf-cp0-ext
+                      egress-constituent-cpd-id: vnf-cp0-ext
+              match-attributes:
+                - id: rule1_80
+                  ip-proto: 6
+                  source-ip-address: 20.20.1.2
+                  destination-ip-address: 20.20.3.5
+                  source-port: 0
+                  destination-port: 80
+              nfp-position-element-id:
+                - test
+      nfp-position-element:
+        - id: test
+
+  df:
+    - id: default-df
+      vnf-profile:
+        - id: '1'
+          virtual-link-connectivity:
+            - constituent-cpd-id:
+                - constituent-base-element-id: '1'
+                  constituent-cpd-id: eth0-ext
+              virtual-link-profile-id: osm-ext
+          vnfd-id: cirros_vnffg-vnf
+  description: Simple NS example with vnffgd
+"""