DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock autotest
@ 2019-04-15  9:04 Joyce Kong
  2019-04-15  9:04 ` Joyce Kong
  2019-04-15 15:45 ` Phil Yang (Arm Technology China)
  0 siblings, 2 replies; 6+ messages in thread
From: Joyce Kong @ 2019-04-15  9:04 UTC (permalink / raw)
  To: dev
  Cc: nd, thomas, david.marchand, stephen, jerin.jacob,
	konstantin.ananyev, honnappa.nagarahalli, gavin.hu

Add ticketlock_autotest implementation in python.

Fixes: efbcdaa55b93 ("test/ticketlock: add test cases")

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
---
 app/test/autotest_data.py       |  2 +-
 app/test/autotest_test_funcs.py | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py
index db25274..72c56e5 100644
--- a/app/test/autotest_data.py
+++ b/app/test/autotest_data.py
@@ -175,7 +175,7 @@
         "Command": "ticketlock_autotest",
         "Func":    ticketlock_autotest,
         "Report":  None,
-    }
+    },
     {
         "Name":    "Byte order autotest",
         "Command": "byteorder_autotest",
diff --git a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py
index 65fe335..31cc0f5 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)
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock autotest
  2019-04-15  9:04 [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock autotest Joyce Kong
@ 2019-04-15  9:04 ` Joyce Kong
  2019-04-15 15:45 ` Phil Yang (Arm Technology China)
  1 sibling, 0 replies; 6+ messages in thread
From: Joyce Kong @ 2019-04-15  9:04 UTC (permalink / raw)
  To: dev
  Cc: nd, thomas, david.marchand, stephen, jerin.jacob,
	konstantin.ananyev, honnappa.nagarahalli, gavin.hu

Add ticketlock_autotest implementation in python.

Fixes: efbcdaa55b93 ("test/ticketlock: add test cases")

Signed-off-by: Joyce Kong <joyce.kong@arm.com>
---
 app/test/autotest_data.py       |  2 +-
 app/test/autotest_test_funcs.py | 34 ++++++++++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py
index db25274..72c56e5 100644
--- a/app/test/autotest_data.py
+++ b/app/test/autotest_data.py
@@ -175,7 +175,7 @@
         "Command": "ticketlock_autotest",
         "Func":    ticketlock_autotest,
         "Report":  None,
-    }
+    },
     {
         "Name":    "Byte order autotest",
         "Command": "byteorder_autotest",
diff --git a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py
index 65fe335..31cc0f5 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)
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock autotest
  2019-04-15  9:04 [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock autotest Joyce Kong
  2019-04-15  9:04 ` Joyce Kong
@ 2019-04-15 15:45 ` Phil Yang (Arm Technology China)
  2019-04-15 15:45   ` Phil Yang (Arm Technology China)
  2019-04-15 20:41   ` Thomas Monjalon
  1 sibling, 2 replies; 6+ messages in thread
From: Phil Yang (Arm Technology China) @ 2019-04-15 15:45 UTC (permalink / raw)
  To: Joyce Kong (Arm Technology China), dev
  Cc: nd, thomas, david.marchand, stephen, jerin.jacob,
	konstantin.ananyev, Honnappa Nagarahalli,
	Gavin Hu (Arm Technology China),
	nd

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Joyce Kong
> Sent: Monday, April 15, 2019 5:05 PM
> To: dev@dpdk.org
> Cc: nd <nd@arm.com>; thomas@monjalon.net;
> david.marchand@redhat.com; stephen@networkplumber.org;
> jerin.jacob@caviumnetworks.com; konstantin.ananyev@intel.com;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Gavin Hu (Arm
> Technology China) <Gavin.Hu@arm.com>
> Subject: [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock
> autotest
> 
> Add ticketlock_autotest implementation in python.
> 
> Fixes: efbcdaa55b93 ("test/ticketlock: add test cases")
> 
> Signed-off-by: Joyce Kong <joyce.kong@arm.com>
> ---
>  app/test/autotest_data.py       |  2 +-
>  app/test/autotest_test_funcs.py | 34
> ++++++++++++++++++++++++++++++++++
>  2 files changed, 35 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py index
> db25274..72c56e5 100644
> --- a/app/test/autotest_data.py
> +++ b/app/test/autotest_data.py
> @@ -175,7 +175,7 @@
>          "Command": "ticketlock_autotest",
>          "Func":    ticketlock_autotest,
>          "Report":  None,
> -    }
> +    },
>      {
>          "Name":    "Byte order autotest",
>          "Command": "byteorder_autotest", diff --git
> a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py
> index 65fe335..31cc0f5 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)
> 
> --
> 2.7.4

