From: garciadeblas Date: Thu, 14 Mar 2024 18:50:59 +0000 (+0100) Subject: Update openjdk version to 19 and yang2swagger version to 2.1.0 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FIM.git;a=commitdiff_plain;h=HEAD;hp=b81a30c263ceb425406f52c52a7c44f62bf96bc0 Update openjdk version to 19 and yang2swagger version to 2.1.0 Change-Id: I16dc02009cc61f8452f3a0787b288d9c140c4ea8 Signed-off-by: garciadeblas --- diff --git a/Dockerfile b/Dockerfile index 3ca4992..01475b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ # devops-stages/stage-build.sh # -FROM ubuntu:20.04 +FROM ubuntu:22.04 ARG APT_PROXY RUN if [ ! -z $APT_PROXY ] ; then \ @@ -34,15 +34,15 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ debhelper \ dh-python \ git \ - python3.8 \ + python3 \ python3-all \ - python3.8-dev \ - python3-setuptools - -RUN python3 -m easy_install pip==21.3.1 -RUN pip install tox==3.24.5 + python3-dev \ + python3-setuptools \ + python3-pip \ + tox RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ 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 + openjdk-19-jdk maven +RUN update-java-alternatives --jre-headless --set /usr/lib/jvm/java-1.19.0-openjdk-amd64 + diff --git a/Makefile b/Makefile index 6b9b622..683a624 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,16 @@ # 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 diff --git a/build-docs.sh b/build-docs.sh index 6f21939..623e98f 100755 --- a/build-docs.sh +++ b/build-docs.sh @@ -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 - diff --git a/debian/control b/debian/control index 10fb75b..f06583a 100644 --- a/debian/control +++ b/debian/control @@ -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 -Build-Depends: debhelper (>=9) +Build-Depends: debhelper-compat (= 13) Standards-Version: 3.9.6 -Homepage: http://osm.etsi.org +Homepage: + 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. - diff --git a/devops-stages/stage-archive.sh b/devops-stages/stage-archive.sh index 98b44a3..84e1041 100755 --- a/devops-stages/stage-archive.sh +++ b/devops-stages/stage-archive.sh @@ -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/ diff --git a/devops-stages/stage-build.sh b/devops-stages/stage-build.sh index e8b397b..6268698 100755 --- a/devops-stages/stage-build.sh +++ b/devops-stages/stage-build.sh @@ -15,4 +15,4 @@ rm -rf dist deb_dist osm*.tar.gz *.egg-info .eggs -tox -e dist +tox -e dist --recreate diff --git a/devops-stages/stage-test.sh b/devops-stages/stage-test.sh index 067d896..eee57ff 100755 --- a/devops-stages/stage-test.sh +++ b/devops-stages/stage-test.sh @@ -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 + diff --git a/models/augments/additional-info.yang b/models/augments/additional-info.yang index 2119073..6b460c1 100644 --- a/models/augments/additional-info.yang +++ b/models/augments/additional-info.yang @@ -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; + } } diff --git a/models/augments/common-augments.yang b/models/augments/common-augments.yang index f1235eb..18481a9 100644 --- a/models/augments/common-augments.yang +++ b/models/augments/common-augments.yang @@ -348,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"; @@ -726,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 { diff --git a/models/augments/epa.yang b/models/augments/epa.yang index d47d6a9..af8b7cd 100644 --- a/models/augments/epa.yang +++ b/models/augments/epa.yang @@ -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 index 0000000..13651db --- /dev/null +++ b/models/augments/exporters.yang @@ -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/kdu.yang b/models/augments/kdu.yang index 1b5c084..9dc512f 100644 --- a/models/augments/kdu.yang +++ b/models/augments/kdu.yang @@ -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; diff --git a/models/augments/ns-vld.yang b/models/augments/ns-vld.yang index b85acbf..ac3cc4c 100644 --- a/models/augments/ns-vld.yang +++ b/models/augments/ns-vld.yang @@ -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 index 0000000..3000b3b --- /dev/null +++ b/models/augments/vnffgd.yang @@ -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; + } +} diff --git a/models/yang/mano-types.yang b/models/yang/mano-types.yang index 7fc0e50..d1cbb86 100644 --- a/models/yang/mano-types.yang +++ b/models/yang/mano-types.yang @@ -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; diff --git a/models/yang/vnfd-base.yang b/models/yang/vnfd-base.yang index 28a4961..e38bac9 100644 --- a/models/yang/vnfd-base.yang +++ b/models/yang/vnfd-base.yang @@ -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; diff --git a/requirements-dist.in b/requirements-dist.in index 4f8784f..28d0ce1 100644 --- a/requirements-dist.in +++ b/requirements-dist.in @@ -15,4 +15,5 @@ stdeb setuptools-version-command -setuptools<60 \ No newline at end of file +setuptools<60 +pyang diff --git a/requirements-dist.txt b/requirements-dist.txt index 8192b48..05bfb57 100644 --- a/requirements-dist.txt +++ b/requirements-dist.txt @@ -14,6 +14,10 @@ # 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 diff --git a/requirements-test.txt b/requirements-test.txt index 40c7f11..77ae576 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -14,11 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### -coverage==6.4.1 - # via - # -r requirements-test.in - # nose2 -nose2==0.11.0 +coverage==7.3.1 + # via -r requirements-test.in +nose2==0.13.0 # via -r requirements-test.in -six==1.16.0 - # via nose2 diff --git a/requirements.in b/requirements.in index 94c2eb9..128194b 100644 --- a/requirements.in +++ b/requirements.in @@ -15,4 +15,4 @@ pyang pyangbind -pyyaml==5.4.1 \ No newline at end of file +pyyaml>6 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 9572169..da4aa3a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,11 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. ####################################################################################### -bitarray==2.5.1 - # via pyangbind enum34==1.1.10 # via pyangbind -lxml==4.9.0 +lxml==4.9.3 # via # pyang # pyangbind @@ -26,11 +24,11 @@ pyang==2.5.3 # via # -r requirements.in # pyangbind -pyangbind==0.8.1 +pyangbind==0.8.3.post1 # via -r requirements.in -pyyaml==5.4.1 +pyyaml==6.0.1 # via -r requirements.in -regex==2022.6.2 +regex==2023.8.8 # via pyangbind six==1.16.0 # via pyangbind diff --git a/setup.py b/setup.py index ec75988..4cd2be2 100644 --- 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/dest_vnfd.yaml b/tests/examples/dest_vnfd.yaml new file mode 100644 index 0000000..4ee94e9 --- /dev/null +++ b/tests/examples/dest_vnfd.yaml @@ -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 index 0000000..f1ddf8c --- /dev/null +++ b/tests/examples/mid_vnfd.yaml @@ -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 index 0000000..746d87f --- /dev/null +++ b/tests/examples/sfc_nsd.yaml @@ -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 index 0000000..33ca97a --- /dev/null +++ b/tests/examples/src_vnfd.yaml @@ -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 4a2494a..1109b9c 100644 --- a/tox.ini +++ b/tox.ini @@ -23,12 +23,13 @@ toxworkdir = /tmp/.tox [testenv] usedevelop = True -basepython = python3.8 +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,15 +77,15 @@ commands = ####################################################################################### [testenv:pip-compile] -deps = pip-tools==6.6.2 +deps = pip-tools==6.13.0 skip_install = true -whitelist_externals = bash +allowlist_externals = bash [ commands = - bash -c "for file in requirements*.in ; do \ UNSAFE="" ; \ if [[ $file =~ 'dist' ]] ; then UNSAFE='--allow-unsafe' ; fi ; \ - pip-compile -rU --no-header $UNSAFE $file ;\ + 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" @@ -104,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]