self.peer = peer
self.subsystem = subsystem
self.name = name
- self.value = value
+ self.value = str(value)
self.result = -1
def check(self):
if (self.fulfilled == False):
self.result = self.peer.get_statistics_value(self.subsystem, self.name)
- if (self.result == str(self.value)):
+ if (self.result == self.value):
self.fulfilled = True
return True
else:
# op +
# res +
# fail)
- logger.debug('%s %s %s condition in subsystem %s : %s : (expected/real value) %s %s %s %s', self.peer.id[:4], self.peer.cfg.encode('utf-8'), str(self.type).encode('utf-8'), self.subsystem.encode('utf-8').ljust(12), self.name.encode('utf-8').ljust(30), str(self.value).encode('utf-8'), op, self.result, fail)
+ logger.debug('%s %s %s condition in subsystem %s : %s : (expected/real value) %s %s %s %s', self.peer.id[:4], self.peer.cfg, str(self.type), self.subsystem.ljust(12), self.name.ljust(30), self.value, op, self.result, fail)
return self.fulfilled
# self.name2.encode('utf-8').ljust(30) +
# b'" ' +
# self.result2)
- logger.debug('%s %s %s == %s %s %s %s %s', self.peer.id[:4], self.subsystem.encode('utf-8').ljust(12), self.name.encode('utf-8').ljust(30), self.result, self.peer2.id[:4], self.subsystem2.encode('uft-8').ljust(12), self.name2.encode('utf-8').ljust(30), self.result2)
+ logger.debug('%s %s %s == %s %s %s %s %s', self.peer.id[:4], self.subsystem.ljust(12), self.name.ljust(30), self.result, self.peer2.id[:4], self.subsystem2.ljust(12), self.name2.ljust(30), self.result2)
return self.fulfilled
if os.name == 'nt' and tests[1] == b'\n' and tests[0][-1] == b'\r':
tests = (tests[0][:-1], tests[1], tests[2])
tests = tests[0]
- # print("running gnunet-statistics " + self.cfg + " for " + name + "/" + subsystem + " yields " + tests.decode("utf-8"))
- logger.debug('running gnunet-statistics %s for %s "/" %s yields %s', self.cfg, name, subsystem, test.decode("utf-8"))
result = tests.decode("utf-8").strip()
+ logger.debug('running gnunet-statistics %s for %s "/" %s yields %s', self.cfg, name, subsystem, result)
if (result.isdigit() == True):
return result
else:
- # print("Invalid statistics value: " + str(tests) + " is not a number!")
logger.debug('Invalid statistics value: %s is not a number!', result)
return -1
def check_connect ():
check = Check (test)
- check.add (StatisticsCondition (client, 'transport', '# peers connected',2))
- check.add (StatisticsCondition (client, 'core', '# peers connected',2))
- check.add (StatisticsCondition (client, 'topology', '# peers connected',2))
- check.add (StatisticsCondition (client, 'dht', '# peers connected',2))
- check.add (StatisticsCondition (client, 'fs', '# peers connected',2))
-
- check.add (StatisticsCondition (server, 'transport', '# peers connected',2))
- check.add (StatisticsCondition (server, 'core', '# peers connected',2))
- check.add (StatisticsCondition (server, 'topology', '# peers connected',2))
- check.add (StatisticsCondition (server, 'dht', '# peers connected',2))
- check.add (StatisticsCondition (server, 'fs', '# peers connected',2))
+ check.add (StatisticsCondition (server, 'transport', '# peers connected',1))
+ check.add (StatisticsCondition (server, 'core', '# peers connected',1))
+ check.add (StatisticsCondition (server, 'topology', '# peers connected',1))
+ check.add (StatisticsCondition (server, 'dht', '# peers connected',1))
+ check.add (StatisticsCondition (server, 'fs', '# peers connected',1))
+
+ check.add (StatisticsCondition (client, 'transport', '# peers connected',1))
+ check.add (StatisticsCondition (client, 'core', '# peers connected',1))
+ check.add (StatisticsCondition (client, 'topology', '# peers connected',1))
+ check.add (StatisticsCondition (client, 'dht', '# peers connected',1))
+ check.add (StatisticsCondition (client, 'fs', '# peers connected',1))
check.run_blocking (check_timeout, success_connect_cont, fail_connect_cont)