diff options
Diffstat (limited to 'src/util/k5test.py')
-rw-r--r-- | src/util/k5test.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/util/k5test.py b/src/util/k5test.py index f90f8ac51c..74768de9aa 100644 --- a/src/util/k5test.py +++ b/src/util/k5test.py @@ -22,9 +22,13 @@ """A module for krb5 test scripts -Put test script names in the PYTESTS make variable to get them run -with the appropriate PYTHONPATH during "make check". Sample test -script usage: +To run test scripts during "make check" (if Python 2.4 or later is +available), add rules like the following to Makeflie.in: + + check-pytests:: + $(RUNPYTEST) $(srcdir)/t_testname.py $(PYTESTFLAGS) + +A sample test script: from k5test import * @@ -304,11 +308,6 @@ import string import subprocess import sys -# runenv.py is built in each directory where tests are run, providing -# the environment variable settings needed for running programs in the -# build tree. These can vary by platform. -import runenv - # Used when most things go wrong (other than programming errors) so # that the user sees an error message rather than a Python traceback, # without help from the test script. The on-exit handler will display @@ -1022,6 +1021,12 @@ plugins = _find_plugins() hostname = socket.getfqdn() null_input = open(os.devnull, 'r') +# runenv.py is built in the top level by "make fake-install". Import +# it now (rather than at the beginning of the file) so that we get a +# friendly error message from _find_plugins() if "make fake-install" +# has not been run. +import runenv + krb5kdc = os.path.join(buildtop, 'kdc', 'krb5kdc') kadmind = os.path.join(buildtop, 'kadmin', 'server', 'kadmind') kadmin = os.path.join(buildtop, 'kadmin', 'cli', 'kadmin') |