From ffa3a5cdcc0ce35504b0b70fd9912d03dc958e2a Mon Sep 17 00:00:00 2001 From: Mahesh Jethanandani Date: Thu, 18 Apr 2019 14:33:33 -0700 Subject: [PATCH] Added module and test cases for PNFD and NSD --- example-data/nfv-nsd.xml | 33 ++++++++++++++++++ example-data/nfv-pnfd.xml | 8 +++++ example-data/nfv.xml | 24 ++++++------- run-test.sh | 14 ++++++-- src/yang/etsi-nfv-common.yang | 2 +- src/yang/etsi-nfv-descriptors.yang | 8 ++--- src/yang/etsi-nfv-ns.yang | 52 ++++++++++++++-------------- src/yang/etsi-nfv-nsd.yang | 55 ++++++++++++++++++++++++++++++ src/yang/etsi-nfv-pnf.yang | 2 +- src/yang/etsi-nfv-pnfd.yang | 26 ++++++++++++++ src/yang/etsi-nfv-vnfd.yang | 2 +- 11 files changed, 179 insertions(+), 47 deletions(-) create mode 100644 example-data/nfv-nsd.xml create mode 100644 example-data/nfv-pnfd.xml create mode 100644 src/yang/etsi-nfv-nsd.yang create mode 100644 src/yang/etsi-nfv-pnfd.yang diff --git a/example-data/nfv-nsd.xml b/example-data/nfv-nsd.xml new file mode 100644 index 0000000..94b81ea --- /dev/null +++ b/example-data/nfv-nsd.xml @@ -0,0 +1,33 @@ + + + firewall-nsd + ASA + + inside + + + management + + + outside + + + firewall + + firewall + ASA + normal + single + 1 + 1 + + + single + + firewall + 1 + + + + + diff --git a/example-data/nfv-pnfd.xml b/example-data/nfv-pnfd.xml new file mode 100644 index 0000000..4cd51f4 --- /dev/null +++ b/example-data/nfv-pnfd.xml @@ -0,0 +1,8 @@ + + physical-dpi + 1.0 + + outside + nfv:ethernet + + diff --git a/example-data/nfv.xml b/example-data/nfv.xml index 1b0c901..729a284 100644 --- a/example-data/nfv.xml +++ b/example-data/nfv.xml @@ -1,5 +1,5 @@ - + ASA My Company My Company ASAv @@ -100,8 +100,8 @@ single - - + + CSR My Company My Company CSR 1000v @@ -202,8 +202,8 @@ single - - + + firewall-nsd ASA @@ -233,8 +233,8 @@ - - + + service-chain-1 ASA CSR @@ -483,8 +483,8 @@ - - + + service-chain-2 firewall-nsd CSR @@ -570,13 +570,13 @@ - - + + physical-dpi 1.0 outside ethernet - + diff --git a/run-test.sh b/run-test.sh index 555e80c..b726bb5 100755 --- a/run-test.sh +++ b/run-test.sh @@ -10,17 +10,27 @@ cd src CONFD_OPTS="--fail-on-warnings" CONFD_OPTS="" -echo "Testing compilations of pkg." +echo "Testing compilations of VNFD." confdc -c $CONFD_OPTS -o /opt/confd/etc/confd/etsi-nfv-vnfd.fxs etsi-nfv-vnfd.yang +echo "Testing compilations of PNFD." +confdc -c $CONFD_OPTS -o /opt/confd/etc/confd/etsi-nfv-pnfd.fxs etsi-nfv-pnfd.yang +echo "Testing compilations of NSD." +confdc -c $CONFD_OPTS -o /opt/confd/etc/confd/etsi-nfv-nsd.fxs etsi-nfv-nsd.yang echo "Testing compilations of descriptors." confdc -c $CONFD_OPTS -o /opt/confd/etc/confd/etsi-nfv-descriptors.fxs etsi-nfv-descriptors.yang echo "Starting ConfD" confd -echo "Loading Data for pkg" +echo "Loading Data for VNFD" confd_load -l -m nfv-vnfd.xml +echo "Loading Data for PNFD" +confd_load -l -m nfv-pnfd.xml + +echo "Loading Data for NSD" +confd_load -l -m nfv-nsd.xml + echo "Loading Data for descriptors" confd_load -l -m nfv.xml diff --git a/src/yang/etsi-nfv-common.yang b/src/yang/etsi-nfv-common.yang index f30f825..da377dc 100644 --- a/src/yang/etsi-nfv-common.yang +++ b/src/yang/etsi-nfv-common.yang @@ -9,7 +9,7 @@ submodule etsi-nfv-common { description "Common data types for ETSI data models."; - revision 2019-03-18 { + revision 2019-04-25 { description "Initial revision diff --git a/src/yang/etsi-nfv-descriptors.yang b/src/yang/etsi-nfv-descriptors.yang index bdd46b5..afedb3b 100644 --- a/src/yang/etsi-nfv-descriptors.yang +++ b/src/yang/etsi-nfv-descriptors.yang @@ -14,7 +14,7 @@ module etsi-nfv-descriptors { description "Network Function Virtualization Descriptors"; - revision 2019-03-18 { + revision 2019-04-25 { description "Initial revision. NSD and PNFD according to ETSI GS NFV-IFA 014 Ed261v252 @@ -22,7 +22,7 @@ module etsi-nfv-descriptors { } container nfv { - list vnfds { + list vnfd { key "id"; description "A VNF Descriptor (VNFD) is a deployment template which @@ -35,7 +35,7 @@ module etsi-nfv-descriptors { uses vnfd; } - list nsds { + list nsd { key "id"; description @@ -49,7 +49,7 @@ module etsi-nfv-descriptors { uses nsd; } - list pnfds { + list pnfd { key "id"; description diff --git a/src/yang/etsi-nfv-ns.yang b/src/yang/etsi-nfv-ns.yang index 3406dbe..1eb49ce 100644 --- a/src/yang/etsi-nfv-ns.yang +++ b/src/yang/etsi-nfv-ns.yang @@ -11,7 +11,7 @@ submodule etsi-nfv-ns { description "Models for NS according to ETSI GS NFV-IFA 014."; - revision 2019-03-18 { + revision 2019-04-25 { description "Initial revision Common data structure to support NSD according to: @@ -86,7 +86,7 @@ submodule etsi-nfv-ns { leaf-list nested-nsd-id { must ". != ../id"; type leafref { - path "../../nsds/id"; + path "../../nsd/id"; } description "References the NSD of a constituent nested NS."; @@ -97,7 +97,7 @@ submodule etsi-nfv-ns { leaf-list vnfd-id { type leafref { - path "../../vnfds/id"; + path "../../vnfd/id"; } description "References the VNFD of a constituent VNF."; @@ -108,7 +108,7 @@ submodule etsi-nfv-ns { leaf-list pnfd-id { type leafref { - path "../../pnfds/id"; + path "../../pnfd/id"; } description "References the PNFD of a constituent PNF."; @@ -164,7 +164,7 @@ submodule etsi-nfv-ns { leaf vnfd-id { mandatory true; type leafref { - path "../../../../nfv:vnfds/nfv:id"; + path "../../../../vnfd/id"; } must "boolean(../../../vnfd-id[.=current()])"; } @@ -172,7 +172,7 @@ submodule etsi-nfv-ns { leaf ext-cpd-id { mandatory true; type leafref { - path "deref(../vnfd-id)/../nfv:ext-cpd/nfv:id"; + path "deref(../vnfd-id)/../ext-cpd/id"; } } } @@ -181,7 +181,7 @@ submodule etsi-nfv-ns { leaf pnfd-id { mandatory true; type leafref { - path "../../../../nfv:pnfds/nfv:id"; + path "../../../../pnfd/id"; } must "boolean(../pnfd-id[.=current()])"; } @@ -189,7 +189,7 @@ submodule etsi-nfv-ns { leaf ext-cpd-id { mandatory true; type leafref { - path "deref(../pnfd-id)/../nfv:ext-cpd/nfv:id"; + path "deref(../pnfd-id)/../ext-cpd/id"; } } } @@ -197,7 +197,7 @@ submodule etsi-nfv-ns { leaf nsd-id { mandatory true; type leafref { - path "../../../../nfv:nsds/nfv:id"; + path "../../../../nsd/id"; } must "boolean(../nsd-id[.=current()])"; } @@ -205,7 +205,7 @@ submodule etsi-nfv-ns { leaf ext-cpd-id { mandatory true; type leafref { - path "deref(../nsd-id)/../nfv:sapd/nfv:id"; + path "deref(../nsd-id)/../sapd/id"; } } } @@ -437,7 +437,7 @@ submodule etsi-nfv-ns { must ". = deref(../../vnfd-profile-id)" { } type leafref { - path "/nfv/nsds/df/vnf-profile/id"; + path "../../../../../nsd/df/vnf-profile/id"; } } } @@ -446,7 +446,7 @@ submodule etsi-nfv-ns { must ". = deref(../../pnfd-profile-id)" { } type leafref { - path "/nfv/nsds/df/pnf-profile/id"; + path "../../../../../nsd/df/pnf-profile/id"; } } } @@ -455,7 +455,7 @@ submodule etsi-nfv-ns { must ". = deref(../../ns-profile-id)" { } type leafref { - path "/nfv/nsds/df/ns-profile/id"; + path "../../../../../nsd/df/ns-profile/id"; } } } @@ -472,12 +472,12 @@ submodule etsi-nfv-ns { must ". = deref(../../vnfd-profile-id)/../vnfd-id" { } type leafref { - path "/nfv/vnfds/id"; + path "../../../../../vnfd/id"; } } leaf cpd-id { type leafref { - path "deref(../vnfd-id)/../nfv:ext-cpd/nfv:id"; + path "deref(../vnfd-id)/../ext-cpd/id"; } } } @@ -486,12 +486,12 @@ submodule etsi-nfv-ns { must ". = deref(../../pnfd-profile-id)/../pnfd-id" { } type leafref { - path "/nfv/pnfds/id"; + path "../../../../../pnfd/id"; } } leaf pnf-cpd-id { type leafref { - path "deref(../pnfd-id)/../nfv:ext-cpd/nfv:id"; + path "deref(../pnfd-id)/../ext-cpd/id"; } } } @@ -502,12 +502,12 @@ submodule etsi-nfv-ns { } type leafref { - path "/nfv/nsds/id"; + path "../../../../../nsd/id"; } } leaf sap-cpd-id { type leafref { - path "deref(../nsd-id)/../nfv:sapd/nfv:id"; + path "deref(../nsd-id)/../sapd/id"; } } } @@ -721,7 +721,7 @@ submodule etsi-nfv-ns { leaf vnfd-id { mandatory true; type leafref { - path "/nfv/vnfds/id"; + path "../../../../vnfd/id"; } description "References a VNFD."; @@ -845,7 +845,7 @@ submodule etsi-nfv-ns { leaf constituent-cpd-id { type leafref { - path "deref(../../../vnfd-id)/../nfv:ext-cpd/nfv:id"; + path "deref(../../../vnfd-id)/../ext-cpd/id"; } description "A reference to the descriptor of a connection point @@ -879,7 +879,7 @@ submodule etsi-nfv-ns { leaf pnfd-id { type leafref { - path "/nfv/pnfds/id"; + path "../../../../pnfd/id"; } description "References a PNFD."; @@ -935,7 +935,7 @@ submodule etsi-nfv-ns { leaf constituent-cpd-id { type leafref { - path "deref(../../../pnfd-id)/../nfv:ext-cpd/nfv:id"; + path "deref(../../../pnfd-id)/../ext-cpd/id"; } description "A reference to the descriptor of a connection point @@ -1314,7 +1314,7 @@ submodule etsi-nfv-ns { leaf nsd-id { mandatory true; type leafref { - path "/nfv/nsds/id"; + path "../../../../nsd/id"; } description "Identifies the NSD applicable to NS instantiated @@ -1432,7 +1432,7 @@ submodule etsi-nfv-ns { leaf constituent-cpd-id { type leafref { - path "deref(../../../nsd-id)/../nfv:sapd/nfv:id"; + path "deref(../../../nsd-id)/../sapd/id"; } description "A reference to the descriptor of a connection point @@ -1506,7 +1506,7 @@ submodule etsi-nfv-ns { container vnf-indicator-info { leaf vnfd-id { type leafref { - path "/nfv/vnfds/id"; + path "../../../../../vnfd/id"; } description "Identifies a VNFD."; diff --git a/src/yang/etsi-nfv-nsd.yang b/src/yang/etsi-nfv-nsd.yang new file mode 100644 index 0000000..c6622c0 --- /dev/null +++ b/src/yang/etsi-nfv-nsd.yang @@ -0,0 +1,55 @@ +module etsi-nfv-nsd { + yang-version 1.1; + namespace "urn:etsi:nfv:yang:etsi-nfv-nsd"; + prefix nsd; + + import etsi-nfv-descriptors { + prefix vnf; + } + + organization + "European Telecommunications Standards Institute (ETSI)"; + + description + "Network Services Descriptors"; + + revision 2019-04-25 { + description + "Initial revision. + NSD according to ETSI GS NFV-IFA 014 Ed261v252."; + } + + container nsd { + list vnfd { + key "id"; + description + "A VNF Descriptor (VNFD) is a deployment template which + describes a VNF in terms of deployment and operational + behaviour requirements. It also contains connectivity, + interface and virtualised resource requirements"; + reference + "GS NFV-IFA011: Section 7.1.2, VNFD information element"; + + uses vnf:vnfd; + } + + list nsd { + key "id"; + max-elements 1; + uses vnf:nsd; + } + + list pnfd { + key "id"; + + description + "The Pnfd information element is a deployment template + enabling on-boarding PNFs and referencing them from an + NSD. It focuses on connectivity aspects only."; + reference + "GS NFV-IFA014: Section 6.6.2, Pnfd information element."; + + uses vnf:pnfd; + } + } +} diff --git a/src/yang/etsi-nfv-pnf.yang b/src/yang/etsi-nfv-pnf.yang index e2cc14a..ffe5d06 100644 --- a/src/yang/etsi-nfv-pnf.yang +++ b/src/yang/etsi-nfv-pnf.yang @@ -12,7 +12,7 @@ submodule etsi-nfv-pnf { description "Models for PNFD according to GS NFV-IFA 014."; - revision 2019-03-18 { + revision 2019-04-25 { description "Initial revision. diff --git a/src/yang/etsi-nfv-pnfd.yang b/src/yang/etsi-nfv-pnfd.yang new file mode 100644 index 0000000..a365e01 --- /dev/null +++ b/src/yang/etsi-nfv-pnfd.yang @@ -0,0 +1,26 @@ +module etsi-nfv-pnfd { + yang-version 1.1; + namespace "urn:etsi:nfv:yang:etsi-nfv-pnfd"; + prefix pnfd; + + import etsi-nfv-descriptors { + prefix vnf; + } + + organization + "European Telecommunications Standards Institute (ETSI)"; + + description + "Physcial Network Function Descriptor."; + + revision 2019-04-25 { + description + "Initial revision. + NSD according to ETSI GS NFV-IFA 014 Ed261v252."; + } + + container pnfd { + presence "PNFD container."; + uses vnf:pnfd; + } +} diff --git a/src/yang/etsi-nfv-vnfd.yang b/src/yang/etsi-nfv-vnfd.yang index 04598dc..5ded801 100644 --- a/src/yang/etsi-nfv-vnfd.yang +++ b/src/yang/etsi-nfv-vnfd.yang @@ -1,7 +1,7 @@ module etsi-nfv-vnfd { yang-version 1.1; namespace "urn:etsi:nfv:yang:etsi-nfv-vnfd"; - prefix pkg; + prefix vnfd; import etsi-nfv-descriptors { prefix vnf; -- GitLab