Skip to content

Commit

Permalink
Merge pull request #4185 from zhenyzha/pktgen_burst_test
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulYuuu authored Nov 14, 2024
2 parents 5a44c70 + b2d10cf commit c97ee92
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
20 changes: 16 additions & 4 deletions generic/tests/pktgen_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,19 @@ def init_vm_and_login(test, params, env, result_file, pktgen_runner):
_pin_vm_threads(params.get("numa_node"))
guest_ver = session_serial.cmd_output(guest_ver_cmd)
result_file.write("### guest-kernel-ver :%s" % guest_ver)

if pktgen_runner.is_version_lt_rhel7(session_serial.cmd("uname -r")):
pktgen_runner.install_package(
guest_ver.strip(), vm=vm, session_serial=session_serial
)
if guest_ver.count("64k"):
pktgen_runner.install_package(
guest_ver.strip(),
pagesize="64k",
vm=vm,
session_serial=session_serial,
)
else:
pktgen_runner.install_package(
guest_ver.strip(), vm=vm, session_serial=session_serial
)
return vm, session_serial

# get parameter from dictionary
Expand All @@ -97,7 +106,10 @@ def init_vm_and_login(test, params, env, result_file, pktgen_runner):

pktgen_runner = pktgen_utils.PktgenRunner()
if pktgen_runner.is_version_lt_rhel7(process.getoutput("uname -r")):
pktgen_runner.install_package(host_ver)
if host_ver.count("64k"):
pktgen_runner.install_package(host_ver, pagesize="64k")
else:
pktgen_runner.install_package(host_ver)

vdpa_net_test = None
vm = None
Expand Down
7 changes: 5 additions & 2 deletions provider/pktgen_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,14 @@ def run_test(self, script, cmd, runner, interface, timeout):
mpps_results = "%.2f" % mpps_results
return mpps_results

def install_package(self, ver, vm=None, session_serial=None):
def install_package(self, ver, pagesize=None, vm=None, session_serial=None):
"""Check module pktgen, install kernel-modules-internal package"""

output_cmd = process.getoutput
kernel_ver = "kernel-modules-internal-%s" % ver
if pagesize:
kernel_ver = "kernel-%s-modules-internal-%s" % (pagesize, ver.split("+")[0])
else:
kernel_ver = "kernel-modules-internal-%s" % ver
cmd_download = "cd /tmp && brew download-build %s --rpm" % kernel_ver
cmd_install = "cd /tmp && rpm -ivh %s.rpm --force --nodeps" % kernel_ver
output_cmd(cmd_download)
Expand Down

0 comments on commit c97ee92

Please sign in to comment.