From 35ccc8f32b4dc1b906939d1277089cec944b6f0b Mon Sep 17 00:00:00 2001 From: Simone Orru Date: Thu, 21 Nov 2024 13:03:40 +0100 Subject: [PATCH] End to end executed everywhere Signed-off-by: Simone Orru --- e2e/Kconfig | 4 +++- e2e/certificate.cmake | 2 +- e2e/pytest/cfgvalues.py | 6 ++++-- lib/astarte_device_sdk/Kconfig | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/e2e/Kconfig b/e2e/Kconfig index a404de67..68f77db6 100644 --- a/e2e/Kconfig +++ b/e2e/Kconfig @@ -18,7 +18,9 @@ menu "E2E test" config TLS_CERTIFICATE_PATH string "Path of the tls certificate" help - Path to a certificate, the file byte's will be included in the binary and used for https and mqtts connection + Path to a certificate in PEM format. it will be included in the binary and used for TLS + authentication. + This path should be relative to the end to end project folder. config DEVICE_ID string "Astarte device ID" diff --git a/e2e/certificate.cmake b/e2e/certificate.cmake index c57a8b6c..1f638ac0 100644 --- a/e2e/certificate.cmake +++ b/e2e/certificate.cmake @@ -9,7 +9,7 @@ if(NOT DEFINED ${CERTIFICATE_PATH_VAR}) return() endif() -get_filename_component(certificate_file ${${CERTIFICATE_PATH_VAR}} ABSOLUTE) +get_filename_component(certificate_file ${CMAKE_SOURCE_DIR}/${${CERTIFICATE_PATH_VAR}} ABSOLUTE) if(NOT EXISTS ${certificate_file}) message(ERROR "The file path '${certificate_file}' specified in '${CERTIFICATE_PATH_VAR}' does not exist, provide a valid file or remove the option") diff --git a/e2e/pytest/cfgvalues.py b/e2e/pytest/cfgvalues.py index 8a5c0635..78bf072e 100644 --- a/e2e/pytest/cfgvalues.py +++ b/e2e/pytest/cfgvalues.py @@ -3,6 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 from typing import Optional +import os +from pathlib import Path from dotenv import dotenv_values @@ -26,8 +28,8 @@ def __init__(self, config_file_path: str) -> None: self.device_id: str = self._get_config_value(prj_config, "CONFIG_DEVICE_ID") self.appengine_url: str = self._get_config_value(prj_config, "CONFIG_E2E_APPENGINE_URL") self.appengine_token: str = self._get_config_value(prj_config, "CONFIG_E2E_APPENGINE_TOKEN") - self.appengine_cert: bool | str = self._get_config_value( - prj_config, "CONFIG_TLS_CERTIFICATE_PATH" + self.appengine_cert: Path = Path(os.path.abspath(__file__)).parent.parent.joinpath( + self._get_config_value(prj_config, "CONFIG_TLS_CERTIFICATE_PATH") ) @staticmethod diff --git a/lib/astarte_device_sdk/Kconfig b/lib/astarte_device_sdk/Kconfig index 82d31bb3..28ece23b 100644 --- a/lib/astarte_device_sdk/Kconfig +++ b/lib/astarte_device_sdk/Kconfig @@ -186,7 +186,7 @@ config ASTARTE_DEVICE_SDK_ADVANCED_CODE_GENERATION_INTERFACE_DIRECTORY string "Path to the interface json directory" depends on ASTARTE_DEVICE_SDK_ADVANCED_CODE_GENERATION help - This must be set to the path of a directory containing valid interface jsons. + This must be set to the relative path of a directory containing valid interface jsons. Generated interfaces may then be included by adding `#include "astarte_generated_interfaces.h"`. endmenu