test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH v1] Enhance Test App building and installation
@ 2017-03-08  6:00 Chen, Zhaoyan
  2017-03-08  7:06 ` Liu, Yong
  0 siblings, 1 reply; 2+ messages in thread
From: Chen, Zhaoyan @ 2017-03-08  6:00 UTC (permalink / raw)
  To: dts; +Cc: Chen, Zhaoyan

- Refactor Test App building and installation to a new function
- Add Test App building and installation in retry step
  (which build dpdk without -j option), so that fix sometime
  retry building successfully, but test app miss

---
 framework/project_dpdk.py | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
index 3b91dd6..a0cb4c2 100644
--- a/framework/project_dpdk.py
+++ b/framework/project_dpdk.py
@@ -185,19 +185,17 @@ class DPDKdut(Dut):
         out = self.send_expect("make -j install T=%s %s" % (target, extra_options), "# ", build_time)
         #should not check test app compile status, because if test compile fail,
         #all unit test can't exec, but others case will exec sucessfull 
-        self.send_expect("make -j -C test/", "# ", build_time)
-        app_list = ['./test/test/test', './test/test-acl/testacl', './test/test-pipeline/testpipeline', './test/cmdline_test/cmdline_test']
-        for app in app_list:
-            self.send_expect('cp  %s ./%s/app' % (app, target), "# ", 30)
-          
+        self.build_install_dpdk_test_app(target, build_time)
 
         if("Error" in out or "No rule to make" in out):
             self.logger.error("ERROR - try without '-j'")
             # if Error try to execute make without -j option
             out = self.send_expect("make install T=%s %s" % (target, extra_options), "# ", 120)
+            self.build_install_dpdk_test_app(target, build_time)
 
         assert ("Error" not in out), "Compilation error..."
         assert ("No rule to make" not in out), "No rule to make error..."
+
     def build_install_dpdk_freebsd(self, target, extra_options):
         """
         Build DPDK source code on Freebsd with specified target.
@@ -214,21 +212,28 @@ class DPDKdut(Dut):
                                "#", build_time)
         #should not check test app compile status, because if test compile fail,
         #all unit test can't exec, but others case will exec sucessfull 
-        self.send_expect("make -j -C test/ CC=gcc48", "# ", build_time)
-        
-        app_list = ['./test/test/test', './test/test-acl/testacl', './test/test-pipeline/testpipeline', './test/cmdline_test/cmdline_test']
-        for app in app_list:
-            self.send_expect('cp -f %s ./%s/app' % (app, target), "# ", 30)
+        self.build_install_dpdk_test_app(target, build_time, os_type="freebsd")
 
         if("Error" in out or "No rule to make" in out):
             self.logger.error("ERROR - try without '-j'")
             # if Error try to execute make without -j option
             out = self.send_expect("make install T=%s CC=gcc48" % target,
                                    "#", build_time)
+            self.build_install_dpdk_test_app(target, build_time, os_type="freebsd")
 
         assert ("Error" not in out), "Compilation error..."
         assert ("No rule to make" not in out), "No rule to make error..."
 
+    def build_install_dpdk_test_app(self, target, build_time, os_type="linux"):
+        cmd_build_test = "make -j -C test/"
+        if os_type == "freebsd":
+            cmd_build_test = "make -j -C test/ CC=gcc48"
+
+        self.send_expect(cmd_build_test, "# ", build_time)
+        app_list = ['./test/test/test', './test/test-acl/testacl', './test/test-pipeline/testpipeline', './test/cmdline_test/cmdline_test']
+        for app in app_list:
+            self.send_expect('cp -f %s ./%s/app' % (app, target), "# ", 30)
+         
     def prepare_package(self):
         if not self.skip_setup:
             assert (os.path.isfile(self.package) is True), "Invalid package"
-- 
1.9.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dts] [PATCH v1] Enhance Test App building and installation
  2017-03-08  6:00 [dts] [PATCH v1] Enhance Test App building and installation Chen, Zhaoyan
@ 2017-03-08  7:06 ` Liu, Yong
  0 siblings, 0 replies; 2+ messages in thread
From: Liu, Yong @ 2017-03-08  7:06 UTC (permalink / raw)
  To: Chen, Zhaoyan, dts

Thanks, applied.

On 03/08/2017 02:00 PM, Chen, Zhaoyan wrote:
> - Refactor Test App building and installation to a new function
> - Add Test App building and installation in retry step
>    (which build dpdk without -j option), so that fix sometime
>    retry building successfully, but test app miss
>
> ---
>   framework/project_dpdk.py | 25 +++++++++++++++----------
>   1 file changed, 15 insertions(+), 10 deletions(-)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-08  7:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-08  6:00 [dts] [PATCH v1] Enhance Test App building and installation Chen, Zhaoyan
2017-03-08  7:06 ` Liu, Yong

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).