summaryrefslogtreecommitdiff
path: root/wintest/wintest.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-30 11:54:55 +1100
committerAndrew Tridgell <tridge@samba.org>2010-12-01 11:03:25 +1100
commit1079195a7652e890d6e683f4f29d0454d72141e6 (patch)
treecfab1fef091344c93bdf135e0c4c5422a24aea89 /wintest/wintest.py
parent47e8cbe3d630bef40e2564963177e08b65102aff (diff)
downloadsamba-1079195a7652e890d6e683f4f29d0454d72141e6.tar.gz
wintest: added --vms option
this allows you to run tests associated with a specified list of VMs
Diffstat (limited to 'wintest/wintest.py')
-rw-r--r--wintest/wintest.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/wintest/wintest.py b/wintest/wintest.py
index 67af51a313b..c98083f57d2 100644
--- a/wintest/wintest.py
+++ b/wintest/wintest.py
@@ -11,6 +11,7 @@ class wintest():
def __init__(self):
self.vars = {}
self.list_mode = False
+ self.vms = None
os.putenv('PYTHONUNBUFFERED', '1')
def setvar(self, varname, value):
@@ -59,6 +60,10 @@ class wintest():
'''set a list of tests to skip'''
self.skiplist = skiplist.split(',')
+ def set_vms(self, vms):
+ '''set a list of VMs to test'''
+ self.vms = vms.split(',')
+
def skip(self, step):
'''return True if we should skip a step'''
if self.list_mode:
@@ -96,6 +101,13 @@ class wintest():
'''see if a variable has been set'''
return varname in self.vars
+ def have_vm(self, vmname):
+ '''see if a VM should be used'''
+ if not self.have_var(vmname + '_VM'):
+ return False
+ if self.vms is None:
+ return True
+ return vmname in self.vms
def putenv(self, key, value):
'''putenv with substitution'''