When a command fails, CalledProcessError is raised. testing with except: masks other failures.
Change-Id: I7e3a6739411cb6a4c13e96dd123aff9159213fea
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
bufsize=1)
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
bufsize=1)
+ except subprocess.CalledProcessError as e:
cls.logger.critical("Couldn't start vpp: %s" % e)
raise
cls.logger.critical("Couldn't start vpp: %s" % e)
raise
self.logger.info("Process output : {0}{1}".format(os.linesep, out))
if self.process.returncode != 0:
self.logger.info("Process output : {0}{1}".format(os.linesep, out))
if self.process.returncode != 0:
+ raise subprocess.CalledProcessError(
"Command {0} failed with return code: {1}.{2}"
"Process error output: {2}{3}"
.format(command, self.process.returncode, os.linesep, err))
"Command {0} failed with return code: {1}.{2}"
"Process error output: {2}{3}"
.format(command, self.process.returncode, os.linesep, err))
try:
subprocess.check_output(['iperf3', '-v'])
try:
subprocess.check_output(['iperf3', '-v'])
+ except subprocess.CalledProcessError:
self.logger.error("WARNING: 'iperf3' is not installed,")
self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
return
self.logger.error("WARNING: 'iperf3' is not installed,")
self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
return
try:
subprocess.check_output(['iperf3', '-v'])
try:
subprocess.check_output(['iperf3', '-v'])
+ except subprocess.CalledProcessError:
self.logger.error("WARNING: 'iperf3' is not installed,")
self.logger.error(
" 'test_ldp_thru_host_stack_iperf3' not run!")
self.logger.error("WARNING: 'iperf3' is not installed,")
self.logger.error(
" 'test_ldp_thru_host_stack_iperf3' not run!")
try:
subprocess.check_output(['iperf3', '-v'])
try:
subprocess.check_output(['iperf3', '-v'])
+ except subprocess.CalledProcessError:
self.logger.error("WARNING: 'iperf3' is not installed,")
self.logger.error(
" 'test_ldp_thru_host_stack_iperf3' not run!")
self.logger.error("WARNING: 'iperf3' is not installed,")
self.logger.error(
" 'test_ldp_thru_host_stack_iperf3' not run!")