From e578599e6e202d9a1e572a8c2b66a5ddd6b61a6c Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Tue, 12 Jul 2016 18:25:30 +0200 Subject: Fix testcase2 JIRA: SDNVPN-31 It seems due to the merge conflict, some of the lines got reordered and the script failed. Also, added the private key for the instances. Change-Id: I58c3dfe5ba2d43e0749ca5cd08b3a87221a68b66 Signed-off-by: jose.lausuch --- test/functest/id_rsa | Bin 0 -> 426 bytes test/functest/testcase_2.py | 32 +++++++++++++++----------------- 2 files changed, 15 insertions(+), 17 deletions(-) create mode 100644 test/functest/id_rsa (limited to 'test') diff --git a/test/functest/id_rsa b/test/functest/id_rsa new file mode 100644 index 0000000..d590406 Binary files /dev/null and b/test/functest/id_rsa differ diff --git a/test/functest/testcase_2.py b/test/functest/testcase_2.py index 4a51111..76757d6 100644 --- a/test/functest/testcase_2.py +++ b/test/functest/testcase_2.py @@ -164,11 +164,26 @@ def create_instance(nova_client, # Retrieve IP of INSTANCE # instance_ip = instance.networks.get(network_id)[0] + logger.debug("Adding '%s' to security group '%s'..." + % (name, SECGROUP_NAME)) + os_utils.add_secgroup_to_instance(nova_client, instance.id, sg_id) + + return instance + +def generate_userdata_common(): + return ("#!/bin/sh\n" + "sudo mkdir -p /home/cirros/.ssh/\n" + "sudo chown cirros:cirros /home/cirros/.ssh/\n" + "sudo chown cirros:cirros /home/cirros/id_rsa\n" + "mv /home/cirros/id_rsa /home/cirros/.ssh/\n" "sudo echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgnWtSS98Am516e" "stBsq0jbyOB4eLMUYDdgzsUHsnxFQCtACwwAg9/2uq3FoGUBUWeHZNsT6jcK9" "sCMEYiS479CUCzbrxcd8XaIlK38HECcDVglgBNwNzX/WDfMejXpKzZG61s98rU" "ElNvZ0YDqhaqZGqxIV4ejalqLjYrQkoly3R+2k= " + "cirros@test1>/home/cirros/.ssh/authorized_keys\n" + "sudo chown cirros:cirros /home/cirros/.ssh/authorized_keys\n" + "chmod 700 /home/cirros/.ssh\n" "chmod 644 /home/cirros/.ssh/authorized_keys\n" "chmod 600 /home/cirros/.ssh/id_rsa\n" ) @@ -461,20 +476,3 @@ def main(): if __name__ == '__main__': main() - - "cirros@test1>/home/cirros/.ssh/authorized_keys\n" - "sudo chown cirros:cirros /home/cirros/.ssh/authorized_keys\n" - "chmod 700 /home/cirros/.ssh\n" - "sudo chown cirros:cirros /home/cirros/.ssh/\n" - "sudo chown cirros:cirros /home/cirros/id_rsa\n" - "mv /home/cirros/id_rsa /home/cirros/.ssh/\n" -def generate_userdata_common(): - return ("#!/bin/sh\n" - "sudo mkdir -p /home/cirros/.ssh/\n" - return instance - - - logger.debug("Adding '%s' to security group '%s'..." - % (name, SECGROUP_NAME)) - os_utils.add_secgroup_to_instance(nova_client, instance.id, sg_id) - -- cgit 1.2.3-korg