Star p4runtime shell in verbose mode, exit if shell fails to connect
Change-Id: I7b3120de1642010ec355a21b6f46065718676b7f
diff --git a/TestON/drivers/common/cli/p4runtimeclidriver.py b/TestON/drivers/common/cli/p4runtimeclidriver.py
index e2ef0c8..4de91be 100644
--- a/TestON/drivers/common/cli/p4runtimeclidriver.py
+++ b/TestON/drivers/common/cli/p4runtimeclidriver.py
@@ -108,7 +108,7 @@
try:
main.log.debug(self.name + ": Starting P4Runtime Shell CLI")
grpcAddr = "%s:%s" % (self.p4rtAddress, self.p4rtPort)
- startP4RtShLine = "python3 -m p4runtime_sh --grpc-addr " + grpcAddr + \
+ startP4RtShLine = "python3 -m p4runtime_sh -v --grpc-addr " + grpcAddr + \
" --device-id " + self.p4rtDeviceId + \
" --election-id " + self.p4rtElectionId
if pushConfig:
@@ -119,6 +119,9 @@
"You should provide a P4 Runtime config to push!")
main.cleanAndExit()
response = self.__clearSendAndExpect(startP4RtShLine)
+ if "CRITICAL" in response:
+ main.log.exception(self.name + ": Connection error.")
+ main.cleanAndExit()
self.preDisconnect = self.stopP4RtClient
except pexpect.TIMEOUT:
main.log.exception(self.name + ": Command timed out")