forked from gssapi/gssproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
t_reloading.py
executable file
·58 lines (48 loc) · 1.93 KB
/
t_reloading.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/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):
basicconf['prefix'] = str(cmd_index)
prefix = basicconf['prefix']
keysenv = basicconf["keysenv"]
rets = []
print("Testing basic SIGHUP with no change", file=sys.stderr)
sys.stderr.write(" ")
basicconf['prefix'] += prefix + "_1"
gssproxy_reload(testdir, basicconf['gpid'])
r = run_basic_test(testdir, env, basicconf)
rets.append(r)
print("Testing SIGHUP with dropped service", file=sys.stderr)
sys.stderr.write(" ")
basicconf['prefix'] = prefix + "_2"
update_gssproxy_conf(testdir, keysenv, GSSPROXY_CONF_MINIMAL_TEMPLATE)
gssproxy_reload(testdir, basicconf['gpid'])
r = run_basic_test(testdir, env, basicconf, True)
rets.append(r)
print("Testing SIGHUP with new service", file=sys.stderr)
sys.stderr.write(" ")
basicconf['prefix'] = prefix + "_3"
update_gssproxy_conf(testdir, keysenv, GSSPROXY_CONF_TEMPLATE)
gssproxy_reload(testdir, basicconf['gpid'])
r = run_basic_test(testdir, env, basicconf)
rets.append(r)
print("Testing SIGHUP with change of socket", file=sys.stderr)
sys.stderr.write(" ")
basicconf['prefix'] = prefix + "_4"
update_gssproxy_conf(testdir, keysenv, GSSPROXY_CONF_SOCKET_TEMPLATE)
env['GSSPROXY_SOCKET'] += "2"
gssproxy_reload(testdir, basicconf['gpid'])
r = run_basic_test(testdir, env, basicconf)
rets.append(r)
# restore old configuration
env['GSSPROXY_SOCKET'] = env['GSSPROXY_SOCKET'][:-1]
update_gssproxy_conf(testdir, keysenv, GSSPROXY_CONF_TEMPLATE)
gssproxy_reload(testdir, basicconf['gpid'])
e = [r for r in rets if r != 0]
if len(e) > 0:
return e[0]
return 0
if __name__ == "__main__":
from runtests import runtests_main
runtests_main(["t_reloading.py"])