Blame SOURCES/0011-Have-k5test.py-provide-runenv-to-python-tests.patch

4be148
From f78f8b1a46534db3a4547323ba952c1fa1b41fe9 Mon Sep 17 00:00:00 2001
4be148
From: Nalin Dahyabhai <nalin@dahyabhai.net>
4be148
Date: Fri, 30 May 2014 17:13:31 -0400
4be148
Subject: [PATCH 11/13] Have k5test.py provide 'runenv' to python tests
4be148
4be148
Expose the formerly-internal _runenv module as k5test.runenv, so that
4be148
settings we store in the top-level runenv.py will be available to them.
4be148
4be148
ticket: 7929
4be148
---
4be148
 src/util/k5test.py | 15 ++++++++++-----
4be148
 1 file changed, 10 insertions(+), 5 deletions(-)
4be148
4be148
diff --git a/src/util/k5test.py b/src/util/k5test.py
4be148
index a2bfbee..8cb477d 100644
4be148
--- a/src/util/k5test.py
4be148
+++ b/src/util/k5test.py
4be148
@@ -177,6 +177,12 @@ Scripts may use the following functions and variables:
4be148
 
4be148
 * args: Positional arguments left over after flags are processed.
4be148
 
4be148
+* runenv: The contents of $srctop/runenv.py, containing a dictionary
4be148
+  'env' which specifies additional variables to be added to the realm
4be148
+  environment, and a variable 'proxy_tls_impl', which indicates which
4be148
+  SSL implementation (if any) is being used by libkrb5's support for
4be148
+  contacting KDCs and kpasswd servers over HTTPS.
4be148
+
4be148
 * verbose: Whether the script is running verbosely.
4be148
 
4be148
 * testpass: The command-line test pass argument.  The script does not
4be148
@@ -526,9 +532,9 @@ def _match_cmdnum(cmdnum, ind):
4be148
 # Return an environment suitable for running programs in the build
4be148
 # tree.  It is safe to modify the result.
4be148
 def _build_env():
4be148
-    global buildtop, _runenv
4be148
+    global buildtop, runenv
4be148
     env = os.environ.copy()
4be148
-    for (k, v) in _runenv.iteritems():
4be148
+    for (k, v) in runenv.env.iteritems():
4be148
         if v.find('./') == 0:
4be148
             env[k] = os.path.join(buildtop, v)
4be148
         else:
4be148
@@ -544,8 +550,7 @@ def _import_runenv():
4be148
     runenv_py = os.path.join(buildtop, 'runenv.py')
4be148
     if not os.path.exists(runenv_py):
4be148
         fail('You must run "make runenv.py" in %s first.' % buildtop)
4be148
-    module = imp.load_source('runenv', runenv_py)
4be148
-    return module.env
4be148
+    return imp.load_source('runenv', runenv_py)
4be148
 
4be148
 
4be148
 # Merge the nested dictionaries cfg1 and cfg2 into a new dictionary.
4be148
@@ -1174,7 +1179,7 @@ _cmd_index = 1
4be148
 buildtop = _find_buildtop()
4be148
 srctop = _find_srctop()
4be148
 plugins = os.path.join(buildtop, 'plugins')
4be148
-_runenv = _import_runenv()
4be148
+runenv = _import_runenv()
4be148
 hostname = _get_hostname()
4be148
 null_input = open(os.devnull, 'r')
4be148
 
4be148
-- 
4be148
2.1.0
4be148