Skip to content

Commit

Permalink
Suse VPP tool enable (#1852)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgov authored Apr 4, 2022
1 parent 1df6f57 commit 383ea08
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions microsoft/testsuites/dpdk/dpdkvpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,18 @@ def start(self) -> None:
),
)

if isinstance(node.os, Debian) or isinstance(node.os, Fedora):
# It is possible the service has already been started, so
# rather than assume anything we'll call restart
# this will force the reload if it's already started
# or start it if it hasn't started yet.
modprobe.load("uio_hv_generic")
node.execute(
"service vpp restart",
sudo=True,
expected_exit_code=0,
expected_exit_code_failure_message=(
"Could not start/restart vpp service"
),
)
else:
raise UnsupportedDistroException(
os=node.os,
message=("VPP start is not implemented for this platform"),
)
# It is possible the service has already been started, so
# rather than assume anything we'll call restart
# this will force the reload if it's already started
# or start it if it hasn't started yet.
modprobe.load("uio_hv_generic")
node.execute(
"service vpp restart",
sudo=True,
expected_exit_code=0,
expected_exit_code_failure_message=("Could not start/restart vpp service"),
)

time.sleep(3) # give it a moment to start up

def run_test(self) -> None:
Expand All @@ -92,10 +85,11 @@ def run_test(self) -> None:

def _install(self) -> bool:
node = self.node
if isinstance(node.os, Fedora):
node.os.install_epel()
if isinstance(node.os, Debian):
pkg_type = "deb"
elif isinstance(node.os, Fedora):
node.os.install_epel()
elif isinstance(node.os, Fedora) or isinstance(node.os, Suse):
pkg_type = "rpm"
else:
raise UnsupportedDistroException(self.node.os)
Expand All @@ -121,7 +115,7 @@ def _install_from_package_manager(self) -> None:

if isinstance(node.os, Debian):
vpp_packages += ["vpp-plugin-dpdk", "vpp-plugin-core"]
elif isinstance(node.os, Fedora):
elif isinstance(node.os, Fedora) or isinstance(node.os, Suse):
vpp_packages.append("vpp-plugins")
else:
raise UnsupportedDistroException(self.node.os)
Expand Down

0 comments on commit 383ea08

Please sign in to comment.