From: Ondrej Lichtner <olichtne(a)redhat.com>
Added a property that returns the name of the base testpmd executable.
At some point in the dpdk upstream development the name of the binary
changed to "dpdk-testpmd", breaking the use of this TestModule on rhel8.
This also adds an additional "sanity check" by testing to see if the
executable is actually installed with "is_installed" and raising an
exception in case it isn't.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Tests/TestPMD.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/lnst/Tests/TestPMD.py b/lnst/Tests/TestPMD.py
index 2e740cff..94783fea 100644
--- a/lnst/Tests/TestPMD.py
+++ b/lnst/Tests/TestPMD.py
@@ -3,6 +3,7 @@
import signal
from lnst.Common.Parameters import Param, StrParam, IntParam, FloatParam
from lnst.Common.Parameters import IpParam, DeviceOrIpParam
+from lnst.Common.Utils import is_installed
from lnst.Tests.BaseTestModule import BaseTestModule, TestModuleError
from lnst.Common.LnstError import LnstError
@@ -16,11 +17,19 @@ class TestPMD(BaseTestModule):
nics = Param(mandatory=True)
peer_macs = Param(mandatory=False)
+ @property
+ def testpmd_executable(self):
+ if is_installed("dpdk-testpmd"):
+ return "dpdk-testpmd"
+ elif is_installed("testpmd"):
+ return "testpmd"
+ else:
+ raise TestModuleError("testpmd not installed")
+
def format_command(self):
+ testpmd_args = [self.testpmd_executable]
if self.params.forward_mode == "macswap":
- testpmd_args = ["dpdk-testpmd", "--no-pci"]
- else:
- testpmd_args = ["testpmd"]
+ testpmd_args.append("--no-pci")
testpmd_args.extend(["-c", self.params.coremask,
"-n", "4", "--socket-mem",
"1024,0"])
--
2.31.1
Show replies by date