diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-12-16 17:15:23 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-12-16 17:15:23 +0000 |
commit | 6853afe24f91945f44593fa039b80a21dfd55e8d (patch) | |
tree | ff44e96651c624124e7a4d367239933f15cd60a4 /src/integration-tests/gnunet_testing.py.in | |
parent | 04b917265ee942383b8366d9aa9c037cfa89c038 (diff) | |
download | gnunet-6853afe24f91945f44593fa039b80a21dfd55e8d.tar.gz gnunet-6853afe24f91945f44593fa039b80a21dfd55e8d.zip |
Diffstat (limited to 'src/integration-tests/gnunet_testing.py.in')
-rw-r--r-- | src/integration-tests/gnunet_testing.py.in | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/integration-tests/gnunet_testing.py.in b/src/integration-tests/gnunet_testing.py.in index 0b7f87fa4..cb3dc541f 100644 --- a/src/integration-tests/gnunet_testing.py.in +++ b/src/integration-tests/gnunet_testing.py.in | |||
@@ -116,8 +116,8 @@ class StatisticsCondition (Condition): | |||
116 | self.result = -1; | 116 | self.result = -1; |
117 | def check(self): | 117 | def check(self): |
118 | if (self.fulfilled == False): | 118 | if (self.fulfilled == False): |
119 | self.result = self.peer.check (self.subsystem, self.name, self.value); | 119 | self.result = self.peer.get_statistics_value (self.subsystem, self.name); |
120 | if (self.result == self.value): | 120 | if (str(self.result) == str(self.value)): |
121 | self.fulfilled = True | 121 | self.fulfilled = True |
122 | return True | 122 | return True |
123 | else: | 123 | else: |
@@ -208,15 +208,15 @@ class Peer: | |||
208 | return False | 208 | return False |
209 | self.started = False | 209 | self.started = False |
210 | return True; | 210 | return True; |
211 | def check (self, subsystem, name, value): | 211 | def get_statistics_value (self, subsystem, name): |
212 | from gnunet_pyexpect import pexpect | 212 | from gnunet_pyexpect import pexpect |
213 | server = pexpect () | 213 | server = pexpect () |
214 | server.spawn (None, [self.test.gnunetstatistics, '-c', self.cfg ,'-q','-n', name, '-s', subsystem ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | 214 | server.spawn (None, [self.test.gnunetstatistics, '-c', self.cfg ,'-q','-n', name, '-s', subsystem ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
215 | #server.expect ("stdout", re.compile (r"")) | 215 | #server.expect ("stdout", re.compile (r"")) |
216 | test = server.read("stdout", 10240) | 216 | test = server.read("stdout", 10240) |
217 | if (test.find(str(value)) == -1): | 217 | tests = test.partition('\n')[0] |
218 | return -1 | 218 | if (tests.isdigit() == True): |
219 | return tests | ||
219 | else: | 220 | else: |
220 | return value | 221 | return -1 |
221 | |||
222 | \ No newline at end of file | 222 | \ No newline at end of file |