cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [37/50] [abbrv] git commit: updated refs/heads/4.9-mvn-upgrade to 7617117
Date Tue, 22 Mar 2016 11:44:34 GMT
Made the code Pyflakes compliant


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/65d7ae37
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/65d7ae37
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/65d7ae37

Branch: refs/heads/4.9-mvn-upgrade
Commit: 65d7ae379d8bf5bc39fc1aa384b1edbf61a248b0
Parents: 1446ecd
Author: Sowmya <sowmya.neeladhuri@nokia.com>
Authored: Mon Mar 14 18:06:28 2016 -0700
Committer: Sowmya <sowmya.neeladhuri@nokia.com>
Committed: Mon Mar 14 18:06:28 2016 -0700

----------------------------------------------------------------------
 .../plugins/nuagevsp/nuageTestCase.py           | 27 ----------
 .../nuagevsp/test_nuage_password_reset.py       | 55 +++++++++++++++-----
 2 files changed, 41 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65d7ae37/test/integration/plugins/nuagevsp/nuageTestCase.py
----------------------------------------------------------------------
diff --git a/test/integration/plugins/nuagevsp/nuageTestCase.py b/test/integration/plugins/nuagevsp/nuageTestCase.py
index cb13f19..55199d5 100644
--- a/test/integration/plugins/nuagevsp/nuageTestCase.py
+++ b/test/integration/plugins/nuagevsp/nuageTestCase.py
@@ -48,9 +48,6 @@ from marvin.cloudstackAPI import (listPhysicalNetworks,
                                   listHypervisors,
                                   stopRouter,
                                   startRouter)
-# Import nosetests Modules
-from nose.plugins.attrib import attr
-
 # Import System Modules
 import socket
 import importlib
@@ -318,30 +315,6 @@ class nuageTestCase(cloudstackTestCase):
         self.cleanup.append(vm)
         return vm
 
-    # starts the given vm
-    def start(self, apiclient):
-        """Start the instance"""
-        cmd = startVirtualMachine.startVirtualMachineCmd()
-        cmd.id = self.id
-        apiclient.startVirtualMachine(cmd)
-        response = self.getState(apiclient, VirtualMachine.RUNNING)
-        if response[0] == FAIL:
-            raise Exception(response[1])
-        return
-
-    # stops the given vm
-    def stop(self, apiclient, forced=None):
-        """Stop the instance"""
-        cmd = stopVirtualMachine.stopVirtualMachineCmd()
-        cmd.id = self.id
-        if forced:
-            cmd.forced = forced
-        apiclient.stopVirtualMachine(cmd)
-        response = self.getState(apiclient, VirtualMachine.STOPPED)
-        if response[0] == FAIL:
-            raise Exception(response[1])
-        return
-
     # delete_VM - Deletes the given VM
     def delete_VM(self, vm):
         self.debug('Deleting VM - %s' % vm.name)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/65d7ae37/test/integration/plugins/nuagevsp/test_nuage_password_reset.py
----------------------------------------------------------------------
diff --git a/test/integration/plugins/nuagevsp/test_nuage_password_reset.py b/test/integration/plugins/nuagevsp/test_nuage_password_reset.py
index 3e600c2..5582819 100644
--- a/test/integration/plugins/nuagevsp/test_nuage_password_reset.py
+++ b/test/integration/plugins/nuagevsp/test_nuage_password_reset.py
@@ -18,13 +18,14 @@
 """ Component tests for - userdata
 """
 # Import Local Modules
-from marvin.lib.base import (VirtualMachine,
-                             Account,
-                             PublicIPAddress)
+from marvin.lib.base import (Account,
+                             VirtualMachine,
+                             Volume,
+                             Template)
 from nose.plugins.attrib import attr
 from nuageTestCase import nuageTestCase
-from marvin.cloudstackAPI import (createTemplate,
-                                  listVolumes)
+from marvin.lib.utils import cleanup_resources
+from marvin.cloudstackAPI import startVirtualMachine
 import base64
 
 
