summaryrefslogtreecommitdiff
path: root/src/integration-tests/gnunet_testing.py.in
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-12-16 17:15:23 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-12-16 17:15:23 +0000
commit6853afe24f91945f44593fa039b80a21dfd55e8d (patch)
treeff44e96651c624124e7a4d367239933f15cd60a4 /src/integration-tests/gnunet_testing.py.in
parent04b917265ee942383b8366d9aa9c037cfa89c038 (diff)
Diffstat (limited to 'src/integration-tests/gnunet_testing.py.in')
-rw-r--r--src/integration-tests/gnunet_testing.py.in14
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):
self.result = -1;
def check(self):
if (self.fulfilled == False):
- self.result = self.peer.check (self.subsystem, self.name, self.value);
- if (self.result == self.value):
+ self.result = self.peer.get_statistics_value (self.subsystem, self.name);
+ if (str(self.result) == str(self.value)):
self.fulfilled = True
return True
else:
@@ -208,15 +208,15 @@ class Peer:
return False
self.started = False
return True;
- def check (self, subsystem, name, value):
+ def get_statistics_value (self, subsystem, name):
from gnunet_pyexpect import pexpect
server = pexpect ()
server.spawn (None, [self.test.gnunetstatistics, '-c', self.cfg ,'-q','-n', name, '-s', subsystem ], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
#server.expect ("stdout", re.compile (r""))
test = server.read("stdout", 10240)
- if (test.find(str(value)) == -1):
- return -1
+ tests = test.partition('\n')[0]
+ if (tests.isdigit() == True):
+ return tests
else:
- return value
-
+ return -1
\ No newline at end of file