summaryrefslogtreecommitdiffstats
path: root/proxy/tests/t_reloading.py
diff options
context:
space:
mode:
authorRobbie Harwood <rharwood@redhat.com>2016-12-07 20:15:14 +0000
committerSimo Sorce <simo@redhat.com>2017-01-12 11:52:20 -0500
commit75cef8a29218ec6f55a979ce9e30535249d1dd3d (patch)
treeb22471e68e63531e8013c9ff91f88b50290e5e59 /proxy/tests/t_reloading.py
parent3be3f605d2a89cbda85f8bcf5b06f431a050cb9f (diff)
Split out each test into its own file
Some naming and scoping issues are also fixed here in order for the result to run. Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'proxy/tests/t_reloading.py')
-rwxr-xr-xproxy/tests/t_reloading.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/proxy/tests/t_reloading.py b/proxy/tests/t_reloading.py
new file mode 100755
index 0000000..46a262e
--- /dev/null
+++ b/proxy/tests/t_reloading.py
@@ -0,0 +1,43 @@
+#!/usr/bin/python3
+# Copyright (C) 2014,2015,2016 - GSS-Proxy contributors; see COPYING for the license
+
+from testlib import *
+from t_basic import run as run_basic_test
+
+def run(testdir, env, basicconf):
+ prefix = basicconf['prefix']
+ keysenv = basicconf["keysenv"]
+
+ print("Testing basic SIGHUP with no change", file=sys.stderr)
+ basicconf['prefix'] += prefix + "_1"
+ os.kill(basicconf["gpid"], signal.SIGHUP)
+ time.sleep(1) #Let gssproxy reload everything
+ run_basic_test(testdir, env, basicconf)
+
+ print("Testing SIGHUP with dropped service", file=sys.stderr)
+ basicconf['prefix'] = prefix + "_2"
+ update_gssproxy_conf(testdir, keysenv, GSSPROXY_CONF_MINIMAL_TEMPLATE)
+ os.kill(basicconf["gpid"], signal.SIGHUP)
+ time.sleep(1) #Let gssproxy reload everything
+ run_basic_test(testdir, env, basicconf, True)
+
+ print("Testing SIGHUP with new service", file=sys.stderr)
+ basicconf['prefix'] = prefix + "_3"
+ update_gssproxy_conf(testdir, keysenv, GSSPROXY_CONF_TEMPLATE)
+ os.kill(basicconf["gpid"], signal.SIGHUP)
+ time.sleep(1) #Let gssproxy reload everything
+ run_basic_test(testdir, env, basicconf)
+
+ print("Testing SIGHUP with change of socket", file=sys.stderr)
+ basicconf['prefix'] = prefix + "_4"
+ update_gssproxy_conf(testdir, keysenv, GSSPROXY_CONF_SOCKET_TEMPLATE)
+ env['GSSPROXY_SOCKET'] += "2"
+ os.kill(basicconf["gpid"], signal.SIGHUP)
+ time.sleep(1) #Let gssproxy reload everything
+ run_basic_test(testdir, env, basicconf)
+
+ # restore old configuration
+ env['GSSPROXY_SOCKET'] = env['GSSPROXY_SOCKET'][:-1]
+ update_gssproxy_conf(testdir, keysenv, GSSPROXY_CONF_TEMPLATE)
+ os.kill(basicconf["gpid"], signal.SIGHUP)
+ time.sleep(1) #Let gssproxy reload everything