diff options
author | Rob Crittenden <rcritten@redhat.com> | 2010-07-29 10:51:47 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-08-06 15:33:32 -0400 |
commit | 768cb29afe892e5dfc115430f60f623220c78740 (patch) | |
tree | 7eb49a01b282936de22606f37b37d176c4c3a8b3 /tests/test_cmdline/cmdline.py | |
parent | 35cbbde5bf6e2f38375390fa102ce489191a9450 (diff) | |
download | freeipa-768cb29afe892e5dfc115430f60f623220c78740.tar.gz freeipa-768cb29afe892e5dfc115430f60f623220c78740.tar.xz freeipa-768cb29afe892e5dfc115430f60f623220c78740.zip |
Check to see if the command is available before running command tests.
Diffstat (limited to 'tests/test_cmdline/cmdline.py')
-rw-r--r-- | tests/test_cmdline/cmdline.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_cmdline/cmdline.py b/tests/test_cmdline/cmdline.py index 4de06850c..913760e3a 100644 --- a/tests/test_cmdline/cmdline.py +++ b/tests/test_cmdline/cmdline.py @@ -28,6 +28,7 @@ from ipalib import api, request from ipalib import errors from tests.test_xmlrpc.xmlrpc_test import XMLRPC_test from ipaserver.plugins.ldap2 import ldap2 +from ipapython import ipautil # See if our LDAP server is up and we can talk to it over GSSAPI ccache = krbV.default_context().default_ccache().name @@ -46,8 +47,16 @@ class cmdline_test(XMLRPC_test): """ Base class for all command-line tests """ + # some reasonable default command + command = '/bin/ls' def setUp(self): + # raise an error if the command is missing even if the remote + # server is not available. + if not ipautil.file_exists(self.command): + raise AssertionError( + 'Command %r not available' % self.command + ) super(cmdline_test, self).setUp() if not server_available: raise nose.SkipTest( |