From 33e28d7a7016afff06caed947ed8769a840d77c3 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Mon, 6 May 2024 12:34:05 +0200 Subject: [PATCH 1/3] Increase timeout --- test/integration/QuickTestIM.py | 12 ++++++------ test/integration/TestIM.py | 24 ++++++++++++------------ test/integration/TestREST.py | 10 +++++----- test/integration/TestREST_JSON.py | 6 +++--- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/test/integration/QuickTestIM.py b/test/integration/QuickTestIM.py index 4ffd1390..deeb5438 100755 --- a/test/integration/QuickTestIM.py +++ b/test/integration/QuickTestIM.py @@ -140,7 +140,7 @@ def test_11_create(self): success, msg="ERROR calling CreateInfrastructure: " + str(inf_id)) self.__class__.inf_id = inf_id - all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 900) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 1200) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -236,7 +236,7 @@ def test_19_addresource(self): self.assertEqual(len(vm_ids), 3, msg=("ERROR getting infrastructure info: Incorrect number of VMs(" + str(len(vm_ids)) + "). It must be 3")) - all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 900) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 1200) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -301,7 +301,7 @@ def test_22_removeresource(self): self.assertEqual(vm_state, VirtualMachine.RUNNING, msg="ERROR unexpected state. Expected 'running' and obtained " + vm_state) - all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 600) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 900) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -341,7 +341,7 @@ def test_24_reconfigure(self): self.inf_id, "", self.auth_data) self.assertTrue(success, msg="ERROR calling Reconfigure: " + str(res)) - all_stopped = self.wait_inf_state(VirtualMachine.CONFIGURED, 600) + all_stopped = self.wait_inf_state(VirtualMachine.CONFIGURED, 900) self.assertTrue( all_stopped, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -353,7 +353,7 @@ def test_25_reconfigure_vmlist(self): self.inf_id, "", self.auth_data, [0]) self.assertTrue(success, msg="ERROR calling Reconfigure: " + str(res)) - all_stopped = self.wait_inf_state(VirtualMachine.CONFIGURED, 600) + all_stopped = self.wait_inf_state(VirtualMachine.CONFIGURED, 900) self.assertTrue( all_stopped, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -366,7 +366,7 @@ def test_26_reconfigure_radl(self): self.inf_id, radl, self.auth_data) self.assertTrue(success, msg="ERROR calling Reconfigure: " + str(res)) - all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 600) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 900) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") diff --git a/test/integration/TestIM.py b/test/integration/TestIM.py index d82cbf04..9ad7b1ce 100755 --- a/test/integration/TestIM.py +++ b/test/integration/TestIM.py @@ -154,7 +154,7 @@ def test_11_create(self): self.__class__.inf_id = inf_id all_configured = self.wait_inf_state( - inf_id, VirtualMachine.CONFIGURED, 1800) + inf_id, VirtualMachine.CONFIGURED, 2400) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -272,7 +272,7 @@ def test_19_addresource(self): str(len(vm_ids)) + "). It must be 4")) all_configured = self.wait_inf_state( - self.inf_id, VirtualMachine.CONFIGURED, 1200) + self.inf_id, VirtualMachine.CONFIGURED, 1500) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -337,7 +337,7 @@ def test_22_removeresource(self): msg="ERROR unexpected state. Expected 'running' and obtained " + vm_state) all_configured = self.wait_inf_state( - self.inf_id, VirtualMachine.CONFIGURED, 900) + self.inf_id, VirtualMachine.CONFIGURED, 1200) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -377,7 +377,7 @@ def test_24_reconfigure(self): self.assertTrue(success, msg="ERROR calling Reconfigure: " + str(res)) all_stopped = self.wait_inf_state( - self.inf_id, VirtualMachine.CONFIGURED, 600) + self.inf_id, VirtualMachine.CONFIGURED, 900) self.assertTrue( all_stopped, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -390,7 +390,7 @@ def test_25_reconfigure_vmlist(self): self.assertTrue(success, msg="ERROR calling Reconfigure: " + str(res)) all_stopped = self.wait_inf_state( - self.inf_id, VirtualMachine.CONFIGURED, 600) + self.inf_id, VirtualMachine.CONFIGURED, 900) self.assertTrue( all_stopped, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -404,7 +404,7 @@ def test_26_reconfigure_radl(self): self.assertTrue(success, msg="ERROR calling Reconfigure: " + str(res)) all_configured = self.wait_inf_state( - self.inf_id, VirtualMachine.CONFIGURED, 600) + self.inf_id, VirtualMachine.CONFIGURED, 900) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -635,7 +635,7 @@ def test_80_create_ansible_host(self): self.__class__.inf_id = [inf_id] all_configured = self.wait_inf_state( - inf_id, VirtualMachine.CONFIGURED, 600) + inf_id, VirtualMachine.CONFIGURED, 900) self.assertTrue( all_configured, msg="ERROR waiting the ansible master to be configured (timeout).") @@ -672,7 +672,7 @@ def test_80_create_ansible_host(self): self.__class__.inf_id.append(inf_id) all_configured = self.wait_inf_state( - inf_id, VirtualMachine.CONFIGURED, 600) + inf_id, VirtualMachine.CONFIGURED, 900) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -698,7 +698,7 @@ def test_90_create(self): self.__class__.inf_id = [inf_id] all_configured = self.wait_inf_state( - inf_id, VirtualMachine.CONFIGURED, 1500) + inf_id, VirtualMachine.CONFIGURED, 1800) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -723,7 +723,7 @@ def test_96_create(self): success, msg="ERROR calling CreateInfrastructure: " + str(inf_id)) self.__class__.inf_id = [inf_id] - all_configured = self.wait_inf_state(inf_id, VirtualMachine.CONFIGURED, 600) + all_configured = self.wait_inf_state(inf_id, VirtualMachine.CONFIGURED, 900) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -759,7 +759,7 @@ def test_98_proxy(self): self.assertTrue(success, msg="ERROR calling CreateInfrastructure: " + str(inf_id)) self.__class__.inf_id = [inf_id] - all_configured = self.wait_inf_state(inf_id, VirtualMachine.CONFIGURED, 600) + all_configured = self.wait_inf_state(inf_id, VirtualMachine.CONFIGURED, 900) self.assertTrue(all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") (success, vminfo) = self.server.GetVMInfo(inf_id, 0, self.auth_data) @@ -786,7 +786,7 @@ def test_98_proxy(self): (success, inf_id2) = self.server.CreateInfrastructure(radl, self.auth_data) self.__class__.inf_id.append(inf_id2) - all_configured = self.wait_inf_state(inf_id2, VirtualMachine.CONFIGURED, 600) + all_configured = self.wait_inf_state(inf_id2, VirtualMachine.CONFIGURED, 900) self.assertTrue(all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") def test_99_destroy(self): diff --git a/test/integration/TestREST.py b/test/integration/TestREST.py index 96e1876f..c7dd8c42 100755 --- a/test/integration/TestREST.py +++ b/test/integration/TestREST.py @@ -190,7 +190,7 @@ def test_20_create(self): self.__class__.inf_id = str(os.path.basename(resp.text)) - all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 600) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 900) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -278,7 +278,7 @@ def test_40_addresource(self): vm_ids = resp.text.split("\n") self.assertEqual(len(vm_ids), 2, 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) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 900) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -443,7 +443,7 @@ def test_93_create_tosca(self): self.__class__.inf_id = str(os.path.basename(resp.text)) - all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 1800) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 2400) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -473,7 +473,7 @@ def test_95_add_tosca(self): vm_ids = resp.text.split("\n") 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, 1200) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 1500) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -494,7 +494,7 @@ def test_96_remove_tosca(self): vm_ids = resp.text.split("\n") self.assertEqual(len(vm_ids), 2, 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, 900) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 1200) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") diff --git a/test/integration/TestREST_JSON.py b/test/integration/TestREST_JSON.py index f8a056a5..30b26124 100755 --- a/test/integration/TestREST_JSON.py +++ b/test/integration/TestREST_JSON.py @@ -141,7 +141,7 @@ def test_20_create(self): self.__class__.inf_id = str(os.path.basename(resp.text)) - all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 1200) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 1500) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -175,7 +175,7 @@ def test_40_addresource(self): vm_ids = resp.text.split("\n") 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) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 900) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") @@ -195,7 +195,7 @@ def test_55_reconfigure(self): body=new_config) self.assertEqual(resp.status_code, 200, msg="ERROR reconfiguring:" + resp.text) - all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 500) + all_configured = self.wait_inf_state(VirtualMachine.CONFIGURED, 800) self.assertTrue( all_configured, msg="ERROR waiting the infrastructure to be configured (timeout).") From 6aa584a7c062e1e4223b9f5c4b19c58350ac0211 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Fri, 10 May 2024 09:16:59 +0200 Subject: [PATCH 2/3] Add old galaxy sever in conf-ansible --- contextualization/conf-ansible.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contextualization/conf-ansible.yml b/contextualization/conf-ansible.yml index 5ea7096c..1da87a2c 100644 --- a/contextualization/conf-ansible.yml +++ b/contextualization/conf-ansible.yml @@ -232,3 +232,6 @@ - { section: 'defaults', option: 'ansible_python_interpreter', value: 'auto' } - { section: 'defaults', option: 'transport', value: 'ssh' } - { section: 'ssh_connection', option: 'ssh_args', value: '-o ControlMaster=auto -o ControlPersist=900s -o UserKnownHostsFile=/dev/null' } + - { section: 'galaxy', option: 'server_list', value: 'galaxy, oldgalaxy' } + - { section: 'galaxy_server.galaxy', option: 'url', value: 'https://galaxy.ansible.com/api/' } + - { section: 'galaxy_server.oldgalaxy', option: 'url', value: 'https://old-galaxy.ansible.com/api/' } From 885a9115c8822ef400e0c9c9b2d6868d3592b9d2 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Fri, 10 May 2024 11:35:00 +0200 Subject: [PATCH 3/3] Fix ansible_install script --- contextualization/ansible_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contextualization/ansible_install.sh b/contextualization/ansible_install.sh index caea5aa8..0ad3fce6 100755 --- a/contextualization/ansible_install.sh +++ b/contextualization/ansible_install.sh @@ -1,6 +1,6 @@ #!/bin/sh -ANSIBLE_VERSION="2.9.21" +ANSIBLE_VERSION="4.10.0" distribution_id() { RETVAL="" @@ -71,7 +71,7 @@ else pip3 install "pip>=20.0" pip3 install -U "setuptools<66.0" - pip3 install "pyOpenSSL>20.0,<22.1.0" "cryptography>37.0.0,<39.0.0" pyyaml jmespath scp "paramiko>=2.9.5" --prefer-binary + pip3 install "pyOpenSSL>20.0,<22.1.0" "cryptography>37.0.0,<39.0.0" pyyaml jmespath scp "paramiko>=2.9.5" packaging --prefer-binary pip3 install ansible==$ANSIBLE_VERSION --prefer-binary fi