X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Fautotest_test_funcs.py;h=31cc0f5ee4fee23fb87f849ce19f8948fdf16914;hb=8741a907453681b3c7f3ad8e2fb6de08b9fdf574;hp=65fe335397844508f14e09d5b4d0626469a84fae;hpb=a9de470cc7c0649221e156fc5f30a2dbdfe7c166;p=dpdk.git diff --git a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py index 65fe335397..31cc0f5ee4 100644 --- a/app/test/autotest_test_funcs.py +++ b/app/test/autotest_test_funcs.py @@ -131,6 +131,40 @@ def rwlock_autotest(child, test_name): return 0, "Success" +def ticketlock_autotest(child, test_name): + i = 0 + ir = 0 + child.sendline(test_name) + while True: + index = child.expect(["Test OK", + "Test Failed", + "Hello from core ([0-9]*) !", + "Hello from within recursive locks " + "from ([0-9]*) !", + pexpect.TIMEOUT], timeout=5) + # ok + if index == 0: + break + + # message, check ordering + elif index == 2: + if int(child.match.groups()[0]) < i: + return -1, "Fail [Bad order]" + i = int(child.match.groups()[0]) + elif index == 3: + if int(child.match.groups()[0]) < ir: + return -1, "Fail [Bad order]" + ir = int(child.match.groups()[0]) + + # fail + elif index == 4: + return -1, "Fail [Timeout]" + elif index == 1: + return -1, "Fail" + + return 0, "Success" + + def logs_autotest(child, test_name): child.sendline(test_name)