From 768cb29afe892e5dfc115430f60f623220c78740 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 29 Jul 2010 10:51:47 -0400 Subject: Check to see if the command is available before running command tests. --- tests/test_cmdline/cmdline.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/test_cmdline/cmdline.py') 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( -- cgit