diff options
author | Viliam Luc <vluc@cisco.com> | 2022-11-22 09:54:07 +0100 |
---|---|---|
committer | Peter Mikus <peter.mikus@protonmail.ch> | 2022-11-23 12:00:38 +0000 |
commit | 44035124ff149a8b92d79ab73bf79466328035b8 (patch) | |
tree | 70ae3d8ab594e8813b88e29c028f397c13d9e59f | |
parent | cfb2a1ddc8976d6e6da939132b4963416ef0cb12 (diff) |
Fix: Nginx check simplified
Signed-off-by: Viliam Luc <vluc@cisco.com>
Change-Id: Icd8a5e892bb2c31c01851f731482c692cea4d70a
-rw-r--r-- | resources/libraries/python/NGINX/NGINXTools.py | 14 | ||||
-rw-r--r-- | resources/libraries/robot/shared/suite_setup.robot | 2 |
2 files changed, 5 insertions, 11 deletions
diff --git a/resources/libraries/python/NGINX/NGINXTools.py b/resources/libraries/python/NGINX/NGINXTools.py index 9418484f15..941fe733e7 100644 --- a/resources/libraries/python/NGINX/NGINXTools.py +++ b/resources/libraries/python/NGINX/NGINXTools.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Intel and/or its affiliates. +# Copyright (c) 2022 Intel and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -74,21 +74,15 @@ class NGINXTools: :type nginx_version: str :raises RuntimeError: If command returns nonzero return code. """ - nginx_path = f"{pkg_dir}/nginx-{nginx_version}/sbin/nginx" - cmd_options = NginxUtil.get_cmd_options(path=nginx_path) - ret_code, _, stderr = exec_cmd(node, cmd_options, sudo=True) - if nginx_version in stderr and ret_code == 0: - logger.info(f"NGINX Version: {stderr}") + cmd = f"test -f {pkg_dir}/nginx-{nginx_version}/sbin/nginx" + ret_code, _, _ = exec_cmd(node, cmd, sudo=True) + if ret_code == 0: return command = f"{Constants.REMOTE_FW_DIR}/{Constants.RESOURCES_LIB_SH}" \ f"/entry/install_nginx.sh nginx-{nginx_version}" message = u"Install the NGINX failed!" exec_cmd_no_error(node, command, sudo=True, timeout=600, message=message) - _, stderr = exec_cmd_no_error(node, cmd_options, sudo=True, - message=message) - - logger.info(f"NGINX Version: {stderr}") @staticmethod def install_vsap_nginx_on_dut(node, pkg_dir): diff --git a/resources/libraries/robot/shared/suite_setup.robot b/resources/libraries/robot/shared/suite_setup.robot index 48845708ad..0e859ccd82 100644 --- a/resources/libraries/robot/shared/suite_setup.robot +++ b/resources/libraries/robot/shared/suite_setup.robot @@ -288,7 +288,7 @@ | | ... | Additional Setup for suites which uses Nginx. | | | | Install NGINX framework on all DUTs | ${nodes} | ${packages_dir} -| | ... | ${nginx_version} +| | ... | ${nginx_version} | Additional Suite Setup Action For vppecho | | [Documentation] |