test suite reviews and discussions
 help / color / mirror / Atom feed
* [PATCH] tests/firmware_version: add case of nfp driver
@ 2023-07-03 19:16 Niklas Söderlund
  2023-08-11 11:15 ` Niklas Söderlund
  0 siblings, 1 reply; 2+ messages in thread
From: Niklas Söderlund @ 2023-07-03 19:16 UTC (permalink / raw)
  To: dts; +Cc: oss-drivers, Qin Ke, Dano Teixeira, Niklas Söderlund

From: Qin Ke <qin.ke@corigine.com>

Add case of nfp driver to check related firmware version and format.

Signed-off-by: Qin Ke <qin.ke@corigine.com>
Acked-by: Dano Teixeira <dano.teixeira@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
---
 tests/TestSuite_firmware_version.py | 44 +++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/tests/TestSuite_firmware_version.py b/tests/TestSuite_firmware_version.py
index a5215c40441b..0e26b519ed19 100644
--- a/tests/TestSuite_firmware_version.py
+++ b/tests/TestSuite_firmware_version.py
@@ -140,6 +140,50 @@ class TestFirmwareVersion(TestCase):
                     None,
                 )
 
+            elif self.kdriver == "nfp":
+                # Get the version information from output and cfg file
+                (
+                    exp_vnic_version,
+                    exp_nsp_version,
+                    exp_mip,
+                    exp_app,
+                ) = expected_version_info
+                vnic_version, nsp_version, mip, app = version_info.split()
+
+                self.check_format(
+                    exp_nsp_version,
+                    nsp_version,
+                    "nsp_version",
+                    r"^\d{1,4}\.\d{1,4}$",
+                    None,
+                )
+
+                self.check_firmware_version(exp_nsp_version, nsp_version)
+
+                self.check_format(
+                    exp_vnic_version,
+                    vnic_version,
+                    "vnic_version",
+                    r"^((\d{1,4}\.\d{1,4}\.\d{1,4}\.\d{1,4})|\*)$",
+                    None,
+                )
+
+                self.check_format(
+                    exp_mip,
+                    mip,
+                    "mip",
+                    r"^(tc|sriov|nic)-.*$",
+                    None,
+                )
+
+                self.check_format(
+                    exp_app,
+                    app,
+                    "app",
+                    r"(flower|nic|unknown)",
+                    None,
+                )
+
             else:
                 self.verify(False, f"Test: case fails on {self.kdriver} driver")
 
-- 
2.41.0


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

end of thread, other threads:[~2023-08-11 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03 19:16 [PATCH] tests/firmware_version: add case of nfp driver Niklas Söderlund
2023-08-11 11:15 ` Niklas Söderlund

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