summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2012-08-03 09:29:31 -0400
committerMartin Kosek <mkosek@redhat.com>2012-08-03 16:26:54 +0200
commit36c4778bc66a6435b578268143a2eee766ab9f9c (patch)
tree7b142fb486c09b3b8ee914d80d721be2276e8346 /tests
parent72cc54bc2798125a7e0ca3eb08fcc8b973b8844e (diff)
downloadfreeipa-36c4778bc66a6435b578268143a2eee766ab9f9c.tar.gz
freeipa-36c4778bc66a6435b578268143a2eee766ab9f9c.tar.xz
freeipa-36c4778bc66a6435b578268143a2eee766ab9f9c.zip
Adds check for ipa-join.
If the executable ipa-client/ipa-join is not found, the relevant tests are skipped. Implemented in setUpClass() method, also moved the mkstemp() call there. https://fedorahosted.org/freeipa/ticket/2905
Diffstat (limited to 'tests')
-rw-r--r--tests/test_xmlrpc/test_host_plugin.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/test_xmlrpc/test_host_plugin.py b/tests/test_xmlrpc/test_host_plugin.py
index 03aa089a2..c9ec6a2bd 100644
--- a/tests/test_xmlrpc/test_host_plugin.py
+++ b/tests/test_xmlrpc/test_host_plugin.py
@@ -28,6 +28,7 @@ from ipapython import ipautil
from ipalib import api, errors, x509
from ipalib.dn import *
from nose.tools import raises, assert_raises
+from nose.plugins.skip import Skip, SkipTest
from tests.test_xmlrpc.xmlrpc_test import (Declarative, XMLRPC_test,
fuzzy_uuid, fuzzy_digits, fuzzy_hash, fuzzy_date, fuzzy_issuer,
fuzzy_hex)
@@ -751,10 +752,17 @@ class test_host_false_pwd_change(XMLRPC_test):
fqdn1 = u'testhost1.%s' % api.env.domain
short1 = u'testhost1'
new_pass = u'pass_123'
-
command = "ipa-client/ipa-join"
- [keytabfd, keytabname] = tempfile.mkstemp()
- os.close(keytabfd)
+
+ @classmethod
+ def setUpClass(cls):
+ [cls.keytabfd,cls.keytabname] = tempfile.mkstemp()
+ os.close(cls.keytabfd)
+
+ does_command_exist = os.path.isfile(cls.command)
+
+ if not does_command_exist:
+ raise SkipTest("Command '%s' not found" % cls.command)
# auxiliary function for checking whether the join operation has set
# correct attributes
@@ -767,6 +775,7 @@ class test_host_false_pwd_change(XMLRPC_test):
"""
Create a test host and join him into IPA.
"""
+
# create a test host with bulk enrollment password
random_pass = api.Command['host_add'](self.fqdn1, random=True, force=True)['result']['randompassword']