ipa/freeipa-3.0.0.pre1-079-adds-check-for-ipa-join.patch
2012-08-06 18:17:49 +02:00

59 lines
2.1 KiB
Diff

From 36c4778bc66a6435b578268143a2eee766ab9f9c Mon Sep 17 00:00:00 2001
From: Tomas Babej <tbabej@redhat.com>
Date: Fri, 3 Aug 2012 09:29:31 -0400
Subject: [PATCH 79/79] 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
---
tests/test_xmlrpc/test_host_plugin.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/tests/test_xmlrpc/test_host_plugin.py b/tests/test_xmlrpc/test_host_plugin.py
index 03aa089a2739486f6033a9d1870d7567bfdf1f5a..c9ec6a2bdda6eaebed72b1088e9e3cbb223d528b 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']
--
1.7.11.2