From 7fbea95db114ac68b23dec148e5be41cb1e02036 Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 19 Dec 2018 15:39:17 +0100 Subject: [PATCH 1/3] Change tests to use only 1 pub ip --- test/files/test_simple.json | 24 +++++++++++++++++++++++- test/files/tosca_add.yml | 6 +++--- test/integration/TestREST_JSON.py | 6 +++--- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/test/files/test_simple.json b/test/files/test_simple.json index e52cf6f6b..7745fd85b 100644 --- a/test/files/test_simple.json +++ b/test/files/test_simple.json @@ -4,6 +4,10 @@ "id": "publica", "outbound": "yes" }, + { + "class": "network", + "id": "privada" + }, { "class": "system", "cpu.arch": "x86_64", @@ -14,11 +18,29 @@ "disk.0.os.name": "linux", "id": "front", "memory.size_min": 536870912, - "net_interface.0.connection": "publica" + "net_interface.0.connection": "publica", + "net_interface.1.connection": "privada" + }, + { + "class": "system", + "cpu.arch": "x86_64", + "cpu.count_min": 1, + "disk.0.image.url": "one://ramses.i3m.upv.es/95", + "disk.0.os.credentials.password": "yoyoyo", + "disk.0.os.credentials.username": "ubuntu", + "disk.0.os.name": "linux", + "id": "wn", + "memory.size_min": 536870912, + "net_interface.0.connection": "privada" }, { "class": "deploy", "system": "front", "vm_number": 1 + }, + { + "class": "deploy", + "system": "wn", + "vm_number": 1 } ] \ No newline at end of file diff --git a/test/files/tosca_add.yml b/test/files/tosca_add.yml index b394be9a4..aea80a66e 100644 --- a/test/files/tosca_add.yml +++ b/test/files/tosca_add.yml @@ -48,9 +48,6 @@ topology_template: protocol: tcp source: 80 capabilities: - scalable: - properties: - count: 2 # Host container properties host: properties: @@ -98,6 +95,9 @@ topology_template: db_server: type: tosca.nodes.Compute capabilities: + scalable: + properties: + count: 2 # Host container properties host: properties: diff --git a/test/integration/TestREST_JSON.py b/test/integration/TestREST_JSON.py index f6bb54494..57fdc8e0d 100755 --- a/test/integration/TestREST_JSON.py +++ b/test/integration/TestREST_JSON.py @@ -31,8 +31,8 @@ from radl.radl_json import parse_radl as parse_radl_json PID = None -RADL_ADD = """[{"class":"network","reference":true,"id":"publica"}, -{"class":"system","reference":true,"id":"front"},{"vm_number":1,"class":"deploy","system":"front"}]""" +RADL_ADD = """[{"class":"network","reference":true,"id":"privada"}, +{"class":"system","reference":true,"id":"wn"},{"vm_number":1,"class":"deploy","system":"wn"}]""" HOSTNAME = "localhost" TEST_PORT = 8800 @@ -164,7 +164,7 @@ def test_40_addresource(self): self.assertEqual(resp.status_code, 200, msg="ERROR getting the infrastructure info:" + resp.text) vm_ids = resp.text.split("\n") - self.assertEqual(len(vm_ids), 2, msg=("ERROR getting infrastructure info: Incorrect number of VMs(" + + self.assertEqual(len(vm_ids), 3, msg=("ERROR getting infrastructure info: Incorrect number of VMs(" + str(len(vm_ids)) + "). It must be 2")) all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 600) self.assertTrue( From 2f4cc2b1b917dfd9b18cf9b0a12709724f9e6bda Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 19 Dec 2018 16:10:01 +0100 Subject: [PATCH 2/3] Fix error test --- test/files/tosca_add.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/files/tosca_add.yml b/test/files/tosca_add.yml index aea80a66e..1d61b374f 100644 --- a/test/files/tosca_add.yml +++ b/test/files/tosca_add.yml @@ -93,7 +93,7 @@ topology_template: node: db_server db_server: - type: tosca.nodes.Compute + type: tosca.nodes.indigo.Compute capabilities: scalable: properties: From 22e892a53f7b59d5150fc193b71e922fdcf6293d Mon Sep 17 00:00:00 2001 From: micafer Date: Wed, 19 Dec 2018 16:51:12 +0100 Subject: [PATCH 3/3] Fix test --- test/files/tosca_remove.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/files/tosca_remove.yml b/test/files/tosca_remove.yml index 997af4cef..5fd4ced90 100644 --- a/test/files/tosca_remove.yml +++ b/test/files/tosca_remove.yml @@ -49,10 +49,6 @@ topology_template: protocol: tcp source: 80 capabilities: - scalable: - properties: - count: 1 - removal_list: ['2'] # Host container properties host: properties: @@ -98,8 +94,12 @@ topology_template: node: db_server db_server: - type: tosca.nodes.Compute + type: tosca.nodes.indigo.Compute capabilities: + scalable: + properties: + count: 1 + removal_list: ['2'] # Host container properties host: properties: