test suite reviews and discussions
 help / color / mirror / Atom feed
* [dts] [PATCH V1 0/7] framework: record DPDK version in result
@ 2020-11-27  2:50 Haiyang Zhao
  2020-11-27  2:50 ` [dts] [PATCH V1 1/7] framework/dut: record DPDK version in host DUT Haiyang Zhao
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Haiyang Zhao @ 2020-11-27  2:50 UTC (permalink / raw)
  To: Lijuan.Tu, dts; +Cc: Haiyang Zhao

record DPDK version in json/excel/statistic result.

Haiyang Zhao (7):
  framework/dut: record DPDK version in host DUT get dpdk version from
    VERSION and save it in host dut.
  framework/virt_dut: record DPDK version in guest DUT get and save
    guest DUT dpdk version.
  framework/dts: save dpdk version in global result save dpdk version in
    global result after executing prerequisities.
  framework/excel_reporter: add dpdk version in excel result add dpdk
    version in excel result and modify the other element index.
  framework/json_reporter: add dpdk version in json result add dpdk
    version in json result.
  framework/test_result: add dpdk_version in Result
  framework/stats_reporter: add dpdk version in stats_reporter add dpdk
    version in stats_reporter.

 framework/dts.py            |  2 +-
 framework/dut.py            |  9 ++++++-
 framework/excel_reporter.py | 54 ++++++++++++++++++++-----------------
 framework/json_reporter.py  |  1 +
 framework/stats_reporter.py |  7 +++++
 framework/test_result.py    | 20 +++++++++++++-
 framework/virt_dut.py       |  6 ++++-
 7 files changed, 70 insertions(+), 29 deletions(-)

-- 
2.17.1


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

* [dts] [PATCH V1 1/7] framework/dut: record DPDK version in host DUT
  2020-11-27  2:50 [dts] [PATCH V1 0/7] framework: record DPDK version in result Haiyang Zhao
@ 2020-11-27  2:50 ` Haiyang Zhao
  2020-11-27  2:50 ` [dts] [PATCH V1 2/7] framework/virt_dut: record DPDK version in guest DUT Haiyang Zhao
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Haiyang Zhao @ 2020-11-27  2:50 UTC (permalink / raw)
  To: Lijuan.Tu, dts; +Cc: Haiyang Zhao

get dpdk version from VERSION and save it in host dut.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 framework/dut.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/framework/dut.py b/framework/dut.py
index 2863848..f3ef8c6 100644
--- a/framework/dut.py
+++ b/framework/dut.py
@@ -80,6 +80,7 @@ class Dut(Crb):
         self.hugepage_path = None
         self.apps_name_conf = {}
         self.apps_name = {}
+        self.dpdk_version = ''
 
     def filter_cores_from_crb_cfg(self):
         # get core list from crbs.cfg
@@ -368,7 +369,13 @@ class Dut(Crb):
         Then call pci scan function to collect nic device information.
         At last setup DUT' environment for validation.
         """
-        self.send_expect("cd %s" % self.base_dir, "# ")
+        out = self.send_expect("cd %s" % self.base_dir, "# ")
+        assert 'No such file or directory' not in out, "Can't switch to dpdk folder!!!"
+        out = self.send_expect("cat VERSION", "# ")
+        if 'No such file or directory' in out:
+            self.logger.error("Can't get DPDK version due to VERSION not exist!!!")
+        else:
+            self.dpdk_version = out
         self.send_expect("alias ls='ls --color=none'", "#")
 
         if self.get_os_type() == 'freebsd':
-- 
2.17.1


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

* [dts] [PATCH V1 2/7] framework/virt_dut: record DPDK version in guest DUT
  2020-11-27  2:50 [dts] [PATCH V1 0/7] framework: record DPDK version in result Haiyang Zhao
  2020-11-27  2:50 ` [dts] [PATCH V1 1/7] framework/dut: record DPDK version in host DUT Haiyang Zhao
@ 2020-11-27  2:50 ` Haiyang Zhao
  2020-11-27  2:50 ` [dts] [PATCH V1 3/7] framework/dts: save dpdk version in global result Haiyang Zhao
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Haiyang Zhao @ 2020-11-27  2:50 UTC (permalink / raw)
  To: Lijuan.Tu, dts; +Cc: Haiyang Zhao

 get and save guest DUT dpdk version.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 framework/virt_dut.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/framework/virt_dut.py b/framework/virt_dut.py
