Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/96058/?format=api
http://patchwork.dpdk.org/api/patches/96058/?format=api", "web_url": "http://patchwork.dpdk.org/project/dts/patch/1626699608-20895-3-git-send-email-churchill.khangar@intel.com/", "project": { "id": 3, "url": "http://patchwork.dpdk.org/api/projects/3/?format=api", "name": "DTS", "link_name": "dts", "list_id": "dts.dpdk.org", "list_email": "dts@dpdk.org", "web_url": "", "scm_url": "git://dpdk.org/tools/dts", "webscm_url": "http://git.dpdk.org/tools/dts/", "list_archive_url": "https://inbox.dpdk.org/dts", "list_archive_url_format": "https://inbox.dpdk.org/dts/{}", "commit_url_format": "" }, "msgid": "<1626699608-20895-3-git-send-email-churchill.khangar@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dts/1626699608-20895-3-git-send-email-churchill.khangar@intel.com", "date": "2021-07-19T13:00:08", "name": "[2/2] tests/pipeline: add LPM and action selector test suite", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "ac7121ae21a8b501f897a4bb1091ab36b9432fbc", "submitter": { "id": 2045, "url": "http://patchwork.dpdk.org/api/people/2045/?format=api", "name": "Churchill Khangar", "email": "churchill.khangar@intel.com" }, "delegate": null, "mbox": "http://patchwork.dpdk.org/project/dts/patch/1626699608-20895-3-git-send-email-churchill.khangar@intel.com/mbox/", "series": [ { "id": 17895, "url": "http://patchwork.dpdk.org/api/series/17895/?format=api", "web_url": "http://patchwork.dpdk.org/project/dts/list/?series=17895", "date": "2021-07-19T13:00:08", "name": "add pipeline LPM and action selector test coverage", "version": 1, "mbox": "http://patchwork.dpdk.org/series/17895/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/96058/comments/", "check": "pending", "checks": "http://patchwork.dpdk.org/api/patches/96058/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dts-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BE339A0547;\n\tMon, 19 Jul 2021 15:09:31 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B5D2F410F4;\n\tMon, 19 Jul 2021 15:09:31 +0200 (CEST)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n by mails.dpdk.org (Postfix) with ESMTP id E0F8A4068B\n for <dts@dpdk.org>; Mon, 19 Jul 2021 15:09:29 +0200 (CEST)", "from fmsmga004.fm.intel.com ([10.253.24.48])\n by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 19 Jul 2021 06:07:11 -0700", "from bdcdev11.iind.intel.com ([10.190.193.151])\n by fmsmga004.fm.intel.com with ESMTP; 19 Jul 2021 06:07:09 -0700" ], "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10049\"; a=\"296612997\"", "E=Sophos;i=\"5.84,252,1620716400\"; d=\"scan'208\";a=\"296612997\"", "E=Sophos;i=\"5.84,252,1620716400\"; d=\"scan'208\";a=\"494057159\"" ], "X-ExtLoop1": "1", "From": "Churchill Khangar <churchill.khangar@intel.com>", "To": "dts@dpdk.org", "Cc": "venkata.suresh.kumar.p@intel.com, churchill.khangar@intel.com,\n yogesh.jangra@intel.com", "Date": "Mon, 19 Jul 2021 09:00:08 -0400", "Message-Id": "<1626699608-20895-3-git-send-email-churchill.khangar@intel.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1626699608-20895-1-git-send-email-churchill.khangar@intel.com>", "References": "<1626699608-20895-1-git-send-email-churchill.khangar@intel.com>", "Subject": "[dts] [PATCH 2/2] tests/pipeline: add LPM and action selector test\n suite", "X-BeenThere": "dts@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "test suite reviews and discussions <dts.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dts>,\n <mailto:dts-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dts/>", "List-Post": "<mailto:dts@dpdk.org>", "List-Help": "<mailto:dts-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dts>,\n <mailto:dts-request@dpdk.org?subject=subscribe>", "Errors-To": "dts-bounces@dpdk.org", "Sender": "\"dts\" <dts-bounces@dpdk.org>" }, "content": "This patch has the pipeline test suite changes to cover\nthe scenarios on Longest Prefix Match(LPM) and\naction selector features.\n\nSigned-off-by: Churchill Khangar <churchill.khangar@intel.com>\nTested-by: Venkata Suresh Kumar P <venkata.suresh.kumar.p@intel.com>\n---\n tests/TestSuite_pipeline.py | 391 ++++++++++++++++++++++++++++++++++++--------\n 1 file changed, 326 insertions(+), 65 deletions(-)", "diff": "diff --git a/tests/TestSuite_pipeline.py b/tests/TestSuite_pipeline.py\nindex 2b14ddf..e00f2e9 100644\n--- a/tests/TestSuite_pipeline.py\n+++ b/tests/TestSuite_pipeline.py\n@@ -250,6 +250,36 @@ class TestPipeline(TestCase):\n self.dut.send_expect('^C', '# ')\n self.verify(False, \"Output pcap files mismatch error\")\n \n+ def send_scapy_pkts(self, from_port):\n+\n+ tx_port = self.tester.get_local_port(self.dut_ports[from_port])\n+ tx_interface = self.tester.get_interface(tx_port)\n+\n+ self.tester.send_expect('rm -f /tmp/*.txt /tmp/*.pcap /tmp/*.out', '# ')\n+ pcap_file = '/tmp/packet_tx.pcap'\n+ self.tester.scapy_foreground()\n+ pr = 0\n+ for a in range(192, 255):\n+ for b in range(0, 255):\n+ for c in range(0, 255):\n+ for d in range(0, 255):\n+ my_dst = \"{}.{}.{}.{}\".format(a, b, c, d)\n+ pkt = [Ether(dst=self.dut_p0_mac)/IP(src=\"0.0.0.2\", dst=my_dst) /\n+ TCP(sport=100, dport=200)/Raw(load=\"X\"*6)]\n+ wrpcap(pcap_file, pkt, append=True)\n+ pr += 1\n+ if pr == 50:\n+ pr = 0\n+ self.tester.scapy_append('pkt = rdpcap(\"/tmp/packet_tx.pcap\")')\n+ self.tester.scapy_append('sendp(pkt, iface=\"{}\", count=1)'.format(tx_interface))\n+ self.tester.scapy_execute()\n+ self.tester.send_expect('rm -f /tmp/*.txt /tmp/*.pcap /tmp/*.out', '# ')\n+\n+ if pr:\n+ self.tester.scapy_append('pkt = rdpcap(\"/tmp/packet_tx.pcap\")')\n+ self.tester.scapy_append('sendp(pkt, iface=\"{}\", count=1)'.format(tx_interface))\n+ self.tester.scapy_execute()\n+\n def setup_env(self, port_nums, driver):\n \"\"\"\n This is to set up vf environment.\n@@ -2566,71 +2596,6 @@ class TestPipeline(TestCase):\n self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n self.dut.send_expect(\"^C\", \"# \", 20)\n \n- def test_table_005(self):\n-\n- cli_file = '/tmp/pipeline/table_005/table_005.cli'\n- self.run_dpdk_app(cli_file)\n- sleep(1)\n- s = self.connect_cli_server()\n-\n- # [1]: Empty table: Default action executed for all the packets.\n- in_pcap = 'pipeline/table_005/pcap_files/in_1.txt'\n- out_pcap = 'pipeline/table_005/pcap_files/out_1.txt'\n- self.send_and_sniff_pkts(0, 0, in_pcap, out_pcap, \"tcp\")\n-\n- # [2]: Single rule: Defined action for hit, Default action for miss.\n- CMD_FILE = '/tmp/pipeline/table_005/cmd_files/cmd_2.txt'\n- CLI_CMD = 'pipeline PIPELINE0 table table_005_table add {}\\n'.format(CMD_FILE)\n- self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n- CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n- self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n- in_pcap = 'pipeline/table_005/pcap_files/in_2.txt'\n- out_pcap = 'pipeline/table_005/pcap_files/out_2.txt'\n- self.send_and_sniff_pkts(1, 1, in_pcap, out_pcap, \"tcp\")\n-\n- # [3]: Two rules scenario. Appropriate action for hit.\n- CMD_FILE = '/tmp/pipeline/table_005/cmd_files/cmd_3.txt'\n- CLI_CMD = 'pipeline PIPELINE0 table table_005_table add {}\\n'.format(CMD_FILE)\n- self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n- CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n- self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n- in_pcap = 'pipeline/table_005/pcap_files/in_3.txt'\n- out_pcap = 'pipeline/table_005/pcap_files/out_3.txt'\n- self.send_and_sniff_pkts(2, 2, in_pcap, out_pcap, \"tcp\")\n-\n- # [4]: Action update scenario. Updated action(s) for hit.\n- CMD_FILE = '/tmp/pipeline/table_005/cmd_files/cmd_4.txt'\n- CLI_CMD = 'pipeline PIPELINE0 table table_005_table add {}\\n'.format(CMD_FILE)\n- self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n- CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n- self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n- in_pcap = 'pipeline/table_005/pcap_files/in_4.txt'\n- out_pcap = 'pipeline/table_005/pcap_files/out_4.txt'\n- self.send_and_sniff_pkts(3, 2, in_pcap, out_pcap, \"tcp\")\n-\n- # [5]: Delete one rule. Default action for packet corresponding to deleted rule.\n- CMD_FILE = '/tmp/pipeline/table_005/cmd_files/cmd_5.txt'\n- CLI_CMD = 'pipeline PIPELINE0 table table_005_table delete {}\\n'.format(CMD_FILE)\n- self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n- CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n- self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n- in_pcap = 'pipeline/table_005/pcap_files/in_5.txt'\n- out_pcap = 'pipeline/table_005/pcap_files/out_5.txt'\n- self.send_and_sniff_pkts(0, 1, in_pcap, out_pcap, \"tcp\")\n-\n- # [6]: Delete remaining rule. Default action executed for all the packets.\n- CMD_FILE = '/tmp/pipeline/table_005/cmd_files/cmd_6.txt'\n- CLI_CMD = 'pipeline PIPELINE0 table table_005_table delete {}\\n'.format(CMD_FILE)\n- self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n- CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n- self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n- in_pcap = 'pipeline/table_005/pcap_files/in_6.txt'\n- out_pcap = 'pipeline/table_005/pcap_files/out_6.txt'\n- self.send_and_sniff_pkts(1, 0, in_pcap, out_pcap, \"tcp\")\n-\n- s.close()\n- self.dut.send_expect(\"^C\", \"# \", 20)\n-\n def test_reg_001(self):\n \n cli_file = '/tmp/pipeline/reg_001/reg_001.cli'\n@@ -4623,6 +4588,302 @@ class TestPipeline(TestCase):\n self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n self.dut.send_expect(\"^C\", \"# \", 20)\n \n+ def test_lpm_001(self):\n+\n+ cli_file = '/tmp/pipeline/lpm_001/lpm_001.cli'\n+ self.run_dpdk_app(cli_file)\n+ sleep(1)\n+ s = self.connect_cli_server()\n+\n+ # [1]: Empty table: Default action executed for all the packets.\n+ in_pcap = 'pipeline/lpm_001/pcap_files/in_1.txt'\n+ out_pcap = 'pipeline/lpm_001/pcap_files/out_1.txt'\n+ self.send_and_sniff_pkts(0, 0, in_pcap, out_pcap, \"tcp\")\n+\n+ # [2]: Single rule: Defined action for hit, Default action for miss.\n+ CMD_FILE = '/tmp/pipeline/lpm_001/cmd_files/cmd_2.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 table lpm_001_table add {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = 'pipeline/lpm_001/pcap_files/in_2.txt'\n+ out_pcap = 'pipeline/lpm_001/pcap_files/out_2.txt'\n+ self.send_and_sniff_pkts(1, 1, in_pcap, out_pcap, \"tcp\")\n+\n+ # [3]: Two rules scenario. Appropriate action for hit.\n+ CMD_FILE = '/tmp/pipeline/lpm_001/cmd_files/cmd_3.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 table lpm_001_table add {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = 'pipeline/lpm_001/pcap_files/in_3.txt'\n+ out_pcap = 'pipeline/lpm_001/pcap_files/out_3.txt'\n+ self.send_and_sniff_pkts(2, 2, in_pcap, out_pcap, \"tcp\")\n+\n+ # [4]: Action update scenario. Updated action(s) for hit.\n+ CMD_FILE = '/tmp/pipeline/lpm_001/cmd_files/cmd_4.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 table lpm_001_table add {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = 'pipeline/lpm_001/pcap_files/in_4.txt'\n+ out_pcap = 'pipeline/lpm_001/pcap_files/out_4.txt'\n+ self.send_and_sniff_pkts(3, 2, in_pcap, out_pcap, \"tcp\")\n+\n+ # [5]: Delete one rule. Default action for packet corresponding to deleted rule.\n+ CMD_FILE = '/tmp/pipeline/lpm_001/cmd_files/cmd_5.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 table lpm_001_table delete {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = 'pipeline/lpm_001/pcap_files/in_5.txt'\n+ out_pcap = 'pipeline/lpm_001/pcap_files/out_5.txt'\n+ self.send_and_sniff_pkts(0, 1, in_pcap, out_pcap, \"tcp\")\n+\n+ # [6]: Delete remaining rule. Default action executed for all the packets.\n+ CMD_FILE = '/tmp/pipeline/lpm_001/cmd_files/cmd_6.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 table lpm_001_table delete {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = 'pipeline/lpm_001/pcap_files/in_6.txt'\n+ out_pcap = 'pipeline/lpm_001/pcap_files/out_6.txt'\n+ self.send_and_sniff_pkts(1, 0, in_pcap, out_pcap, \"tcp\")\n+\n+ s.close()\n+ self.dut.send_expect(\"^C\", \"# \", 20)\n+\n+ def test_lpm_002(self):\n+\n+ cli_file = '/tmp/pipeline/lpm_002/lpm_002.cli'\n+ self.run_dpdk_app(cli_file)\n+ sleep(1)\n+ s = self.connect_cli_server()\n+\n+ # [1] Input packets on ports 0 .. 3:\n+ # IPv4 dest_addr has all bits randomized (mask is 0.0.0.0)\n+ # Expected output packet distribution on ports 0 .. 3:\n+ # Port 0 = 25%; Port 1 = 25%; Port 2 = 25%; Port 3 = 25%\n+ in_pcap = ['pipeline/lpm_002/pcap_files/in_1.txt']\n+ out_pcap_1 = 'pipeline/lpm_002/pcap_files/out_11.txt'\n+ out_pcap_2 = 'pipeline/lpm_002/pcap_files/out_12.txt'\n+ out_pcap_3 = 'pipeline/lpm_002/pcap_files/out_13.txt'\n+ out_pcap_4 = 'pipeline/lpm_002/pcap_files/out_14.txt'\n+ out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3, out_pcap_4]\n+ filters = [\"tcp\"] * 4\n+ tx_port = [0]\n+ rx_port = [0, 1, 2, 3]\n+ self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n+\n+ # [2] Input packets on ports 0 .. 3:\n+ # IPv4 dest_addr has all bits randomized (mask is 0.0.0.0)\n+ # Expected output packet distribution on ports 0 .. 3:\n+ # Port 0 = 50%; Port 1 = 25%; Port 2 = 12.5%; Port 3 = 12.5%\n+ CMD_FILE = '/tmp/pipeline/lpm_002/cmd_files/cmd_1.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 table lpm_002_table delete {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CMD_FILE = '/tmp/pipeline/lpm_002/cmd_files/cmd_2.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 table lpm_002_table add {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = ['pipeline/lpm_002/pcap_files/in_2.txt']\n+ out_pcap_1 = 'pipeline/lpm_002/pcap_files/out_21.txt'\n+ out_pcap_2 = 'pipeline/lpm_002/pcap_files/out_22.txt'\n+ out_pcap_3 = 'pipeline/lpm_002/pcap_files/out_23.txt'\n+ out_pcap_4 = 'pipeline/lpm_002/pcap_files/out_24.txt'\n+ out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3, out_pcap_4]\n+ self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n+\n+ s.close()\n+ self.dut.send_expect(\"^C\", \"# \", 20)\n+\n+ def test_lpm_003(self):\n+\n+ cli_file = '/tmp/pipeline/lpm_003/lpm_003.cli'\n+ self.run_dpdk_app(cli_file)\n+\n+ # Input packets on ports 0 .. 3:\n+ # IPv4 dest_addr has all bits randomized (mask is 0.0.0.0)\n+ # Expected output packet distribution on ports 0 .. 3:\n+ # Port 0 = 12.5% + 25% = 37.5% (i.e. 3/8 = 6/16)\n+ # Port 1 = 12.5% + 12.5% = 25% (i.e. 1/4 = 4/16)\n+ # Port 2 = 12.5% + 6.25% = 18.75% (i.e. 3/16)\n+ # Port 3 = 12.5% + 6.25% = 18.75% (i.e. 3/16)\n+ in_pcap = ['pipeline/lpm_003/pcap_files/in_1.txt']\n+ out_pcap_1 = 'pipeline/lpm_003/pcap_files/out_11.txt'\n+ out_pcap_2 = 'pipeline/lpm_003/pcap_files/out_12.txt'\n+ out_pcap_3 = 'pipeline/lpm_003/pcap_files/out_13.txt'\n+ out_pcap_4 = 'pipeline/lpm_003/pcap_files/out_14.txt'\n+ out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3, out_pcap_4]\n+ filters = [\"tcp\"] * 4\n+ tx_port = [0]\n+ rx_port = [0, 1, 2, 3]\n+ self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n+ self.dut.send_expect(\"^C\", \"# \", 20)\n+\n+ def test_lpm_004(self):\n+\n+ cli_file = '/tmp/pipeline/lpm_004/lpm_004.cli'\n+ self.run_dpdk_app(cli_file)\n+\n+ # Input packets on ports 0 .. 3:\n+ # IPv4 dest_addr has all bits randomized (mask is 0.0.0.0)\n+ # Expected output packet distribution on ports 0 .. 3:\n+ # Port 0 = 25%; Port 1 = 25%; Port 2 = 37.5%; Port 3 = 12.5%\n+ in_pcap = ['pipeline/lpm_004/pcap_files/in_1.txt']\n+ out_pcap_1 = 'pipeline/lpm_004/pcap_files/out_11.txt'\n+ out_pcap_2 = 'pipeline/lpm_004/pcap_files/out_12.txt'\n+ out_pcap_3 = 'pipeline/lpm_004/pcap_files/out_13.txt'\n+ out_pcap_4 = 'pipeline/lpm_004/pcap_files/out_14.txt'\n+ out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3, out_pcap_4]\n+ filters = [\"tcp\"] * 4\n+ tx_port = [0]\n+ rx_port = [0, 1, 2, 3]\n+ self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n+ self.dut.send_expect(\"^C\", \"# \", 20)\n+\n+ def test_selector_001(self):\n+\n+ # ----- Selector table feature validation -----\n+ cli_file = '/tmp/pipeline/selector_001/selector_001.cli'\n+ self.run_dpdk_app(cli_file)\n+ sleep(1)\n+ s = self.connect_cli_server()\n+\n+ # [1]: Absence of Group\n+ # Member 0 should act as the default member for each group.\n+ in_pcap = 'pipeline/selector_001/pcap_files/in_1.txt'\n+ out_pcap = 'pipeline/selector_001/pcap_files/out_1.txt'\n+ self.send_and_sniff_pkts(1, 0, in_pcap, out_pcap, \"tcp\")\n+\n+ # [2]: Allocate a group [Group ID: 0]\n+ # All packets of this group should use this member.\n+ CLI_CMD = 'pipeline PIPELINE0 selector selector_001 group add\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = 'pipeline/selector_001/pcap_files/in_2.txt'\n+ out_pcap = 'pipeline/selector_001/pcap_files/out_2.txt'\n+ self.send_and_sniff_pkts(1, 0, in_pcap, out_pcap, \"tcp\")\n+\n+ # [3]: Add one member [Member ID: 1, Weight: 1] to Group 0\n+ # All packets of this group should use this member.\n+ CMD_FILE = '/tmp/pipeline/selector_001/cmd_files/cmd_3.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 selector selector_001 group member add {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = 'pipeline/selector_001/pcap_files/in_3.txt'\n+ out_pcap = 'pipeline/selector_001/pcap_files/out_3.txt'\n+ self.send_and_sniff_pkts(0, 1, in_pcap, out_pcap, \"tcp\")\n+\n+ # [4]: Add a new member [Member ID: 0, Weight: 1] to Group 0\n+ # Packets of this group should use members according to weights. [50:50]\n+ CMD_FILE = '/tmp/pipeline/selector_001/cmd_files/cmd_4.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 selector selector_001 group member add {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = ['pipeline/selector_001/pcap_files/in_4.txt']\n+ out_pcap_1 = 'pipeline/selector_001/pcap_files/out_41.txt'\n+ out_pcap_2 = 'pipeline/selector_001/pcap_files/out_42.txt'\n+ out_pcap = [out_pcap_1, out_pcap_2]\n+ filters = [\"tcp\"] * 2\n+ tx_port = [0]\n+ rx_port = [0, 1]\n+ self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n+\n+ # [5]: Add a new member [Member ID: 2, Weight: 2] to Group 0\n+ # Packets of this group should use members according to weights. [25:25:50]\n+ CMD_FILE = '/tmp/pipeline/selector_001/cmd_files/cmd_5.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 selector selector_001 group member add {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = ['pipeline/selector_001/pcap_files/in_5.txt']\n+ out_pcap_1 = 'pipeline/selector_001/pcap_files/out_51.txt'\n+ out_pcap_2 = 'pipeline/selector_001/pcap_files/out_52.txt'\n+ out_pcap_3 = 'pipeline/selector_001/pcap_files/out_53.txt'\n+ out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3]\n+ filters = [\"tcp\"] * 3\n+ tx_port = [0]\n+ rx_port = [0, 1, 2]\n+ self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n+\n+ # [6]: Add a new group [Group ID: 1] & add 4 members to it.\n+ # [Member IDs: 0, 1, 2, 3; Weights: 1, 1, 2, 4] [12.5% : 12.5% : 25% : 50%]\n+ # Packets of this group should use members according to weights.\n+ CLI_CMD = 'pipeline PIPELINE0 selector selector_001 group add\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CMD_FILE = '/tmp/pipeline/selector_001/cmd_files/cmd_6.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 selector selector_001 group member add {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = ['pipeline/selector_001/pcap_files/in_6.txt']\n+ out_pcap_1 = 'pipeline/selector_001/pcap_files/out_61.txt'\n+ out_pcap_2 = 'pipeline/selector_001/pcap_files/out_62.txt'\n+ out_pcap_3 = 'pipeline/selector_001/pcap_files/out_63.txt'\n+ out_pcap_4 = 'pipeline/selector_001/pcap_files/out_64.txt'\n+ out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3, out_pcap_4]\n+ filters = [\"tcp\"] * 4\n+ tx_port = [0]\n+ rx_port = [0, 1, 2, 3]\n+ self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n+\n+ # [7]: Delete group with ID: 0\n+ # All packets of this group should use member with ID 0.\n+ CLI_CMD = 'pipeline PIPELINE0 selector selector_001 group delete 0\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = 'pipeline/selector_001/pcap_files/in_7.txt'\n+ out_pcap = 'pipeline/selector_001/pcap_files/out_7.txt'\n+ self.send_and_sniff_pkts(1, 0, in_pcap, out_pcap, \"tcp\")\n+\n+ # [8]: Delete member with member ID 3 of Group ID 1\n+ # Group ID 1: [Member IDs: 0, 1, 2; Weights: 1, 1, 2] [25% : 25% : 50%]\n+ CMD_FILE = '/tmp/pipeline/selector_001/cmd_files/cmd_8.txt'\n+ CLI_CMD = 'pipeline PIPELINE0 selector selector_001 group member delete {}\\n'.format(CMD_FILE)\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ CLI_CMD = 'pipeline PIPELINE0 commit\\n'\n+ self.socket_send_cmd(s, CLI_CMD, \"pipeline> \")\n+ in_pcap = ['pipeline/selector_001/pcap_files/in_8.txt']\n+ out_pcap_1 = 'pipeline/selector_001/pcap_files/out_81.txt'\n+ out_pcap_2 = 'pipeline/selector_001/pcap_files/out_82.txt'\n+ out_pcap_3 = 'pipeline/selector_001/pcap_files/out_83.txt'\n+ out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3]\n+ filters = [\"tcp\"] * 3\n+ tx_port = [0]\n+ rx_port = [0, 1, 2]\n+ self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n+\n+ s.close()\n+ self.dut.send_expect(\"^C\", \"# \", 20)\n+\n+ def test_selector_002(self):\n+\n+ cli_file = '/tmp/pipeline/selector_002/selector_002.cli'\n+ self.run_dpdk_app(cli_file)\n+\n+ in_pcap = ['pipeline/selector_002/pcap_files/in_1.txt']\n+ out_pcap_1 = 'pipeline/selector_002/pcap_files/out_1.txt'\n+ out_pcap_2 = 'pipeline/selector_002/pcap_files/out_2.txt'\n+ out_pcap_3 = 'pipeline/selector_002/pcap_files/out_3.txt'\n+ out_pcap_4 = 'pipeline/selector_002/pcap_files/out_4.txt'\n+ out_pcap = [out_pcap_1, out_pcap_2, out_pcap_3, out_pcap_4]\n+ filters = [\"tcp\"] * 4\n+ tx_port = [0]\n+ rx_port = [0, 1, 2, 3]\n+ self.send_and_sniff_multiple(tx_port, rx_port, in_pcap, out_pcap, filters)\n+ self.dut.send_expect(\"^C\", \"# \", 20)\n+\n+ def test_scapy_pkt_gen(self):\n+\n+ # self.send_scapy_pkts(0)\n+ pass\n+\n def tear_down(self):\n \"\"\"\n Run after each test case.\n", "prefixes": [ "2/2" ] }{ "id": 96058, "url": "