helper methods for creating/destroying vservers
[tests.git] / qaapi / qa / tests / vserver_create.py
1 #!/usr/bin/python
2 import os,sys
3 from Test import Test
4 from qa import utils
5
6 class vserver_create(Test):
7     """
8     Create a vsever given the specified name, reference,
9     mailto options. Installs the specified myplc distro.
10     """
11
12     def call(self, name, fcdistro, mailto):
13         
14         # Create vserver
15         vcreate_script = self.config.vserver_scripts_path + 'vtest-nightly.sh'
16         command = "%(vcreate_script)s -b %(name)s -f %(fcdistro)s -m %(mailto)s -w /tmp/" % locals()
17         (status, output) = utils.commands(command)
18
19         # Start vserver
20         command = "vserver %(name)s start" % locals()
21         (status, output) = utils.commands(command)      
22
23         return 1