From 094395a0910126738305cf1892c39fdcb5d4bee9 Mon Sep 17 00:00:00 2001 From: Mahesh Jethanandani Date: Fri, 8 Feb 2019 12:32:05 -0800 Subject: [PATCH] Fix for bug#170 --- example-data/complex-vnfd.xml | 260 ++++++++++++++++++++++++++++++++++ example-data/nfv.xml | 8 +- run-test.sh | 4 +- src/yang/etsi-nfv-vnf.yang | 8 +- 4 files changed, 271 insertions(+), 9 deletions(-) create mode 100644 example-data/complex-vnfd.xml diff --git a/example-data/complex-vnfd.xml b/example-data/complex-vnfd.xml new file mode 100644 index 0000000..8aee7fc --- /dev/null +++ b/example-data/complex-vnfd.xml @@ -0,0 +1,260 @@ + + + + complex-vnf + ACME + complex-vnf + 1.0 + 1.0 + netconf + + control-plane-active + control-plane-active + + internal + internal-vl + IPv4 + + + mgmt + mgmt + IPv4 + + CP + root + CP + + + control-plane-standby + control-plane-standby + + internal + internal-vl + IPv4 + + + mgmt + mgmt + IPv4 + + CP + root + CP + + + data-plane + data-plane + + in + IPv4 + + + internal + internal-vl + IPv4 + + + out + IPv4 + + DP + root + DP + + + CP + + 16.0 + + + 8 + + + + DP + + 32.0 + + + 16 + + + + root + root + 10 + + + CP + CP + bare + qcow2 + http://acme.images.com/control-plane.qcow2 + + + DP + DP + bare + qcow2 + http://acme.images.com/data-plane.qcow2 + + + internal-vl + + + IPv4 + + + + + mgmt + + + IPv4 + + + + + in + + data-plane + in + + IPv4 + + + mgmt + mgmt + IPv4 + + + out + + data-plane + out + + IPv4 + + + gold + + control-plane-active + 1 + 1 + + control-plane + + + + control-plane-standby + 1 + 1 + + control-plane + + + + data-plane + 2 + 8 + + + il-1 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 2 + + + + il-2 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 4 + + + il-1 + + control-plane + anti-affinity + nfvi-node + + + + silver + + control-plane-active + 1 + 1 + + control-plane + + + + control-plane-standby + 1 + 1 + + control-plane + + + + data-plane + 1 + 4 + + + il-1 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 1 + + + + il-2 + + control-plane-active + 1 + + + control-plane-standby + 1 + + + data-plane + 2 + + + il-1 + + control-plane + anti-affinity + nfvi-node + + + + + diff --git a/example-data/nfv.xml b/example-data/nfv.xml index ddfd65a..23a6b64 100644 --- a/example-data/nfv.xml +++ b/example-data/nfv.xml @@ -25,7 +25,7 @@ asa-vsd asa-image - + asa-vcd 4.0 @@ -33,7 +33,7 @@ 2 - + asa-vsd root @@ -120,7 +120,7 @@ csr-vsd csr-image - + csr-vcd 4.0 @@ -128,7 +128,7 @@ 2 - + csr-vsd root diff --git a/run-test.sh b/run-test.sh index 36bc6ec..e45d593 100755 --- a/run-test.sh +++ b/run-test.sh @@ -15,8 +15,10 @@ confdc -c $CONFD_OPTS -o /opt/confd/etc/confd/etsi-nfv.fxs etsi-nfv.yang echo "Starting ConfD" confd -echo "Loading Data" +echo "Loading data for the simple example" confd_load -l -m nfv.xml +echo "Loading data for the complex Vnfd example" +confd_load -l -m complex-vnfd.xml # Don't do this in the actual test, just waste of cycles # echo "Stopping ConfD" diff --git a/src/yang/etsi-nfv-vnf.yang b/src/yang/etsi-nfv-vnf.yang index cc08efb..eaae5e7 100755 --- a/src/yang/etsi-nfv-vnf.yang +++ b/src/yang/etsi-nfv-vnf.yang @@ -82,7 +82,7 @@ submodule etsi-nfv-vnf { } leaf nicio-requirements { type leafref { - path "/nfv/vnfd/virtual-compute-descriptor/id"; + path "/nfv/vnfd/virtual-compute-desc/id"; } description "This references (couples) the CPD with any logical node I/O @@ -295,10 +295,10 @@ submodule etsi-nfv-vnf { } leaf virtual-compute-desc { type leafref { - path "../../nfv:virtual-compute-descriptor/" + + path "../../nfv:virtual-compute-desc/" + "nfv:id"; } - must "../../nfv:virtual-compute-descriptor[id=current()]/" + + must "../../nfv:virtual-compute-desc[id=current()]/" + "nfv:virtual-memory/size >=" + "../../nfv:sw-image-desc[id=current()/" + "../sw-image-desc]/min-ram" { @@ -419,7 +419,7 @@ submodule etsi-nfv-vnf { } } - list virtual-compute-descriptor { + list virtual-compute-desc { key "id"; description "Defines descriptors of virtual compute resources to be -- GitLab