summaryrefslogtreecommitdiffstats
path: root/test/functest/testcase_2.py
diff options
context:
space:
mode:
authorjose.lausuch <jose.lausuch@ericsson.com>2016-07-12 18:25:30 +0200
committerjose.lausuch <jose.lausuch@ericsson.com>2016-07-13 16:09:54 +0200
commite578599e6e202d9a1e572a8c2b66a5ddd6b61a6c (patch)
tree691db55111f4717b259dc91610312a01992182a1 /test/functest/testcase_2.py
parentb2058a81210e70dbfc3bcf1f5ed9f7cdbc73c62a (diff)
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 <jose.lausuch@ericsson.com>
Diffstat (limited to 'test/functest/testcase_2.py')
-rw-r--r--test/functest/testcase_2.py32
1 files changed, 15 insertions, 17 deletions
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)
-