forked from espressif/esp-idf
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:
@@ -14,11 +14,14 @@ from pytest_embedded import Dut
|
|||||||
from pytest_embedded_idf.utils import idf_parametrize
|
from pytest_embedded_idf.utils import idf_parametrize
|
||||||
|
|
||||||
try:
|
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:
|
except ModuleNotFoundError:
|
||||||
idf_path = os.environ['IDF_PATH']
|
idf_path = os.environ['IDF_PATH']
|
||||||
|
sys.path.append(idf_path + '/tools/ci')
|
||||||
sys.path.insert(0, idf_path + '/tools/ci/python_packages')
|
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 = (
|
server_cert = (
|
||||||
'-----BEGIN CERTIFICATE-----\n'
|
'-----BEGIN CERTIFICATE-----\n'
|
||||||
|
@@ -16,11 +16,14 @@ from pytest_embedded import Dut
|
|||||||
from pytest_embedded_idf.utils import idf_parametrize
|
from pytest_embedded_idf.utils import idf_parametrize
|
||||||
|
|
||||||
try:
|
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:
|
except ModuleNotFoundError:
|
||||||
idf_path = os.environ['IDF_PATH']
|
idf_path = os.environ['IDF_PATH']
|
||||||
|
sys.path.append(idf_path + '/tools/ci')
|
||||||
sys.path.insert(0, idf_path + '/tools/ci/python_packages')
|
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 = (
|
server_cert = (
|
||||||
'-----BEGIN CERTIFICATE-----\n'
|
'-----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.write(server_key)
|
||||||
key_file_handle.close()
|
key_file_handle.close()
|
||||||
|
|
||||||
chunked_server = subprocess.Popen([
|
chunked_server = subprocess.Popen(
|
||||||
|
[
|
||||||
'openssl',
|
'openssl',
|
||||||
's_server',
|
's_server',
|
||||||
'-tls1_3',
|
'-tls1_3',
|
||||||
@@ -133,7 +137,8 @@ def start_tls1_3_server(ota_image_dir: str, server_port: int) -> subprocess.Pope
|
|||||||
server_file,
|
server_file,
|
||||||
'-port',
|
'-port',
|
||||||
str(server_port),
|
str(server_port),
|
||||||
])
|
]
|
||||||
|
)
|
||||||
return chunked_server
|
return chunked_server
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user