summaryrefslogtreecommitdiff
path: root/selftest/target
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-04 16:01:18 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-04 18:02:07 +0100
commit3a6e4cf2b1a88f3ab6631e75ca2e1be5273b2f8f (patch)
tree11f586290b2e3bf9729fa7cdc6189f54b2fcefde /selftest/target
parentcd9cf4797204f307defda7482360580558c5ee44 (diff)
downloadsamba-3a6e4cf2b1a88f3ab6631e75ca2e1be5273b2f8f.tar.gz
samba-3a6e4cf2b1a88f3ab6631e75ca2e1be5273b2f8f.tar.bz2
samba-3a6e4cf2b1a88f3ab6631e75ca2e1be5273b2f8f.zip
selftest.target: Add NoneTarget.
Diffstat (limited to 'selftest/target')
-rw-r--r--selftest/target/__init__.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/selftest/target/__init__.py b/selftest/target/__init__.py
index b6a297ce02..4c95c74895 100644
--- a/selftest/target/__init__.py
+++ b/selftest/target/__init__.py
@@ -29,6 +29,14 @@ class EnvironmentDown(Exception):
super(EnvironmentDown, self).__init__("environment went down: %s" % msg)
+class UnsupportedEnvironment(Exception):
+ """Indicates a particular environment is not supported."""
+
+ def __init__(self, target, envname):
+ super(UnsupportedEnvironment, self).__init__(
+ "Target %s does not support environment %s" % (target, envname))
+
+
class Target(object):
"""A target for Samba tests."""
@@ -93,6 +101,15 @@ class NoneEnvironment(Environment):
return {}
+class NoneTarget(Target):
+ """Target that can only provide the 'none' environment."""
+
+ name = "none"
+
+ def setup_env(self, envname, prefix):
+ raise UnsupportedEnvironment(self.name, envname)
+
+
class EnvironmentManager(object):
"""Manager of environments."""