From bec9ae693f170821e2de715fca20be0d39701d39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikul=C3=A1=C5=A1=20=C5=A0=C5=A5astn=C3=BD?= Date: Wed, 5 Nov 2025 14:02:56 +0100 Subject: [PATCH] Add local repo test --- .../config/CMCONF_FLEET_PROTOCOLConfig.cmake | 44 +++++++++++++++ example_context/config/README.md | 17 ++++++ example_context/docker/debian12/Dockerfile | 5 ++ example_context/docker/fedora40/Dockerfile | 5 ++ example_context/docker/fedora41/Dockerfile | 5 ++ example_context/docker/fleet-os-2/Dockerfile | 5 ++ example_context/docker/ubuntu2404/Dockerfile | 5 ++ .../fleet_protocol_cpp_debug.json | 3 +- .../fleet_protocol_cpp_release.json | 3 +- .../fleet_protocol_debug.json | 3 +- .../fleet_protocol_release.json | 3 +- tests/integration_tests/test_build_apps.py | 53 +++++++++++++++++++ .../app/io-module/io-module_debug.json | 5 +- .../app/io-module/io-module_release.json | 5 +- .../fleet_protocol_cpp_debug.json | 40 ++++++++++++++ .../fleet_protocol_cpp_release.json | 40 ++++++++++++++ .../fleet_protocol_debug.json | 39 ++++++++++++++ .../fleet_protocol_release.json | 39 ++++++++++++++ .../nlohmann-json/nlohmann_json_debug.json | 35 ++++++++++++ .../nlohmann-json/nlohmann_json_release.json | 35 ++++++++++++ .../test_packages/zlib/zlib_debug.json | 34 ++++++++++++ .../test_packages/zlib/zlib_release.json | 34 ++++++++++++ tests/test_utils/test_utils.py | 4 ++ 23 files changed, 453 insertions(+), 8 deletions(-) create mode 100644 example_context/config/CMCONF_FLEET_PROTOCOLConfig.cmake create mode 100644 example_context/config/README.md create mode 100644 tests/test_data/test_packages/fleet-protocol-cpp/fleet_protocol_cpp_debug.json create mode 100644 tests/test_data/test_packages/fleet-protocol-cpp/fleet_protocol_cpp_release.json create mode 100644 tests/test_data/test_packages/fleet-protocol-interface/fleet_protocol_debug.json create mode 100644 tests/test_data/test_packages/fleet-protocol-interface/fleet_protocol_release.json create mode 100644 tests/test_data/test_packages/nlohmann-json/nlohmann_json_debug.json create mode 100644 tests/test_data/test_packages/nlohmann-json/nlohmann_json_release.json create mode 100644 tests/test_data/test_packages/zlib/zlib_debug.json create mode 100644 tests/test_data/test_packages/zlib/zlib_release.json diff --git a/example_context/config/CMCONF_FLEET_PROTOCOLConfig.cmake b/example_context/config/CMCONF_FLEET_PROTOCOLConfig.cmake new file mode 100644 index 0000000..0d554a5 --- /dev/null +++ b/example_context/config/CMCONF_FLEET_PROTOCOLConfig.cmake @@ -0,0 +1,44 @@ + +# Example configuration for CMCONF system. +# + +FIND_PACKAGE(CMLIB REQUIRED COMPONENTS CMCONF) + +CMCONF_INIT_SYSTEM(FLEET_PROTOCOL) + +# +# Setting using upstream Package Repository by default for this system. This can be overridden by +# App in CMakeLists.txt. +# +CMCONF_SET(BA_PACKAGE_LOCAL_USE OFF) +CMCONF_SET(BA_PACKAGE_LOCAL_PATH "") + +# +# The http authorization header is usually used for accessing private Package Repositories. This +# example does not need it, but the variable must be set. +# +CMCONF_SET(BA_PACKAGE_HTTP_AUTHORIZATION_HEADER "") + +# +# Setting BringAuto's Package Repository URI Template +# +CMCONF_SET(BA_PACKAGE_URI_REVISION master) +CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitea.bringauto.com/fleet-protocol/package-repository/media//package///") + +# +# Gitea hosted public Package Repository: +# +#CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitea.example.com/username/repository/media//package///") + +# +# Gitea hosted private Package Repository. +# Do not forget to specify Access Token +# +#CMCONF_SET(BA_PACKAGE_HTTP_AUTHORIZATION_HEADER "token ") +#CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitea.example.com/username/repository/raw//package///") + +# +# Gitlab hosted private Package Repository. +# +#CMCONF_SET(BA_PACKAGE_HTTP_AUTHORIZATION_HEADER "Bearer ") +#CMCONF_SET(BA_PACKAGE_URI_TEMPLATE_REMOTE "https://gitlab.example.com/username/repository/-/raw//package///") diff --git a/example_context/config/README.md b/example_context/config/README.md new file mode 100644 index 0000000..09f346d --- /dev/null +++ b/example_context/config/README.md @@ -0,0 +1,17 @@ + +# FLEET_PROTOCOL System Configuration + +This directory contains the configuration file for FLEET_PROTOCOL [CMCONF] system. It is used to set +required variables for [Package Tracker]. The most important variable is +`BA_PACKAGE_URI_TEMPLATE_REMOTE`, which sets URI of Package Repository used during builds. + +This system must be installed in all Docker images. + +More information about this system can be found in [Package Tracker Example]. + +Using this system is an example and in general Context does not need to use it. + + +[Package Tracker]: https://github.com/bacpack-system/package-tracker +[Package Tracker Example]: https://github.com/bacpack-system/package-tracker/tree/master/example +[CMCONF]: https://github.com/cmakelib/cmakelib-component-cmconf diff --git a/example_context/docker/debian12/Dockerfile b/example_context/docker/debian12/Dockerfile index 162c6fa..998d824 100644 --- a/example_context/docker/debian12/Dockerfile +++ b/example_context/docker/debian12/Dockerfile @@ -34,6 +34,11 @@ RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc && \ echo "export CXX=/usr/local/bin/g++" >> /root/.bashrc && \ echo "export LD_LIBRARY_PATH=/usr/local/lib64" >> /root/.bashrc +# Install Fleet Protocol's CMCONF system +COPY --from=package-context config/CMCONF_FLEET_PROTOCOLConfig.cmake /etc +ENV CMLIB_DIR=/cmakelib +RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_FLEET_PROTOCOLConfig.cmake + RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config RUN mkdir -p /run/sshd diff --git a/example_context/docker/fedora40/Dockerfile b/example_context/docker/fedora40/Dockerfile index 36ca393..2b99365 100644 --- a/example_context/docker/fedora40/Dockerfile +++ b/example_context/docker/fedora40/Dockerfile @@ -20,6 +20,11 @@ RUN dnf -y update && \ RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc +# Install Fleet Protocol's CMCONF system +COPY --from=package-context config/CMCONF_FLEET_PROTOCOLConfig.cmake /etc +ENV CMLIB_DIR=/cmakelib +RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_FLEET_PROTOCOLConfig.cmake + RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config RUN mkdir -p /run/sshd diff --git a/example_context/docker/fedora41/Dockerfile b/example_context/docker/fedora41/Dockerfile index 347de41..abc06ff 100644 --- a/example_context/docker/fedora41/Dockerfile +++ b/example_context/docker/fedora41/Dockerfile @@ -20,6 +20,11 @@ RUN dnf -y update && \ RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc +# Install Fleet Protocol's CMCONF system +COPY --from=package-context config/CMCONF_FLEET_PROTOCOLConfig.cmake /etc +ENV CMLIB_DIR=/cmakelib +RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_FLEET_PROTOCOLConfig.cmake + RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config RUN mkdir -p /run/sshd diff --git a/example_context/docker/fleet-os-2/Dockerfile b/example_context/docker/fleet-os-2/Dockerfile index 4028813..d9cc3a3 100644 --- a/example_context/docker/fleet-os-2/Dockerfile +++ b/example_context/docker/fleet-os-2/Dockerfile @@ -42,6 +42,11 @@ RUN chmod +x /root/init_toolchain.sh && \ COPY os-release /etc/os-release COPY uname.txt /root/tools/ +# Install Fleet Protocol's CMCONF system +COPY --from=package-context config/CMCONF_FLEET_PROTOCOLConfig.cmake /etc +ENV CMLIB_DIR=/cmakelib +RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_FLEET_PROTOCOLConfig.cmake + RUN apt-get update && \ apt-get purge -y \ wget unzip && \ diff --git a/example_context/docker/ubuntu2404/Dockerfile b/example_context/docker/ubuntu2404/Dockerfile index c8d66d6..584c718 100644 --- a/example_context/docker/ubuntu2404/Dockerfile +++ b/example_context/docker/ubuntu2404/Dockerfile @@ -20,6 +20,11 @@ RUN apt-get purge -y \ RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc +# Install Fleet Protocol's CMCONF system +COPY --from=package-context config/CMCONF_FLEET_PROTOCOLConfig.cmake /etc +ENV CMLIB_DIR=/cmakelib +RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_FLEET_PROTOCOLConfig.cmake + RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config RUN mkdir -p /run/sshd diff --git a/example_context/package/fleet-protocol-cpp/fleet_protocol_cpp_debug.json b/example_context/package/fleet-protocol-cpp/fleet_protocol_cpp_debug.json index 6178552..5872a3f 100644 --- a/example_context/package/fleet-protocol-cpp/fleet_protocol_cpp_debug.json +++ b/example_context/package/fleet-protocol-cpp/fleet_protocol_cpp_debug.json @@ -33,7 +33,8 @@ "debian12", "ubuntu2404", "fedora40", - "fedora41" + "fedora41", + "fleet-os-2" ] } } diff --git a/example_context/package/fleet-protocol-cpp/fleet_protocol_cpp_release.json b/example_context/package/fleet-protocol-cpp/fleet_protocol_cpp_release.json index 4e576e0..efd384e 100644 --- a/example_context/package/fleet-protocol-cpp/fleet_protocol_cpp_release.json +++ b/example_context/package/fleet-protocol-cpp/fleet_protocol_cpp_release.json @@ -33,7 +33,8 @@ "debian12", "ubuntu2404", "fedora40", - "fedora41" + "fedora41", + "fleet-os-2" ] } } diff --git a/example_context/package/fleet-protocol-interface/fleet_protocol_debug.json b/example_context/package/fleet-protocol-interface/fleet_protocol_debug.json index 8fd78fa..899b951 100644 --- a/example_context/package/fleet-protocol-interface/fleet_protocol_debug.json +++ b/example_context/package/fleet-protocol-interface/fleet_protocol_debug.json @@ -32,7 +32,8 @@ "ubuntu1804-aarch64", "ubuntu2404", "fedora40", - "fedora41" + "fedora41", + "fleet-os-2" ] } } diff --git a/example_context/package/fleet-protocol-interface/fleet_protocol_release.json b/example_context/package/fleet-protocol-interface/fleet_protocol_release.json index 36ac755..ed8768f 100644 --- a/example_context/package/fleet-protocol-interface/fleet_protocol_release.json +++ b/example_context/package/fleet-protocol-interface/fleet_protocol_release.json @@ -32,7 +32,8 @@ "ubuntu1804-aarch64", "ubuntu2404", "fedora40", - "fedora41" + "fedora41", + "fleet-os-2" ] } } diff --git a/tests/integration_tests/test_build_apps.py b/tests/integration_tests/test_build_apps.py index 3679500..919cf14 100644 --- a/tests/integration_tests/test_build_apps.py +++ b/tests/integration_tests/test_build_apps.py @@ -6,6 +6,7 @@ is_tracked, does_app_support_image, clean_sysroot, + prepare_packages, ) from test_utils.common import PackagerExpectedResult, PackagerReturnCode @@ -147,3 +148,55 @@ def test_04_build_all_apps_when_port_1122_is_used( pytest.skip("Port 1122 is already in use, skipping test") finally: sock.close() + +def test_05_build_app_local_repo(test_image, packager_binary, context, test_repo): + """Test building a single app using local Package Repository.""" + app = "io-module" + + if not does_app_support_image(app, test_image): + pytest.skip(f"App {app} does not support image {test_image}") + + run_packager( + packager_binary, + "build-app", + context=context, + image_name=test_image, + output_dir=test_repo, + name=app, + use_local_repo=True, + expected_result=PackagerExpectedResult.FAILURE, + expected_returncode=( + PackagerReturnCode.BUILD_ERROR + if does_app_support_image(app, test_image) + else PackagerReturnCode.DEFAULT_ERROR + ), + ) + dep_packages = ["nlohmann-json", "zlib", "fleet-protocol-interface", "fleet-protocol-cpp"] + prepare_packages(dep_packages) + for package in dep_packages: + run_packager( + packager_binary, + "build-package", + context=context, + image_name=test_image, + output_dir=test_repo, + name=package, + expected_result=PackagerExpectedResult.SUCCESS, + ) + + run_packager( + packager_binary, + "build-app", + context=context, + image_name=test_image, + output_dir=test_repo, + name=app, + use_local_repo=True, + expected_result=PackagerExpectedResult.SUCCESS, + expected_returncode=( + PackagerReturnCode.SUCCESS + if does_app_support_image(app, test_image) + else PackagerReturnCode.DEFAULT_ERROR + ), + ) + \ No newline at end of file diff --git a/tests/test_data/example/app/io-module/io-module_debug.json b/tests/test_data/example/app/io-module/io-module_debug.json index 1b9b1e4..50ed090 100644 --- a/tests/test_data/example/app/io-module/io-module_debug.json +++ b/tests/test_data/example/app/io-module/io-module_debug.json @@ -8,7 +8,8 @@ "CMake": { "Defines": { "CMAKE_BUILD_TYPE": "Debug", - "BRINGAUTO_INSTALL": "ON" + "BRINGAUTO_INSTALL": "ON", + "FLEET_PROTOCOL_BUILD_EXTERNAL_SERVER": "OFF" } } }, @@ -31,4 +32,4 @@ "fedora41" ] } -} \ No newline at end of file +} diff --git a/tests/test_data/example/app/io-module/io-module_release.json b/tests/test_data/example/app/io-module/io-module_release.json index f6bb39a..1763f30 100644 --- a/tests/test_data/example/app/io-module/io-module_release.json +++ b/tests/test_data/example/app/io-module/io-module_release.json @@ -8,7 +8,8 @@ "CMake": { "Defines": { "CMAKE_BUILD_TYPE": "Release", - "BRINGAUTO_INSTALL": "ON" + "BRINGAUTO_INSTALL": "ON", + "FLEET_PROTOCOL_BUILD_EXTERNAL_SERVER": "OFF" } } }, @@ -31,4 +32,4 @@ "fedora41" ] } -} \ No newline at end of file +} diff --git a/tests/test_data/test_packages/fleet-protocol-cpp/fleet_protocol_cpp_debug.json b/tests/test_data/test_packages/fleet-protocol-cpp/fleet_protocol_cpp_debug.json new file mode 100644 index 0000000..5872a3f --- /dev/null +++ b/tests/test_data/test_packages/fleet-protocol-cpp/fleet_protocol_cpp_debug.json @@ -0,0 +1,40 @@ +{ + "Env": {}, + "DependsOn": [ + "fleet-protocol-interface" + ], + "Git": { + "URI": "https://github.com/bringauto/fleet-protocol-cpp.git", + "Revision": "v1.1.1" + }, + "Build": { + "CMake": { + "Defines": { + "CMAKE_BUILD_TYPE": "Debug", + "BRINGAUTO_INSTALL": "ON", + "BRINGAUTO_PACKAGE": "ON", + "BRINGAUTO_SYSTEM_DEP": "ON", + "BRINGAUTO_TESTS": "OFF" + } + } + }, + "Package": { + "Name": "fleet-protocol-cpp", + "VersionTag": "v1.1.1", + "PlatformString": { + "Mode": "auto" + }, + "IsLibrary": true, + "IsDevLib": true, + "IsDebug": true + }, + "DockerMatrix": { + "ImageNames": [ + "debian12", + "ubuntu2404", + "fedora40", + "fedora41", + "fleet-os-2" + ] + } +} diff --git a/tests/test_data/test_packages/fleet-protocol-cpp/fleet_protocol_cpp_release.json b/tests/test_data/test_packages/fleet-protocol-cpp/fleet_protocol_cpp_release.json new file mode 100644 index 0000000..efd384e --- /dev/null +++ b/tests/test_data/test_packages/fleet-protocol-cpp/fleet_protocol_cpp_release.json @@ -0,0 +1,40 @@ +{ + "Env": {}, + "DependsOn": [ + "fleet-protocol-interface" + ], + "Git": { + "URI": "https://github.com/bringauto/fleet-protocol-cpp.git", + "Revision": "v1.1.1" + }, + "Build": { + "CMake": { + "Defines": { + "CMAKE_BUILD_TYPE": "Release", + "BRINGAUTO_INSTALL": "ON", + "BRINGAUTO_PACKAGE": "ON", + "BRINGAUTO_SYSTEM_DEP": "ON", + "BRINGAUTO_TESTS": "OFF" + } + } + }, + "Package": { + "Name": "fleet-protocol-cpp", + "VersionTag": "v1.1.1", + "PlatformString": { + "Mode": "auto" + }, + "IsLibrary": true, + "IsDevLib": true, + "IsDebug": false + }, + "DockerMatrix": { + "ImageNames": [ + "debian12", + "ubuntu2404", + "fedora40", + "fedora41", + "fleet-os-2" + ] + } +} diff --git a/tests/test_data/test_packages/fleet-protocol-interface/fleet_protocol_debug.json b/tests/test_data/test_packages/fleet-protocol-interface/fleet_protocol_debug.json new file mode 100644 index 0000000..899b951 --- /dev/null +++ b/tests/test_data/test_packages/fleet-protocol-interface/fleet_protocol_debug.json @@ -0,0 +1,39 @@ +{ + "Env": {}, + "DependsOn": [], + "Git": { + "URI": "https://github.com/bringauto/fleet-protocol.git", + "Revision": "v2.0.0" + }, + "Build": { + "CMake": { + "Defines": { + "CMAKE_BUILD_TYPE": "Debug", + "BRINGAUTO_INSTALL": "ON", + "BRINGAUTO_PACKAGE": "ON", + "BRINGAUTO_SYSTEM_DEP": "ON", + "BRINGAUTO_SAMPLES": "OFF" + } + } + }, + "Package": { + "Name": "fleet-protocol-interface", + "VersionTag": "v2.0.0", + "PlatformString": { + "Mode": "auto" + }, + "IsLibrary": true, + "IsDevLib": true, + "IsDebug": true + }, + "DockerMatrix": { + "ImageNames": [ + "debian12", + "ubuntu1804-aarch64", + "ubuntu2404", + "fedora40", + "fedora41", + "fleet-os-2" + ] + } +} diff --git a/tests/test_data/test_packages/fleet-protocol-interface/fleet_protocol_release.json b/tests/test_data/test_packages/fleet-protocol-interface/fleet_protocol_release.json new file mode 100644 index 0000000..ed8768f --- /dev/null +++ b/tests/test_data/test_packages/fleet-protocol-interface/fleet_protocol_release.json @@ -0,0 +1,39 @@ +{ + "Env": {}, + "DependsOn": [], + "Git": { + "URI": "https://github.com/bringauto/fleet-protocol.git", + "Revision": "v2.0.0" + }, + "Build": { + "CMake": { + "Defines": { + "CMAKE_BUILD_TYPE": "Release", + "BRINGAUTO_INSTALL": "ON", + "BRINGAUTO_PACKAGE": "ON", + "BRINGAUTO_SYSTEM_DEP": "ON", + "BRINGAUTO_SAMPLES": "OFF" + } + } + }, + "Package": { + "Name": "fleet-protocol-interface", + "VersionTag": "v2.0.0", + "PlatformString": { + "Mode": "auto" + }, + "IsLibrary": true, + "IsDevLib": true, + "IsDebug": false + }, + "DockerMatrix": { + "ImageNames": [ + "debian12", + "ubuntu1804-aarch64", + "ubuntu2404", + "fedora40", + "fedora41", + "fleet-os-2" + ] + } +} diff --git a/tests/test_data/test_packages/nlohmann-json/nlohmann_json_debug.json b/tests/test_data/test_packages/nlohmann-json/nlohmann_json_debug.json new file mode 100644 index 0000000..63e500f --- /dev/null +++ b/tests/test_data/test_packages/nlohmann-json/nlohmann_json_debug.json @@ -0,0 +1,35 @@ +{ + "Env": {}, + "DependsOn": [], + "Git": { + "URI": "https://github.com/nlohmann/json.git", + "Revision": "v3.10.5" + }, + "Build": { + "CMake": { + "Defines": { + "CMAKE_BUILD_TYPE": "Debug", + "JSON_BuildTests": "OFF" + } + } + }, + "Package": { + "Name": "nlohmann-json", + "VersionTag": "v3.10.5", + "PlatformString": { + "Mode": "auto" + }, + "IsLibrary": true, + "IsDevLib": true, + "IsDebug": true + }, + "DockerMatrix": { + "ImageNames": [ + "fleet-os-2", + "debian12", + "ubuntu2404", + "fedora40", + "fedora41" + ] + } +} diff --git a/tests/test_data/test_packages/nlohmann-json/nlohmann_json_release.json b/tests/test_data/test_packages/nlohmann-json/nlohmann_json_release.json new file mode 100644 index 0000000..f160543 --- /dev/null +++ b/tests/test_data/test_packages/nlohmann-json/nlohmann_json_release.json @@ -0,0 +1,35 @@ +{ + "Env": {}, + "DependsOn": [], + "Git": { + "URI": "https://github.com/nlohmann/json.git", + "Revision": "v3.10.5" + }, + "Build": { + "CMake": { + "Defines": { + "CMAKE_BUILD_TYPE": "Release", + "JSON_BuildTests": "OFF" + } + } + }, + "Package": { + "Name": "nlohmann-json", + "VersionTag": "v3.10.5", + "PlatformString": { + "Mode": "auto" + }, + "IsLibrary": true, + "IsDevLib": true, + "IsDebug": false + }, + "DockerMatrix": { + "ImageNames": [ + "fleet-os-2", + "debian12", + "ubuntu2404", + "fedora40", + "fedora41" + ] + } +} diff --git a/tests/test_data/test_packages/zlib/zlib_debug.json b/tests/test_data/test_packages/zlib/zlib_debug.json new file mode 100644 index 0000000..ccb39d2 --- /dev/null +++ b/tests/test_data/test_packages/zlib/zlib_debug.json @@ -0,0 +1,34 @@ +{ + "Env": {}, + "Git": { + "URI": "https://github.com/madler/zlib.git", + "Revision": "v1.2.11" + }, + "Build": { + "CMake": { + "Defines": { + "CMAKE_BUILD_TYPE": "Debug" + } + } + }, + "Package": { + "Name": "zlib", + "VersionTag": "v1.2.11", + "PlatformString": { + "Mode": "auto" + }, + "IsLibrary": true, + "IsDevLib": true, + "IsDebug": true + }, + "DockerMatrix": { + "ImageNames": [ + "fleet-os-2", + "debian12", + "ubuntu1804-aarch64", + "ubuntu2404", + "fedora40", + "fedora41" + ] + } +} diff --git a/tests/test_data/test_packages/zlib/zlib_release.json b/tests/test_data/test_packages/zlib/zlib_release.json new file mode 100644 index 0000000..76583c0 --- /dev/null +++ b/tests/test_data/test_packages/zlib/zlib_release.json @@ -0,0 +1,34 @@ +{ + "Env": {}, + "Git": { + "URI": "https://github.com/madler/zlib.git", + "Revision": "v1.2.11" + }, + "Build": { + "CMake": { + "Defines": { + "CMAKE_BUILD_TYPE": "Release" + } + } + }, + "Package": { + "Name": "zlib", + "VersionTag": "v1.2.11", + "PlatformString": { + "Mode": "auto" + }, + "IsLibrary": true, + "IsDevLib": true, + "IsDebug": false + }, + "DockerMatrix": { + "ImageNames": [ + "fleet-os-2", + "debian12", + "ubuntu1804-aarch64", + "ubuntu2404", + "fedora40", + "fedora41" + ] + } +} diff --git a/tests/test_utils/test_utils.py b/tests/test_utils/test_utils.py index 3306882..0632156 100644 --- a/tests/test_utils/test_utils.py +++ b/tests/test_utils/test_utils.py @@ -203,6 +203,7 @@ def run_packager( build_deps: bool = False, build_deps_on: bool = False, build_deps_on_recursive: bool = False, + use_local_repo: bool = False, help: bool = False, all: bool = False, expected_result: PackagerExpectedResult = PackagerExpectedResult.NOT_APPLICABLE, @@ -267,6 +268,9 @@ def run_packager( if build_deps_on_recursive: parameters.append("--build-deps-on-recursive") + + if use_local_repo: + parameters.append("--use-local-repo") print("\033[95m\nRunning command:", " ".join(parameters), "\033[0m")