diff options
Diffstat (limited to 'src/dht/test_dht_tools.py.in')
-rw-r--r-- | src/dht/test_dht_tools.py.in | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/dht/test_dht_tools.py.in b/src/dht/test_dht_tools.py.in index 0f48d7f76..9489d12c1 100644 --- a/src/dht/test_dht_tools.py.in +++ b/src/dht/test_dht_tools.py.in | |||
@@ -1,4 +1,16 @@ | |||
1 | #!@PYTHON@ | 1 | #!@PYTHON@ |
2 | # | ||
3 | # This testcase simply checks that the DHT command-line tools work. | ||
4 | # It launches a single peer, stores a value "testdata" under "testkey", | ||
5 | # and then gives the system 50 ms to fetch it. | ||
6 | # | ||
7 | # This could fail if | ||
8 | # - command line tool interfaces fail | ||
9 | # - DHT plugins for storage are not installed / working | ||
10 | # - block plugins for verification (the test plugin) is not installed | ||
11 | # | ||
12 | # The code does NOT depend on DHT routing or any actual P2P functionality. | ||
13 | # | ||
2 | from __future__ import print_function | 14 | from __future__ import print_function |
3 | import os | 15 | import os |
4 | import sys | 16 | import sys |
@@ -103,7 +115,7 @@ print ("PASS") | |||
103 | time.sleep (1) | 115 | time.sleep (1) |
104 | 116 | ||
105 | print ("TEST: Testing get...", end='') | 117 | print ("TEST: Testing get...", end='') |
106 | rc, stdo, stde = r_get (['-k', 'testkey', '-T', '5 ms', '-t', '8'], want_stdo = True, failer = end_arm_failer) | 118 | rc, stdo, stde = r_get (['-k', 'testkey', '-T', '50 ms', '-t', '8'], want_stdo = True, failer = end_arm_failer) |
107 | stdo = stdo.replace ('\r', '').splitlines () | 119 | stdo = stdo.replace ('\r', '').splitlines () |
108 | expect = "Result 0, type 8:\ntestdata".splitlines() | 120 | expect = "Result 0, type 8:\ntestdata".splitlines() |
109 | if len (stdo) != 2 or len (expect) != 2 or stdo[0] != expect[0] or stdo[1] != expect[1]: | 121 | if len (stdo) != 2 or len (expect) != 2 or stdo[0] != expect[0] or stdo[1] != expect[1]: |