diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-04-27 23:29:48 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2021-04-28 10:25:39 +0200 |
commit | 1b87a306f0ec3da8bdb1907e2b4efb9e1b3cb9bd (patch) | |
tree | b2c2e39f0815220bc8f23af2c97dbe4d4612ad0e /src/dht | |
parent | 5e347ac9df8b49503a1fdfa38707a99a6b2b3b0c (diff) | |
download | gnunet-1b87a306f0ec3da8bdb1907e2b4efb9e1b3cb9bd.tar.gz gnunet-1b87a306f0ec3da8bdb1907e2b4efb9e1b3cb9bd.zip |
- fix misc typos
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/test_dht_tools.py.in | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dht/test_dht_tools.py.in b/src/dht/test_dht_tools.py.in index 20739c45f..84e297081 100644 --- a/src/dht/test_dht_tools.py.in +++ b/src/dht/test_dht_tools.py.in | |||
@@ -72,10 +72,10 @@ def fail(result): | |||
72 | cleanup(1) | 72 | cleanup(1) |
73 | 73 | ||
74 | 74 | ||
75 | def r_something(to_run, extra_args, failer=None, normal=True, **kw): | 75 | def r_something(to_run, extra_args, failure=None, normal=True, **kw): |
76 | rc, stdo, stde = sub_run(to_run + extra_args, nofail=True, **kw) | 76 | rc, stdo, stde = sub_run(to_run + extra_args, nofail=True, **kw) |
77 | if failer is not None: | 77 | if failure is not None: |
78 | failer(to_run + extra_args, rc, stdo, stde, normal) | 78 | failure(to_run + extra_args, rc, stdo, stde, normal) |
79 | return (rc, stdo, stde) | 79 | return (rc, stdo, stde) |
80 | 80 | ||
81 | 81 | ||
@@ -91,7 +91,7 @@ def r_put(extra_args, **kw): | |||
91 | return r_something(run_put, extra_args, **kw) | 91 | return r_something(run_put, extra_args, **kw) |
92 | 92 | ||
93 | 93 | ||
94 | def end_arm_failer(command, rc, stdo, stde, normal): | 94 | def end_arm_failure(command, rc, stdo, stde, normal): |
95 | if normal: | 95 | if normal: |
96 | if rc != 0: | 96 | if rc != 0: |
97 | fail( | 97 | fail( |
@@ -107,7 +107,7 @@ def end_arm_failer(command, rc, stdo, stde, normal): | |||
107 | ) | 107 | ) |
108 | 108 | ||
109 | 109 | ||
110 | def print_only_failer(command, rc, stdo, stde, normal): | 110 | def print_only_failure(command, rc, stdo, stde, normal): |
111 | if normal: | 111 | if normal: |
112 | if rc != 0: | 112 | if rc != 0: |
113 | print( | 113 | print( |
@@ -126,19 +126,19 @@ def print_only_failer(command, rc, stdo, stde, normal): | |||
126 | 126 | ||
127 | 127 | ||
128 | print("TEST: Starting ARM...", end='') | 128 | print("TEST: Starting ARM...", end='') |
129 | r_arm(['-s'], failer=end_arm_failer, want_stdo=False, want_stde=False) | 129 | r_arm(['-s'], failure=end_arm_failure, want_stdo=False, want_stde=False) |
130 | print("PASS") | 130 | print("PASS") |
131 | time.sleep(1) | 131 | time.sleep(1) |
132 | 132 | ||
133 | print("TEST: Testing put...", end='') | 133 | print("TEST: Testing put...", end='') |
134 | r_put(['-k', 'testkey', '-d', 'testdata', '-t', '8'], failer=end_arm_failer) | 134 | r_put(['-k', 'testkey', '-d', 'testdata', '-t', '8'], failure=end_arm_failure) |
135 | print("PASS") | 135 | print("PASS") |
136 | time.sleep(1) | 136 | time.sleep(1) |
137 | 137 | ||
138 | print("TEST: Testing get...", end='') | 138 | print("TEST: Testing get...", end='') |
139 | rc, stdo, stde = r_get(['-k', 'testkey', '-T', '50 ms', '-t', '8'], | 139 | rc, stdo, stde = r_get(['-k', 'testkey', '-T', '50 ms', '-t', '8'], |
140 | want_stdo=True, | 140 | want_stdo=True, |
141 | failer=end_arm_failer) | 141 | failure=end_arm_failure) |
142 | stdo = stdo.decode('utf-8').replace('\r', '').splitlines() | 142 | stdo = stdo.decode('utf-8').replace('\r', '').splitlines() |
143 | expect = "Result 0, type 8:\ntestdata".splitlines() | 143 | expect = "Result 0, type 8:\ntestdata".splitlines() |
144 | if len(stdo) != 2 or len(expect | 144 | if len(stdo) != 2 or len(expect |
@@ -146,4 +146,4 @@ if len(stdo) != 2 or len(expect | |||
146 | fail("output `{}' differs from expected `{}'".format(stdo, expect)) | 146 | fail("output `{}' differs from expected `{}'".format(stdo, expect)) |
147 | print("PASS") | 147 | print("PASS") |
148 | 148 | ||
149 | r_arm(['-e', '-d'], failer=print_only_failer) | 149 | r_arm(['-e', '-d'], failure=print_only_failure) |