stressng : Improve error handling

The browbeat stressng workload reports an error in the logs
while running the stressng command, even though the output of
the stressng command reports that it has executed successfully[1].
This happens in all iterations. Also, the iteration ends with END: OK
even if there happens to be a genuine error in executing the command.

This patch fixes these 2 issues by checking the exitcode of the stressng
command and raising an exception if it is nonzero.

[1] https://privatebin.corp.redhat.com/?dc09ee175a9ee377#37vYuNmR4CF2Hc3ghjcggXeW1EHY5WXDH5PB9Wb5sBoZ

Change-Id: I0d49ee6f80e4ae9b2946c67e8689daaccb200b1d
This commit is contained in:
Sanjay Chari 2022-10-03 16:00:39 +05:30
parent 0ed5a8d0bc
commit 62650d6652
1 changed files with 2 additions and 1 deletions

View File

@ -83,7 +83,8 @@ class BrowbeatStressNg(vm_utils.VMScenario, neutron_utils.NeutronScenario):
for sip in _clients:
cmd = " {} 'ssh {}@{}' ".format(command, username, sip)
exitcode, stdout, stderr = ssh.execute(cmd)
LOG.error(" couldn't run the stress-ng command: {}".format(stderr))
if exitcode != 0:
raise Exception(" couldn't run the stress-ng command: {}".format(stderr))
def create_clients(self, jump_ssh, num_clients, image, flavor, user, **kwargs):
"""Creates Client VM's