X-Git-Url: https://gerrit.fd.io/r/gitweb?p=deb_dpdk.git;a=blobdiff_plain;f=test%2Ftest%2Fautotest_test_funcs.py;h=15fcb7cf4521ca0574fcc2b003c376e4de6d0323;hp=8da8fcd782606232d156645baa07e348de6e09a9;hb=976be7358289d46cd5ed8131bbf2e2c5a6838d3c;hpb=055c52583a2794da8ba1e85a48cce3832372b12f diff --git a/test/test/autotest_test_funcs.py b/test/test/autotest_test_funcs.py index 8da8fcd7..15fcb7cf 100644 --- a/test/test/autotest_test_funcs.py +++ b/test/test/autotest_test_funcs.py @@ -62,21 +62,30 @@ def dump_autotest(child, test_name): def memory_autotest(child, test_name): + lines = 0 + error = '' child.sendline(test_name) - regexp = "phys:0x[0-9a-f]*, len:([0-9]*), virt:0x[0-9a-f]*, " \ - "socket_id:[0-9]*" - index = child.expect([regexp, pexpect.TIMEOUT], timeout=180) - if index != 0: - return -1, "Fail [Timeout]" - size = int(child.match.groups()[0], 16) - if size <= 0: - return -1, "Fail [Bad size]" - index = child.expect(["Test OK", "Test Failed", - pexpect.TIMEOUT], timeout=10) - if index == 1: - return -1, "Fail" - elif index == 2: - return -1, "Fail [Timeout]" + while True: + regexp = "IOVA:0x[0-9a-f]*, len:([0-9]*), virt:0x[0-9a-f]*, " \ + "socket_id:[0-9]*" + index = child.expect([regexp, "Test OK", "Test Failed", + pexpect.TIMEOUT], timeout=10) + if index == 3: + return -1, "Fail [Timeout]" + elif index == 1: + break + elif index == 2: + return -1, "Fail" + else: + lines = lines + 1 + size = int(child.match.groups()[0], 10) + if size <= 0: + error = 'Bad size' + + if lines <= 0: + return -1, "Fail [No entries]" + if error != '': + return -1, "Fail [{}]".format(error) return 0, "Success"