@@ -69,12 +70,10 @@ class TestNuagePasswordReset(nuageTestCase):
     # create_template - Takes the VM object as the argument to create the template
     def create_template(self, vm):
         self.debug("CREATE TEMPLATE")
-        list_volume = list_volumes(
-            self.apiclient,
-            virtualmachineid=vm.id,
-            type='ROOT',
-            listall=True
-        )
+        list_volume = Volume.list(self.apiclient,
+                                  virtualmachineid=vm.id,
+                                  type='ROOT',
+                                  listall=True)
         if isinstance(list_volume, list):
             self.volume = list_volume[0]
         else:
@@ -115,7 +114,6 @@ class TestNuagePasswordReset(nuageTestCase):
 
         # VSD verification
         self.verify_vsp_floating_ip(network, vm, public_ip.ipaddress)
-        vm_public_ip = public_ip.ipaddress.ipaddress
 
         fw_rule = self.create_firewall_rule(public_ip, self.test_data["ingress_rule"])
         self.verify_vsp_firewall_rule(fw_rule)
@@ -131,6 +129,35 @@ class TestNuagePasswordReset(nuageTestCase):
         if not gotFirewallPolicy:
             raise ValueError('No firewall policy decision in vm interface')
 
+    def stop_vm(self, vm):
+        self.debug("STOP VM")
+        vm.stop(self.apiclient)
+        list_vm_response = VirtualMachine.list(self.apiclient,
+                                               id=vm.id)
+        if isinstance(list_vm_response, list):
+            vm = list_vm_response[0]
+            if vm.state != 'Stopped':
+                raise Exception("Failed to stop VM (ID: %s) " %
+                                self.vm.id)
+        else:
+            raise Exception("Invalid response from list_virtual_machines VM (ID: %s) " %
+                            self.vm.id)
+
+    def install_cloud_set_guest_password_script(self, ssh_client):
+        self.debug("GET CLOUD-SET-GUEST-PASSWORD")
+        cmd = "cd /etc/init.d;wget http://people.apache.org/~tsp/cloud-set-guest-password"
+        result = self.execute_cmd(ssh_client, cmd)
+        self.debug("WGET CLOUD-SET-GUEST-PASSWORD: " + result)
+        if "200 OK" not in result:
+            self.fail("failed to get file cloud-set-guest-password")
+        cmds = ["chmod +x /etc/init.d/cloud-set-guest-password",
+                "chkconfig --add cloud-set-guest-password"
+                ]
+        for c in cmds:
+            result = self.execute_cmd(ssh_client, c)
+            self.debug("get_set_password_file cmd " + c)
+            self.debug("get_set_password_file result " + result)
+
     @attr(tags=["advanced", "nuagevsp"], required_hardware="true")
     def test_01_UserDataPasswordReset(self):
         self.debug("START USER DATA PASSWORD RESET ON VM")
@@ -211,7 +238,7 @@ class TestNuagePasswordReset(nuageTestCase):
             self.stop_vm(self.vm_1)
             self.create_template(self.vm_1)
             self.debug("DEPLOY VM 2 IN TEST NETWORK WITH NEW TEMPLATE")
-            self.vm_1 = self.create_VM_in_Network(self.network_1, "virtual_machine_pr")
+            self.vm_2 = self.create_VM_in_Network(self.network_1, "virtual_machine_pr")
             self.remove_vm2 = True
             self.debug("STARTING VM_2 ")
             startCmd = startVirtualMachine.startVirtualMachineCmd()
@@ -225,7 +252,7 @@ class TestNuagePasswordReset(nuageTestCase):
                                 "Password enabled not working. Password same as virtual_machine
password "
                                 )
             self.verify_vsp_vm(vm_2a)
-            self.debug("GET PUBLIC IP,  CREATE AND VERIFY FIREWALL RULES")
+            self.debug("GET PUBLIC IP.  CREATE AND VERIFIED FIREWALL RULES")
             public_ip_2 = self.acquire_Public_IP(self.network_1)
             self.create_and_verify_fw(self.vm_2, public_ip_2, self.network_1)
 


Mime
View raw message