Update openjdk version to 19 and yang2swagger version to 2.1.0 61/14261/5 master
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Thu, 14 Mar 2024 18:50:59 +0000 (19:50 +0100)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Mon, 18 Mar 2024 16:55:32 +0000 (17:55 +0100)
Change-Id: I16dc02009cc61f8452f3a0787b288d9c140c4ea8
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
30 files changed:
Dockerfile
Jenkinsfile
Makefile
build-docs.sh
debian/control
devops-stages/stage-archive.sh
devops-stages/stage-build.sh
devops-stages/stage-test.sh
models/augments/additional-info.yang
models/augments/common-augments.yang
models/augments/epa.yang
models/augments/exporters.yang [new file with mode: 0644]
models/augments/healing.yang [new file with mode: 0644]
models/augments/kdu.yang
models/augments/ns-vld.yang
models/augments/vnffgd.yang [new file with mode: 0644]
models/yang/mano-types.yang
models/yang/vnfd-base.yang
requirements-dist.in
requirements-dist.txt
requirements-test.txt
requirements.in
requirements.txt
setup.py
tests/examples/cirros_heal_vnfd_sol006.yaml [new file with mode: 0644]
tests/examples/dest_vnfd.yaml [new file with mode: 0644]
tests/examples/mid_vnfd.yaml [new file with mode: 0644]
tests/examples/sfc_nsd.yaml [new file with mode: 0644]
tests/examples/src_vnfd.yaml [new file with mode: 0644]
tox.ini

index 90b7f94..01475b0 100644 (file)
 #   devops-stages/stage-build.sh
 #
 
-FROM ubuntu:18.04
+FROM ubuntu:22.04
+
+ARG APT_PROXY
+RUN if [ ! -z $APT_PROXY ] ; then \
+    echo "Acquire::http::Proxy \"$APT_PROXY\";" > /etc/apt/apt.conf.d/proxy.conf ;\
+    echo "Acquire::https::Proxy \"$APT_PROXY\";" >> /etc/apt/apt.conf.d/proxy.conf ;\
+    fi
 
 RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
     DEBIAN_FRONTEND=noninteractive apt-get -y install \
         debhelper \
+        dh-python \
         git \
         python3 \
         python3-all \
         python3-dev \
-        python3-setuptools
+        python3-setuptools \
+        python3-pip \
+        tox
 
-RUN python3 -m easy_install pip==21.0.1
-RUN pip3 install tox==3.22.0
+RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
+    DEBIAN_FRONTEND=noninteractive apt-get -y install wget build-essential dh-make \
+                                              openjdk-19-jdk maven
+RUN update-java-alternatives --jre-headless --set /usr/lib/jvm/java-1.19.0-openjdk-amd64
 
