helper methods for creating/destroying vservers
authorTony Mack <tmack@cs.princeton.edu>
Wed, 26 Mar 2008 00:39:27 +0000 (00:39 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Wed, 26 Mar 2008 00:39:27 +0000 (00:39 +0000)
qaapi/qa/tests/vserver_create.py [new file with mode: 0644]
qaapi/qa/tests/vserver_delete.py [new file with mode: 0644]

diff --git a/qaapi/qa/tests/vserver_create.py b/qaapi/qa/tests/vserver_create.py
new file mode 100644 (file)
index 0000000..623af97
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+import os,sys
+from Test import Test
+from qa import utils
+
+class vserver_create(Test):
+    """
+    Create a vsever given the specified name, reference,
+    mailto options. Installs the specified myplc distro.
+    """
+
+    def call(self, name, fcdistro, mailto):
+       
+       # Create vserver
+       vcreate_script = self.config.vserver_scripts_path + 'vtest-nightly.sh'
+       command = "%(vcreate_script)s -b %(name)s -f %(fcdistro)s -m %(mailto)s -w /tmp/" % locals()
+       (status, output) = utils.commands(command)
+
+       # Start vserver
+       command = "vserver %(name)s start" % locals()
+       (status, output) = utils.commands(command)      
+
+       return 1 
diff --git a/qaapi/qa/tests/vserver_delete.py b/qaapi/qa/tests/vserver_delete.py
new file mode 100644 (file)
index 0000000..344ec63
--- /dev/null
@@ -0,0 +1,16 @@
+#!/usr/bin/python
+import os,sys
+from Test import Test
+from qa import utils
+
+class vserver_delete(Test):
+    """
+    Delete the specified vserver
+    """
+
+    def call(self, name):
+        (status, output) = utils.commands("vserver %(name)s stop" % locals(), False)
+        (status, output) = utils.commands("vserver %(name)s delete" % locals())
+
+        return 1
+