From ae9bac9f1ad2c110cace6c88f1c38730de3b1d06 Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 2 May 2020 18:56:47 -0700 Subject: [PATCH] stress test updates --- bin/run.sh | 1 + meshtastic/test.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/run.sh b/bin/run.sh index e6c25e0..460c0fe 100755 --- a/bin/run.sh +++ b/bin/run.sh @@ -1 +1,2 @@ +rm log_* python3 -m meshtastic "$@" diff --git a/meshtastic/test.py b/meshtastic/test.py index bb288b9..5523f6a 100644 --- a/meshtastic/test.py +++ b/meshtastic/test.py @@ -57,8 +57,8 @@ def testSend(fromInterface, toInterface): logging.info(f"Sending test packet from {fromNode} to {toNode}") fromInterface.sendText(f"Test {testNumber}", toNode) - time.sleep(10) - return (len(receivedPackets) == 1) + time.sleep(15) + return (len(receivedPackets) >= 1) def testThread(): @@ -77,12 +77,12 @@ def testThread(): numSuccess = numSuccess + 1 logging.info(f"Test succeeded ({numSuccess} successes so far)") - if numFail >= 2 and numSuccess >= 2: + if numFail >= 3: for i in interfaces: i.close() return - time.sleep(5) + time.sleep(1) def onConnection(topic=pub.AUTO_TOPIC): @@ -110,7 +110,7 @@ def testAll(): Exception: If not enough devices are found """ ports = util.findPorts() - if (len(ports) != 2): + if (len(ports) < 2): raise Exception("Must have at least two devices connected to USB") pub.subscribe(onConnection, "meshtastic.connection")