[dts] [PATCH V3 2/3] Add multiple pthread test suite,

Lijuan Tu lijuanx.a.tu at intel.com
Thu Sep 10 05:45:55 CEST 2015


         There're three cases contained in this suite
         1)Basic operation
         2)Positive Test
         3)Negative Test

Signed-off-by: Lijuan Tu <lijuanx.a.tu at intel.com>
---
 tests/TestSuite_multiple_pthread.py | 626 ++++++++++++++++++++++++++++++++++++
 1 file changed, 626 insertions(+)
 create mode 100644 tests/TestSuite_multiple_pthread.py

diff --git a/tests/TestSuite_multiple_pthread.py b/tests/TestSuite_multiple_pthread.py
new file mode 100644
index 0000000..fa089d2
--- /dev/null
+++ b/tests/TestSuite_multiple_pthread.py
@@ -0,0 +1,626 @@
+# BSD LICENSE
+#
+# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+#   * Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#   * Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in
+#     the documentation and/or other materials provided with the
+#     distribution.
+#   * Neither the name of Intel Corporation nor the names of its
+#     contributors may be used to endorse or promote products derived
+#     from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""
+DPDK Test suite.
+
+Test Multiple Pthread Feature
+
+"""
+
+import dts
+import time
+import re
+import os
+from test_case import TestCase
+from pmd_output import PmdOutput
+
+#
+#
+# Test class.
+#
+
+
+class TestMultiplePthread(TestCase):
+
+    #
+    #
+    #
+    # Test cases.
+    #
+
+    def set_up_all(self):
+        """
+        Run at the start of each test suite.
+        """
+        self.ports = self.dut.get_ports()
+        self.portmask = dts.create_mask(self.dut.get_ports(self.nic))
+        self.verify(len(self.ports) >= 2, "Insufficient number of ports.")
+        self.ports_socket = self.dut.get_numa_id(self.ports[0])
+        self.pmdout = PmdOutput(self.dut)
+
+    def get_stats(self, portid):
+        """
+        Get packets number from port statistic.
+        """
+        output = PmdOutput(self.dut)
+        stats = output.get_pmd_stats(portid)
+        return stats
+
+    def check_forwarding(self, ports):
+        for i in range(len(ports)):
+            if i % 2 == 0:
+                self.send_packet(ports[i], ports[i + 1])
+                self.send_packet(ports[i + 1], ports[i])
+
+    def send_packet(self, txPort, rxPort):
+        """
+        Send packages according to parameters.
+        """
+        port0_stats = self.get_stats(txPort)
+        gp0tx_bytes = port0_stats['TX-bytes']
+        port1_stats = self.get_stats(rxPort)
+        gp1rx_err = port1_stats['RX-errors']
+        gp1rx_bytes = port1_stats['RX-bytes']
+        time.sleep(5)
+
+        itf = self.tester.get_interface(self.tester.get_local_port(rxPort))
+
+        destMac = self.dut.get_mac_address(txPort)
+        self.tester.scapy_foreground()
+        self.tester.scapy_append(
+            'sendp([Ether(dst="%s", src="52:00:00:00:00:00")], iface="%s")'
+            % (destMac, itf))
+        self.tester.scapy_execute()
+        time.sleep(3)
+
+        port0_stats = self.get_stats(txPort)
+        p0tx_bytes = port0_stats['TX-bytes']
+        port1_stats = self.get_stats(rxPort)
+        p1rx_err = port1_stats['RX-errors']
+        p1rx_bytes = port1_stats['RX-bytes']
+        time.sleep(5)
+
+        p0tx_bytes -= gp0tx_bytes
+        p1rx_bytes -= gp1rx_bytes
+        p1rx_err -= gp1rx_err
+
+        self.verify(p0tx_bytes == p1rx_bytes,
+                    "Wrong TX pkts p0_tx=%d, p1_rx=%d"
+                    % (p0tx_bytes, p1rx_bytes))
+
+    def set_up(self):
+        """
+        Run before each test case.
+        """
+        pass
+
+    def basic_operation(self, lcores, corelist):
+        """
+        Basic operation
+        """
+        # lcores = '0 at 8,(4-5)@9'
+        pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+            % (self.target, lcores, self.portmask)
+        self.dut.send_expect(pmd_cmd, "testpmd> ", 100)
+
+        self.dut.send_expect("set fwd mac", "testpmd>")
+        self.dut.send_expect("set corelist %s" % corelist, "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+        out = self.dut.send_expect("show config fwd", "testpmd> ")
+        for core in corelist:
+            if core.isdigit() == True:
+                self.verify("Logical Core %s " % core in out,
+                            "set corelist error: " + out)
+
+        self.check_forwarding(self.ports)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+        print out
+        result_scanner = "\d+\s+\d+\s+\w+.\w+\s+9\s./%s/app/testpmd" \
+            % self.target
+        scanner = re.compile(result_scanner, re.DOTALL)
+        m = scanner.finditer(out)
+        if m:
+            count = 0
+            for i in m:
+                text = i.group()
+                self.dut.alt_session.send_expect(
+                    "echo '%s' > /root/temp" % text, "#")
+                out = self.dut.alt_session.send_expect(
+                    "cat /root/temp | awk '{print $2}'", "#")
+                count += 1
+            self.verify(count == 2, "Threads running error")
+
+        self.dut.send_expect("quit", "#")
+
+    def positive_1_test(self, lcores, corelist):
+        # lcores = '0 at 8,(4-5)@(8-11)'
+        pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+            % (self.target, lcores, self.portmask)
+        out = self.dut.send_expect(pmd_cmd, "testpmd> ", 100)
+        self.dut.send_expect("set fwd mac", "testpmd>")
+        self.dut.send_expect("set corelist %s" % corelist, "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+        out = self.dut.send_expect("show config fwd", "testpmd> ")
+        for core in corelist:
+            if core.isdigit() == True:
+                self.verify("Logical Core %s " % core in out,
+                            "set corelist error:" + out)
+
+        self.check_forwarding(self.ports)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+        print out
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+            head -n 2 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '8',
+                    "Threads running error:cpu is %s, expect 8 ." % out)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+            tail -n 2", "#")
+        result_scanner = "\d+\s+\d+\s+\w+.\w+\s+\d+\s./%s/app/testpmd" \
+            % self.target
+        scanner = re.compile(result_scanner, re.DOTALL)
+        m = scanner.finditer(out)
+        if m:
+            count = 0
+            for i in m:
+                text = i.group()
+                self.dut.alt_session.send_expect(
+                    "echo '%s' > /root/temp" % text, "#")
+                out = self.dut.alt_session.send_expect(
+                    "cat /root/temp | awk '{print $4}'", "#")
+                if out == '8' or out == '9' or out == '10' or out == '11':
+                    count += 1
+            self.verify(count == 2,
+                        "Threads running error:cpu is %s, expect 2 ." % count)
+
+        self.dut.send_expect("quit", "#")
+
+    def positive_2_test(self, lcores, corelist):
+        # lcores = '1,2@(0-4,6),(3-4,6)@5,(7,8)'
+        pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+            % (self.target, lcores, self.portmask)
+        out = self.dut.send_expect(pmd_cmd, "testpmd> ", 100)
+        self.dut.send_expect("set fwd mac", "testpmd>")
+        self.dut.send_expect("set corelist %s" % corelist, "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+        out = self.dut.send_expect("show config fwd", "testpmd> ")
+        for core in corelist:
+            if core.isdigit() == True:
+                self.verify("Logical Core %s " % core in out,
+                            "set corelist error: " + out)
+
+        self.check_forwarding(self.ports)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+        print out
+
+        # decode lcores work cpus
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+            head -n 2 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '1',
+                    "Threads running error:cpu is %s, expect 1 ." % out)
+
+        out = self.dut.alt_session.send_expect(
+             "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+              head -n 4 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '0' or out == '1' or out == '2' or
+                    out == '3' or out == '4' or out == '6',
+                    "Threads running error")
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+             head -n 7 | tail -n 3", "#")
+        result_scanner = "\d+\s+\d+\s+\w+.\w+\s+5\s./%s/app/testpmd" \
+            % self.target
+        scanner = re.compile(result_scanner, re.DOTALL)
+        m = scanner.finditer(out)
+        if m:
+            count = 0
+            for i in m:
+                text = i.group()
+                self.dut.alt_session.send_expect(
+                    "echo '%s' > /root/temp" % text, "#")
+                out = self.dut.alt_session.send_expect(
+                    "cat /root/temp | awk '{print $4}'", "#")
+                if out == '5':
+                    count += 1
+        self.verify(count == 3,
+                    "Threads running error:cpu is %s, expect 3 ." % count)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | tail -n 2", "#")
+        result_scanner = "\d+\s+\d+\s+\w+.\w+\s+\d\s./%s/app/testpmd" \
+            % self.target
+        scanner = re.compile(result_scanner, re.DOTALL)
+        m = scanner.finditer(out)
+        if m:
+            count = 0
+            for i in m:
+                text = i.group()
+                self.dut.alt_session.send_expect(
+                    "echo '%s' > /root/temp" % text, "#")
+                out = self.dut.alt_session.send_expect(
+                    "cat /root/temp | awk '{print $4}'", "#")
+                if out == '8' or out == '7':
+                    count += 1
+        self.verify(count == 2,
+                    "Threads running error:cpu is %s, expect 2 ." % count)
+
+        self.dut.send_expect("quit", "#")
+
+    def positive_3_test(self, lcores, corelist):
+        # lcores = '(0,127)@(4,5)'
+        pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask='%s'" \
+            % (self.target, lcores, self.portmask)
+        out = self.dut.send_expect(pmd_cmd, "testpmd> ", 100)
+        self.dut.send_expect("set fwd mac", "testpmd>")
+        self.dut.send_expect("set corelist %s" % corelist, "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+        out = self.dut.send_expect("show config fwd", "testpmd> ")
+        self.verify("Logical Core 127 " in out, "set corelist error: " + out)
+
+        self.check_forwarding(self.ports)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+        print out
+
+        result_scanner = "\d+\s+\d+\s+\w+.\w+\s+\d\s./%s/app/testpmd" \
+            % self.target
+        scanner = re.compile(result_scanner, re.DOTALL)
+        m = scanner.finditer(out)
+        if m:
+            count = 0
+            for i in m:
+                text = i.group()
+                self.dut.alt_session.send_expect(
+                    "echo '%s' > /root/temp" % text, "#")
+                out = self.dut.alt_session.send_expect(
+                    "cat /root/temp | awk '{print $4}'", "#")
+                if out == '5' or out == '4':
+                    count += 1
+        self.verify(count == 2,
+                    "Threads running error:cpu is %s, expect 2 ." % count)
+
+        self.dut.send_expect("quit", "#")
+
+    def positive_4_test(self, lcores, corelist):
+        # lcores = '(0,64-66)@(4,5)'
+        pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+            % (self.target, lcores, self.portmask)
+        out = self.dut.send_expect(pmd_cmd, "testpmd> ", 100)
+        self.dut.send_expect("set fwd mac", "testpmd>")
+        self.dut.send_expect("set corelist %s" % corelist, "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+        out = self.dut.send_expect("show config fwd", "testpmd> ")
+        self.verify("Logical Core 64 " or "Logical Core 65 " in out,
+                    "set corelist error: " + out)
+
+        self.check_forwarding(self.ports)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+        print out
+
+        result_scanner = "\d+\s+\d+\s+\w+.\w+\s+\d\s./%s/app/testpmd" \
+            % self.target
+        scanner = re.compile(result_scanner, re.DOTALL)
+        m = scanner.finditer(out)
+        if m:
+            count = 0
+            for i in m:
+                text = i.group()
+                self.dut.alt_session.send_expect(
+                    "echo '%s' > /root/temp" % text, "#")
+                out = self.dut.alt_session.send_expect(
+                    "cat /root/temp | awk '{print $4}'", "#")
+                if out == '5' or out == '4':
+                    count += 1
+        self.verify(count == 4,
+                    "Threads running error:cpu is %s, expect 4 ." % count)
+
+        self.dut.send_expect("quit", "#")
+
+    def positive_5_test(self, lcores, corelist):
+        # lcores = '2-5,6,7-9'
+        pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+            % (self.target, lcores, self.portmask)
+        out = self.dut.send_expect(pmd_cmd, "testpmd> ", 100)
+        self.dut.send_expect("set fwd mac", "testpmd>")
+        self.dut.send_expect("set corelist %s" % corelist, "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+        out = self.dut.send_expect("show config fwd", "testpmd> ")
+        for core in corelist:
+            if core.isdigit() == True:
+                self.verify("Logical Core %s " % core in out,
+                            "set corelist error: " + out)
+
+        self.check_forwarding(self.ports)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+        print out
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+             head -n 2 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '2',
+                    "Threads running error:cpu is %s, expect 2 ." % out)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+             head -n 4 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '3',
+                    "Threads running error:cpu is %s, expect 3 ." % out)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+             head -n 5 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '4',
+                    "Threads running error:cpu is %s, expect 4 ." % out)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+             head -n 6 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '5',
+                    "Threads running error:cpu is %s, expect 5 ." % out)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+             head -n 7 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '6',
+                    "Threads running error:cpu is %s, expect 6 ." % out)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+             head -n 8 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '7',
+                    "Threads running error:cpu is %s, expect 7 ." % out)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+             head -n 9 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '8',
+                    "Threads running error:cpu is %s, expect 8 ." % out)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+             head -n 10 | tail -n 1 | awk '{print $4}'", "#")
+        self.verify(out == '9',
+                    "Threads running error:cpu is %s, expect 9 ." % out)
+
+        self.dut.send_expect("quit", "#")
+
+    def positive_6_test(self, lcores, corelist):
+        # lcores = '2, (3-5)@ 3'
+        pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+            % (self.target, lcores, self.portmask)
+        out = self.dut.send_expect(pmd_cmd, "testpmd> ", 100)
+        self.dut.send_expect("set fwd mac", "testpmd>")
+        self.dut.send_expect("set corelist %s" % corelist, "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+        out = self.dut.send_expect("show config fwd", "testpmd> ")
+        for core in corelist:
+            if core.isdigit() == True:
+                self.verify("Logical Core %s " % core in out,
+                            "set corelist error: " + out)
+
+        self.check_forwarding(self.ports)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+        print out
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args | \
+             head -n 2 | tail -n 1 | awk '{print $4}'", "#")
+        print out
+        self.verify(out == '2',
+                    "Threads running error:cpu is %s, expect 2 ." % out)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+        print out
+        result_scanner = "\d+\s+\d+\s+\w+.\w+\s+\d\s./%s/app/testpmd" \
+            % self.target
+        scanner = re.compile(result_scanner, re.DOTALL)
+        m = scanner.finditer(out)
+        if m:
+            count = 0
+            for i in m:
+                text = i.group()
+                self.dut.alt_session.send_expect(
+                    "echo '%s' > /root/temp" % text, "#")
+                out = self.dut.alt_session.send_expect(
+                    "cat /root/temp | awk '{print $4}'", "#")
+                if out == '3':
+                    count += 1
+        self.verify(count == 3,
+                    "Threads running error:cpu is %s, expect 3 ." % count)
+
+        self.dut.send_expect("quit", "#")
+
+    def positive_7_test(self, lcores, corelist):
+
+        # lcores = '(0,64-66)@(4,5)'
+        pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+            % (self.target, lcores, self.portmask)
+        out = self.dut.send_expect(pmd_cmd, "testpmd> ", 100)
+        self.dut.send_expect("set fwd mac", "testpmd>")
+        self.dut.send_expect("set corelist %s" % corelist, "testpmd> ")
+        self.dut.send_expect("start", "testpmd> ")
+        self.dut.send_expect("show config fwd", "testpmd> ")
+        self.check_forwarding(self.ports)
+
+        out = self.dut.alt_session.send_expect(
+            "ps -C testpmd -L -opid,tid,%cpu,psr,args", "#")
+        print out
+
+        result_scanner = "\d+\s+\d+\s+\w+.\w+\s+\d\s./%s/app/testpmd" \
+            % self.target
+        scanner = re.compile(result_scanner, re.DOTALL)
+        m = scanner.finditer(out)
+        self.dut.alt_session.send_expect(
+            "cd /sys/fs/cgroup/cpu/dpdk/thread0", "#")
+        if m:
+            count = 0
+            for i in m:
+                text = i.group()
+                self.dut.alt_session.send_expect(
+                    "echo '%s' > /root/temp" % text, "#")
+                out = self.dut.alt_session.send_expect(
+                    "cat /root/temp | awk '{print $4}'", "#")
+                if out == '5' or out == '4':
+                    count += 1
+        self.verify(count == 5, "Threads running error:cpu is %s, expect 5 ."
+                    % count)
+
+        self.dut.send_expect("quit", "#")
+
+    def check_negative(self, lcores):
+        """
+        """
+        pmd_cmd = "./%s/app/testpmd --lcores='%s' -n 4 -- -i --portmask=%s" \
+            % (self.target, lcores, self.portmask)
+        self.dut.send_expect(pmd_cmd, "#", 100)
+
+    def test_basic_operation(self):
+	"""
+        Basic operation
+        """
+        lcores = '0 at 8,(4-5)@9'
+        corelist = ['4', '5', '4,5']
+        for core in corelist:
+            self.basic_operation(lcores, core)
+
+    def test_positive_test(self):
+	"""
+        Positive Test
+        """
+
+        # item 1
+        lcores = '0 at 8,(4-5)@(8-11)'
+        corelist = ['4', '5', '4,5']
+        for core in corelist:
+            self.positive_1_test(lcores, core)
+
+        # item 2
+        lcores = '1,2@(0-4,6),(3-4,6)@5,(7,8)'
+        corelist = ['2', '3', '4', '6', '7', '8',
+                    '2,3', '2,4', '2,6', '2,7', '2,8',
+                    '3,4', '3,6', '3,7', '3,8',
+                    '4,6', '4,7', '4,8',
+                    '6,7', '6,8',
+                    '7,8']
+        for core in corelist:
+            self.positive_2_test(lcores, core)
+
+        # item 3
+        lcores = '(0,127)@(4,5)'
+        corelist = ['127']
+        for core in corelist:
+            self.positive_3_test(lcores, core)
+
+        # item 4
+        lcores = '(0,64-66)@(4,5)'
+        corelist = ['64', '65', '66', '64,65', '64,66', '65,66']
+        for core in corelist:
+            self.positive_4_test(lcores, core)
+
+        # item 5
+        lcores = '2-5,6,7-9'
+        corelist = ['3', '4', '5', '6', '7', '8', '9',
+                    '3,4', '3,5', '3,6', '3,7', '3,8', '3,9',
+                    '4,5', '4,6', '4,7', '4,8', '4,9',
+                    '5,6', '5,7', '5,8', '5,9',
+                    '6,7', '6,8', '6,9',
+                    '7,8', '7,9',
+                    '8,9']
+        for core in corelist:
+            self.positive_5_test(lcores, core)
+
+        # item 6
+        lcores = '2, (3-5)@ 3'
+        corelist = ['3', '4', '5', '3,4', '3,5', '4,5']
+        for core in corelist:
+            self.positive_6_test(lcores, core)
+
+        # item 7
+        lcores = '(0,7-4)@(4,5)'
+        corelist = ['7', '6', '5', '4',
+                    '7,6', '7,5', '7,4', '6,5', '6,4', '5,4']
+        for core in corelist:
+            self.positive_7_test(lcores, core)
+
+    def test_negative_test(self):
+        """
+        Negative Test
+        """
+        lcores = [
+            '(0-,4-7)@(4,5)',
+            '(-1,4-7)@(4,5)',
+            '(0,4-7-9)@(4,5)',
+            '(0,abcd)@(4,5)',
+            '(0,4-7)@(1-,5)',
+            '(0,4-7)@(-1,5)',
+            '(0,4-7)@(4,5-8-9)',
+            '(0,4-7)@(abc,5)',
+            '(0,4-7)@(4,xyz)',
+            '(0,4-7)=(8,9)',
+            '2,3 at 4,(0-1,,4))',
+            '[0-,4-7]@(4,5)',
+            '(0-,4-7)@[4,5]',
+            '3-4 at 3,2 at 5-6',
+            '2,,3''2--3',
+            '2,,,3''2--3']
+        for lcore in lcores:
+            self.check_negative(lcore)
+
+    def tear_down(self):
+        """
+        Run after each test case.
+        """
+        self.dut.kill_all()
+
+    def tear_down_all(self):
+        """
+        Run after each test suite.
+        """
-- 
1.8.3.1



More information about the dts mailing list