You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ml...@apache.org on 2013/01/30 23:12:10 UTC

git commit: Summary: Add in testing definitions for add/remove nic in marvin base.py

Updated Branches:
  refs/heads/add_remove_nics e8fcdcbfe -> e430b7aed


Summary: Add in testing definitions for add/remove nic in marvin base.py

Submitted-by: Ryan Dietrich <ry...@betterservers.com>
Signed-off-by: Marcus Sorensen <ma...@betterservers.com> 1359583956 -0700


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

Branch: refs/heads/add_remove_nics
Commit: e430b7aeddfd8a5b5a5b129a86e366484210c6ab
Parents: e8fcdcb
Author: Marcus Sorensen <ma...@betterservers.com>
Authored: Wed Jan 30 15:12:36 2013 -0700
Committer: Marcus Sorensen <ma...@betterservers.com>
Committed: Wed Jan 30 15:12:36 2013 -0700

----------------------------------------------------------------------
 tools/marvin/marvin/integration/lib/base.py |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/e430b7ae/tools/marvin/marvin/integration/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py
index 87b0bbb..830914c 100644
--- a/tools/marvin/marvin/integration/lib/base.py
+++ b/tools/marvin/marvin/integration/lib/base.py
@@ -389,6 +389,27 @@ class VirtualMachine:
         cmd.id = volume.id
         return apiclient.detachVolume(cmd)
 
+    def add_nic(self, apiclient, networkId):
+        """Add a NIC to a VM"""
+        cmd = addNicToVirtualMachine.addNicToVirtualMachineCmd();
+        cmd.virtualmachineid = self.id
+        cmd.networkid = networkId
+        return apiclient.addNicToVirtualMachine(cmd)
+
+    def remove_nic(self, apiclient, nicId):
+        """Remove a NIC to a VM"""
+        cmd = removeNicFromVirtualMachine.removeNicFromVirtualMachineCmd()
+        cmd.nicid = nicId
+        cmd.virtualmachineid = self.id
+        return apiclient.removeNicFromVirtualMachine(cmd)
+
+    def update_default_nic(self, apiclient, nicId):
+        """Set a NIC to be the default network adapter for a VM"""
+        cmd = updateDefaultNicForVirtualMachine.updateDefaultNicForVirtualMachineCmd()
+        cmd.nicid = nicId
+        cmd.virtualmachineid = self.id
+        return apiclient.updateDefaultNicForVirtualMachine(cmd)
+
     @classmethod
     def list(cls, apiclient, **kwargs):
         """List all VMs matching criteria"""