index 03569ba..9b0126b 100644
--- a/framework/virt_dut.py
+++ b/framework/virt_dut.py
@@ -172,8 +172,12 @@ class VirtDut(DPDKdut):
             self.prepare_package()
 
         out = self.send_expect("cd %s" % self.base_dir, "# ")
+        assert 'No such file or directory' not in out, "Can't switch to dpdk folder!!!"
+        out = self.send_expect("cat VERSION", "# ")
         if 'No such file or directory' in out:
-            self.logger.error("Can't switch to dpdk folder!!!")
+            self.logger.error("Can't get DPDK version due to VERSION not exist!!!")
+        else:
+            self.dpdk_version = out
 
         self.send_expect("alias ls='ls --color=none'", "#")
 
-- 
2.17.1


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

* [dts] [PATCH V1 3/7] framework/dts: save dpdk version in global result
  2020-11-27  2:50 [dts] [PATCH V1 0/7] framework: record DPDK version in result Haiyang Zhao
  2020-11-27  2:50 ` [dts] [PATCH V1 1/7] framework/dut: record DPDK version in host DUT Haiyang Zhao
  2020-11-27  2:50 ` [dts] [PATCH V1 2/7] framework/virt_dut: record DPDK version in guest DUT Haiyang Zhao
@ 2020-11-27  2:50 ` Haiyang Zhao
  2020-11-27  2:50 ` [dts] [PATCH V1 4/7] framework/excel_reporter: add dpdk version in excel result Haiyang Zhao
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Haiyang Zhao @ 2020-11-27  2:50 UTC (permalink / raw)
  To: Lijuan.Tu, dts; +Cc: Haiyang Zhao

