diff options
author | Tim Irnich <tim.irnich@ericsson.com> | 2016-07-14 09:14:31 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-07-14 09:14:31 +0000 |
commit | 95252994f4b1ff4369c49ce4ef024469d8b6df7d (patch) | |
tree | 781855dc1745f71be3ce1f3fe666c11e535e0e9a /test | |
parent | d118ba357ece52c37e03d26ed114ec59f57c2ca5 (diff) | |
parent | e578599e6e202d9a1e572a8c2b66a5ddd6b61a6c (diff) |
Merge "Fix testcase2"
Diffstat (limited to 'test')
-rw-r--r-- | test/functest/id_rsa | bin | 0 -> 426 bytes | |||
-rw-r--r-- | test/functest/testcase_2.py | 32 |
2 files changed, 15 insertions, 17 deletions
diff --git a/test/functest/id_rsa b/test/functest/id_rsa Binary files differnew file mode 100644 index 0000000..d590406 --- /dev/null +++ b/test/functest/id_rsa 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) - |