- cmd = (u"vppctl show pci 2>&1 | "
- u"fgrep -v 'Connection refused' | "
- u"fgrep -v 'No such file or directory'")
+ for _ in range(retries + 1):
+ try:
+ # Execute puts the command into single quotes,
+ # so inner arguments are enclosed in qouble quotes here.
+ self.execute(
+ u'vppctl show pci 2>&1 | '
+ u'fgrep -v "Connection refused" | '
+ u'fgrep -v "No such file or directory"'
+ )
+ break
+ except (RuntimeError, AssertionError):
+ sleep(retry_wait)
+ else:
+ self.execute(u"cat /tmp/vppd.log")
+ raise RuntimeError(
+ f"VPP did not come up in container: {self.container.name}"
+ )
+
+ def adjust_privileges(self):
+ """Adjust privileges to control VPP without sudo."""
+ self.execute("chmod -R o+rwx /run/vpp")
+
+ def verify_vpp_papi(self, retries=120, retry_wait=1):
+ """Verify that VPP is available for PAPI.