[dts] [PATCH V1] tests/ipfrag: sed and regex of linux diff freebsd
Ma, LihongX
lihongx.ma at intel.com
Mon Jul 29 08:25:09 CEST 2019
Hi, changing
Where the 0001-fix-ipfrag-failed-on-freeBSD.patch ? And why use the patch file instead of the command ?
-----Original Message-----
From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of changqingxwu
Sent: Monday, July 29, 2019 9:47 AM
To: dts at dpdk.org
Cc: Wu, ChangqingX <changqingx.wu at intel.com>
Subject: [dts] [PATCH V1] tests/ipfrag: sed and regex of linux diff freebsd
Signed-off-by: changqingxwu <changqingx.wu at intel.com>
---
tests/TestSuite_ipfrag.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/tests/TestSuite_ipfrag.py b/tests/TestSuite_ipfrag.py index f6d0373..9d2a97d 100644
--- a/tests/TestSuite_ipfrag.py
+++ b/tests/TestSuite_ipfrag.py
@@ -116,8 +116,15 @@ l3fwd_ipv4_route_array[] = {\\\n"
rtLpmTbl[idx] = pat.sub(self.portRepl, rtLpmTbl[idx])
lpmStr_ipv6 = lpmStr_ipv6 + ' ' * 4 + rtLpmTbl[idx] + ",\\\n"
lpmStr_ipv6 = lpmStr_ipv6 + "};"
- self.dut.send_expect(r"sed -i '/l3fwd_ipv4_route_array\[\].*{/,/^\}\;/c\\%s' examples/ip_fragmentation/main.c" % lpmStr_ipv4, "# ")
- self.dut.send_expect(r"sed -i '/l3fwd_ipv6_route_array\[\].*{/,/^\}\;/c\\%s' examples/ip_fragmentation/main.c" % lpmStr_ipv6, "# ")
+
+ if self.dut.get_os_type() == "freebsd":
+ filename = "conf/0001-fix-ipfrag-failed-on-freeBSD.patch"
+ self.dut.session.copy_file_to(filename, self.dut.base_dir)
+ self.dut.send_expect("git apply 0001-fix-ipfrag-failed-on-freeBSD.patch", "#")
+ else:
+ self.dut.send_expect(r"sed -i '/l3fwd_ipv4_route_array\[\].*{/,/^\}\;/c\\%s' examples/ip_fragmentation/main.c" % lpmStr_ipv4, "# ")
+ self.dut.send_expect(r"sed -i
+ '/l3fwd_ipv6_route_array\[\].*{/,/^\}\;/c\\%s'
+ examples/ip_fragmentation/main.c" % lpmStr_ipv6, "# ")
+
# make application
out = self.dut.build_dpdk_apps("examples/ip_fragmentation")
self.verify("Error" not in out, "compilation error 1")
--
2.17.2
More information about the dts
mailing list