fix(ota): Fix the OTA pytest idf_path

Due to ci/pytest-mark-formatter(branch) fix, while executing the main
function from the pytest, it gives error for the incorrect idf_path.

This commit ensure that, idf_path is fixed correctly.
This commit is contained in:
hrushikesh.bhosale
2025-04-09 12:06:22 +05:30
parent 4f3e64331b
commit 3e1317fd13
2 changed files with 24 additions and 16 deletions

View File

@@ -14,11 +14,14 @@ from pytest_embedded import Dut
from pytest_embedded_idf.utils import idf_parametrize
try:
from common_test_methods import get_env_config_variable, get_host_ip4_by_dest_ip
from common_test_methods import get_env_config_variable
from common_test_methods import get_host_ip4_by_dest_ip
except ModuleNotFoundError:
idf_path = os.environ['IDF_PATH']
sys.path.append(idf_path + '/tools/ci')
sys.path.insert(0, idf_path + '/tools/ci/python_packages')
from common_test_methods import get_env_config_variable, get_host_ip4_by_dest_ip
from common_test_methods import get_env_config_variable
from common_test_methods import get_host_ip4_by_dest_ip
server_cert = (
'-----BEGIN CERTIFICATE-----\n'

View File

@@ -16,11 +16,14 @@ from pytest_embedded import Dut
from pytest_embedded_idf.utils import idf_parametrize
try:
from common_test_methods import get_env_config_variable, get_host_ip4_by_dest_ip
from common_test_methods import get_env_config_variable
from common_test_methods import get_host_ip4_by_dest_ip
except ModuleNotFoundError:
idf_path = os.environ['IDF_PATH']
sys.path.append(idf_path + '/tools/ci')
sys.path.insert(0, idf_path + '/tools/ci/python_packages')
from common_test_methods import get_env_config_variable, get_host_ip4_by_dest_ip
from common_test_methods import get_env_config_variable
from common_test_methods import get_host_ip4_by_dest_ip
server_cert = (
'-----BEGIN CERTIFICATE-----\n'
@@ -122,7 +125,8 @@ def start_tls1_3_server(ota_image_dir: str, server_port: int) -> subprocess.Pope
key_file_handle.write(server_key)
key_file_handle.close()
chunked_server = subprocess.Popen([
chunked_server = subprocess.Popen(
[
'openssl',
's_server',
'-tls1_3',
@@ -133,7 +137,8 @@ def start_tls1_3_server(ota_image_dir: str, server_port: int) -> subprocess.Pope
server_file,
'-port',
str(server_port),
])
]
)
return chunked_server