save dpdk version in global result after executing prerequisities.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 framework/dts.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/dts.py b/framework/dts.py
index 8c61385..d4a8c6e 100644
--- a/framework/dts.py
+++ b/framework/dts.py
@@ -624,7 +624,7 @@ def run_all(config_file, pkgName, git, patch, skip_setup,
         if dts_run_prerequisties(duts, tester, pkgName, patch, dts_commands, serializer) is False:
             dts_crbs_exit(duts, tester)
             continue
-
+        result.dpdk_version = duts[0].dpdk_version
         dts_run_target(duts, tester, targets, test_suites, subtitle)
 
         dts_crbs_exit(duts, tester)
-- 
2.17.1


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

* [dts] [PATCH V1 4/7] framework/excel_reporter: add dpdk version in excel result
  2020-11-27  2:50 [dts] [PATCH V1 0/7] framework: record DPDK version in result Haiyang Zhao
                   ` (2 preceding siblings ...)
  2020-11-27  2:50 ` [dts] [PATCH V1 3/7] framework/dts: save dpdk version in global result Haiyang Zhao
@ 2020-11-27  2:50 ` Haiyang Zhao
  2020-11-27  2:50 ` [dts] [PATCH V1 5/7] framework/json_reporter: add dpdk version in json Haiyang Zhao
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Haiyang Zhao @ 2020-11-27  2:50 UTC (permalink / raw)
  To: Lijuan.Tu, dts; +Cc: Haiyang Zhao

 add dpdk version in excel result and modify the other element index.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 framework/excel_reporter.py | 54 ++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 25 deletions(-)

diff --git a/framework/excel_reporter.py b/framework/excel_reporter.py
index 65d26b6..89b9a17 100644
--- a/framework/excel_reporter.py
+++ b/framework/excel_reporter.py
@@ -76,38 +76,40 @@ class ExcelReporter(object):
 
     def __add_header(self):
         self.sheet.write(0, 0, 'DUT', self.header_style)
-        self.sheet.write(0, 1, 'Target', self.header_style)
-        self.sheet.write(0, 2, 'NIC', self.header_style)
-        self.sheet.write(0, 3, 'Test suite', self.header_style)
-        self.sheet.write(0, 4, 'Test case', self.header_style)
-        self.sheet.write(0, 5, 'Results', self.header_style)
-
-        self.sheet.write(0, 7, 'Pass', self.header_style)
-        self.sheet.write(0, 8, 'Fail', self.header_style)
-        self.sheet.write(0, 9, 'Blocked', self.header_style)
-        self.sheet.write(0, 10, 'N/A', self.header_style)
-        self.sheet.write(0, 11, 'Not Run', self.header_style)
-        self.sheet.write(0, 12, 'Total', self.header_style)
-
-        self.sheet.write(1, 7, Formula('COUNTIF(F2:F2000,"PASSED")'))
-        self.sheet.write(1, 8, Formula('COUNTIF(F2:F2000,"FAILED*") + COUNTIF(F2:F2000,"IXA*")'))
-        self.sheet.write(1, 9, Formula('COUNTIF(F2:F2000,"BLOCKED*")'))
-        self.sheet.write(1, 10, Formula('COUNTIF(F2:F2000,"N/A*")'))
-        self.sheet.write(1, 12, Formula('H2+I2+J2+K2+L2'))
+        self.sheet.write(0, 1, 'DPDK version', self.header_style)
+        self.sheet.write(0, 2, 'Target', self.header_style)
+        self.sheet.write(0, 3, 'NIC', self.header_style)
+        self.sheet.write(0, 4, 'Test suite', self.header_style)
+        self.sheet.write(0, 5, 'Test case', self.header_style)
+        self.sheet.write(0, 6, 'Results', self.header_style)
+
+        self.sheet.write(0, 8, 'Pass', self.header_style)
+        self.sheet.write(0, 9, 'Fail', self.header_style)
+        self.sheet.write(0, 10, 'Blocked', self.header_style)
+        self.sheet.write(0, 11, 'N/A', self.header_style)
+        self.sheet.write(0, 12, 'Not Run', self.header_style)
+        self.sheet.write(0, 13, 'Total', self.header_style)
+
+        self.sheet.write(1, 8, Formula('COUNTIF(G2:G2000,"PASSED")'))
+        self.sheet.write(1, 9, Formula('COUNTIF(G2:G2000,"FAILED*") + COUNTIF(G2:G2000,"IXA*")'))
+        self.sheet.write(1, 10, Formula('COUNTIF(G2:G2000,"BLOCKED*")'))
+        self.sheet.write(1, 11, Formula('COUNTIF(G2:G2000,"N/A*")'))
+        self.sheet.write(1, 13, Formula('I2+J2+K2+L2+M2'))
 
         self.sheet.col(0).width = 4000
-        self.sheet.col(1).width = 7500
-        self.sheet.col(2).width = 3000
-        self.sheet.col(3).width = 5000
-        self.sheet.col(4).width = 8000
-        self.sheet.col(5).width = 3000
-        self.sheet.col(6).width = 1000
-        self.sheet.col(7).width = 3000
+        self.sheet.col(1).width = 4500
+        self.sheet.col(2).width = 7500
+        self.sheet.col(3).width = 3000
+        self.sheet.col(4).width = 5000
+        self.sheet.col(5).width = 8000
+        self.sheet.col(6).width = 3000
+        self.sheet.col(7).width = 1000
         self.sheet.col(8).width = 3000
         self.sheet.col(9).width = 3000
         self.sheet.col(10).width = 3000
         self.sheet.col(11).width = 3000
         self.sheet.col(12).width = 3000
+        self.sheet.col(13).width = 3000
 
     def __styles(self):
         header_pattern = xlwt.Pattern()
@@ -223,6 +225,8 @@ class ExcelReporter(object):
             if self.result.is_dut_failed(dut):
                 self.__write_failed_dut(dut)
             else:
+                self.col = self.col + 1
+                self.sheet.write(self.row, self.col, self.result.current_dpdk_version(dut), self.title_style)
                 self.__write_targets(dut)
             self.row += 1
 
-- 
2.17.1


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

* [dts] [PATCH V1 5/7] framework/json_reporter: add dpdk version in json
  2020-11-27  2:50 [dts] [PATCH V1 0/7] framework: record DPDK version in result Haiyang Zhao
                   ` (3 preceding siblings ...)
  2020-11-27  2:50 ` [dts] [PATCH V1 4/7] framework/excel_reporter: add dpdk version in excel result Haiyang Zhao
@ 2020-11-27  2:50 ` Haiyang Zhao
  2020-11-27  2:50 ` [dts] [PATCH V1 6/7] framework/test_result: add dpdk_version in Result Haiyang Zhao
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: Haiyang Zhao @ 2020-11-27  2:50 UTC (permalink / raw)
  To: Lijuan.Tu, dts; +Cc: Haiyang Zhao

result add dpdk version in json result.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 framework/json_reporter.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/framework/json_reporter.py b/framework/json_reporter.py
index 1b15bbe..88099cb 100644
--- a/framework/json_reporter.py
+++ b/framework/json_reporter.py
@@ -64,6 +64,7 @@ class JSONReporter(object):
         if result.is_dut_failed(dut):
             return 'fail'
         target_map = {}
+        target_map['dpdk_version'] = result.current_dpdk_version(dut)
         for target in result.all_targets(dut):
             target_map[target] = self.__scan_target(result, dut, target)
         return target_map
-- 
2.17.1


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

* [dts] [PATCH V1 6/7] framework/test_result: add dpdk_version in Result
  2020-11-27  2:50 [dts] [PATCH V1 0/7] framework: record DPDK version in result Haiyang Zhao
                   ` (4 preceding siblings ...)
  2020-11-27  2:50 ` [dts] [PATCH V1 5/7] framework/json_reporter: add dpdk version in json Haiyang Zhao
@ 2020-11-27  2:50 ` Haiyang Zhao
  2020-11-27  2:50 ` [dts] [PATCH V1 7/7] framework/stats_reporter: add dpdk version in stats_reporter Haiyang Zhao
  2020-12-01  1:33 ` [dts] [PATCH V1 0/7] framework: record DPDK version in result Tu, Lijuan
  7 siblings, 0 replies; 9+ messages in thread
From: Haiyang Zhao @ 2020-11-27  2:50 UTC (permalink / raw)
  To: Lijuan.Tu, dts; +Cc: Haiyang Zhao

add dpdk_version and get method in class Result, and modify
all_targets as target element index changed.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 framework/test_result.py | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/framework/test_result.py b/framework/test_result.py
index e5a2b4e..3560745 100644
--- a/framework/test_result.py
+++ b/framework/test_result.py
@@ -86,6 +86,23 @@ class Result(object):
     def __get_dut(self):
         return self.__internals[self.__dut]
 
+    def current_dpdk_version(self, dut):
+        """
+        Returns the dpdk version for a given DUT
+        """
+        try:
+            dut_idx = self.__internals.index(dut)
+            return self.__internals[dut_idx + 1][0]
+        except:
+            return ''
+
+    def __set_dpdk_version(self, dpdk_version):
+        if not self.internals[self.__dut + 1]:
+            self.internals[self.__dut + 1].append(dpdk_version)
+
+    def __get_dpdk_version(self):
+        return self.internals[self.__dut + 1][0]
+
     def __current_targets(self):
         return self.internals[self.__dut + 1]
 
@@ -193,7 +210,7 @@ class Result(object):
             dut_idx = self.__internals.index(dut)
         except:
             return None
-        return self.__internals[dut_idx + 1][::3]
+        return self.__internals[dut_idx + 1][1::3]
 
     def current_nic(self, dut, target):
         """
@@ -287,6 +304,7 @@ class Result(object):
     presented interface.
     """
     dut = property(__get_dut, __set_dut)
+    dpdk_version = property(__get_dpdk_version, __set_dpdk_version)
     target = property(__get_target, __set_target)
     test_suite = property(__get_test_suite, __set_test_suite)
     test_case = property(__get_test_case, __set_test_case)
-- 
2.17.1


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

* [dts] [PATCH V1 7/7] framework/stats_reporter: add dpdk version in stats_reporter
  2020-11-27  2:50 [dts] [PATCH V1 0/7] framework: record DPDK version in result Haiyang Zhao
                   ` (5 preceding siblings ...)
  2020-11-27  2:50 ` [dts] [PATCH V1 6/7] framework/test_result: add dpdk_version in Result Haiyang Zhao
@ 2020-11-27  2:50 ` Haiyang Zhao
  2020-12-01  1:33 ` [dts] [PATCH V1 0/7] framework: record DPDK version in result Tu, Lijuan
  7 siblings, 0 replies; 9+ messages in thread
From: Haiyang Zhao @ 2020-11-27  2:50 UTC (permalink / raw)
  To: Lijuan.Tu, dts; +Cc: Haiyang Zhao

add dpdk version in stats_reporter.

Signed-off-by: Haiyang Zhao <haiyangx.zhao@intel.com>
---
 framework/stats_reporter.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/framework/stats_reporter.py b/framework/stats_reporter.py
index 3793ca5..8cde5cd 100644
--- a/framework/stats_reporter.py
+++ b/framework/stats_reporter.py
@@ -65,6 +65,13 @@ class StatsReporter(object):
                             self.__add_stat(test_result)
 
     def __write_stats(self):
+        duts = self.result.all_duts()
+        if len(duts) == 1:
+            self.stats_file.write("dpdk_version = {}\n".format(self.result.current_dpdk_version(duts[0])))
+        else:
+            for dut in duts():
+                dpdk_version = self.result.current_dpdk_version(dut)
+                self.stats_file.write("{}.dpdk_version = {}\n".format(dut, dpdk_version))
         self.__count_stats()
         self.stats_file.write("Passed     = %d\n" % self.passed)
         self.stats_file.write("Failed     = %d\n" % self.failed)
-- 
2.17.1


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

* Re: [dts] [PATCH V1 0/7] framework: record DPDK version in result
  2020-11-27  2:50 [dts] [PATCH V1 0/7] framework: record DPDK version in result Haiyang Zhao
                   ` (6 preceding siblings ...)
  2020-11-27  2:50 ` [dts] [PATCH V1 7/7] framework/stats_reporter: add dpdk version in stats_reporter Haiyang Zhao
@ 2020-12-01  1:33 ` Tu, Lijuan
  7 siblings, 0 replies; 9+ messages in thread
From: Tu, Lijuan @ 2020-12-01  1:33 UTC (permalink / raw)
  To: Zhao, HaiyangX, dts; +Cc: Zhao, HaiyangX

> record DPDK version in json/excel/statistic result.
> 
> Haiyang Zhao (7):
>   framework/dut: record DPDK version in host DUT get dpdk version from
>     VERSION and save it in host dut.
>   framework/virt_dut: record DPDK version in guest DUT get and save
>     guest DUT dpdk version.
>   framework/dts: save dpdk version in global result save dpdk version in
>     global result after executing prerequisities.
>   framework/excel_reporter: add dpdk version in excel result add dpdk
>     version in excel result and modify the other element index.
>   framework/json_reporter: add dpdk version in json result add dpdk
>     version in json result.
>   framework/test_result: add dpdk_version in Result
>   framework/stats_reporter: add dpdk version in stats_reporter add dpdk
>     version in stats_reporter.

Applied

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

end of thread, other threads:[~2020-12-01  1:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27  2:50 [dts] [PATCH V1 0/7] framework: record DPDK version in result Haiyang Zhao
2020-11-27  2:50 ` [dts] [PATCH V1 1/7] framework/dut: record DPDK version in host DUT Haiyang Zhao
2020-11-27  2:50 ` [dts] [PATCH V1 2/7] framework/virt_dut: record DPDK version in guest DUT Haiyang Zhao
2020-11-27  2:50 ` [dts] [PATCH V1 3/7] framework/dts: save dpdk version in global result Haiyang Zhao
2020-11-27  2:50 ` [dts] [PATCH V1 4/7] framework/excel_reporter: add dpdk version in excel result Haiyang Zhao
2020-11-27  2:50 ` [dts] [PATCH V1 5/7] framework/json_reporter: add dpdk version in json Haiyang Zhao
2020-11-27  2:50 ` [dts] [PATCH V1 6/7] framework/test_result: add dpdk_version in Result Haiyang Zhao
2020-11-27  2:50 ` [dts] [PATCH V1 7/7] framework/stats_reporter: add dpdk version in stats_reporter Haiyang Zhao
2020-12-01  1:33 ` [dts] [PATCH V1 0/7] framework: record DPDK version in result Tu, Lijuan

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