* [dts] [PATCH V1] update dump test suite @ 2016-08-08 8:11 xu,huilong 2016-08-09 5:14 ` Liu, Yong 0 siblings, 1 reply; 5+ messages in thread From: xu,huilong @ 2016-08-08 8:11 UTC (permalink / raw) To: dts; +Cc: xu,huilong update list: 1. discard test_log_dump, because this function remove in dpdk.org 2. update ring_dump/mempool_dump case, ignore get ring/mempool struct info. because ring struct is a internal struct, only get ring/mempool name. and check. 3. update dump_devargs case. update get pci address from portsInfo Signed-off-by: xu,huilong <huilongx.xu@intel.com> --- tests/TestSuite_unit_tests_dump.py | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/tests/TestSuite_unit_tests_dump.py b/tests/TestSuite_unit_tests_dump.py index afdc256..26299f0 100644 --- a/tests/TestSuite_unit_tests_dump.py +++ b/tests/TestSuite_unit_tests_dump.py @@ -72,7 +72,7 @@ class TestUnitTestsDump(TestCase): """ pass - def test_log_dump(self): + def discard_test_log_dump(self): """ Run history log dump test case. """ @@ -86,40 +86,31 @@ class TestUnitTestsDump(TestCase): Run history log dump test case. """ self.dut.send_expect("./%s/app/test -n 1 -c ffff" % (self.target), "R.*T.*E.*>.*>", self.start_test_time) + self.dut.send_expect("mempool_autotest", "RTE>>", self.run_cmd_time * 2) out = self.dut.send_expect("dump_ring", "RTE>>", self.run_cmd_time) self.dut.send_expect("quit", "# ") - elements = ['ring', 'address', 'flags', 'size', 'ct', 'ch', 'pt', 'ph', 'used', 'avail', 'watermark'] + elements = ['ring', 'flags', 'size', 'ct', 'ch', 'pt', 'ph', 'used', 'avail', 'watermark'] match_regex = "ring <(.*?)>@0x(.*)\r\n" - for element in elements[2:]: - match_regex += " %s=(\d*)\r\n" % element m = re.compile(r"%s" % match_regex, re.S) result = m.search(out) - ring_info = dict(zip(elements, result.groups())) + ring_info = result.groups() - self.verify(ring_info['ring'] == 'MP_log_history', "Test failed") + self.verify(len(ring_info) == 2, "dump ring name failed") def test_mempool_dump(self): """ Run mempool dump test case. """ self.dut.send_expect("./%s/app/test -n 1 -c ffff" % (self.target), "R.*T.*E.*>.*>", self.start_test_time) + self.dut.send_expect("mempool_autotest", "RTE>>", self.run_cmd_time * 2) out = self.dut.send_expect("dump_mempool", "RTE>>", self.run_cmd_time * 2) self.dut.send_expect("quit", "# ") - elements = ['mempool', 'flags', 'ring', 'phys_addr', 'nb_mem_chunks', 'size', 'populated_size', 'header_size', 'elt_size', - 'trailer_size', 'total_obj_size', 'private_data_size', 'avg bytes/object', 'cache infos','cache_size', 'common_pool_count'] match_regex = "mempool <(.*?)>@0x(.*?)\r\n" - for element in elements[1:]: - if element == 'cache_size': - match_regex += " %s=(.*?)\r\n" % element - elif element == 'cache infos': - match_regex += " %s:\r\n" % element - else: - match_regex += " %s=(.*?)\r\n" % element m = re.compile(r"%s" % match_regex, re.S) result = m.search(out) - mempool_info = dict(zip(elements, result.groups())) + mempool_info = result.groups() - self.verify(mempool_info['mempool'] == 'log_history', "Test failed") + self.verify(len(mempool_info) == 2, "dump mempool name failed") def test_physmem_dump(self): """ @@ -185,19 +176,22 @@ class TestUnitTestsDump(TestCase): Run devargs dump test case. """ test_port = self.dut_ports[0] - self.dut.send_expect("./%s/app/test -n 1 -c ffff -b %s" - % (self.target, self.dut.ports_info[test_port]['pci']), "R.*T.*E.*>.*>", self.start_test_time) + pci_address = self.dut.ports_info[test_port]['pci']; + if not pci_address.startswith('0000:'): + pci_address = '0000:' + pci_address + self.dut.send_expect("./%s/app/test -n 1 -c ffff -b %s" + % (self.target, pci_address), "R.*T.*E.*>.*>", self.start_test_time) out = self.dut.send_expect("dump_devargs", "RTE>>", self.run_cmd_time * 2) self.dut.send_expect("quit", "# ") - black_str = "PCI blacklist %s" % self.dut.ports_info[test_port]['pci'] + black_str = "PCI blacklist %s" % pci_address self.verify(black_str in out, "Dump black list failed") self.dut.send_expect("./%s/app/test -n 1 -c ffff -w %s" - % (self.target, self.dut.ports_info[test_port]['pci']), "R.*T.*E.*>.*>", self.start_test_time) + % (self.target, pci_address), "R.*T.*E.*>.*>", self.start_test_time) out = self.dut.send_expect("dump_devargs", "RTE>>", self.run_cmd_time * 2) self.dut.send_expect("quit", "# ") - white_str = "PCI whitelist %s" % self.dut.ports_info[test_port]['pci'] + white_str = "PCI whitelist %s" % pci_address self.verify(white_str in out, "Dump white list failed") def tear_down(self): -- 1.9.3 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dts] [PATCH V1] update dump test suite 2016-08-08 8:11 [dts] [PATCH V1] update dump test suite xu,huilong @ 2016-08-09 5:14 ` Liu, Yong 2016-08-09 5:47 ` Xu, HuilongX 0 siblings, 1 reply; 5+ messages in thread From: Liu, Yong @ 2016-08-09 5:14 UTC (permalink / raw) To: Xu, HuilongX, dts; +Cc: Xu, HuilongX Huilong, two comments below. > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong > Sent: Monday, August 08, 2016 4:11 PM > To: dts@dpdk.org > Cc: Xu, HuilongX > Subject: [dts] [PATCH V1] update dump test suite > > update list: > 1. discard test_log_dump, because this function remove in dpdk.org > 2. update ring_dump/mempool_dump case, ignore get ring/mempool struct info. > because ring struct is a internal struct, only get ring/mempool name. > and check. > 3. update dump_devargs case. update get pci address from portsInfo > > Signed-off-by: xu,huilong <huilongx.xu@intel.com> > --- > tests/TestSuite_unit_tests_dump.py | 38 ++++++++++++++++----------------- > ----- > 1 file changed, 16 insertions(+), 22 deletions(-) > > diff --git a/tests/TestSuite_unit_tests_dump.py > b/tests/TestSuite_unit_tests_dump.py > index afdc256..26299f0 100644 > --- a/tests/TestSuite_unit_tests_dump.py > +++ b/tests/TestSuite_unit_tests_dump.py > @@ -72,7 +72,7 @@ class TestUnitTestsDump(TestCase): > """ > pass > > - def test_log_dump(self): > + def discard_test_log_dump(self): > """ > Run history log dump test case. > """ > @@ -86,40 +86,31 @@ class TestUnitTestsDump(TestCase): > Run history log dump test case. > """ > self.dut.send_expect("./%s/app/test -n 1 -c ffff" % (self.target), > "R.*T.*E.*>.*>", self.start_test_time) > + self.dut.send_expect("mempool_autotest", "RTE>>", > self.run_cmd_time * 2) > out = self.dut.send_expect("dump_ring", "RTE>>", > self.run_cmd_time) > self.dut.send_expect("quit", "# ") > - elements = ['ring', 'address', 'flags', 'size', 'ct', 'ch', 'pt', > 'ph', 'used', 'avail', 'watermark'] > + elements = ['ring', 'flags', 'size', 'ct', 'ch', 'pt', 'ph', > 'used', 'avail', 'watermark'] > match_regex = "ring <(.*?)>@0x(.*)\r\n" > - for element in elements[2:]: > - match_regex += " %s=(\d*)\r\n" % element > m = re.compile(r"%s" % match_regex, re.S) > result = m.search(out) > - ring_info = dict(zip(elements, result.groups())) > + ring_info = result.groups() > > - self.verify(ring_info['ring'] == 'MP_log_history', "Test failed") > + self.verify(len(ring_info) == 2, "dump ring name failed") > Only check ring number is not enough, we'd better also check expected ring name. > def test_mempool_dump(self): > """ > Run mempool dump test case. > """ > self.dut.send_expect("./%s/app/test -n 1 -c ffff" % (self.target), > "R.*T.*E.*>.*>", self.start_test_time) > + self.dut.send_expect("mempool_autotest", "RTE>>", > self.run_cmd_time * 2) > out = self.dut.send_expect("dump_mempool", "RTE>>", > self.run_cmd_time * 2) > self.dut.send_expect("quit", "# ") > - elements = ['mempool', 'flags', 'ring', 'phys_addr', > 'nb_mem_chunks', 'size', 'populated_size', 'header_size', 'elt_size', > - 'trailer_size', 'total_obj_size', 'private_data_size', > 'avg bytes/object', 'cache infos','cache_size', 'common_pool_count'] > match_regex = "mempool <(.*?)>@0x(.*?)\r\n" > - for element in elements[1:]: > - if element == 'cache_size': > - match_regex += " %s=(.*?)\r\n" % element > - elif element == 'cache infos': > - match_regex += " %s:\r\n" % element > - else: > - match_regex += " %s=(.*?)\r\n" % element > m = re.compile(r"%s" % match_regex, re.S) > result = m.search(out) > - mempool_info = dict(zip(elements, result.groups())) > + mempool_info = result.groups() > > - self.verify(mempool_info['mempool'] == 'log_history', "Test > failed") > + self.verify(len(mempool_info) == 2, "dump mempool name failed") > > def test_physmem_dump(self): > """ > @@ -185,19 +176,22 @@ class TestUnitTestsDump(TestCase): > Run devargs dump test case. > """ > test_port = self.dut_ports[0] > - self.dut.send_expect("./%s/app/test -n 1 -c ffff -b %s" > - % (self.target, > self.dut.ports_info[test_port]['pci']), "R.*T.*E.*>.*>", > self.start_test_time) > + pci_address = self.dut.ports_info[test_port]['pci']; > + if not pci_address.startswith('0000:'): > + pci_address = '0000:' + pci_address > + self.dut.send_expect("./%s/app/test -n 1 -c ffff -b %s" > + % (self.target, pci_address), pci_address should be correct, framework has been added domain id into pci address. > "R.*T.*E.*>.*>", self.start_test_time) > out = self.dut.send_expect("dump_devargs", "RTE>>", > self.run_cmd_time * 2) > self.dut.send_expect("quit", "# ") > - black_str = "PCI blacklist %s" % > self.dut.ports_info[test_port]['pci'] > + black_str = "PCI blacklist %s" % pci_address > self.verify(black_str in out, "Dump black list failed") > > self.dut.send_expect("./%s/app/test -n 1 -c ffff -w %s" > - % (self.target, > self.dut.ports_info[test_port]['pci']), "R.*T.*E.*>.*>", > self.start_test_time) > + % (self.target, pci_address), > "R.*T.*E.*>.*>", self.start_test_time) > out = self.dut.send_expect("dump_devargs", "RTE>>", > self.run_cmd_time * 2) > self.dut.send_expect("quit", "# ") > > - white_str = "PCI whitelist %s" % > self.dut.ports_info[test_port]['pci'] > + white_str = "PCI whitelist %s" % pci_address > self.verify(white_str in out, "Dump white list failed") > > def tear_down(self): > -- > 1.9.3 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dts] [PATCH V1] update dump test suite 2016-08-09 5:14 ` Liu, Yong @ 2016-08-09 5:47 ` Xu, HuilongX 2016-08-09 9:56 ` Liu, Yong 0 siblings, 1 reply; 5+ messages in thread From: Xu, HuilongX @ 2016-08-09 5:47 UTC (permalink / raw) To: Liu, Yong, dts Hi yong, Two comments. > -----Original Message----- > From: Liu, Yong > Sent: Tuesday, August 09, 2016 1:14 PM > To: Xu, HuilongX; dts@dpdk.org > Cc: Xu, HuilongX > Subject: RE: [dts] [PATCH V1] update dump test suite > > Huilong, two comments below. > > > -----Original Message----- > > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of xu,huilong > > Sent: Monday, August 08, 2016 4:11 PM > > To: dts@dpdk.org > > Cc: Xu, HuilongX > > Subject: [dts] [PATCH V1] update dump test suite > > > > update list: > > 1. discard test_log_dump, because this function remove in dpdk.org > > 2. update ring_dump/mempool_dump case, ignore get ring/mempool struct > info. > > because ring struct is a internal struct, only get ring/mempool > name. > > and check. > > 3. update dump_devargs case. update get pci address from portsInfo > > > > Signed-off-by: xu,huilong <huilongx.xu@intel.com> > > --- > > tests/TestSuite_unit_tests_dump.py | 38 ++++++++++++++++------------- > ---- > > ----- > > 1 file changed, 16 insertions(+), 22 deletions(-) > > > > diff --git a/tests/TestSuite_unit_tests_dump.py > > b/tests/TestSuite_unit_tests_dump.py > > index afdc256..26299f0 100644 > > --- a/tests/TestSuite_unit_tests_dump.py > > +++ b/tests/TestSuite_unit_tests_dump.py > > @@ -72,7 +72,7 @@ class TestUnitTestsDump(TestCase): > > """ > > pass > > > > - def test_log_dump(self): > > + def discard_test_log_dump(self): > > """ > > Run history log dump test case. > > """ > > @@ -86,40 +86,31 @@ class TestUnitTestsDump(TestCase): > > Run history log dump test case. > > """ > > self.dut.send_expect("./%s/app/test -n 1 -c ffff" % > (self.target), > > "R.*T.*E.*>.*>", self.start_test_time) > > + self.dut.send_expect("mempool_autotest", "RTE>>", > > self.run_cmd_time * 2) > > out = self.dut.send_expect("dump_ring", "RTE>>", > > self.run_cmd_time) > > self.dut.send_expect("quit", "# ") > > - elements = ['ring', 'address', 'flags', 'size', 'ct', 'ch', > 'pt', > > 'ph', 'used', 'avail', 'watermark'] > > + elements = ['ring', 'flags', 'size', 'ct', 'ch', 'pt', 'ph', > > 'used', 'avail', 'watermark'] > > match_regex = "ring <(.*?)>@0x(.*)\r\n" > > - for element in elements[2:]: > > - match_regex += " %s=(\d*)\r\n" % element > > m = re.compile(r"%s" % match_regex, re.S) > > result = m.search(out) > > - ring_info = dict(zip(elements, result.groups())) > > + ring_info = result.groups() > > > > - self.verify(ring_info['ring'] == 'MP_log_history', "Test > failed") > > + self.verify(len(ring_info) == 2, "dump ring name failed") > > > Only check ring number is not enough, we'd better also check expected > ring name. The ring name only a string. The string content set by who will used it. So I think we don't need check the string content. We only should check dump can work, and get ring struct info. And the struct content by dpdk decision. > > > def test_mempool_dump(self): > > """ > > Run mempool dump test case. > > """ > > self.dut.send_expect("./%s/app/test -n 1 -c ffff" % > (self.target), > > "R.*T.*E.*>.*>", self.start_test_time) > > + self.dut.send_expect("mempool_autotest", "RTE>>", > > self.run_cmd_time * 2) > > out = self.dut.send_expect("dump_mempool", "RTE>>", > > self.run_cmd_time * 2) > > self.dut.send_expect("quit", "# ") > > - elements = ['mempool', 'flags', 'ring', 'phys_addr', > > 'nb_mem_chunks', 'size', 'populated_size', 'header_size', 'elt_size', > > - 'trailer_size', 'total_obj_size', > 'private_data_size', > > 'avg bytes/object', 'cache infos','cache_size', 'common_pool_count'] > > match_regex = "mempool <(.*?)>@0x(.*?)\r\n" > > - for element in elements[1:]: > > - if element == 'cache_size': > > - match_regex += " %s=(.*?)\r\n" % element > > - elif element == 'cache infos': > > - match_regex += " %s:\r\n" % element > > - else: > > - match_regex += " %s=(.*?)\r\n" % element > > m = re.compile(r"%s" % match_regex, re.S) > > result = m.search(out) > > - mempool_info = dict(zip(elements, result.groups())) > > + mempool_info = result.groups() > > > > - self.verify(mempool_info['mempool'] == 'log_history', "Test > > failed") > > + self.verify(len(mempool_info) == 2, "dump mempool name > failed") > > > > def test_physmem_dump(self): > > """ > > @@ -185,19 +176,22 @@ class TestUnitTestsDump(TestCase): > > Run devargs dump test case. > > """ > > test_port = self.dut_ports[0] > > - self.dut.send_expect("./%s/app/test -n 1 -c ffff -b %s" > > - % (self.target, > > self.dut.ports_info[test_port]['pci']), "R.*T.*E.*>.*>", > > self.start_test_time) > > + pci_address = self.dut.ports_info[test_port]['pci']; > > + if not pci_address.startswith('0000:'): > > + pci_address = '0000:' + pci_address > > + self.dut.send_expect("./%s/app/test -n 1 -c ffff -b %s" > > + % (self.target, pci_address), > > pci_address should be correct, framework has been added domain id into > pci address. OK, I will remove pci_address check code. > > > > "R.*T.*E.*>.*>", self.start_test_time) > > out = self.dut.send_expect("dump_devargs", "RTE>>", > > self.run_cmd_time * 2) > > self.dut.send_expect("quit", "# ") > > - black_str = "PCI blacklist %s" % > > self.dut.ports_info[test_port]['pci'] > > + black_str = "PCI blacklist %s" % pci_address > > self.verify(black_str in out, "Dump black list failed") > > > > self.dut.send_expect("./%s/app/test -n 1 -c ffff -w %s" > > - % (self.target, > > self.dut.ports_info[test_port]['pci']), "R.*T.*E.*>.*>", > > self.start_test_time) > > + % (self.target, pci_address), > > "R.*T.*E.*>.*>", self.start_test_time) > > out = self.dut.send_expect("dump_devargs", "RTE>>", > > self.run_cmd_time * 2) > > self.dut.send_expect("quit", "# ") > > > > - white_str = "PCI whitelist %s" % > > self.dut.ports_info[test_port]['pci'] > > + white_str = "PCI whitelist %s" % pci_address > > self.verify(white_str in out, "Dump white list failed") > > > > def tear_down(self): > > -- > > 1.9.3 ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dts] [PATCH V1] update dump test suite 2016-08-09 5:47 ` Xu, HuilongX @ 2016-08-09 9:56 ` Liu, Yong 2016-08-10 7:50 ` Xu, HuilongX 0 siblings, 1 reply; 5+ messages in thread From: Liu, Yong @ 2016-08-09 9:56 UTC (permalink / raw) To: Xu, HuilongX, dts Huilong, dump_ring, dump_mempool are the test cases for dpdk API which can dump all mempools and rings. Ideally, we need to verify dumped mempool information is the same as added. But at least, we need to verify all added mempools and rings can be dumped. After running mempool autotest, there' re three mempools left, they are "test_nocache", "test_cache", "test_stack". We need verify the information is correct. On 08/09/2016 01:47 PM, Xu, HuilongX wrote: >> Only check ring number is not enough, we'd better also check expected >> >ring name. > The ring name only a string. The string content set by who will used it. > So I think we don't need check the string content. We only should check dump can work, and get ring struct info. > And the struct content by dpdk decision. >> > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dts] [PATCH V1] update dump test suite 2016-08-09 9:56 ` Liu, Yong @ 2016-08-10 7:50 ` Xu, HuilongX 0 siblings, 0 replies; 5+ messages in thread From: Xu, HuilongX @ 2016-08-10 7:50 UTC (permalink / raw) To: Liu, Yong, dts Hi yong, The mempool name maybe will changed, when development want to update. Dump only a debug function, I think we only check it can dump the info. And the info by dump is normal or not decide by mempool auto test and mempool struct. Thanks a lot > -----Original Message----- > From: Liu, Yong > Sent: Tuesday, August 09, 2016 5:57 PM > To: Xu, HuilongX; dts@dpdk.org > Subject: Re: [dts] [PATCH V1] update dump test suite > > Huilong, > dump_ring, dump_mempool are the test cases for dpdk API which can dump > all mempools and rings. > Ideally, we need to verify dumped mempool information is the same as > added. But at least, we need to verify all added mempools and rings can > be dumped. > After running mempool autotest, there' re three mempools left, they are > "test_nocache", "test_cache", "test_stack". > We need verify the information is correct. > > > On 08/09/2016 01:47 PM, Xu, HuilongX wrote: > >> Only check ring number is not enough, we'd better also check expected > >> >ring name. > > The ring name only a string. The string content set by who will used > it. > > So I think we don't need check the string content. We only should > check dump can work, and get ring struct info. > > And the struct content by dpdk decision. > >> > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-10 7:50 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-08-08 8:11 [dts] [PATCH V1] update dump test suite xu,huilong 2016-08-09 5:14 ` Liu, Yong 2016-08-09 5:47 ` Xu, HuilongX 2016-08-09 9:56 ` Liu, Yong 2016-08-10 7:50 ` Xu, HuilongX
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).