aboutsummaryrefslogtreecommitdiff
path: root/src/arm/test_gnunet_arm.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'src/arm/test_gnunet_arm.py.in')
-rw-r--r--src/arm/test_gnunet_arm.py.in20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/arm/test_gnunet_arm.py.in b/src/arm/test_gnunet_arm.py.in
index e657d4a3f..2b30b6b97 100644
--- a/src/arm/test_gnunet_arm.py.in
+++ b/src/arm/test_gnunet_arm.py.in
@@ -53,7 +53,7 @@ def fail(result):
53 sys.exit(1) 53 sys.exit(1)
54 54
55 55
56def end_arm_failer(command, rc, stdo, stde, normal): 56def end_arm_failure(command, rc, stdo, stde, normal):
57 if normal: 57 if normal:
58 if rc != 0: 58 if rc != 0:
59 fail( 59 fail(
@@ -69,7 +69,7 @@ def end_arm_failer(command, rc, stdo, stde, normal):
69 ) 69 )
70 70
71 71
72def print_only_failer(command, rc, stdo, stde, normal): 72def print_only_failure(command, rc, stdo, stde, normal):
73 if normal: 73 if normal:
74 if rc != 0: 74 if rc != 0:
75 print( 75 print(
@@ -87,12 +87,12 @@ def print_only_failer(command, rc, stdo, stde, normal):
87 sys.exit(1) 87 sys.exit(1)
88 88
89 89
90def r_something(to_run, extra_args, failer=None, normal=True, **kw): 90def r_something(to_run, extra_args, failure=None, normal=True, **kw):
91 rc, stdo, stde = sub_run( 91 rc, stdo, stde = sub_run(
92 to_run + extra_args, nofail=True, want_stde=True, **kw 92 to_run + extra_args, nofail=True, want_stde=True, **kw
93 ) 93 )
94 if failer is not None: 94 if failure is not None:
95 failer(to_run + extra_args, rc, stdo, stde, normal) 95 failure(to_run + extra_args, rc, stdo, stde, normal)
96 return (rc, stdo, stde) 96 return (rc, stdo, stde)
97 97
98 98
@@ -103,26 +103,26 @@ def r_arm(extra_args, **kw):
103cleanup() 103cleanup()
104 104
105print("TEST: Bad argument checking...", end='') 105print("TEST: Bad argument checking...", end='')
106r_arm(['-x'], normal=False, failer=print_only_failer) 106r_arm(['-x'], normal=False, failure=print_only_failure)
107print("PASS") 107print("PASS")
108 108
109print("TEST: Start ARM...", end='') 109print("TEST: Start ARM...", end='')
110r_arm(['-s'], failer=print_only_failer) 110r_arm(['-s'], failure=print_only_failure)
111time.sleep(1) 111time.sleep(1)
112print("PASS") 112print("PASS")
113 113
114print("TEST: Start another service...", end='') 114print("TEST: Start another service...", end='')
115r_arm(['-i', 'resolver'], failer=end_arm_failer) 115r_arm(['-i', 'resolver'], failure=end_arm_failure)
116time.sleep(1) 116time.sleep(1)
117print("PASS") 117print("PASS")
118 118
119print("TEST: Stop a service...", end='') 119print("TEST: Stop a service...", end='')
120r_arm(['-k', 'resolver'], failer=end_arm_failer) 120r_arm(['-k', 'resolver'], failure=end_arm_failure)
121time.sleep(1) 121time.sleep(1)
122print("PASS") 122print("PASS")
123 123
124print("TEST: Stop ARM...", end='') 124print("TEST: Stop ARM...", end='')
125r_arm(['-e'], failer=print_only_failer) 125r_arm(['-e'], failure=print_only_failure)
126time.sleep(1) 126time.sleep(1)
127print("PASS") 127print("PASS")
128 128