From 88b676c8c572277e2487c309be6daace6bed0ee9 Mon Sep 17 00:00:00 2001 From: calvinosanch Date: Fri, 16 Aug 2019 10:59:12 +0000 Subject: [PATCH] test_RO: Removing deprecated tests and updating some examples Change-Id: I620a5b5263a8656ab23e4c152da15d67230633be Signed-off-by: calvinosanch --- .../simple_linux/scenario_simple_linux.yaml | 36 ++-- test/RO_tests/simple_linux/vnfd_linux.yaml | 46 ++--- .../scenario_multi_vnfc.yaml | 40 ++-- .../vnfd_linux_2VMs_v02.yaml | 178 ++++++++++-------- test/test_RO.py | 160 ++++++++-------- 5 files changed, 255 insertions(+), 205 deletions(-) diff --git a/test/RO_tests/simple_linux/scenario_simple_linux.yaml b/test/RO_tests/simple_linux/scenario_simple_linux.yaml index 4ad320df..b6cff705 100644 --- a/test/RO_tests/simple_linux/scenario_simple_linux.yaml +++ b/test/RO_tests/simple_linux/scenario_simple_linux.yaml @@ -19,16 +19,28 @@ # contact with: nfvlabs@tid.es ## --- -schema_version: 2 -scenario: - name: simple - description: Simple network scenario consisting of a single VNF connected to an external network - vnfs: - linux1: # vnf/net name in the scenario - vnf_name: linux # VNF name as introduced in OPENMANO DB - networks: - mgmt: # provide a name for this net or connection - external: true - interfaces: - - linux1: eth0 # Node and its interface +nsd:nsd-catalog: + nsd: + - id: simple + name: simple + vendor: OSM + version: '1.0' + description: Simple network scenario consisting of a single VNF connected to an external network + constituent-vnfd: + # The member-vnf-index needs to be unique, starting from 1 + # vnfd-id-ref is the id of the VNFD + # Multiple constituent VNFDs can be specified + - member-vnf-index: 1 + vnfd-id-ref: linux + vld: + # Networks for the VNFs + - id: vld1 + name: mgmt + short-name: vld1-sname + type: ELAN + mgmt-network: 'true' + vnfd-connection-point-ref: + - member-vnf-index-ref: 1 + vnfd-id-ref: linux + vnfd-connection-point-ref: eth0 diff --git a/test/RO_tests/simple_linux/vnfd_linux.yaml b/test/RO_tests/simple_linux/vnfd_linux.yaml index 45c670fe..a6661244 100644 --- a/test/RO_tests/simple_linux/vnfd_linux.yaml +++ b/test/RO_tests/simple_linux/vnfd_linux.yaml @@ -19,24 +19,28 @@ # contact with: nfvlabs@tid.es ## --- -vnf: - name: linux - description: Single-VM VNF with a traditional cloud VM based on generic Linux OS - external-connections: - - name: eth0 - type: bridge - VNFC: linux-VM - local_iface_name: eth0 - description: General purpose interface - VNFC: - - name: linux-VM - description: Generic Linux Virtual Machine - #Copy the image to a compute path and edit this path - image name: image_name.qcow2 - vcpus: 1 # Only for traditional cloud VMs. Number of virtual CPUs (oversubscription is allowed). - ram: 1024 # Only for traditional cloud VMs. Memory in MBytes (not from hugepages, oversubscription is allowed) - disk: 10 - bridge-ifaces: - - name: eth0 - vpci: "0000:00:11.0" - numas: [] +vnfd-catalog: + vnfd: + - id: linux + name: linux + description: Single-VM VNF with a traditional cloud VM based on generic Linux OS + connection-point: + - name: eth0 + type: VPORT + vdu: + - id: linux-VM + name: linux-VM + description: Generic Linux Virtual Machine + #Copy the image to a compute path and edit this path + image: image_name.qcow2 + vm-flavor: + memory-mb: '1024' + storage-gb: '10' + vcpu-count: '1' + interface: + - name: eth0 + type: EXTERNAL + virtual-interface: + type: VIRTIO + vpci: "0000:00:11.0" + external-connection-point-ref: eth0 diff --git a/test/RO_tests/simple_multi_vnfc/scenario_multi_vnfc.yaml b/test/RO_tests/simple_multi_vnfc/scenario_multi_vnfc.yaml index da9e2702..07b89020 100644 --- a/test/RO_tests/simple_multi_vnfc/scenario_multi_vnfc.yaml +++ b/test/RO_tests/simple_multi_vnfc/scenario_multi_vnfc.yaml @@ -19,17 +19,31 @@ # contact with: nfvlabs@tid.es ## --- -schema_version: 2 -scenario: - name: simple_multi_vnfc - description: Simple network scenario consisting of a multi VNFC VNF connected to an external network - vnfs: - linux1: # vnf/net name in the scenario - vnf_name: linux_2VMs_v02 # VNF name as introduced in OPENMANO DB - networks: - mgmt: # provide a name for this net or connection - external: true - interfaces: - - linux1: control0 # Node and its interface - - linux1: control1 # Node and its interface +nsd:nsd-catalog: + nsd: + - id: simple_multi_vnfc + name: simple_multi_vnfc + vendor: OSM + version: '1.0' + description: Simple network scenario consisting of a multi VNFC VNF connected to an external network + constituent-vnfd: + # The member-vnf-index needs to be unique, starting from 1 + # vnfd-id-ref is the id of the VNFD + # Multiple constituent VNFDs can be specified + - member-vnf-index: 1 + vnfd-id-ref: linux_2VMs_v02 + vld: + # Networks for the VNFs + - id: vld1 + name: mgmt + short-name: vld1-sname + type: ELAN + mgmt-network: 'true' + vnfd-connection-point-ref: + - member-vnf-index-ref: 1 + vnfd-id-ref: linux_2VMs_v02 + vnfd-connection-point-ref: eth0 + - member-vnf-index-ref: 1 + vnfd-id-ref: linux_2VMs_v02 + vnfd-connection-point-ref: xe1 diff --git a/test/RO_tests/simple_multi_vnfc/vnfd_linux_2VMs_v02.yaml b/test/RO_tests/simple_multi_vnfc/vnfd_linux_2VMs_v02.yaml index bf69cae0..8d541c6a 100644 --- a/test/RO_tests/simple_multi_vnfc/vnfd_linux_2VMs_v02.yaml +++ b/test/RO_tests/simple_multi_vnfc/vnfd_linux_2VMs_v02.yaml @@ -19,86 +19,106 @@ # contact with: nfvlabs@tid.es ## --- -schema_version: "0.2" -vnf: - name: linux_2VMs_v02 - description: "Example of a linux VNF consisting of two VMs with one internal network" - # class: parent # Optional. Used to organize VNFs - internal-connections: - - name: internalnet - description: internalnet - type: e-lan - implementation: overlay - ip-profile: - ip-version: IPv4 - subnet-address: 192.168.1.0/24 +vnfd-catalog: + vnfd: + - id: linux_2VMs_v02 + name: linux_2VMs_v02 + description: "Example of a linux VNF consisting of two VMs with one internal network" + connection-point: + - id: eth0 + name: eth0 + short-name: eth0 + type: VPORT + - id: xe1 + name: xe1 + short-name: xe1 + type: VPORT + internal-vld: + - id: internalnet + name: internalnet + short-name: internalnet + ip-profile-ref: ip-prof1 + type: ELAN + internal-connection-point: + - id-ref: VM1-xe0 + - id-ref: VM2-xe0 + ip-profiles: + - name: ip-prof1 + description: IP profile gateway-address: 192.168.1.1 - dns-address: 8.8.8.8 - dhcp: + dns-address: 8.8.8.8 + #- address: 8.8.8.8 + ip-profile-params: + ip-version: ipv4 + subnet-address: 192.168.1.0/24 + dhcp-params: enabled: true start-address: 192.168.1.100 count: 100 - elements: - - VNFC: linux_2VMs-VM1 - local_iface_name: xe0 - ip_address: 192.168.1.2 - - VNFC: linux_2VMs-VM2 - local_iface_name: xe0 - ip_address: 192.168.1.3 - external-connections: - - name: control0 - type: mgmt - VNFC: linux_2VMs-VM1 - local_iface_name: eth0 - description: control interface VM1 - - name: control1 - type: mgmt - VNFC: linux_2VMs-VM2 - local_iface_name: eth0 - description: control interface VM2 - - name: in - type: bridge - VNFC: linux_2VMs-VM1 - local_iface_name: xe1 - description: data interface input - - name: out - type: bridge - VNFC: linux_2VMs-VM2 - local_iface_name: xe1 - description: data interface output - VNFC: - - name: linux_2VMs-VM1 - description: "Linux VM1 with 4 CPUs, 2 GB RAM and 3 bridge interfaces" - #Copy the image to a compute path and edit this path - image name: TestVM - disk: 10 - vcpus: 4 - ram: 2048 - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - - name: xe0 - vpci: "0000:00:11.0" - bandwidth: 1 Mbps - - name: xe1 - vpci: "0000:00:12.0" - bandwidth: 1 Mbps - - name: linux_2VMs-VM2 - description: "Linux VM2 with 2 CPUs, 2 GB RAM and 3 bridge interfaces" - #Copy the image to a compute path and edit this path - image name: TestVM - disk: 10 - vcpus: 2 - ram: 2048 - bridge-ifaces: - - name: eth0 - vpci: "0000:00:09.0" - bandwidth: 1 Mbps # Optional, informative only - - name: xe0 - vpci: "0000:00:11.0" - bandwidth: 1 Mbps - - name: xe1 - vpci: "0000:00:12.0" - bandwidth: 1 Mbps - + vdu: + - id: linux_2VMs-VM1 + name: linux_2VMs-VM1 + description: Generic Linux Virtual Machine + #Copy the image to a compute path and edit this path + image: TestVM + vm-flavor: + memory-mb: '2048' + storage-gb: '10' + vcpu-count: '4' + interface: + - name: eth0 + type: EXTERNAL + virtual-interface: + type: VIRTIO + vpci: "0000:00:09.0" + external-connection-point-ref: eth0 + - name: xe0 + type: INTERNAL + virtual-interface: + type: VIRTIO + vpci: "0000:00:11.0" + internal-connection-point-ref: VM1-xe0 + - name: xe1 + type: EXTERNAL + virtual-interface: + type: VIRTIO + vpci: "0000:00:12.0" + external-connection-point-ref: xe1 + internal-connection-point: + - id: VM1-xe0 + name: VM1-xe0 + short-name: VM1-xe0 + type: VPORT + - id: linux_2VMs-VM2 + name: linux_2VMs-VM2 + description: Generic Linux Virtual Machine + #Copy the image to a compute path and edit this path + image: TestVM + vm-flavor: + memory-mb: '2048' + storage-gb: '10' + vcpu-count: '4' + interface: + - name: eth0 + type: EXTERNAL + virtual-interface: + type: VIRTIO + vpci: "0000:00:09.0" + external-connection-point-ref: eth0 + - name: xe0 + type: INTERNAL + virtual-interface: + type: VIRTIO + vpci: "0000:00:11.0" + internal-connection-point-ref: VM2-xe0 + - name: xe1 + type: EXTERNAL + virtual-interface: + type: VIRTIO + vpci: "0000:00:12.0" + external-connection-point-ref: xe1 + internal-connection-point: + - id: VM2-xe0 + name: VM2-xe0 + short-name: VM2-xe0 + type: VPORT diff --git a/test/test_RO.py b/test/test_RO.py index 6652d56e..932853c5 100755 --- a/test/test_RO.py +++ b/test/test_RO.py @@ -840,87 +840,87 @@ class test_vimconn_new_flavor(test_base): self.assertEqual((context.exception).http_code, 404) -class test_vimconn_new_image(test_base): - - def test_000_new_image(self): - self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], - self.__class__.test_index, - inspect.currentframe().f_code.co_name) - self.__class__.test_index += 1 - - image_path = test_config['image_path'] - if image_path: - self.__class__.image_id = test_config["vim_conn"].new_image({ 'name': 'TestImage', 'location' : image_path, 'metadata': {'upload_location':None} }) - time.sleep(20) - - self.assertIsInstance(self.__class__.image_id, (str, unicode)) - self.assertIsInstance(uuid.UUID(self.__class__.image_id), uuid.UUID) - else: - self.skipTest("Skipping test as image file not present at RO container") - - def test_010_new_image_negative(self): - Non_exist_image_path = '/temp1/cirros.ovf' - - self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], - self.__class__.test_index, - inspect.currentframe().f_code.co_name) - self.__class__.test_index += 1 - - with self.assertRaises(Exception) as context: - test_config["vim_conn"].new_image({ 'name': 'TestImage', 'location' : Non_exist_image_path}) - - self.assertEqual((context.exception).http_code, 400) - - def test_020_delete_image(self): - self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], - self.__class__.test_index, - inspect.currentframe().f_code.co_name) - self.__class__.test_index += 1 - - image_id = test_config["vim_conn"].delete_image(self.__class__.image_id) - - self.assertIsInstance(image_id, (str, unicode)) - - def test_030_delete_image_negative(self): - Non_exist_image_id = str(uuid.uuid4()) - - self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], - self.__class__.test_index, - inspect.currentframe().f_code.co_name) - self.__class__.test_index += 1 - - with self.assertRaises(Exception) as context: - test_config["vim_conn"].delete_image(Non_exist_image_id) - - self.assertEqual((context.exception).http_code, 404) - -class test_vimconn_get_image_id_from_path(test_base): - - def test_000_get_image_id_from_path(self): - self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], - self.__class__.test_index, - inspect.currentframe().f_code.co_name) - self.__class__.test_index += 1 - - image_path = test_config['image_path'] - if image_path: - image_id = test_config["vim_conn"].get_image_id_from_path( image_path ) - self.assertEqual(type(image_id),str) - else: - self.skipTest("Skipping test as image file not present at RO container") - - def test_010_get_image_id_from_path_negative(self): - Non_exist_image_path = '/temp1/cirros.ovf' - - self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], - self.__class__.test_index, - inspect.currentframe().f_code.co_name) - self.__class__.test_index += 1 - - with self.assertRaises(Exception) as context: - test_config["vim_conn"].new_image({ 'name': 'TestImage', 'location' : Non_exist_image_path }) +# class test_vimconn_new_image(test_base): +# +# def test_000_new_image(self): +# self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], +# self.__class__.test_index, +# inspect.currentframe().f_code.co_name) +# self.__class__.test_index += 1 +# +# image_path = test_config['image_path'] +# if image_path: +# self.__class__.image_id = test_config["vim_conn"].new_image({ 'name': 'TestImage', 'location' : image_path, 'metadata': {'upload_location':None} }) +# time.sleep(20) +# +# self.assertIsInstance(self.__class__.image_id, (str, unicode)) +# self.assertIsInstance(uuid.UUID(self.__class__.image_id), uuid.UUID) +# else: +# self.skipTest("Skipping test as image file not present at RO container") +# +# def test_010_new_image_negative(self): +# Non_exist_image_path = '/temp1/cirros.ovf' +# +# self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], +# self.__class__.test_index, +# inspect.currentframe().f_code.co_name) +# self.__class__.test_index += 1 +# +# with self.assertRaises(Exception) as context: +# test_config["vim_conn"].new_image({ 'name': 'TestImage', 'location' : Non_exist_image_path}) +# +# self.assertEqual((context.exception).http_code, 400) +# +# def test_020_delete_image(self): +# self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], +# self.__class__.test_index, +# inspect.currentframe().f_code.co_name) +# self.__class__.test_index += 1 +# +# image_id = test_config["vim_conn"].delete_image(self.__class__.image_id) +# +# self.assertIsInstance(image_id, (str, unicode)) +# +# def test_030_delete_image_negative(self): +# Non_exist_image_id = str(uuid.uuid4()) +# +# self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], +# self.__class__.test_index, +# inspect.currentframe().f_code.co_name) +# self.__class__.test_index += 1 +# +# with self.assertRaises(Exception) as context: +# test_config["vim_conn"].delete_image(Non_exist_image_id) +# +# self.assertEqual((context.exception).http_code, 404) - self.assertEqual((context.exception).http_code, 400) +# class test_vimconn_get_image_id_from_path(test_base): +# +# def test_000_get_image_id_from_path(self): +# self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], +# self.__class__.test_index, +# inspect.currentframe().f_code.co_name) +# self.__class__.test_index += 1 +# +# image_path = test_config['image_path'] +# if image_path: +# image_id = test_config["vim_conn"].get_image_id_from_path( image_path ) +# self.assertEqual(type(image_id),str) +# else: +# self.skipTest("Skipping test as image file not present at RO container") +# +# def test_010_get_image_id_from_path_negative(self): +# Non_exist_image_path = '/temp1/cirros.ovf' +# +# self.__class__.test_text = "{}.{}. TEST {}".format(test_config["test_number"], +# self.__class__.test_index, +# inspect.currentframe().f_code.co_name) +# self.__class__.test_index += 1 +# +# with self.assertRaises(Exception) as context: +# test_config["vim_conn"].new_image({ 'name': 'TestImage', 'location' : Non_exist_image_path }) +# +# self.assertEqual((context.exception).http_code, 400) class test_vimconn_get_image_list(test_base): image_name = None -- 2.17.1