tests: gnrc_sock_ip: remove timing tests from pexpect script
This commit is contained in:
parent
edaba0454a
commit
137afbe6e7
@ -14,9 +14,6 @@ from datetime import datetime
|
|||||||
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
sys.path.append(os.path.join(os.environ['RIOTBASE'], 'dist/tools/testrunner'))
|
||||||
import testrunner
|
import testrunner
|
||||||
|
|
||||||
class InvalidTimeout(Exception):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact(u"Calling test_sock_ip_create__EAFNOSUPPORT()")
|
child.expect_exact(u"Calling test_sock_ip_create__EAFNOSUPPORT()")
|
||||||
child.expect_exact(u"Calling test_sock_ip_create__EINVAL_addr()")
|
child.expect_exact(u"Calling test_sock_ip_create__EINVAL_addr()")
|
||||||
@ -30,20 +27,8 @@ def testfunc(child):
|
|||||||
child.expect_exact(u"Calling test_sock_ip_recv__ENOBUFS()")
|
child.expect_exact(u"Calling test_sock_ip_recv__ENOBUFS()")
|
||||||
child.expect_exact(u"Calling test_sock_ip_recv__EPROTO()")
|
child.expect_exact(u"Calling test_sock_ip_recv__EPROTO()")
|
||||||
child.expect_exact(u"Calling test_sock_ip_recv__ETIMEDOUT()")
|
child.expect_exact(u"Calling test_sock_ip_recv__ETIMEDOUT()")
|
||||||
child.match # get to ensure program reached that point
|
|
||||||
start = datetime.now()
|
|
||||||
child.expect_exact(u" * Calling sock_ip_recv()")
|
child.expect_exact(u" * Calling sock_ip_recv()")
|
||||||
child.expect(u" \\* \\(timed out with timeout (\\d+)\\)")
|
child.expect(r" \* \(timed out with timeout \d+\)")
|
||||||
exp_diff = int(child.match.group(1))
|
|
||||||
stop = datetime.now()
|
|
||||||
diff = (stop - start)
|
|
||||||
diff = (diff.seconds * 1000000) + diff.microseconds
|
|
||||||
# fail within 5% of expected
|
|
||||||
if diff > (exp_diff + (exp_diff * 0.05)) or \
|
|
||||||
diff < (exp_diff - (exp_diff * 0.05)):
|
|
||||||
raise InvalidTimeout("Invalid timeout %d (expected %d)" % (diff, exp_diff));
|
|
||||||
else:
|
|
||||||
print("Timed out correctly: %d (expected %d)" % (diff, exp_diff))
|
|
||||||
child.expect_exact(u"Calling test_sock_ip_recv__socketed()")
|
child.expect_exact(u"Calling test_sock_ip_recv__socketed()")
|
||||||
child.expect_exact(u"Calling test_sock_ip_recv__socketed_with_remote()")
|
child.expect_exact(u"Calling test_sock_ip_recv__socketed_with_remote()")
|
||||||
child.expect_exact(u"Calling test_sock_ip_recv__unsocketed()")
|
child.expect_exact(u"Calling test_sock_ip_recv__unsocketed()")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user