diff options
Diffstat (limited to 'src/integration-tests')
-rw-r--r-- | src/integration-tests/gnunet_testing.py.in | 7 | ||||
-rwxr-xr-x | src/integration-tests/test_integration_connection_value.py.in | 18 |
2 files changed, 15 insertions, 10 deletions
diff --git a/src/integration-tests/gnunet_testing.py.in b/src/integration-tests/gnunet_testing.py.in index fa8af728c..253797249 100644 --- a/src/integration-tests/gnunet_testing.py.in +++ b/src/integration-tests/gnunet_testing.py.in | |||
@@ -42,7 +42,6 @@ class Check: | |||
42 | neg += 1 | 42 | neg += 1 |
43 | else: | 43 | else: |
44 | pos += 1 | 44 | pos += 1 |
45 | self.test.p (str(pos) +' out of '+ str (pos+neg) + ' conditions fulfilled') | ||
46 | return fulfilled | 45 | return fulfilled |
47 | def run_blocking (self, timeout, pos_cont, neg_cont): | 46 | def run_blocking (self, timeout, pos_cont, neg_cont): |
48 | execs = 0; | 47 | execs = 0; |
@@ -75,6 +74,10 @@ class Check: | |||
75 | pos += 1 | 74 | pos += 1 |
76 | print (str(pos) +' out of '+ str (pos+neg) + ' conditions fulfilled') | 75 | print (str(pos) +' out of '+ str (pos+neg) + ' conditions fulfilled') |
77 | return self.fulfilled | 76 | return self.fulfilled |
77 | def reset (self): | ||
78 | self.fulfilled = False | ||
79 | for c in self.conditions: | ||
80 | c.fulfilled = False | ||
78 | 81 | ||
79 | class Condition: | 82 | class Condition: |
80 | def __init__(self): | 83 | def __init__(self): |
@@ -125,7 +128,7 @@ class StatisticsCondition (Condition): | |||
125 | self.result = -1; | 128 | self.result = -1; |
126 | def check(self): | 129 | def check(self): |
127 | if (self.fulfilled == False): | 130 | if (self.fulfilled == False): |
128 | self.result = self.peer.get_statistics_value (self.subsystem, self.name); | 131 | self.result = self.peer.get_statistics_value (self.subsystem, self.name) |
129 | if (str(self.result) == str(self.value)): | 132 | if (str(self.result) == str(self.value)): |
130 | self.fulfilled = True | 133 | self.fulfilled = True |
131 | return True | 134 | return True |
diff --git a/src/integration-tests/test_integration_connection_value.py.in b/src/integration-tests/test_integration_connection_value.py.in index cb9a1378e..29b1dfaa5 100755 --- a/src/integration-tests/test_integration_connection_value.py.in +++ b/src/integration-tests/test_integration_connection_value.py.in | |||
@@ -65,16 +65,18 @@ def fail_cont (check): | |||
65 | def check_connect (): | 65 | def check_connect (): |
66 | check = Check (test) | 66 | check = Check (test) |
67 | check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# neighbour entries allocated')) | 67 | check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# neighbour entries allocated')) |
68 | #check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# entries in session map')) | 68 | check.add (EqualStatisticsCondition (client, 'transport', '# peers connected', client, 'core', '# entries in session map')) |
69 | #check.add (EqualStatisticsCondition (client, 'core', '# neighbour entries allocated', client, 'core', '# entries in session map')) | 69 | check.add (EqualStatisticsCondition (client, 'core', '# neighbour entries allocated', client, 'core', '# entries in session map')) |
70 | 70 | ||
71 | while True: | 71 | while True: |
72 | res = check.run_once (None, None) | 72 | time.sleep (5) |
73 | print "Values are equal" | 73 | check.reset() |
74 | check.evaluate (False) | 74 | res = check.run_once (None, None) |
75 | if (False == res): | 75 | print "Values are equal" |
76 | break | 76 | check.evaluate (False) |
77 | time.sleep (1) | 77 | #if (False == res): |
78 | # break | ||
79 | |||
78 | 80 | ||
79 | # | 81 | # |
80 | # Test execution | 82 | # Test execution |