Custom_Command: add option to fail if returncode is non-zero

This commit is contained in:
Robert Schmidt
2023-03-10 12:38:17 +01:00
parent e3520f952e
commit 4ae28aba10
2 changed files with 16 additions and 9 deletions
+3
View File
@@ -429,6 +429,7 @@ def GetParametersFromXML(action):
elif action == 'Custom_Command':
RAN.node = test.findtext('node')
RAN.command = test.findtext('command')
RAN.command_fail = test.findtext('command_fail') in ['True', 'true', 'Yes', 'yes']
else:
logging.warning(f"unknown action {action} from option-parsing point-of-view")
@@ -752,6 +753,8 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
elif action == 'Custom_Command':
logging.info(f"Executing custom command")
RAN.CustomCommand(HTML)
if RAN.prematureExit:
CiTestObj.AutoTerminateeNB(HTML,RAN,EPC,CONTAINERS)
elif action == 'Initialize_eNB':
RAN.InitializeeNB(HTML, EPC)
if RAN.prematureExit: