From: TangHaifeng <haifengx.tang@intel.com>
To: dts@dpdk.org
Cc: jingguox.fu@intel.com
Subject: [dts] [dts 17/28] add unit_test_eal testcase into dts
Date: Tue, 26 May 2015 15:35:44 +0800 [thread overview]
Message-ID: <1432625755-19403-11-git-send-email-haifengx.tang@intel.com> (raw)
In-Reply-To: <1432625755-19403-1-git-send-email-haifengx.tang@intel.com>
---
tests/TestSuite_unit_tests_eal.py | 409 +++++++++++++++++++++++++++++++++++++
1 files changed, 409 insertions(+), 0 deletions(-)
create mode 100644 tests/TestSuite_unit_tests_eal.py
diff --git a/tests/TestSuite_unit_tests_eal.py b/tests/TestSuite_unit_tests_eal.py
new file mode 100644
index 0000000..e36adc5
--- /dev/null
+++ b/tests/TestSuite_unit_tests_eal.py
@@ -0,0 +1,409 @@
+# <COPYRIGHT_TAG>
+
+"""
+DPDK Test suite.
+
+EAL autotest.
+
+"""
+
+import dts
+
+
+from test_case import TestCase
+
+#
+#
+# Test class.
+#
+
+
+class TestUnitTestsEal(TestCase):
+
+ #
+ #
+ #
+ # Test cases.
+ #
+
+ def set_up_all(self):
+ """
+ Run at the start of each test suite.
+ """
+ out = self.dut.build_dpdk_apps('./app/test/')
+ self.verify('make: Leaving directory' in out, "Compilation failed")
+ [arch, machine, self.env, toolchain] = self.target.split('-')
+
+ def set_up(self):
+ """
+ Run before each test case.
+ """
+ pass
+
+ def test_version(self):
+ """
+ Run version autotest.
+ """
+
+ self.dut.send_expect("%s ./app/test/test -n 1 -c ffff" % self.dut.taskset(1),
+ "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("version_autotest", "RTE>>", 30)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_memcopy(self):
+ """
+ Run memcopy autotest.
+ """
+
+ self.dut.send_expect("%s ./app/test/test -n 1 -c ffff" % self.dut.taskset(1),
+ "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("memcpy_autotest", "RTE>>", 30)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_common(self):
+ """
+ Run common autotest.
+ """
+
+ self.dut.send_expect("%s ./app/test/test -n 1 -c ffff" % self.dut.taskset(1),
+ "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("common_autotest", "RTE>>", 30)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_eal_fs(self):
+ """
+ Run memcopy autotest.
+ """
+
+ self.dut.send_expect("%s ./app/test/test -n 1 -c ffff" % self.dut.taskset(1),
+ "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("eal_fs_autotest", "RTE>>", 30)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_memcpy(self):
+ """
+ Run memcopy autotest.
+ """
+
+ self.dut.send_expect("%s ./app/test/test -n 1 -c ffff" % self.dut.taskset(1),
+ "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("memcpy_autotest", "RTE>>", 30)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_memcpy_perf(self):
+ """
+ Run memcopy performance autotest.
+ """
+ self.dut.send_expect("%s ./app/test/test -n 1 -c ffff" % self.dut.taskset(1),
+ "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("memcpy_perf_autotest", "RTE>>", 240)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_hash(self):
+ """
+ Run hash autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("hash_autotest", "RTE>>", 30)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_hash_perf(self):
+ """
+ Run has performance autotest.
+ """
+
+ self.dut.send_expect("%s ./app/test/test -n 1 -c fffe" % self.dut.taskset(1),
+ "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("hash_perf_autotest", "RTE>>", 600)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_malloc(self):
+ """
+ Run malloc autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("malloc_autotest", "RTE>>", 30)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_func_reentrancy(self):
+ """
+ Run function reentrancy autotest.
+ """
+
+ if self.dut.architecture == "x86_64":
+ cmdline = "./app/test/test -n 1 -c ffff"
+ else:
+ # mask cores only on socket 0
+ cmdline = "%s ./app/test/test -n 1 -c 5555" % self.dut.taskset(1)
+ self.dut.send_expect(cmdline, "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("func_reentrancy_autotest", "RTE>>", 30)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_pci(self):
+ """
+ Run pci autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("pci_autotest", "RTE>>", 30)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_atomic(self):
+ """
+ Run atomic autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("atomic_autotest", "RTE>>", 30)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_memory(self):
+ """
+ Run memory autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect('memory_autotest', "RTE>>", 20)
+ regexp = "phys:0x[0-9a-f]*, len:([0-9a-f]*), virt:0x[0-9a-f]*, socket_id:[0-9]*"
+ match = dts.regexp(out, regexp)
+ size = int(match, 16)
+ self.verify(size > 0, "bad size")
+ self.dut.send_expect("quit", "# ")
+
+ def test_lcore_launch(self):
+ """
+ Run lcore autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("per_lcore_autotest", "RTE>>", 20)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_spinlock(self):
+ """
+ Run spinlock autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("spinlock_autotest", "RTE>>", 120)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_rwlock(self):
+ """
+ Run rwlock autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("rwlock_autotest", "RTE>>", 20)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_prefetch(self):
+ """
+ Run prefetch autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("prefetch_autotest", "RTE>>", 20)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_byteorder(self):
+ """
+ Run byte order autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("byteorder_autotest", "RTE>>", 10)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_cycles(self):
+ """
+ Run cycles autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("cycles_autotest", "RTE>>", 20)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_logs(self):
+ """
+ Run logs autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("logs_autotest", "RTE>>", 10)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_memzone(self):
+ """
+ Run memzone autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("memzone_autotest", "RTE>>", 10)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_debug(self):
+ """
+ Run debug autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("debug_autotest", "RTE>>", 10)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_flags(self):
+ """
+ Run eal flags autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff -m 64", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("eal_flags_autotest", "RTE>>", 40)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_alarm(self):
+ """
+ Run alarm autotest.
+ """
+
+ self.verify(self.env == "linuxapp", "Alarm only supported in linux env")
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("alarm_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_cpuflags(self):
+ """
+ Run CPU flags autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("cpuflags_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_errno(self):
+ """
+ Run errno autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*TE>>|RT.*E>>|RTE.*>>|RTE>.*>", 20)
+ out = self.dut.send_expect("errno_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_interrupts(self):
+ """
+ Run interrupt autotest.
+ """
+
+ self.verify(self.env == "linuxapp", "Interrupt only supported in linux env")
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*TE>>|RT.*E>>|RTE.*>>|RTE>.*>", 20)
+ out = self.dut.send_expect("interrupt_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_multiprocess(self):
+ """
+ Run multiprocess autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff -m 64", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("multiprocess_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_string(self):
+ """
+ Run string autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("string_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_tailq(self):
+ """
+ Run tailq autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("tailq_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_devargs(self):
+ """
+ Run devargs autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("devargs_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_kvargs(self):
+ """
+ Run kvargs autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("kvargs_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_acl(self):
+ """
+ Run acl autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("acl_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def test_link_bonding(self):
+ """
+ Run acl autotest.
+ """
+
+ self.dut.send_expect("./app/test/test -n 1 -c ffff", "R.*T.*E.*>.*>", 10)
+ out = self.dut.send_expect("link_bonding_autotest", "RTE>>", 60)
+ self.dut.send_expect("quit", "# ")
+ self.verify("Test OK" in out, "Test failed")
+
+ def tear_down(self):
+ """
+ Run after each test case.
+ """
+ pass
+
+ def tear_down_all(self):
+ """
+ Run after each test suite.
+ """
+ pass
--
1.7.4.4
next prev parent reply other threads:[~2015-05-26 7:36 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-26 7:35 [dts] [dts 07/28] add unit_test_mbuf rst file " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 08/28] add unit_test_mempool " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 09/28] add unit_tests_pmd_perf " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 10/28] add unit_test_power " TangHaifeng
2015-05-26 9:01 ` Liu, Yong
2015-05-26 7:35 ` [dts] [dts 11/28] add unit_test_qos " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 12/28] add unit_test_ring " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 13/28] add unit_test_ringpmd " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 14/28] add unit_test_timer " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 15/28] add unit_test_cmdline testcase " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 16/28] add unit_test_dump " TangHaifeng
2015-05-26 7:35 ` TangHaifeng [this message]
2015-05-26 7:35 ` [dts] [dts 18/28] add unit_test_ivshmem " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 19/28] add unit_test_kni " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 20/28] add unit_test_lpm " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 21/28] add unit_test_mbuf " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 22/28] add unit_test_mempool " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 23/28] add unit_test_pmd " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 24/28] add unit_test_power " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 25/28] add unit_test_qos " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 26/28] add unit_test_ring " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 27/28] add unit_test_ringpmd " TangHaifeng
2015-05-26 7:35 ` [dts] [dts 28/28] add unit_tests_timer " TangHaifeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1432625755-19403-11-git-send-email-haifengx.tang@intel.com \
--to=haifengx.tang@intel.com \
--cc=dts@dpdk.org \
--cc=jingguox.fu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).