-RUN DEBIAN_FRONTEND=noninteractive apt-get -y install wget build-essential dh-make \
-                                              openjdk-8-jdk maven
-RUN update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64
index 3e3af2e..7c37292 100644 (file)
@@ -1,3 +1,20 @@
+/* Copyright ETSI OSM and others
+ *
+ * All Rights Reserved.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *   not use this file except in compliance with the License. You may obtain
+ *   a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *   WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ *   License for the specific language governing permissions and limitations
+ *   under the License.
+ */
+
 properties([
     parameters([
         string(defaultValue: env.BRANCH_NAME, description: '', name: 'GERRIT_BRANCH'),
@@ -16,7 +33,7 @@ def devops_checkout() {
     }
 }
 
-node {
+node("stage_2") {
     checkout scm
     devops_checkout()
 
index 6b9b622..683a624 100644 (file)
--- a/Makefile
+++ b/Makefile
 
 # NOTE: pyang and pyangbind are required for build
 
-.PHONY: all clean package trees deps yang-ietf openapi_schemas yang2swagger
-JAVA:=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
-PYANG:= pyang
-PYBINDPLUGIN:=$(shell /usr/bin/env python3 -c \
-                   'import pyangbind; import os; print("{}/plugin".format(os.path.dirname(pyangbind.__file__)))')
+.PHONY: all clean package trees yang-ietf openapi_schemas yang2swagger
+JAVA := /usr/lib/jvm/java-19-openjdk-amd64/bin/java
+PYANG := pyang
+ifeq ($(OS),Windows_NT)     # is Windows_NT on XP, 2000, 7, Vista, 10...
+    PYTHON_INTERPRETER := python
+else
+    PYTHON_INTERPRETER := python3
+endif
+PYBINDPLUGIN := $(shell $(PYTHON_INTERPRETER) -c \
+    'import pyangbind; import os; print(os.path.join(f"{os.path.dirname(pyangbind.__file__)}", "plugin"))')
 
 YANG_DESC_MODELS := vnfd nsd nst nsi etsi-nfv-vnfd etsi-nfv-nsd
 YANG_RECORD_MODELS := vnfr nsr
@@ -57,7 +62,7 @@ $(TREES_DIR):
        $(Q)echo generating $@ from $*.yang
        $(if $(findstring etsi,$@), $(eval DIR=$(SOL006_MODEL_DIR)),$(eval DIR=$(MODEL_DIR)))
        $(if $(findstring etsi,$@), $(eval AUGMENTS_DIR=$(SOL006_AUGMENTS_DIR)),$(eval AUGMENTS_DIR=))
-       $(Q)pyang $(PYANG_OPTIONS) --path $(DIR) --plugindir $(PYBINDPLUGIN) -f pybind -o $(OUT_DIR)/$@ $(AUGMENTS_DIR) $(DIR)/$*.yang
+       $(Q)pyang $(PYANG_OPTIONS) --path $(DIR) --plugindir "$(PYBINDPLUGIN)" -f pybind -o $(OUT_DIR)/$@ $(AUGMENTS_DIR) $(DIR)/$*.yang
 
 %.tree.txt: $(TREES_DIR) yang-ietf
        $(Q)echo generating $@ from $*.yang
@@ -89,7 +94,7 @@ $(TREES_DIR):
 
 osm.yaml: yang-ietf yang2swagger
        $(Q)echo generating $@
-       $(Q)$(JAVA) -jar ${HOME}/.m2/repository/com/mrv/yangtools/swagger-generator-cli/1.1.14/swagger-generator-cli-1.1.14-executable.jar -yang-dir $(MODEL_DIR) -output $(OUT_DIR)/$@
+       $(Q)$(JAVA) -jar ${HOME}/.m2/repository/com/mrv/yangtools/swagger-generator-cli/2.1.0/swagger-generator-cli-2.1.0-executable.jar -yang-dir $(MODEL_DIR) -output $(OUT_DIR)/$@
 
 yang-ietf:
        $(Q)wget -q https://raw.githubusercontent.com/YangModels/yang/master/standard/ietf/RFC/ietf-yang-types%402013-07-15.yang -O $(MODEL_DIR)/ietf-yang-types.yang
@@ -100,17 +105,13 @@ yang-ietf:
 yang2swagger:
        $(Q)mkdir -p ${HOME}/.m2
        $(Q)wget -q -O ${HOME}/.m2/settings.xml https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml
-       git clone https://github.com/bartoszm/yang2swagger.git
-       git -C yang2swagger checkout tags/1.1.14
-       mvn -f yang2swagger/pom.xml clean install
+       $(Q)git clone https://github.com/bartoszm/yang2swagger.git
+       $(Q)git -C yang2swagger checkout tags/2.1.0
+       $(Q)mvn -f yang2swagger/pom.xml clean install
 
 package:
        ./build-docs.sh
 
-deps:
-       $(Q)mkdir -p ${HOME}/.m2
-       $(Q)cp -n ${HOME}/.m2/settings.xml ${HOME}/.m2/settings.xml.orig ; wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ${HOME}/.m2/settings.xml
-
 sol006_deps:
        $(Q)git clone --single-branch --branch v2.6.1 https://forge.etsi.org/rep/nfv/SOL006.git sol006_model
        $(Q)patch -p2 < patch/deref_warnings.patch
@@ -122,5 +123,6 @@ rename_etsi_nfv_py:
 
 clean:
        $(Q)rm -rf dist sol006_model osm_im.egg-info deb deb_dist *.gz osm-imdocs* yang2swagger $(TREES_DIR)
-       $(Q)rm -rf debian/osm-imdocs.install osm_im/etsi_nfv_nsd.py osm_im/etsi_nfv_vnfd.py osm_im/nsd.py
-       $(Q)rm -rf osm_im/nsi.py osm_im/nst.py osm_im/osm.yaml osm_im/vnfd.py
+       $(Q)rm -rf debian/osm-imdocs.install
+       $(Q)rm -rf osm_im/etsi_nfv_nsd.py osm_im/etsi_nfv_vnfd.py
+       $(Q)rm -rf osm_im/nsd.py osm_im/nsi.py osm_im/nst.py osm_im/osm.yaml osm_im/vnfd.py
index 6f21939..623e98f 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 # Copyright 2018 Sandvine
-# All Rights Reserved.
+# Copyright ETSI Contributors and Others.
 #
 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
 #    not use this file except in compliance with the License. You may obtain
@@ -18,8 +18,8 @@ PKG_DIRECTORIES="osm_im_trees models"
 MDG_NAME=im
 PKG_NAME=osm-${MDG_NAME}docs
 DEB_INSTALL=debian/${PKG_NAME}.install
-export DEBEMAIL="mmarchetti@sandvine.com"
-export DEBFULLNAME="Michael Marchetti"
+export DEBEMAIL="OSMSupport@etsi.org"
+export DEBFULLNAME="ETSI OSM"
 
 PKG_VERSION=$(git describe --match "v*" --tags --abbrev=0)
 PKG_VERSION_FULL=$(git describe --match "v*" --tags --long)
@@ -53,5 +53,5 @@ cp -R debian $PKG_DIR/.
 cd $PKG_DIR
 dh_make -y --indep --createorig --a -c apache
 sed -i -e "s/${PKG_VERSION_PREFIX}${POST_UPDATE}-1/$PKG_VERSION_PREFIX${POST_UPDATE}-${PKG_VERSION_FIELDS[2]}/g" debian/changelog
-dpkg-buildpackage -uc -us -tc -rfakeroot 
+dpkg-buildpackage -uc -us -tc -rfakeroot
 cd -
index 10fb75b..f06583a 100644 (file)
@@ -1,12 +1,28 @@
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
 Source: osm-imdocs
 Section: devel
 Priority: optional
 Maintainer: Michael Marchetti <mmarchetti@sandvine.com>
-Build-Depends: debhelper (>=9)
+Build-Depends: debhelper-compat (= 13)
 Standards-Version: 3.9.6
-Homepage: http://osm.etsi.org
+Homepage: <http://osm.etsi.org>
+
 Package: osm-imdocs
-Architecture: all
+Architecture: any
 Depends: ${misc:Depends}
 Description: osm-imdocs is the Information Model package for OSM, providing base classes derived from YANG models to be used by other modules.
-
index 98b44a3..84e1041 100755 (executable)
@@ -1,14 +1,25 @@
 #!/bin/sh
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
 MDG=IM
-
 rm -rf pool
 rm -rf dists
 mkdir -p pool/$MDG
-mv deb_dist/*.deb pool/$MDG/
-mv *.deb pool/$MDG/
-mv pyangbind/deb_dist/*.deb pool/$MDG/
-mv pyang/deb_dist/*.deb pool/$MDG/
-
-mkdir -p dists/unstable/$MDG/binary-amd64/
-apt-ftparchive packages pool/$MDG > dists/unstable/$MDG/binary-amd64/Packages
-gzip -9fk dists/unstable/$MDG/binary-amd64/Packages
+# Move python3-osm-im deb package to pool/$MDG folder
+mv deb_dist/python3-osm-im*.deb pool/$MDG/
+# Move osm-imdocs deb package to pool/$MDG folder
+mv osm-imdocs*.deb pool/$MDG/
index e8b397b..6268698 100755 (executable)
@@ -15,4 +15,4 @@
 
 rm -rf dist deb_dist osm*.tar.gz *.egg-info .eggs
 
-tox -e dist
+tox -e dist --recreate
index 067d896..eee57ff 100755 (executable)
@@ -16,5 +16,6 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-OUTPUT=$(TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto)
-printf "$OUTPUT"
+echo "Launching tox"
+TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto
+
index 2119073..6b460c1 100644 (file)
@@ -39,4 +39,8 @@ module additional-info {
     augment "/vnfd:vnfd/vnfd:virtual-storage-desc" {
         uses common:description;
     }
+
+    augment "/vnfd:vnfd/vnfd:virtual-storage-desc/vnfd:vdu-storage-requirements" {
+        uses common:vdu-storage-requirements;
+    }
 }
index c365424..18481a9 100644 (file)
@@ -200,6 +200,31 @@ module common-augments {
                   "Execution environment that uses the service provided by the provider";
                 uses relations-ee;
             }
+            list entities {
+                description
+                  "DEPRECATION NOTICE: use provider and requirer instead.
+                   List of two elements to be related.
+                   Elements to be related are identified by a pair (id, endpoint).
+                   The relation will relate (id1, endpoint1) to (id2, endpoint2).";
+                key "id";
+
+                leaf id {
+                    description
+                      "A string, reference to the element id in the descriptor.
+                       It could be a vnfd-id or a vdu-id in a VNFD,
+                       or a nsd-id or member-vnf-index in a NSD.";
+                    type string;
+                }
+
+                leaf endpoint {
+                    description
+                      "Endpoint name defining the relation.";
+                    type string;
+                }
+            }
+            must 'not(entities) or (not(provider) and not(requirer))' {
+                error-message 'Cannot set both "entities" and "provider/requirer" fields.';
+            }
         }
     }
 
@@ -323,7 +348,6 @@ module common-augments {
                                 description
                                   "Helm version to use for this helm-chart, v3 by default";
                                 type enumeration {
-                                  enum "v2";
                                   enum "v3";
                                 }
                                 default "v3";
@@ -538,6 +562,7 @@ module common-augments {
             enum GT; // greater than
             enum LT; // less than
             enum EQ; // equal
+            enum NE; // not equal
         }
     }
 
@@ -700,6 +725,34 @@ module common-augments {
         }
     }
 
+    grouping vdu-storage-requirements {
+        list vdu-storage-requirements {
+            description
+              "Array of key-value pairs that articulate the storage
+               deployment requirements.
+
+               If the storage type is persistent-storage, the following setting
+               holds the persistent volume upon VM deletion:
+                 key: keep-volume
+                 value: true
+
+               If storage volume can be attached to several VMs, the following setting
+               will allow it:
+                 key: multiattach
+                 value: true";
+
+            key "key";
+
+            leaf key {
+                type string;
+            }
+
+            leaf value {
+                type string;
+            }
+        }
+    }
+
     typedef scaling-trigger {
         type enumeration {
             enum pre-scale-in {
index d47d6a9..af8b7cd 100644 (file)
@@ -90,19 +90,15 @@ module epa {
               "CPU thread pinning policy describes how to
                place the guest CPUs when the host supports
                hyper threads:
-               AVOID   : Avoids placing a guest on a host
-                         with threads.
-               SEPARATE: Places vCPUs on separate cores,
-                         and avoids placing two vCPUs on
-                         two threads of same core.
+               REQUIRE : Each vCPU is allocated on thread siblings
+                         of the same core.
                ISOLATE : Places each vCPU on a different core,
                          and places no vCPUs from a different
                          guest on the same core.
                PREFER  : Attempts to place vCPUs on threads
                          of the same core.";
             type enumeration {
-                enum AVOID;
-                enum SEPARATE;
+                enum REQUIRE;
                 enum ISOLATE;
                 enum PREFER;
             }
diff --git a/models/augments/exporters.yang b/models/augments/exporters.yang
new file mode 100644 (file)
index 0000000..13651db
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+  Copyright 2020 Tata Elxsi
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+  implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+*/
+
+module exporters {
+  yang-version 1.1;
+  namespace "urn:etsi:osm:yang:augments:exporters";
+  prefix "exporters";
+
+  import etsi-nfv-vnfd {
+    prefix vnfd;
+  }
+
+  grouping extended-exporters-endpoints {
+    container exporters-endpoints {
+      leaf metric-path {
+        type string;
+        description "The path to scrape metric from VNF";
+      }
+      leaf metric-port {
+        type uint16;
+        description "Port to scrape metric from VNF";
+      }
+      leaf external-connection-point-ref {
+        type leafref {
+          path "/vnfd:vnfd/vnfd:ext-cpd/vnfd:id";
+        }
+        description "Representing a leafref reference to the particular external connection point";
+      }
+    }
+  }
+
+  augment "/vnfd:vnfd/vnfd:df" {
+    uses extended-exporters-endpoints;
+  }
+}
diff --git a/models/augments/healing.yang b/models/augments/healing.yang
new file mode 100644 (file)
index 0000000..854eb55
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+  Copyright ETSI Contributors and Others
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+  implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+*/
+
+module healing {
+    yang-version 1.1;
+    namespace "urn:etsi:osm:yang:augments:healing";
+    prefix "healing";
+
+    import etsi-nfv-vnfd {
+        prefix vnfd;
+    }
+
+    typedef recovery-actions {
+        type enumeration {
+
+            enum REDEPLOY_ONLY {
+                value 1;
+            }
+
+            enum REBOOT {
+                value 2;
+            }
+
+            enum REBOOT_THEN_REDEPLOY {
+                value 3;
+            }
+        }
+    }
+
+
+    typedef recovery-type {
+        type enumeration {
+
+            enum manual {
+                value 1;
+            }
+
+            enum automatic {
+                value 2;
+            }
+        }
+    }
+
+    grouping extended-healing {
+        list healing-aspect {
+            key "id";
+
+            description
+              "The healing aspects supported by this DF of the VNF.
+               healingAspect shall be present if the VNF supports
+               healing.";
+
+            leaf id {
+                type string;
+                description
+                  "Unique identifier of this aspect in the VNFD.";
+            }
+
+            list healing-policy {
+
+                key "vdu-id";
+
+                leaf vdu-id {
+                    description
+                      "Identifier of vdu";
+                    type string;
+                }
+
+                leaf event-name {
+                    description
+                      "Describing the event name for healing";
+                    type string;
+                }
+
+                leaf recovery-type {
+                    description
+                      "Type of healing recovery";
+                    type recovery-type;
+                }
+
+                leaf action-on-recovery {
+                    description
+                      "Recovery actions for healing";
+                    type recovery-actions;
+                }
+
+                leaf cooldown-time {
+                    description
+                      "The duration after a healing action has been
+                      triggered, for which there will be no further optional";
+                    type uint32;
+                    mandatory true;
+                }
+
+                leaf day1 {
+                    description
+                      "Specifies if the day1 operations can be applied";
+                    type boolean;
+                    default false;
+                }
+            }
+        }
+
+    }
+    augment "/vnfd:vnfd/vnfd:df" {
+        uses extended-healing;
+    }
+
+}
index 1b5c084..9dc512f 100644 (file)
@@ -74,7 +74,6 @@ module kdu {
                         description
                           "Helm version to use for this helm-chart, v3 by default";
                         type enumeration {
-                            enum v2;
                             enum v3;
                         }
                         default v3;
index b85acbf..ac3cc4c 100644 (file)
@@ -102,9 +102,9 @@ module ns-vld {
                   element";
            }
 
-           leaf ip-address {
+           leaf-list ip-address {
                description
-                 "IP address assigned to the internal connection point";
+                 "IP address list assigned to the internal connection point";
                   type inet:ip-address;
            }
        }
diff --git a/models/augments/vnffgd.yang b/models/augments/vnffgd.yang
new file mode 100644 (file)
index 0000000..3000b3b
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+  # Copyright ETSI Contributors and Others.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+  implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+*/
+module vnffgd {
+    yang-version 1.1;
+    namespace "urn:etsi:osm:yang:augments:vnffgd";
+    prefix "vnffgd";
+
+    import etsi-nfv-nsd {
+        prefix nsd;
+    }
+
+    import ietf-inet-types {
+        prefix inet;
+    }
+
+    grouping match {
+        list match-attributes {
+            description
+                "List of match attributes.";
+
+            key "id";
+            leaf id {
+                description
+                    "Identifier for the classifier match attribute rule.";
+                type string;
+            }
+
+            leaf ip-proto {
+                description
+                    "IP Protocol.";
+                type uint8;
+            }
+
+            leaf source-ip-address {
+                description
+                    "Source IP address.";
+                type inet:ip-address;
+            }
+
+            leaf destination-ip-address {
+                description
+                    "Destination IP address.";
+                type inet:ip-address;
+            }
+
+            leaf source-port {
+                description
+                    "Source port number.";
+                type inet:port-number;
+            }
+
+            leaf destination-port {
+                description
+                    "Destination port number.";
+                type inet:port-number;
+            }
+
+            leaf constituent-base-element-id {
+                description
+                    "Refer to the profile of source NS constituent.";
+                type leafref {
+                    path "/nsd:nsd/nsd:nsd/nsd:df/nsd:vnf-profile/nsd:id";
+                }
+            }
+
+            leaf constituent-cpd-id {
+                description
+                    "Logical source port.";
+                type string;
+            }
+            //TODO: Add more match criteria
+        } //match-attributes
+
+    }
+
+    grouping extended-position-element {
+
+        leaf-list nfp-position-element-id {
+            type leafref {
+              path "../../../nfp-position-element/id";
+            }
+            description
+              "References one or a pair of CPDs or SAPDs.";
+            reference
+              "GS NFV IFA014: Section 6.4.5.2 NfpPositionDesc
+               information element";
+          }
+    }
+
+    grouping extended-nfp-position {
+        list nfp-position-element {
+            key "id";
+            leaf id {
+                type string;
+                description
+                    "Identifier of this NfpPositionElemen information
+                    element. It uniquely identifies an
+                    NfpPositionElement.";
+                reference
+                    "GS NFV IFA014: Section 6.4.6.2 NfpPositionElement
+                    information element";
+            }
+        }
+
+    }
+
+    grouping extended-cpe {
+        leaf constituent-base-element-id {
+            type leafref {
+                path "/nsd:nsd/nsd:nsd/nsd:vnffgd/nsd:vnf-profile-id";
+            }
+        }
+
+        leaf order {
+            type uint8;
+            description
+              "A number that denotes the order of a VNF in a chain";
+        }
+
+        leaf ingress-constituent-cpd-id {
+            description
+              "A reference to a connection point name
+                  in a vnfd.";
+
+            type string;
+        }
+
+        leaf egress-constituent-cpd-id {
+            description
+              "A reference to a connection point name
+                  in a vnfd.";
+
+            type string;
+        }
+    }
+
+    augment "/nsd:nsd/nsd:nsd/nsd:vnffgd/nsd:nfpd/nsd:position-desc-id" {
+        uses match;
+    }
+
+    augment "/nsd:nsd/nsd:nsd/nsd:vnffgd" {
+        uses extended-nfp-position;
+    }
+
+    augment "/nsd:nsd/nsd:nsd/nsd:vnffgd/nsd:nfpd/nsd:position-desc-id" {
+        uses extended-position-element;
+    }
+
+    augment "/nsd:nsd/nsd:nsd/nsd:vnffgd/nsd:nfpd/nsd:position-desc-id/nsd:cp-profile-id/nsd:constituent-profile-elements"{
+        uses extended-cpe;
+    }
+}
index eb38ec2..d1cbb86 100644 (file)
@@ -383,7 +383,6 @@ module mano-types
                 description
                   "Helm version to use for this helm-chart, v3 by default";
                 type enumeration {
-                  enum v2;
                   enum v3;
                 }
                 default v3;
@@ -1937,6 +1936,7 @@ module mano-types
       enum GT; // greater than
       enum LT; // less than
       enum EQ; // equal
+      enum NE; // not equal
     }
   }
 
index 28a4961..e38bac9 100644 (file)
@@ -676,7 +676,6 @@ module vnfd-base
               description
                 "Helm version to use for this helm-chart, v3 by default";
               type enumeration {
-                enum v2;
                 enum v3;
               }
               default v3;
index 11f0a2a..28d0ce1 100644 (file)
@@ -14,4 +14,6 @@
 # limitations under the License.
 
 stdeb
-setuptools-version-command
\ No newline at end of file
+setuptools-version-command
+setuptools<60
+pyang
index 7393626..05bfb57 100644 (file)
@@ -1,10 +1,3 @@
-setuptools-version-command==2.2
-    # via -r requirements-dist.in
-stdeb==0.10.0
-    # via -r requirements-dist.in
-
-# The following packages are considered to be unsafe in a requirements file:
-# setuptools
 #######################################################################################
 # Copyright ETSI Contributors and Others.
 #
@@ -21,3 +14,17 @@ stdeb==0.10.0
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #######################################################################################
+lxml==4.9.3
+    # via pyang
+pyang==2.5.3
+    # via -r requirements-dist.in
+setuptools-version-command==99.9
+    # via -r requirements-dist.in
+stdeb==0.10.0
+    # via -r requirements-dist.in
+
+# The following packages are considered to be unsafe in a requirements file:
+setuptools==59.8.0
+    # via
+    #   -r requirements-dist.in
+    #   setuptools-version-command
index decfef2..77ae576 100644 (file)
@@ -1,11 +1,3 @@
-coverage==5.5
-    # via
-    #   -r requirements-test.in
-    #   nose2
-nose2==0.10.0
-    # via -r requirements-test.in
-six==1.15.0
-    # via nose2
 #######################################################################################
 # Copyright ETSI Contributors and Others.
 #
@@ -22,3 +14,7 @@ six==1.15.0
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #######################################################################################
+coverage==7.3.1
+    # via -r requirements-test.in
+nose2==0.13.0
+    # via -r requirements-test.in
index 24f4c58..128194b 100644 (file)
@@ -15,4 +15,4 @@
 
 pyang
 pyangbind
-pyyaml
\ No newline at end of file
+pyyaml>6
\ No newline at end of file
index 002200e..da4aa3a 100644 (file)
@@ -1,23 +1,3 @@
-bitarray==1.8.1
-    # via pyangbind
-enum34==1.1.10
-    # via pyangbind
-lxml==4.6.3
-    # via
-    #   pyang
-    #   pyangbind
-pyang==2.4.0
-    # via
-    #   -r requirements.in
-    #   pyangbind
-pyangbind==0.8.1
-    # via -r requirements.in
-pyyaml==5.4.1
-    # via -r requirements.in
-regex==2021.3.17
-    # via pyangbind
-six==1.15.0
-    # via pyangbind
 #######################################################################################
 # Copyright ETSI Contributors and Others.
 #
@@ -34,3 +14,21 @@ six==1.15.0
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #######################################################################################
+enum34==1.1.10
+    # via pyangbind
+lxml==4.9.3
+    # via
+    #   pyang
+    #   pyangbind
+pyang==2.5.3
+    # via
+    #   -r requirements.in
+    #   pyangbind
+pyangbind==0.8.3.post1
+    # via -r requirements.in
+pyyaml==6.0.1
+    # via -r requirements.in
+regex==2023.8.8
+    # via pyangbind
+six==1.16.0
+    # via pyangbind
index ec75988..4cd2be2 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -30,8 +30,8 @@ class Install_osm_im(install):
         subprocess.call([sys.executable, "-m", "pip", "install", package])
 
     def run(self):
-        self.pipinstall('pyang')
-        self.pipinstall('pyangbind')
+        self.pipinstall('pyang==2.5.3')
+        self.pipinstall('pyangbind==0.8.3.post1')
         import pyangbind
         print("Using dir {}/{} for python artifacts".format(os.getcwd(), self.im_dir))
         path = "{}/{}".format(os.getcwd(), self.im_dir)
diff --git a/tests/examples/cirros_heal_vnfd_sol006.yaml b/tests/examples/cirros_heal_vnfd_sol006.yaml
new file mode 100644 (file)
index 0000000..c32691c
--- /dev/null
@@ -0,0 +1,80 @@
+#  Copyright ETSI Contributors and Others
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+#  implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+vnfd:
+  id: cirros_heal_vnfd
+  product-name: cirros_heal_vnf
+  description: Simple heal VNF example with a cirros
+  provider: OSM
+  version: "1.0"
+  mgmt-cp: eth0-ext
+
+  virtual-compute-desc:
+    - id: cirros_heal_vnfd-VM-compute
+      virtual-cpu:
+        num-virtual-cpu: 1
+      virtual-memory:
+        size: 0.25 # Memory size in GB
+
+  virtual-storage-desc:
+    - id: cirros_heal_vnfd-VM-storage
+      size-of-storage: 2
+
+  sw-image-desc:
+    - id: cirros034
+      name: cirros034
+      image: cirros034
+
+  vdu:
+    - id: cirros_heal_vnfd-VM
+      name: cirros_heal_vnfd-VM
+      description: cirros_heal_vnfd-VM
+      virtual-compute-desc: cirros_heal_vnfd-VM-compute
+      virtual-storage-desc:
+        - cirros_heal_vnfd-VM-storage
+      sw-image-desc: cirros034
+      int-cpd:
+        - id: eth0-int
+          virtual-network-interface-requirement:
+            - name: eth0
+              virtual-interface:
+                type: VIRTIO
+                bandwidth: "0"
+                vpci: 0000:00:0a.0
+
+  df:
+    - id: default-df
+      vdu-profile:
+        - id: cirros_heal_vnfd-VM
+          min-number-of-instances: 1
+      instantiation-level:
+        - id: default-instantiation-level
+          vdu-level:
+            - vdu-id: cirros_heal_vnfd-VM
+              number-of-instances: 1
+      healing-aspect:
+      -   id: cirros_heal_vnfd-VM_autoheal
+          healing-policy:
+          - vdu-id: cirros_heal_vnfd-VM
+            event-name: heal-alarm
+            recovery-type: automatic
+            action-on-recovery: REDEPLOY_ONLY
+            cooldown-time: 180
+            day1: false
+  ext-cpd:
+    - id: eth0-ext
+      int-cpd: # Connection to int-cpd
+        vdu-id: cirros_heal_vnfd-VM
+        cpd: eth0-int
diff --git a/tests/examples/dest_vnfd.yaml b/tests/examples/dest_vnfd.yaml
new file mode 100644 (file)
index 0000000..4ee94e9
--- /dev/null
@@ -0,0 +1,79 @@
+#  Copyright ETSI Contributors and Others
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+#  implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+vnfd:
+    description: Destination vnf descriptor
+    df:
+    - id: default-df
+      instantiation-level:
+      - id: default-instantiation-level
+        vdu-level:
+        - number-of-instances: 1
+          vdu-id: dest_vnf-VM
+      vdu-profile:
+      - id: dest_vnf-VM
+        min-number-of-instances: 1
+    ext-cpd:
+    - id: eth0-ext
+      int-cpd:
+        cpd: eth0-int
+        vdu-id: dest_vnf-VM
+    id: dest_vnf
+    mgmt-cp: eth0-ext
+    product-name: dest_vnf
+    provider: OSM
+    sw-image-desc:
+    - id: bionic
+      image: bionic
+      name: bionic
+    - id: ubuntu20.04-aws
+      name: ubuntu20.04-aws
+      image: ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180509
+      vim-type: aws
+    - id: ubuntu20.04-azure
+      name: ubuntu20.04-azure
+      image: Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest
+      vim-type: azure
+    vdu:
+    - id: dest_vnf-VM
+      cloud-init-file: cloud-config
+      description: dest_vnf-VM
+      int-cpd:
+      - id: eth0-int
+        virtual-network-interface-requirement:
+        - name: eth0
+          virtual-interface:
+            bandwidth: 0
+            type: VIRTIO
+            vpci: 0000:00:0a.0
+      name: dest_vnf-VM
+      sw-image-desc: bionic
+      alternative-sw-image-desc:
+      - ubuntu20.04-aws
+      - ubuntu20.04-azure
+      virtual-compute-desc: dest_vnf-VM-compute
+      virtual-storage-desc:
+      - dest_vnf-VM-storage
+    version: '1.0'
+    software-version: 1.2
+    virtual-compute-desc:
+    - id: dest_vnf-VM-compute
+      virtual-cpu:
+        num-virtual-cpu: 1
+      virtual-memory:
+        size: 2
+    virtual-storage-desc:
+    - id: dest_vnf-VM-storage
+      size-of-storage: 10
diff --git a/tests/examples/mid_vnfd.yaml b/tests/examples/mid_vnfd.yaml
new file mode 100644 (file)
index 0000000..f1ddf8c
--- /dev/null
@@ -0,0 +1,79 @@
+#  Copyright ETSI Contributors and Others
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+#  implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+vnfd:
+    description: SFC Middle VNF descriptor
+    df:
+    - id: default-df
+      instantiation-level:
+      - id: default-instantiation-level
+        vdu-level:
+        - number-of-instances: 1
+          vdu-id: mid_vnf-VM
+      vdu-profile:
+      - id: mid_vnf-VM
+        min-number-of-instances: 1
+    ext-cpd:
+    - id: eth0-ext
+      int-cpd:
+        cpd: eth0-int
+        vdu-id: mid_vnf-VM
+    id: mid_vnf
+    mgmt-cp: eth0-ext
+    product-name: mid_vnf
+    provider: OSM
+    sw-image-desc:
+    - id: bionic
+      image: bionic
+      name: bionic
+    - id: ubuntu20.04-aws
+      name: ubuntu20.04-aws
+      image: ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180509
+      vim-type: aws
+    - id: ubuntu20.04-azure
+      name: ubuntu20.04-azure
+      image: Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest
+      vim-type: azure
+    vdu:
+    - id: mid_vnf-VM
+      cloud-init-file: cloud-config
+      description: mid_vnf-VM
+      int-cpd:
+      - id: eth0-int
+        virtual-network-interface-requirement:
+        - name: eth0
+          virtual-interface:
+            bandwidth: 0
+            type: VIRTIO
+            vpci: 0000:00:0a.0
+      name: mid_vnf-VM
+      sw-image-desc: bionic
+      alternative-sw-image-desc:
+      - ubuntu20.04-aws
+      - ubuntu20.04-azure
+      virtual-compute-desc: mid_vnf-VM-compute
+      virtual-storage-desc:
+      - mid_vnf-VM-storage
+    version: '1.0'
+    software-version: 1.2
+    virtual-compute-desc:
+    - id: mid_vnf-VM-compute
+      virtual-cpu:
+        num-virtual-cpu: 1
+      virtual-memory:
+        size: 2
+    virtual-storage-desc:
+    - id: mid_vnf-VM-storage
+      size-of-storage: 10
diff --git a/tests/examples/sfc_nsd.yaml b/tests/examples/sfc_nsd.yaml
new file mode 100644 (file)
index 0000000..746d87f
--- /dev/null
@@ -0,0 +1,86 @@
+#  Copyright ETSI Contributors and Others
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+#  implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+nsd:
+  nsd:
+  - description: sfc_nsd Network Service
+    designer: TATA ELXSI
+    df:
+    - id: default-df
+      vnf-profile:
+      - id: vnf1
+        vnfd-id: src_vnf
+        virtual-link-connectivity:
+        - constituent-cpd-id:
+          - constituent-base-element-id: vnf1
+            constituent-cpd-id: eth0-ext
+            ip-address: 20.20.20.10
+          virtual-link-profile-id: private
+      - id: vnf2
+        vnfd-id: mid_vnf
+        virtual-link-connectivity:
+        - constituent-cpd-id:
+          - constituent-base-element-id: vnf2
+            constituent-cpd-id: eth0-ext
+            ip-address: 20.20.20.20
+          virtual-link-profile-id: private
+      - id: vnf3
+        vnfd-id: dest_vnf
+        virtual-link-connectivity:
+        - constituent-cpd-id:
+          - constituent-base-element-id: vnf3
+            constituent-cpd-id: eth0-ext
+            ip-address: 20.20.20.30
+          virtual-link-profile-id: private
+    vnffgd:
+    - id: vnffg1
+      vnf-profile-id:
+      - vnf2
+      nfp-position-element:
+      - id: test
+      nfpd:
+      - id: forwardingpath1
+        position-desc-id:
+        - id: position1
+          nfp-position-element-id:
+          - test
+          match-attributes:
+          -  id: rule1_80
+             ip-proto: 6
+             source-ip-address:  20.20.20.10
+             destination-ip-address: 20.20.20.30
+             source-port: 0
+             destination-port: 80
+             constituent-base-element-id: vnf1
+             constituent-cpd-id: eth0-ext
+          cp-profile-id:
+          -  id: cpprofile2
+             constituent-profile-elements:
+             - id: cp1
+               order: 0
+               constituent-base-element-id: vnf2
+               ingress-constituent-cpd-id: eth0-ext
+               egress-constituent-cpd-id: eth0-ext
+    id: sfc_nsd
+    name: sfc_nsd
+    version: '1.0'
+    virtual-link-desc:
+    - id: private
+      mgmt-network: 'true'
+      vim-network-name: private
+    vnfd-id:
+    - src_vnf
+    - mid_vnf
+    - dest_vnf
diff --git a/tests/examples/src_vnfd.yaml b/tests/examples/src_vnfd.yaml
new file mode 100644 (file)
index 0000000..33ca97a
--- /dev/null
@@ -0,0 +1,80 @@
+#  Copyright ETSI Contributors and Others
+#
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+#  implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+vnfd:
+    description: Source vnf descriptor
+    df:
+    - id: default-df
+      instantiation-level:
+      - id: default-instantiation-level
+        vdu-level:
+        - number-of-instances: 1
+          vdu-id: src_vnf-VM
+      vdu-profile:
+      - id: src_vnf-VM
+        min-number-of-instances: 1
+    ext-cpd:
+    - id: eth0-ext
+      int-cpd:
+        cpd: eth0-int
+        vdu-id: src_vnf-VM
+    id: src_vnf
+    mgmt-cp: eth0-ext
+    product-name: src_vnf
+    provider: OSM
+    sw-image-desc:
+    - id: bionic
+      image: bionic
+      name: bionic
+    - id: ubuntu20.04-aws
+      name: ubuntu20.04-aws
+      image: ubuntu/images/hvm-ssd/ubuntu-artful-17.10-amd64-server-20180509
+      vim-type: aws
+    - id: ubuntu20.04-azure
+      name: ubuntu20.04-azure
+      image: Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest
+      vim-type: azure
+    vdu:
+    - id: src_vnf-VM
+      cloud-init-file: cloud-config
+      description: src_vnf-VM
+      id: src_vnf-VM
+      int-cpd:
+      - id: eth0-int
+        virtual-network-interface-requirement:
+        - name: eth0
+          virtual-interface:
+            bandwidth: 0
+            type: VIRTIO
+            vpci: 0000:00:0a.0
+      name: src_vnf_vnfd-VM
+      sw-image-desc: bionic
+      alternative-sw-image-desc:
+      - ubuntu20.04-aws
+      - ubuntu20.04-azure
+      virtual-compute-desc: src_vnf-VM-compute
+      virtual-storage-desc:
+      - src_vnf-VM-storage
+    version: '1.0'
+    software-version: 1.2
+    virtual-compute-desc:
+    - id: src_vnf-VM-compute
+      virtual-cpu:
+        num-virtual-cpu: 1
+      virtual-memory:
+        size: 2
+    virtual-storage-desc:
+    - id: src_vnf-VM-storage
+      size-of-storage: 10
diff --git a/tox.ini b/tox.ini
index 54128a0..1109b9c 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -23,12 +23,13 @@ toxworkdir = /tmp/.tox
 
 [testenv]
 usedevelop = True
-basepython = python3
+basepython = python3.10
 setenv = VIRTUAL_ENV={envdir}
          PYTHONDONTWRITEBYTECODE = 1
 passenv = HOME
 deps =  -r{toxinidir}/requirements.txt
 skip_install = true
+parallel_show_output = true
 
 
 #######################################################################################
@@ -50,7 +51,7 @@ commands =
         coverage report --omit='*tests*'
         coverage html -d ./cover --omit='*tests*'
         coverage xml -o coverage.xml --omit=*tests*
-whitelist_externals = sh
+allowlist_externals = sh
 
 
 #######################################################################################
@@ -76,13 +77,18 @@ commands =
 
 #######################################################################################
 [testenv:pip-compile]
-deps =  pip-tools==5.5.0
+deps =  pip-tools==6.13.0
+skip_install = true
+allowlist_externals = bash
+        [
 commands =
-        - sh -c 'for file in requirements*.in ; do pip-compile -rU --no-header $file ;\
-        out=`echo $file | sed "s/.in/.txt/"` ; \
-        head -16 tox.ini >> $out ;\
-        done'
-whitelist_externals = sh
+        - bash -c "for file in requirements*.in ; do \
+        UNSAFE="" ; \
+        if [[ $file =~ 'dist' ]] ; then UNSAFE='--allow-unsafe' ; fi ; \
+        pip-compile --resolver=backtracking -rU --no-header $UNSAFE $file ;\
+        out=`echo $file | sed 's/.in/.txt/'` ; \
+        sed -i -e '1 e head -16 tox.ini' $out ;\
+        done"
 
 
 #######################################################################################
@@ -99,7 +105,7 @@ commands =
         python3 setup.py --command-packages=stdeb.command sdist_dsc
         sh -c 'cd deb_dist/osm-im*/ && dpkg-buildpackage -rfakeroot -uc -us'
         sh -c 'rm osm_im/requirements.txt'
-whitelist_externals = sh
+allowlist_externals = sh
 
 #######################################################################################
 [flake8]