Ignore exit code 1 when returned stdout is correct
When the `ps` command is executed on a pod with `oc rsh <pod> ps ...`, sometimes the exit code is not 0, but the command returns the expected output. This patch adds " || true" to that command in order to ignore the returned code. Related-issue: OSPRH-8352 Related-issue: https://github.com/kubevirt/kubevirt/issues/10240 Change-Id: I246adf9f10a2d08b64be001bf13bfb807fb62698
This commit is contained in:
parent
30af407669
commit
e219a1fa23
@ -1237,11 +1237,17 @@ class BaseTempestTestCaseOvn(BaseTempestWhiteboxTestCase):
|
|||||||
command_items.append('--db="{}"'.format(all_db_addresses))
|
command_items.append('--db="{}"'.format(all_db_addresses))
|
||||||
|
|
||||||
# obtain the ovsdb-server command running on this pod
|
# obtain the ovsdb-server command running on this pod
|
||||||
|
# `|| true` added to prevent the following issue:
|
||||||
|
# https://github.com/kubevirt/kubevirt/issues/10240
|
||||||
cmd = ' '.join((cls.OC,
|
cmd = ' '.join((cls.OC,
|
||||||
'rsh',
|
'rsh',
|
||||||
db_pod,
|
db_pod,
|
||||||
'ps -o command -C ovsdb-server --no-headers -ww'))
|
'ps -o command -C ovsdb-server --no-headers -ww',
|
||||||
|
'|| true'))
|
||||||
ovsdb_server_cmd = cls.proxy_host_client.exec_command(cmd)
|
ovsdb_server_cmd = cls.proxy_host_client.exec_command(cmd)
|
||||||
|
assert 'ovsdb-server' in ovsdb_server_cmd, \
|
||||||
|
"command '{}' returned unexpected output: {}".format(
|
||||||
|
cmd, ovsdb_server_cmd)
|
||||||
# obtain the private-key, certificate and ca-cert options
|
# obtain the private-key, certificate and ca-cert options
|
||||||
for ssl_param in ('private-key', 'certificate', 'ca-cert'):
|
for ssl_param in ('private-key', 'certificate', 'ca-cert'):
|
||||||
command_items.append(re.search(
|
command_items.append(re.search(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user