Hi,

Reviewed-by: Phil Yang <phil.yang@arm.com>
Tested-by: Phil Yang <phil.yang@arm.com>

# python ./app/test/autotest.py x86_64-native-linuxapp-gcc/app/test ./x86_64-native-linuxapp-gcc  Ticketlock autotest
x86_64-native-linuxapp-gcc/app/test -c f -n 4
Running tests with 4 workers

Test name                     Test result                     Test    Total
================================================================================
Parallel autotests:
Start test2:                         Success                      [00m 00s][00m 00s]
Start test1:                         Success                      [00m 00s][00m 00s]
Start test0:                         Success                      [00m 01s][00m 01s]
Start test3:                         Success                      [00m 01s][00m 01s]
Ticketlock autotest:          Success                      [00m 00s][00m 01s]
================================================================================
Total run time: 00m 01s

# python ./app/test/autotest.py arm64-armv8a-linuxapp-gcc/app/test ./arm64-armv8a-linuxapp-gcc  Ticketlock autotest
arm64-armv8a-linuxapp-gcc/app/test -c f -n 4
Running tests with 4 workers

Test name                     Test result                     Test    Total
================================================================================
Parallel autotests:
Start test0:                         Success                      [00m 00s][00m 00s]
Start test1:                         Success                      [00m 00s][00m 00s]
Start test3:                         Success                      [00m 00s][00m 00s]
Start test2:                         Success                      [00m 00s][00m 00s]
Ticketlock autotest:          Success                      [00m 00s][00m 00s]
================================================================================
Total run time: 00m 00s

Thanks,
Phil

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock autotest
  2019-04-15 15:45 ` Phil Yang (Arm Technology China)
@ 2019-04-15 15:45   ` Phil Yang (Arm Technology China)
  2019-04-15 20:41   ` Thomas Monjalon
  1 sibling, 0 replies; 6+ messages in thread
From: Phil Yang (Arm Technology China) @ 2019-04-15 15:45 UTC (permalink / raw)
  To: Joyce Kong (Arm Technology China), dev
  Cc: nd, thomas, david.marchand, stephen, jerin.jacob,
	konstantin.ananyev, Honnappa Nagarahalli,
	Gavin Hu (Arm Technology China),
	nd

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Joyce Kong
> Sent: Monday, April 15, 2019 5:05 PM
> To: dev@dpdk.org
> Cc: nd <nd@arm.com>; thomas@monjalon.net;
> david.marchand@redhat.com; stephen@networkplumber.org;
> jerin.jacob@caviumnetworks.com; konstantin.ananyev@intel.com;
> Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>; Gavin Hu (Arm
> Technology China) <Gavin.Hu@arm.com>
> Subject: [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock
> autotest
> 
> Add ticketlock_autotest implementation in python.
> 
> Fixes: efbcdaa55b93 ("test/ticketlock: add test cases")
> 
> Signed-off-by: Joyce Kong <joyce.kong@arm.com>
> ---
>  app/test/autotest_data.py       |  2 +-
>  app/test/autotest_test_funcs.py | 34
> ++++++++++++++++++++++++++++++++++
>  2 files changed, 35 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test/autotest_data.py b/app/test/autotest_data.py index
> db25274..72c56e5 100644
> --- a/app/test/autotest_data.py
> +++ b/app/test/autotest_data.py
> @@ -175,7 +175,7 @@
>          "Command": "ticketlock_autotest",
>          "Func":    ticketlock_autotest,
>          "Report":  None,
> -    }
> +    },
>      {
>          "Name":    "Byte order autotest",
>          "Command": "byteorder_autotest", diff --git
> a/app/test/autotest_test_funcs.py b/app/test/autotest_test_funcs.py
> index 65fe335..31cc0f5 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)
> 
> --
> 2.7.4

Hi,

Reviewed-by: Phil Yang <phil.yang@arm.com>
Tested-by: Phil Yang <phil.yang@arm.com>

# python ./app/test/autotest.py x86_64-native-linuxapp-gcc/app/test ./x86_64-native-linuxapp-gcc  Ticketlock autotest
x86_64-native-linuxapp-gcc/app/test -c f -n 4
Running tests with 4 workers

Test name                     Test result                     Test    Total
================================================================================
Parallel autotests:
Start test2:                         Success                      [00m 00s][00m 00s]
Start test1:                         Success                      [00m 00s][00m 00s]
Start test0:                         Success                      [00m 01s][00m 01s]
Start test3:                         Success                      [00m 01s][00m 01s]
Ticketlock autotest:          Success                      [00m 00s][00m 01s]
================================================================================
Total run time: 00m 01s

# python ./app/test/autotest.py arm64-armv8a-linuxapp-gcc/app/test ./arm64-armv8a-linuxapp-gcc  Ticketlock autotest
arm64-armv8a-linuxapp-gcc/app/test -c f -n 4
Running tests with 4 workers

Test name                     Test result                     Test    Total
================================================================================
Parallel autotests:
Start test0:                         Success                      [00m 00s][00m 00s]
Start test1:                         Success                      [00m 00s][00m 00s]
Start test3:                         Success                      [00m 00s][00m 00s]
Start test2:                         Success                      [00m 00s][00m 00s]
Ticketlock autotest:          Success                      [00m 00s][00m 00s]
================================================================================
Total run time: 00m 00s

Thanks,
Phil

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock autotest
  2019-04-15 15:45 ` Phil Yang (Arm Technology China)
  2019-04-15 15:45   ` Phil Yang (Arm Technology China)
@ 2019-04-15 20:41   ` Thomas Monjalon
  2019-04-15 20:41     ` Thomas Monjalon
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2019-04-15 20:41 UTC (permalink / raw)
  To: Joyce Kong (Arm Technology China)
  Cc: dev, Phil Yang (Arm Technology China),
	nd, david.marchand, stephen, jerin.jacob, konstantin.ananyev,
	Honnappa Nagarahalli, Gavin Hu (Arm Technology China)

> > Add ticketlock_autotest implementation in python.
> > 
> > Fixes: efbcdaa55b93 ("test/ticketlock: add test cases")
> > 
> > Signed-off-by: Joyce Kong <joyce.kong@arm.com>
> Reviewed-by: Phil Yang <phil.yang@arm.com>
> Tested-by: Phil Yang <phil.yang@arm.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock autotest
  2019-04-15 20:41   ` Thomas Monjalon
@ 2019-04-15 20:41     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2019-04-15 20:41 UTC (permalink / raw)
  To: Joyce Kong (Arm Technology China)
  Cc: dev, Phil Yang (Arm Technology China),
	nd, david.marchand, stephen, jerin.jacob, konstantin.ananyev,
	Honnappa Nagarahalli, Gavin Hu (Arm Technology China)

> > Add ticketlock_autotest implementation in python.
> > 
> > Fixes: efbcdaa55b93 ("test/ticketlock: add test cases")
> > 
> > Signed-off-by: Joyce Kong <joyce.kong@arm.com>
> Reviewed-by: Phil Yang <phil.yang@arm.com>
> Tested-by: Phil Yang <phil.yang@arm.com>

Applied, thanks




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-04-15 20:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-15  9:04 [dpdk-dev] [PATCH v1] test/ticketlock: implement ticketlock autotest Joyce Kong
2019-04-15  9:04 ` Joyce Kong
2019-04-15 15:45 ` Phil Yang (Arm Technology China)
2019-04-15 15:45   ` Phil Yang (Arm Technology China)
2019-04-15 20:41   ` Thomas Monjalon
2019-04-15 20:41     ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).