diff --git a/.gitignore b/.gitignore index cb884c8..08f3493 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ tests/**/__pycache__/ tests/test_data/test_repo tests/test_data/example/package /tests/test_data/test_sysroot +tests/test_data/test_context diff --git a/README.md b/README.md index 13e4f7c..bea44cf 100644 --- a/README.md +++ b/README.md @@ -70,19 +70,19 @@ Packager. More information about Apps is in [UseCaseScenarios](./doc/UseCaseScen 2. Build Docker image needed for the build: ```bash - bap-builder build-image --context ./example_context --image-name debian12 + bap-builder build-image --context ./example_context --image-name debian13 ``` 3. Build all Packages for the given distro: ```bash - bap-builder build-package --context ./example_context --image-name debian12 --output-dir ./lfsrepo --all + bap-builder build-package --context ./example_context --image-name debian13 --output-dir ./lfsrepo --all ``` 4. Create sysroot for built Packages: ```bash - bap-builder create-sysroot --context ./example_context --image-name debian12 --git-lfs ./lfsrepo --sysroot-dir ./new_sysroot + bap-builder create-sysroot --context ./example_context --image-name debian13 --git-lfs ./lfsrepo --sysroot-dir ./new_sysroot ``` **Note:** If you do not have `bap-builder` in your system path, you need to use `./cmd/bap-builder/bap-builder` instead of `bap-builder`. diff --git a/example_context/app/io-module/io-module_debug.json b/example_context/app/io-module/io-module_debug.json index 1b9b1e4..3d767c4 100644 --- a/example_context/app/io-module/io-module_debug.json +++ b/example_context/app/io-module/io-module_debug.json @@ -2,7 +2,7 @@ "Env": {}, "Git": { "URI": "https://github.com/bringauto/io-module.git", - "Revision": "v1.3.2" + "Revision": "v1.3.3" }, "Build": { "CMake": { @@ -14,7 +14,7 @@ }, "Package": { "Name": "io-module", - "VersionTag": "v1.3.2", + "VersionTag": "v1.3.3", "PlatformString": { "Mode": "auto" }, @@ -25,7 +25,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/app/io-module/io-module_release.json b/example_context/app/io-module/io-module_release.json index f6bb39a..8bcedac 100644 --- a/example_context/app/io-module/io-module_release.json +++ b/example_context/app/io-module/io-module_release.json @@ -2,7 +2,7 @@ "Env": {}, "Git": { "URI": "https://github.com/bringauto/io-module.git", - "Revision": "v1.3.2" + "Revision": "v1.3.3" }, "Build": { "CMake": { @@ -14,7 +14,7 @@ }, "Package": { "Name": "io-module", - "VersionTag": "v1.3.2", + "VersionTag": "v1.3.3", "PlatformString": { "Mode": "auto" }, @@ -25,7 +25,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/app/mission-module/mission-module_debug.json b/example_context/app/mission-module/mission-module_debug.json index 2772a30..7dd8be1 100644 --- a/example_context/app/mission-module/mission-module_debug.json +++ b/example_context/app/mission-module/mission-module_debug.json @@ -25,7 +25,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/app/mission-module/mission-module_release.json b/example_context/app/mission-module/mission-module_release.json index c234e39..c7f6282 100644 --- a/example_context/app/mission-module/mission-module_release.json +++ b/example_context/app/mission-module/mission-module_release.json @@ -25,7 +25,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" 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/debian13/Dockerfile similarity index 55% rename from example_context/docker/debian12/Dockerfile rename to example_context/docker/debian13/Dockerfile index 162c6fa..1b76d06 100644 --- a/example_context/docker/debian12/Dockerfile +++ b/example_context/docker/debian13/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:12.0 +FROM debian:13.0 USER root RUN echo root:1234 | chpasswd @@ -6,18 +6,9 @@ RUN echo root:1234 | chpasswd RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y \ binutils build-essential flex git libssl-dev lsb-release make pkg-config \ - openssh-server patchelf software-properties-common wget libmpfr-dev libmpc-dev libgmp-dev && \ + openssh-server patchelf wget libmpfr-dev libmpc-dev libgmp-dev && \ rm -rf /var/lib/apt/lists/* -RUN git clone --depth=1 --single-branch --branch=releases/gcc-13.2.0 https://gcc.gnu.org/git/gcc.git /gcc && \ - cd /gcc && \ - mkdir objdir - -RUN cd /gcc/objdir && \ - ../configure --enable-languages=c,c++ --disable-multilib && \ - make -j$(nproc) && \ - make install - RUN wget "https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2-linux-x86_64.sh" -O cmake.sh && \ chmod +x cmake.sh && \ ./cmake.sh --skip-license --prefix=/usr/local && \ @@ -29,10 +20,12 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib -RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc && \ - echo "export CC=/usr/local/bin/gcc" >> /root/.bashrc && \ - echo "export CXX=/usr/local/bin/g++" >> /root/.bashrc && \ - echo "export LD_LIBRARY_PATH=/usr/local/lib64" >> /root/.bashrc +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/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/ba-logger/ba-logger_debug.json b/example_context/package/ba-logger/ba-logger_debug.json index 3b352e6..b02deb4 100644 --- a/example_context/package/ba-logger/ba-logger_debug.json +++ b/example_context/package/ba-logger/ba-logger_debug.json @@ -29,7 +29,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/ba-logger/ba-logger_release.json b/example_context/package/ba-logger/ba-logger_release.json index 5425d32..59f1dc2 100644 --- a/example_context/package/ba-logger/ba-logger_release.json +++ b/example_context/package/ba-logger/ba-logger_release.json @@ -29,7 +29,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/boost/boost_debug.json b/example_context/package/boost/boost_debug.json index d72fdd6..3cc0f92 100644 --- a/example_context/package/boost/boost_debug.json +++ b/example_context/package/boost/boost_debug.json @@ -27,7 +27,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/boost/boost_release.json b/example_context/package/boost/boost_release.json index fff3df6..0bb9965 100644 --- a/example_context/package/boost/boost_release.json +++ b/example_context/package/boost/boost_release.json @@ -27,7 +27,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/cpprestsdk/cpprestsdk_debug.json b/example_context/package/cpprestsdk/cpprestsdk_debug.json index ea1cef1..d508c3e 100644 --- a/example_context/package/cpprestsdk/cpprestsdk_debug.json +++ b/example_context/package/cpprestsdk/cpprestsdk_debug.json @@ -30,7 +30,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/cpprestsdk/cpprestsdk_release.json b/example_context/package/cpprestsdk/cpprestsdk_release.json index 85f470e..c98f93c 100644 --- a/example_context/package/cpprestsdk/cpprestsdk_release.json +++ b/example_context/package/cpprestsdk/cpprestsdk_release.json @@ -30,7 +30,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/cxxopts/cxxopts_v3_debug.json b/example_context/package/cxxopts/cxxopts_v3_debug.json index 2678d17..5872c51 100644 --- a/example_context/package/cxxopts/cxxopts_v3_debug.json +++ b/example_context/package/cxxopts/cxxopts_v3_debug.json @@ -3,7 +3,7 @@ "DependsOn": [], "Git": { "URI": "https://github.com/jarro2783/cxxopts.git", - "Revision": "v3.0.5" + "Revision": "v3.1.0" }, "Build": { "CMake": { @@ -16,7 +16,7 @@ }, "Package": { "Name": "cxxopts", - "VersionTag": "v3.0.5", + "VersionTag": "v3.1.0", "PlatformString": { "Mode": "auto" }, @@ -27,7 +27,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/cxxopts/cxxopts_v3_release.json b/example_context/package/cxxopts/cxxopts_v3_release.json index 75612bc..dc329f3 100644 --- a/example_context/package/cxxopts/cxxopts_v3_release.json +++ b/example_context/package/cxxopts/cxxopts_v3_release.json @@ -3,7 +3,7 @@ "DependsOn": [], "Git": { "URI": "https://github.com/jarro2783/cxxopts.git", - "Revision": "v3.0.5" + "Revision": "v3.1.0" }, "Build": { "CMake": { @@ -16,7 +16,7 @@ }, "Package": { "Name": "cxxopts", - "VersionTag": "v3.0.5", + "VersionTag": "v3.1.0", "PlatformString": { "Mode": "auto" }, @@ -27,7 +27,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/fleet-http-client-shared/fleet_http_client_debug.json b/example_context/package/fleet-http-client-shared/fleet_http_client_debug.json index 26a538a..1c37008 100644 --- a/example_context/package/fleet-http-client-shared/fleet_http_client_debug.json +++ b/example_context/package/fleet-http-client-shared/fleet_http_client_debug.json @@ -35,7 +35,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/fleet-http-client-shared/fleet_http_client_release.json b/example_context/package/fleet-http-client-shared/fleet_http_client_release.json index 80674fc..b90fec0 100644 --- a/example_context/package/fleet-http-client-shared/fleet_http_client_release.json +++ b/example_context/package/fleet-http-client-shared/fleet_http_client_release.json @@ -35,7 +35,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" 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..3227996 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 @@ -30,10 +30,11 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "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..c9e55e7 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 @@ -30,10 +30,11 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "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..95a0725 100644 --- a/example_context/package/fleet-protocol-interface/fleet_protocol_debug.json +++ b/example_context/package/fleet-protocol-interface/fleet_protocol_debug.json @@ -28,11 +28,12 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "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..689a848 100644 --- a/example_context/package/fleet-protocol-interface/fleet_protocol_release.json +++ b/example_context/package/fleet-protocol-interface/fleet_protocol_release.json @@ -28,11 +28,12 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu1804-aarch64", "ubuntu2404", "fedora40", - "fedora41" + "fedora41", + "fleet-os-2" ] } } diff --git a/example_context/package/fleet-protocol-internal-client/internal_client_debug.json b/example_context/package/fleet-protocol-internal-client/internal_client_debug.json index c5b4b86..8bb1421 100644 --- a/example_context/package/fleet-protocol-internal-client/internal_client_debug.json +++ b/example_context/package/fleet-protocol-internal-client/internal_client_debug.json @@ -31,7 +31,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu1804-aarch64", "ubuntu2404", "fedora40", diff --git a/example_context/package/fleet-protocol-internal-client/internal_client_release.json b/example_context/package/fleet-protocol-internal-client/internal_client_release.json index 4b25a02..162c34c 100644 --- a/example_context/package/fleet-protocol-internal-client/internal_client_release.json +++ b/example_context/package/fleet-protocol-internal-client/internal_client_release.json @@ -31,7 +31,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu1804-aarch64", "ubuntu2404", "fedora40", diff --git a/example_context/package/nlohmann-json/nlohmann_json_debug.json b/example_context/package/nlohmann-json/nlohmann_json_debug.json index 63e500f..14e5ed7 100644 --- a/example_context/package/nlohmann-json/nlohmann_json_debug.json +++ b/example_context/package/nlohmann-json/nlohmann_json_debug.json @@ -26,7 +26,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/nlohmann-json/nlohmann_json_release.json b/example_context/package/nlohmann-json/nlohmann_json_release.json index f160543..07065b1 100644 --- a/example_context/package/nlohmann-json/nlohmann_json_release.json +++ b/example_context/package/nlohmann-json/nlohmann_json_release.json @@ -26,7 +26,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/protobuf/protobuf_debug_v21.12.json b/example_context/package/protobuf/protobuf_debug_v21.12.json index 539b022..0d090cf 100644 --- a/example_context/package/protobuf/protobuf_debug_v21.12.json +++ b/example_context/package/protobuf/protobuf_debug_v21.12.json @@ -27,7 +27,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "fleet-os-2", "ubuntu1804-aarch64", "ubuntu2404", diff --git a/example_context/package/protobuf/protobuf_release_v21.12.json b/example_context/package/protobuf/protobuf_release_v21.12.json index 212dad9..9a38d8d 100644 --- a/example_context/package/protobuf/protobuf_release_v21.12.json +++ b/example_context/package/protobuf/protobuf_release_v21.12.json @@ -27,7 +27,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "fleet-os-2", "ubuntu1804-aarch64", "ubuntu2404", diff --git a/example_context/package/spdlog/spdlog_debug.json b/example_context/package/spdlog/spdlog_debug.json index b3b7057..3376084 100644 --- a/example_context/package/spdlog/spdlog_debug.json +++ b/example_context/package/spdlog/spdlog_debug.json @@ -27,7 +27,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/spdlog/spdlog_release.json b/example_context/package/spdlog/spdlog_release.json index 4d6a515..0771f22 100644 --- a/example_context/package/spdlog/spdlog_release.json +++ b/example_context/package/spdlog/spdlog_release.json @@ -27,7 +27,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/statesmurf/statesmurf_debug.json b/example_context/package/statesmurf/statesmurf_debug.json index bbecb61..7114606 100644 --- a/example_context/package/statesmurf/statesmurf_debug.json +++ b/example_context/package/statesmurf/statesmurf_debug.json @@ -30,7 +30,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/statesmurf/statesmurf_release.json b/example_context/package/statesmurf/statesmurf_release.json index 80e39a7..7f25f4d 100644 --- a/example_context/package/statesmurf/statesmurf_release.json +++ b/example_context/package/statesmurf/statesmurf_release.json @@ -30,7 +30,7 @@ }, "DockerMatrix": { "ImageNames": [ - "debian12", + "debian13", "ubuntu2404", "fedora40", "fedora41" diff --git a/example_context/package/zlib/zlib_debug.json b/example_context/package/zlib/zlib_debug.json index ccb39d2..f7f5f01 100644 --- a/example_context/package/zlib/zlib_debug.json +++ b/example_context/package/zlib/zlib_debug.json @@ -24,7 +24,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu1804-aarch64", "ubuntu2404", "fedora40", diff --git a/example_context/package/zlib/zlib_release.json b/example_context/package/zlib/zlib_release.json index 76583c0..6d61dcf 100644 --- a/example_context/package/zlib/zlib_release.json +++ b/example_context/package/zlib/zlib_release.json @@ -24,7 +24,7 @@ "DockerMatrix": { "ImageNames": [ "fleet-os-2", - "debian12", + "debian13", "ubuntu1804-aarch64", "ubuntu2404", "fedora40", diff --git a/internal/build/CMake.go b/internal/build/CMake.go index 616fa27..fe2d000 100644 --- a/internal/build/CMake.go +++ b/internal/build/CMake.go @@ -65,6 +65,9 @@ func (cmake *CMake) ConstructCMDLine() []string { // updateDefines updates CMake defines with values from BuildSystem func (cmake *CMake) updateDefines() { + if cmake.Defines == nil { + cmake.Defines = map[string]string{} + } cmake.Defines["CMAKE_INSTALL_PREFIX"] = cmake.BuildSystem.InstallPrefix cmake.Defines["CMAKE_PREFIX_PATH"] = cmake.BuildSystem.PrefixPath } diff --git a/internal/build/Meson.go b/internal/build/Meson.go index 04a41c3..9307820 100644 --- a/internal/build/Meson.go +++ b/internal/build/Meson.go @@ -82,6 +82,9 @@ func (meson *Meson) ConstructCMDLine() []string { // updateOptions updates Meson options with values from BuildSystem func (meson *Meson) updateOptions() { + if meson.Options == nil { + meson.Options = map[string]string{} + } meson.Options["prefix"] = meson.BuildSystem.InstallPrefix meson.Options["cmake-prefix-path"] = meson.BuildSystem.PrefixPath } diff --git a/internal/docker/default_test.go b/internal/docker/default_test.go index c65cf6f..ca215fd 100644 --- a/internal/docker/default_test.go +++ b/internal/docker/default_test.go @@ -10,7 +10,7 @@ import ( ) func TestDockerRm_GenerateCmdLine(t *testing.T) { - dock, err := prerequisites.CreateAndInitialize[docker.Docker]("debian12", uint16(constants.DefaultSSHPort)) + dock, err := prerequisites.CreateAndInitialize[docker.Docker]("debian13", uint16(constants.DefaultSSHPort)) if err != nil { t.Fatalf("cannot create Docker instance - %s", err) } @@ -32,7 +32,7 @@ func TestDockerRm_GenerateCmdLine(t *testing.T) { } func TestDockerStop_GenerateCmdLine(t *testing.T) { - dock, err := prerequisites.CreateAndInitialize[docker.Docker]("debian12", uint16(constants.DefaultSSHPort)) + dock, err := prerequisites.CreateAndInitialize[docker.Docker]("debian13", uint16(constants.DefaultSSHPort)) if err != nil { t.Fatalf("cannot create Docker instance - %s", err) } @@ -58,7 +58,7 @@ func TestDockerRun_GenerateCmdLine(t *testing.T) { var cmdLineValid bool var err error - dock, err := prerequisites.CreateAndInitialize[docker.Docker]("debian12", uint16(constants.DefaultSSHPort)) + dock, err := prerequisites.CreateAndInitialize[docker.Docker]("debian13", uint16(constants.DefaultSSHPort)) if err != nil { t.Fatalf("cannot create Docker instance - %s", err) } diff --git a/tests/README.md b/tests/README.md index 4bd7f16..f6236a1 100644 --- a/tests/README.md +++ b/tests/README.md @@ -35,7 +35,7 @@ To run tests with additional options, you can use the following flags: - `-v`: Show verbose output. - `-k `: Run only tests that match the provided expression. - `--collect-only`: List all test cases. -- `--image `: Specify the Docker image to use for testing. If not provided, the `fedora40` image is used. To use all available images, specify the `all` option. +- `--image `: Specify the Docker image to use for testing. If not provided, the `fedora43` image is used. To use all available images, specify the `all` option. - `--remove_images`: Remove the Docker images before running the tests to ensure a clean environment. Example: diff --git a/tests/conftest.py b/tests/conftest.py index 889e8e8..09939ee 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,36 +1,53 @@ import pytest import subprocess -import os import docker -from test_utils.test_utils import test_config, init_test_repo, clean, init_test_sysroot +from test_utils.test_utils import test_config, init_test_repo, clean, init_test_sysroot, run_packager +from test_utils.common import PackagerExpectedResult -@pytest.fixture(scope="session", autouse=True) -def setup_environment(request): - """Set up the environment before any tests are run.""" - if request.config.getoption("--remove_images"): - # TODO test this feature - client = docker.from_env() - for image in test_config["test_images"]: - try: - client.images.remove(image, force=True) - except docker.errors.ImageNotFound: - pass +def pytest_sessionstart(session): + """Run before any tests, shows as setup in output.""" + print("=" * 50, "SETUP PHASE", "=" * 50) + + check_or_remove_images(session) + + print("SETUP: Building Packager binary") try: subprocess.run(["go", "version"], check=True, capture_output=True, text=True) except FileNotFoundError: pytest.fail("Please make sure all required system utilities are installed.") + + subprocess.run( + ["go", "build", "-o", test_config["packager_binary"], "../cmd/bap-builder"], + check=True, + ) + print("DONE") + print("SETUP: Building Docker images") + + # Build all images + run_packager( + test_config["packager_binary"], + "build-image", + context=test_config["test_context"], + all=True, + expected_result=PackagerExpectedResult.SUCCESS, + show_output=False, + ) - yield + print("DONE") + + +def pytest_sessionfinish(session): + clean() def pytest_addoption(parser): parser.addoption( "--image", action="store", - default="fedora40", + default="fedora43", help="The image to use for testing", ) parser.addoption( @@ -41,6 +58,31 @@ def pytest_addoption(parser): ) +def check_or_remove_images(session): + client = docker.from_env() + if session.config.getoption("--remove_images"): + # TODO test this feature + print("SETUP: Removing old Docker images") + + for image in test_config["test_images"]: + try: + client.images.remove(image, force=True) + except docker.errors.ImageNotFound: + pass + print("DONE") + else: + existing_images = [] + for image in test_config["test_images"]: + try: + client.images.get(image) + except docker.errors.ImageNotFound: + pass + else: + existing_images.append(image) + if len(existing_images) > 0: + pytest.exit(f"Images {existing_images} already exists. Use --remove_images to remove it.") + + @pytest.fixture(params=test_config["test_images"]) def test_image(request): image_param = request.config.getoption("--image") @@ -54,7 +96,7 @@ def test_image(request): @pytest.fixture def context(): - return os.path.abspath(os.path.join("test_data", "example")) + return test_config["test_context"] @pytest.fixture @@ -71,13 +113,7 @@ def test_sysroot(): def packager_binary(): """Compile the Go application binary.""" - subprocess.run(["go", "get", "bringauto/cmd/bap-builder"], check=True) - subprocess.run( - ["go", "build", "-o", test_config["packager_binary"], "../cmd/bap-builder"], - check=True, - ) - - yield test_config["packager_binary"] # Pass the binary path to tests + return test_config["packager_binary"] # Pass the binary path to tests @pytest.fixture(autouse=True) diff --git a/tests/integration_tests/test_build_apps.py b/tests/integration_tests/test_build_apps.py index 3679500..0e380da 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 @@ -13,7 +14,7 @@ def test_01_build_app(test_image, packager_binary, context, test_repo): """Test building a single app""" - app = "io-module" + app = "test-app-a" run_packager( packager_binary, "build-app", @@ -40,7 +41,7 @@ def test_01_build_app(test_image, packager_binary, context, test_repo): def test_02_build_multiple_apps(test_image, packager_binary, context, test_repo): """Test building multiple apps at once""" - apps = ["io-module", "mission-module"] + apps = ["test-app-a", "test-app-b"] run_packager( packager_binary, "build-app", @@ -87,9 +88,54 @@ def test_02_build_multiple_apps(test_image, packager_binary, context, test_repo) assert not is_tracked(app, test_repo, "app") -def test_03_build_all_apps(test_image, packager_binary, context, test_repo): +def build_app_3_deps(test_image, packager_binary, context, test_repo): + deps = ["test-package-e", "test-package-a", "test-package-b", "test-package-c", "test-package-d"] + + prepare_packages(deps) + + # Build required dependency Packages + run_packager( + packager_binary, + "build-package", + context=context, + image_name=test_image, + output_dir=test_repo, + build_deps=True, + name=deps[0], + expected_result=PackagerExpectedResult.SUCCESS, + expected_returncode=PackagerReturnCode.SUCCESS, + ) + +def test_03_build_app_with_dependencies(test_image, packager_binary, context, test_repo): + """Test building app which has dependencies on Packages in Package Repository""" + app = "test-app-c" + build_app_3_deps(test_image, packager_binary, context, test_repo) + + 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 + if does_app_support_image(app, test_image) + else PackagerExpectedResult.NOT_APPLICABLE + ), + expected_returncode=( + PackagerReturnCode.SUCCESS + if does_app_support_image(app, test_image) + else PackagerReturnCode.DEFAULT_ERROR + ), + ) + + +def test_04_build_all_apps(test_image, packager_binary, context, test_repo): """Test building all apps""" - apps = ["io-module", "mission-module"] + apps = ["test-app-a", "test-app-b", "test-app-c"] + build_app_3_deps(test_image, packager_binary, context, test_repo) run_packager( packager_binary, @@ -98,6 +144,7 @@ def test_03_build_all_apps(test_image, packager_binary, context, test_repo): image_name=test_image, output_dir=test_repo, all=True, + use_local_repo=True, expected_result=( PackagerExpectedResult.SUCCESS if all(does_app_support_image(app, test_image) for app in apps) @@ -117,16 +164,19 @@ def test_03_build_all_apps(test_image, packager_binary, context, test_repo): assert not is_tracked(app, test_repo, "app") -def test_04_build_all_apps_when_port_1122_is_used( +def test_05_build_all_apps_when_port_1122_is_used( test_image, packager_binary, context, test_repo ): """Test building all apps when port 1122 is already used""" - apps = ["io-module", "mission-module"] + apps = ["test-app-a", "test-app-b", "test-app-c"] if not all(does_app_support_image(app, test_image) for app in apps): pytest.skip(f"Apps does not support image {test_image}") + + build_app_3_deps(test_image, packager_binary, context, test_repo) # Seize port 1122 before running the test sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) try: sock.bind(("localhost", 1122)) sock.listen(1) @@ -139,6 +189,7 @@ def test_04_build_all_apps_when_port_1122_is_used( output_dir=test_repo, port=1123, all=True, + use_local_repo=True, expected_result=PackagerExpectedResult.SUCCESS, ) for app in apps: diff --git a/tests/integration_tests/test_build_image.py b/tests/integration_tests/test_build_image.py index 74da485..00c2e38 100644 --- a/tests/integration_tests/test_build_image.py +++ b/tests/integration_tests/test_build_image.py @@ -60,7 +60,7 @@ def build_image(image_name): ) threads = [] - images = ["fedora40", "fedora41"] + images = ["fedora43", "ubuntu2404"] for image in images: t = threading.Thread(target=build_image, args=(image,)) t.start() @@ -69,5 +69,5 @@ def build_image(image_name): for t in threads: t.join() - assert does_image_exist("fedora40") - assert does_image_exist("fedora41") + assert does_image_exist("fedora43") + assert does_image_exist("ubuntu2404") diff --git a/tests/integration_tests/test_build_package.py b/tests/integration_tests/test_build_package.py index e7b5a17..761530d 100644 --- a/tests/integration_tests/test_build_package.py +++ b/tests/integration_tests/test_build_package.py @@ -11,7 +11,7 @@ def test_01_build_package(test_image, packager_binary, context, test_repo): """Test building a package with no dependencies.""" - package = "test_package_1" + package = "test-package-a" prepare_packages([package]) run_packager( @@ -31,8 +31,8 @@ def test_01_build_package(test_image, packager_binary, context, test_repo): def test_02_build_package_with_dependency(test_image, packager_binary, context, test_repo): """Test building a package with a dependency. Fist build the dependency and then the package.""" - package = "test_package_2" - depends_on_package = "test_package_1" + package = "test-package-b" + depends_on_package = "test-package-a" prepare_packages([package, depends_on_package]) if not does_package_support_image(depends_on_package, test_image): @@ -71,8 +71,8 @@ def test_03_build_package_dependency_with_build_deps( test_image, packager_binary, context, test_repo ): """Test build package with deps on.""" - package = "test_package_2" - depends_on_package = "test_package_1" + package = "test-package-b" + depends_on_package = "test-package-a" prepare_packages([package, depends_on_package]) if not does_packages_support_image([package, depends_on_package], test_image): @@ -97,7 +97,7 @@ def test_04_build_multiple_package_dependency_with_build_deps( test_image, packager_binary, context, test_repo ): """Test build package with multiple dependencies using deps on.""" - packages = ["test_package_1", "test_package_2", "test_package_3", "test_package_4"] + packages = ["test-package-a", "test-package-b", "test-package-c", "test-package-d"] prepare_packages(packages) if not does_packages_support_image(packages, test_image): @@ -121,8 +121,8 @@ def test_05_build_package_dependency_with_build_deps_on( test_image, packager_binary, context, test_repo ): """First build dependency and then build package with deps on""" - package = "test_package_2" - depends_on_package = "test_package_1" + package = "test-package-b" + depends_on_package = "test-package-a" prepare_packages([package, depends_on_package]) if not does_packages_support_image([package, depends_on_package], test_image): @@ -159,10 +159,10 @@ def test_06_build_multiple_package_dependency_with_build_deps_on( ): """Test build package with multiple dependencies using deps on.""" packages = [ - "test_package_1_06", - "test_package_2_06", - "test_package_3_06", - "test_package_4_06", + "test-package-a", + "test-package-b", + "test-package-c", + "test-package-d", ] prepare_packages(packages) @@ -200,7 +200,7 @@ def test_07_build_multiple_package_dependency_with_build_deps_on_recursive( test_image, packager_binary, context, test_repo ): """Test build package with multiple dependencies using deps on recursive.""" - packages = ["test_package_1", "test_package_2", "test_package_3", "test_package_4"] + packages = ["test-package-a", "test-package-b", "test-package-c", "test-package-d"] prepare_packages(packages) if not does_packages_support_image(packages, test_image): @@ -231,7 +231,7 @@ def test_07_build_multiple_package_dependency_with_build_deps_on_recursive( def test_08_has_itself_as_dependency_build_deps(test_image, packager_binary, context, test_repo): """Test build package with itself as dependency using deps.""" - package = "test_package_5" + package = "test-package-circ-dep-a" prepare_packages([package]) if not does_package_support_image(package, test_image): @@ -253,7 +253,7 @@ def test_08_has_itself_as_dependency_build_deps(test_image, packager_binary, con def test_09_has_itself_as_dependency_build_deps_on(test_image, packager_binary, context, test_repo): """Test build package with itself as dependency using build_deps_on.""" - package = "test_package_5" + package = "test-package-circ-dep-a" prepare_packages([package]) if not does_package_support_image(package, test_image): @@ -277,7 +277,7 @@ def test_10_has_itself_as_dependency_build_deps_on_recursive( test_image, packager_binary, context, test_repo ): """Test build package with itself as dependency using build_deps_on_recursive.""" - package = "test_package_5" + package = "test-package-circ-dep-a" prepare_packages([package]) if not does_package_support_image(package, test_image): @@ -299,7 +299,7 @@ def test_10_has_itself_as_dependency_build_deps_on_recursive( def test_11_circular_dependencies_deps(test_image, packager_binary, context, test_repo): """Test build package with circular dependencies using deps.""" - packages = ["test_package_6", "test_package_7", "test_package_8"] + packages = ["test-package-circ-dep-b", "test-package-circ-dep-c", "test-package-circ-dep-d"] prepare_packages(packages) if not does_packages_support_image(packages, test_image): @@ -323,7 +323,7 @@ def test_11_circular_dependencies_deps(test_image, packager_binary, context, tes def test_12_circular_dependencies_deps_on(test_image, packager_binary, context, test_repo): """Test build package with circular dependencies using deps on.""" - packages = ["test_package_6", "test_package_7", "test_package_8"] + packages = ["test-package-circ-dep-b", "test-package-circ-dep-c", "test-package-circ-dep-d"] prepare_packages(packages) if not does_packages_support_image(packages, test_image): @@ -359,7 +359,7 @@ def test_13_circular_dependencies_deps_on_recursive( test_image, packager_binary, context, test_repo ): """Test build package with circular dependencies using deps on recursive.""" - packages = ["test_package_6", "test_package_7", "test_package_8"] + packages = ["test-package-circ-dep-b", "test-package-circ-dep-c", "test-package-circ-dep-d"] prepare_packages(packages) if not does_packages_support_image(packages, test_image): @@ -397,11 +397,11 @@ def test_13_circular_dependencies_deps_on_recursive( def test_14_fork_dependencies_deps(test_image, packager_binary, context, test_repo): """Test build package with fork dependencies using deps.""" packages = [ - "test_package_9", - "test_package_1", - "test_package_2", - "test_package_3", - "test_package_4", + "test-package-e", + "test-package-a", + "test-package-b", + "test-package-c", + "test-package-d", ] prepare_packages(packages) @@ -428,11 +428,11 @@ def test_14_fork_dependencies_deps(test_image, packager_binary, context, test_re def test_15_fork_dependencies_deps_on(test_image, packager_binary, context, test_repo): """Test build package with fork dependencies using deps on.""" packages = [ - "test_package_1", - "test_package_2", - "test_package_3", - "test_package_4", - "test_package_9", + "test-package-a", + "test-package-b", + "test-package-c", + "test-package-d", + "test-package-e", ] prepare_packages(packages) @@ -473,11 +473,11 @@ def test_15_fork_dependencies_deps_on(test_image, packager_binary, context, test def test_16_fork_dependencies_deps_on_recursive(test_image, packager_binary, context, test_repo): """Test build package with fork dependencies using deps on recursive.""" packages = [ - "test_package_1", - "test_package_2", - "test_package_3", - "test_package_4", - "test_package_9", + "test-package-a", + "test-package-b", + "test-package-c", + "test-package-d", + "test-package-e", ] prepare_packages(packages) @@ -513,7 +513,7 @@ def test_16_fork_dependencies_deps_on_recursive(test_image, packager_binary, con def test_17_only_debug(test_image, packager_binary, context, test_repo): """Test building a package with only debug version.""" - package = "test_package_1_17" + package = "test-package-a-17" prepare_packages([package]) if not does_package_support_image(package, test_image): @@ -535,10 +535,10 @@ def test_17_only_debug(test_image, packager_binary, context, test_repo): def test_18_only_release(test_image, packager_binary, context, test_repo): """Test building a package with only release version.""" - packages = ["test_package_1_18"] - prepare_packages(packages) + package = "test-package-a-18" + prepare_packages([package]) - if not does_package_support_image(packages[-1], test_image): + if not does_package_support_image(package, test_image): return run_packager( @@ -547,21 +547,19 @@ def test_18_only_release(test_image, packager_binary, context, test_repo): context=context, image_name=test_image, output_dir=test_repo, - name=packages[-1], - expected_result=PackagerExpectedResult.FAILURE, - expected_returncode=PackagerReturnCode.CONTEXT_ERROR, + name=package, + expected_result=PackagerExpectedResult.SUCCESS, ) - for package in packages: - assert not is_tracked( - package, test_repo, "package" - ), f"Package {package} should not be tracked but is." + assert is_tracked( + package, test_repo, "package" + ), f"Package {package} should be tracked but is not." def test_19_missing_release_debug_packages_build_deps( test_image, packager_binary, context, test_repo ): """Test building a package where the dependency is missing debug version""" - packages = ["test_package_1_17", "test_package_2_17"] + packages = ["test-package-a-17", "test-package-b-17"] prepare_packages(packages) if not does_packages_support_image(packages, test_image): @@ -589,7 +587,7 @@ def test_20_missing_release_debug_packages_build_deps_on( test_image, packager_binary, context, test_repo ): """Test building a package where the deps on is missing release version""" - packages = ["test_package_1_17", "test_package_2_17"] + packages = ["test-package-a-17", "test-package-b-17"] prepare_packages(packages) if not does_packages_support_image(packages, test_image): @@ -615,7 +613,7 @@ def test_20_missing_release_debug_packages_build_deps_on( def test_21_build_packages_with_no_images(test_image, packager_binary, context, test_repo): """Build a package with no supported images. It should cause a context error.""" - package = "test_package_1_21" + package = "test-package-a-21" prepare_packages([package]) run_packager( @@ -636,8 +634,8 @@ def test_22_build_packages_where_dependency_is_not_supported( test_image, packager_binary, context, test_repo ): """Dependent package is not supported by the image, but the package itself is supported, so it should not be built.""" - package = "test_package_1_22" - dependents_on_package = "test_package_2_22" + package = "test-package-b" + dependents_on_package = "test-package-a-22" prepare_packages([package, dependents_on_package]) if not does_package_support_image(package, test_image): @@ -663,8 +661,8 @@ def test_23_build_packages_where_package_is_not_supported( test_image, packager_binary, context, test_repo ): """Dependent package is supported but the package itself is not supported, so nothing should be built.""" - package = "test_package_2_23" - dependents_on_package = "test_package_1_23" + package = "test-package-b-23" + dependents_on_package = "test-package-a" prepare_packages([package, dependents_on_package]) if not does_package_support_image(dependents_on_package, test_image): @@ -688,7 +686,7 @@ def test_23_build_packages_where_package_is_not_supported( def test_24_build_same_package_twice(test_image, packager_binary, context, test_repo): """Build the same package twice in a row to check if the second build is skipped.""" - package = "test_package_1" + package = "test-package-a" prepare_packages([package]) run_packager( @@ -722,7 +720,7 @@ def test_24_build_same_package_twice(test_image, packager_binary, context, test_ def test_25_invalid_revision(test_image, packager_binary, context, test_repo): """Test building a package with an invalid revision.""" - package = "test_package_1_25" + package = "test-package-a-25" prepare_packages([package]) run_packager( @@ -735,3 +733,146 @@ def test_25_invalid_revision(test_image, packager_binary, context, test_repo): expected_result=PackagerExpectedResult.FAILURE, expected_returncode=PackagerReturnCode.BUILD_ERROR, ) + +def test_26_meson_build(test_image, packager_binary, context, test_repo): + """Test building a package using Meson build system.""" + package = "test-package-f" + prepare_packages([package]) + if not does_package_support_image(package, test_image): + return + + run_packager( + packager_binary, + "build-package", + context=context, + image_name=test_image, + output_dir=test_repo, + name=package, + expected_result=PackagerExpectedResult.SUCCESS, + ) + + assert is_tracked(package, test_repo, "package") + +def test_27_cmake_invalid_define(test_image, packager_binary, context, test_repo): + """Test building a package with an CMake define with invalid characters.""" + package = "test-package-a-27" + prepare_packages([package]) + + run_packager( + packager_binary, + "build-package", + context=context, + image_name=test_image, + output_dir=test_repo, + name=package, + expected_result=PackagerExpectedResult.FAILURE, + expected_returncode=PackagerReturnCode.CONTEXT_ERROR, + ) + +def test_28_meson_invalid_define(test_image, packager_binary, context, test_repo): + """Test building a package with an Meson define with invalid characters.""" + package = "test-package-f-28" + prepare_packages([package]) + if not does_package_support_image(package, test_image): + return + + run_packager( + packager_binary, + "build-package", + context=context, + image_name=test_image, + output_dir=test_repo, + name=package, + expected_result=PackagerExpectedResult.FAILURE, + expected_returncode=PackagerReturnCode.CONTEXT_ERROR, + ) + +def test_29_meson_invalid_option(test_image, packager_binary, context, test_repo): + """Test building a package with an Meson option with invalid characters.""" + package = "test-package-f-29" + prepare_packages([package]) + if not does_package_support_image(package, test_image): + return + + run_packager( + packager_binary, + "build-package", + context=context, + image_name=test_image, + output_dir=test_repo, + name=package, + expected_result=PackagerExpectedResult.FAILURE, + expected_returncode=PackagerReturnCode.CONTEXT_ERROR, + ) + +def test_30_meson_empty_define(test_image, packager_binary, context, test_repo): + """Test building a package with an Meson define with empty name.""" + package = "test-package-f-30" + prepare_packages([package]) + if not does_package_support_image(package, test_image): + return + + run_packager( + packager_binary, + "build-package", + context=context, + image_name=test_image, + output_dir=test_repo, + name=package, + expected_result=PackagerExpectedResult.FAILURE, + expected_returncode=PackagerReturnCode.CONTEXT_ERROR, + ) + +def test_31_meson_empty_option(test_image, packager_binary, context, test_repo): + """Test building a package with an Meson option with empty name.""" + package = "test-package-f-31" + prepare_packages([package]) + if not does_package_support_image(package, test_image): + return + + run_packager( + packager_binary, + "build-package", + context=context, + image_name=test_image, + output_dir=test_repo, + name=package, + expected_result=PackagerExpectedResult.FAILURE, + expected_returncode=PackagerReturnCode.CONTEXT_ERROR, + ) + +def test_32_cmake_empty_define(test_image, packager_binary, context, test_repo): + """Test building a package with an CMake define with empty name.""" + package = "test-package-a-32" + prepare_packages([package]) + if not does_package_support_image(package, test_image): + return + + run_packager( + packager_binary, + "build-package", + context=context, + image_name=test_image, + output_dir=test_repo, + name=package, + expected_result=PackagerExpectedResult.FAILURE, + expected_returncode=PackagerReturnCode.CONTEXT_ERROR, + ) + +def test_33_cmake_wrong_define_type(test_image, packager_binary, context, test_repo): + """Test building a package with an CMake define with non-string value.""" + package = "test-package-a-33" + prepare_packages([package]) + if not does_package_support_image(package, test_image): + return + + run_packager( + packager_binary, + "build-package", + context=context, + image_name=test_image, + output_dir=test_repo, + name=package, + expected_result=PackagerExpectedResult.FAILURE, + expected_returncode=PackagerReturnCode.CONTEXT_ERROR, + ) diff --git a/tests/integration_tests/test_create_sysroot.py b/tests/integration_tests/test_create_sysroot.py index 9e436d5..894bf50 100644 --- a/tests/integration_tests/test_create_sysroot.py +++ b/tests/integration_tests/test_create_sysroot.py @@ -14,7 +14,7 @@ def test_01_create_sysroot(test_image, packager_binary, context, test_repo, test_sysroot): """Build package and then create sysroot""" - packages = ["test_package_1", "test_package_2"] + packages = ["test-package-a", "test-package-b"] prepare_packages(packages) @@ -48,7 +48,7 @@ def test_02_create_sysroot_with_package_on_two_different_images( packager_binary, context, test_repo, test_sysroot ): """Test creating sysroot with a package built on two different images""" - package = "test_package_1" + package = "test-package-a" prepare_packages([package]) @@ -56,29 +56,29 @@ def test_02_create_sysroot_with_package_on_two_different_images( packager_binary, "build-package", context=context, - image_name="fedora41", + image_name="ubuntu2404", output_dir=test_repo, name=package, expected_result=PackagerExpectedResult.SUCCESS, ) - assert is_tracked(package, test_repo, "package", os_path="fedora/41") + assert is_tracked(package, test_repo, "package", os_path="ubuntu/24.04") run_packager( packager_binary, "build-package", context=context, - image_name="fedora40", + image_name="fedora43", output_dir=test_repo, name=package, expected_result=PackagerExpectedResult.SUCCESS, ) - assert is_tracked(package, test_repo, "package", os_path="fedora/40") + assert is_tracked(package, test_repo, "package", os_path="fedora/43") run_packager( packager_binary, "create-sysroot", context=context, - image_name="fedora40", + image_name="fedora43", sysroot_dir=test_sysroot, git_lfs=test_repo, expected_result=PackagerExpectedResult.CREATING_SYSROOT, @@ -91,7 +91,7 @@ def test_03_create_sysroot_from_empty_repo(packager_binary, context, test_repo, packager_binary, "create-sysroot", context=context, - image_name="fedora41", + image_name="fedora43", sysroot_dir=test_sysroot, git_lfs=test_repo, expected_result=False, @@ -103,7 +103,7 @@ def test_04_create_sysroot_from_repo_with_packages_for_different_images( packager_binary, context, test_repo, test_sysroot ): """Create sysroot for image which is not built in the repo""" - package = "test_package_1" + package = "test-package-a" prepare_packages([package]) @@ -111,23 +111,23 @@ def test_04_create_sysroot_from_repo_with_packages_for_different_images( packager_binary, "build-package", context=context, - image_name="fedora41", + image_name="debian13", output_dir=test_repo, name=package, expected_result=PackagerExpectedResult.SUCCESS, ) - assert is_tracked(package, test_repo, "package", os_path="fedora/41") + assert is_tracked(package, test_repo, "package", os_path="debian/13") run_packager( packager_binary, "build-package", context=context, - image_name="fedora40", + image_name="fedora43", output_dir=test_repo, name=package, expected_result=PackagerExpectedResult.SUCCESS, ) - assert is_tracked(package, test_repo, "package", os_path="fedora/40") + assert is_tracked(package, test_repo, "package", os_path="fedora/43") run_packager( packager_binary, @@ -143,7 +143,7 @@ def test_04_create_sysroot_from_repo_with_packages_for_different_images( def test_05_create_sysroot_from_all_packages(packager_binary, context, test_repo, test_sysroot): """Build all packages and create sysroot from all packages""" - packages = [f"test_package_{i}" for i in range(1, 5)] + packages = ["test-package-a", "test-package-b", "test-package-c", "test-package-d", "test-package-e"] prepare_packages(packages) @@ -151,7 +151,7 @@ def test_05_create_sysroot_from_all_packages(packager_binary, context, test_repo packager_binary, "build-package", context=context, - image_name="fedora40", + image_name="fedora43", output_dir=test_repo, all=True, expected_result=PackagerExpectedResult.SUCCESS, @@ -161,7 +161,7 @@ def test_05_create_sysroot_from_all_packages(packager_binary, context, test_repo packager_binary, "create-sysroot", context=context, - image_name="fedora40", + image_name="fedora43", sysroot_dir=test_sysroot, git_lfs=test_repo, expected_result=PackagerExpectedResult.CREATING_SYSROOT, @@ -170,7 +170,7 @@ def test_05_create_sysroot_from_all_packages(packager_binary, context, test_repo def test_06_check_data_in_sysroot(test_image, packager_binary, context, test_repo, test_sysroot): """Check that expected files from the package are present in the created sysroot""" - packages = ["test_package_1", "test_package_2"] + packages = ["test-package-a", "test-package-b"] prepare_packages(packages) @@ -199,30 +199,10 @@ def test_06_check_data_in_sysroot(test_image, packager_binary, context, test_rep expected_result=PackagerExpectedResult.CREATING_SYSROOT, ) files = [ - "release/bin/curl", - "release/bin/curl-config", - "release/include/curl/curl.h", - "release/include/curl/curlver.h", - "release/include/curl/easy.h", - "release/include/curl/mprintf.h", - "release/include/curl/multi.h", - "release/include/curl/options.h", - "release/include/curl/stdcheaders.h", - "release/include/curl/system.h", - "release/include/curl/system.h", - "release/include/curl/typecheck-gcc.h", - "release/include/curl/urlapi.h", + "release/lib/libtest-package-a-shared.so", + "release/lib/libtest-package-b-shared.so", + "release/include/pack_a.hpp", + "release/include/pack_b.hpp", ] - if test_image in ["fedora40", "fedora41"]: - files += [ - "release/lib64/libcurl.so", - "release/lib64/pkgconfig/libcurl.pc", - ] - else: - files += [ - "release/lib/libcurl.so", - "release/lib/pkgconfig/libcurl.pc", - ] - assert check_if_package_is_in_sysroot(test_sysroot, files) diff --git a/tests/integration_tests/test_invalid_arguments.py b/tests/integration_tests/test_invalid_arguments.py index 20c76ae..fa98234 100644 --- a/tests/integration_tests/test_invalid_arguments.py +++ b/tests/integration_tests/test_invalid_arguments.py @@ -27,9 +27,8 @@ def test_02_run_with_invalid_command(packager_binary): assert "ERROR" in stdout -def test_03_run_with_nonexisting_image(packager_binary): +def test_03_run_with_nonexisting_image(packager_binary, context): """Run packager with a non-existing image""" - context = os.path.abspath(os.path.join("test_data", "example")) result = run_packager( packager_binary, @@ -44,9 +43,8 @@ def test_03_run_with_nonexisting_image(packager_binary): assert "Failed to build Docker image:" in stdout -def test_04_run_with_nonexisting_package(test_image, packager_binary, test_repo): +def test_04_run_with_nonexisting_package(test_image, packager_binary, test_repo, context): """Run packager with a non-existing package""" - context = os.path.abspath(os.path.join("test_data", "example")) result = run_packager( packager_binary, @@ -62,9 +60,8 @@ def test_04_run_with_nonexisting_package(test_image, packager_binary, test_repo) assert "ERROR" in stdout -def test_05_run_with_nonexisting_app(test_image, packager_binary, test_repo): +def test_05_run_with_nonexisting_app(test_image, packager_binary, test_repo, context): """Run packager with a non-existing app""" - context = os.path.abspath(os.path.join("test_data", "example")) result = run_packager( packager_binary, 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 deleted file mode 100644 index 1b9b1e4..0000000 --- a/tests/test_data/example/app/io-module/io-module_debug.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/bringauto/io-module.git", - "Revision": "v1.3.2" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug", - "BRINGAUTO_INSTALL": "ON" - } - } - }, - "Package": { - "Name": "io-module", - "VersionTag": "v1.3.2", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": false, - "IsDevLib": false, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "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 deleted file mode 100644 index f6bb39a..0000000 --- a/tests/test_data/example/app/io-module/io-module_release.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/bringauto/io-module.git", - "Revision": "v1.3.2" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release", - "BRINGAUTO_INSTALL": "ON" - } - } - }, - "Package": { - "Name": "io-module", - "VersionTag": "v1.3.2", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": false, - "IsDevLib": false, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/example/app/mission-module/mission-module_debug.json b/tests/test_data/example/app/mission-module/mission-module_debug.json deleted file mode 100644 index 2772a30..0000000 --- a/tests/test_data/example/app/mission-module/mission-module_debug.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/bringauto/mission-module.git", - "Revision": "v1.2.12" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug", - "BRINGAUTO_INSTALL": "ON" - } - } - }, - "Package": { - "Name": "mission-module", - "VersionTag": "v1.2.12", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": false, - "IsDevLib": false, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/example/app/mission-module/mission-module_release.json b/tests/test_data/example/app/mission-module/mission-module_release.json deleted file mode 100644 index c234e39..0000000 --- a/tests/test_data/example/app/mission-module/mission-module_release.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/bringauto/mission-module.git", - "Revision": "v1.2.12" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release", - "BRINGAUTO_INSTALL": "ON" - } - } - }, - "Package": { - "Name": "mission-module", - "VersionTag": "v1.2.12", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": false, - "IsDevLib": false, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/example/docker b/tests/test_data/example/docker deleted file mode 120000 index 4dea6bf..0000000 --- a/tests/test_data/example/docker +++ /dev/null @@ -1 +0,0 @@ -../../../example_context/docker/ \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1/zlib_debug.json b/tests/test_data/test_packages/test_package_1/zlib_debug.json deleted file mode 100644 index ee55946..0000000 --- a/tests/test_data/test_packages/test_package_1/zlib_debug.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_1", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu1804-aarch64", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1/zlib_release.json b/tests/test_data/test_packages/test_package_1/zlib_release.json deleted file mode 100644 index 73aff37..0000000 --- a/tests/test_data/test_packages/test_package_1/zlib_release.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_1", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu1804-aarch64", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_06/zlib_debug.json b/tests/test_data/test_packages/test_package_1_06/zlib_debug.json deleted file mode 100644 index 2c911b4..0000000 --- a/tests/test_data/test_packages/test_package_1_06/zlib_debug.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_1_06", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu1804-aarch64", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_06/zlib_release.json b/tests/test_data/test_packages/test_package_1_06/zlib_release.json deleted file mode 100644 index 84109b8..0000000 --- a/tests/test_data/test_packages/test_package_1_06/zlib_release.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_1_06", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu1804-aarch64", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_17/zlib_debug.json b/tests/test_data/test_packages/test_package_1_17/zlib_debug.json deleted file mode 100644 index 43352c2..0000000 --- a/tests/test_data/test_packages/test_package_1_17/zlib_debug.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_1_17", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu1804-aarch64", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_18/zlib_release.json b/tests/test_data/test_packages/test_package_1_18/zlib_release.json deleted file mode 100644 index 73aff37..0000000 --- a/tests/test_data/test_packages/test_package_1_18/zlib_release.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_1", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu1804-aarch64", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_21/zlib_debug.json b/tests/test_data/test_packages/test_package_1_21/zlib_debug.json deleted file mode 100644 index d9f2fa0..0000000 --- a/tests/test_data/test_packages/test_package_1_21/zlib_debug.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_1_21", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_21/zlib_release.json b/tests/test_data/test_packages/test_package_1_21/zlib_release.json deleted file mode 100644 index 1cb6c6b..0000000 --- a/tests/test_data/test_packages/test_package_1_21/zlib_release.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_1_21", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_22/zlib_debug.json b/tests/test_data/test_packages/test_package_1_22/zlib_debug.json deleted file mode 100644 index 838b53f..0000000 --- a/tests/test_data/test_packages/test_package_1_22/zlib_debug.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_2_22" - ], - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_1_22", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu1804-aarch64", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_22/zlib_release.json b/tests/test_data/test_packages/test_package_1_22/zlib_release.json deleted file mode 100644 index d4814e6..0000000 --- a/tests/test_data/test_packages/test_package_1_22/zlib_release.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_2_22" - ], - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_1_22", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu1804-aarch64", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_23/zlib_debug.json b/tests/test_data/test_packages/test_package_1_23/zlib_debug.json deleted file mode 100644 index 1e944e8..0000000 --- a/tests/test_data/test_packages/test_package_1_23/zlib_debug.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "Env": {}, - "DependsOn": [], - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_1_23", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu1804-aarch64", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_23/zlib_release.json b/tests/test_data/test_packages/test_package_1_23/zlib_release.json deleted file mode 100644 index 362bebc..0000000 --- a/tests/test_data/test_packages/test_package_1_23/zlib_release.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "Env": {}, - "DependsOn": [], - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "v1.2.11" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_1_23", - "VersionTag": "v1.2.11", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu1804-aarch64", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_1_25/zlib_debug.json b/tests/test_data/test_packages/test_package_1_25/zlib_debug.json deleted file mode 100644 index b70230d..0000000 --- a/tests/test_data/test_packages/test_package_1_25/zlib_debug.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "not_real_version_tag" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_1_25", - "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/test_package_1_25/zlib_release.json b/tests/test_data/test_packages/test_package_1_25/zlib_release.json deleted file mode 100644 index edf62bf..0000000 --- a/tests/test_data/test_packages/test_package_1_25/zlib_release.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/madler/zlib.git", - "Revision": "not_real_version_tag" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_1_25", - "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_data/test_packages/test_package_2/curl_debug.json b/tests/test_data/test_packages/test_package_2/curl_debug.json deleted file mode 100644 index 64d776d..0000000 --- a/tests/test_data/test_packages/test_package_2/curl_debug.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_1" - ], - "Git": { - "URI": "https://github.com/curl/curl.git", - "Revision": "curl-7_79_1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_2", - "VersionTag": "v7.79.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_2/curl_release.json b/tests/test_data/test_packages/test_package_2/curl_release.json deleted file mode 100644 index 433880e..0000000 --- a/tests/test_data/test_packages/test_package_2/curl_release.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_1" - ], - "Git": { - "URI": "https://github.com/curl/curl.git", - "Revision": "curl-7_79_1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_2", - "VersionTag": "v7.79.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_2_06/curl_debug.json b/tests/test_data/test_packages/test_package_2_06/curl_debug.json deleted file mode 100644 index 71daa61..0000000 --- a/tests/test_data/test_packages/test_package_2_06/curl_debug.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_1_06" - ], - "Git": { - "URI": "https://github.com/curl/curl.git", - "Revision": "curl-7_79_1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_2_06", - "VersionTag": "v7.79.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_2_06/curl_release.json b/tests/test_data/test_packages/test_package_2_06/curl_release.json deleted file mode 100644 index 5ddca17..0000000 --- a/tests/test_data/test_packages/test_package_2_06/curl_release.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_1_06" - ], - "Git": { - "URI": "https://github.com/curl/curl.git", - "Revision": "curl-7_79_1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_2_06", - "VersionTag": "v7.79.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_2_17/curl_release.json b/tests/test_data/test_packages/test_package_2_17/curl_release.json deleted file mode 100644 index 13e3118..0000000 --- a/tests/test_data/test_packages/test_package_2_17/curl_release.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_1_17" - ], - "Git": { - "URI": "https://github.com/curl/curl.git", - "Revision": "curl-7_79_1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_2_17", - "VersionTag": "v7.79.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_2_22/curl_debug.json b/tests/test_data/test_packages/test_package_2_22/curl_debug.json deleted file mode 100644 index b8cf145..0000000 --- a/tests/test_data/test_packages/test_package_2_22/curl_debug.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/curl/curl.git", - "Revision": "curl-7_79_1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_2_22", - "VersionTag": "v7.79.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_2_22/curl_release.json b/tests/test_data/test_packages/test_package_2_22/curl_release.json deleted file mode 100644 index 436a136..0000000 --- a/tests/test_data/test_packages/test_package_2_22/curl_release.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "Env": {}, - "Git": { - "URI": "https://github.com/curl/curl.git", - "Revision": "curl-7_79_1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_2_22", - "VersionTag": "v7.79.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_2_23/curl_debug.json b/tests/test_data/test_packages/test_package_2_23/curl_debug.json deleted file mode 100644 index 86c03a3..0000000 --- a/tests/test_data/test_packages/test_package_2_23/curl_debug.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_1_23" - ], - "Git": { - "URI": "https://github.com/curl/curl.git", - "Revision": "curl-7_79_1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_2_23", - "VersionTag": "v7.79.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_2_23/curl_release.json b/tests/test_data/test_packages/test_package_2_23/curl_release.json deleted file mode 100644 index d0d7462..0000000 --- a/tests/test_data/test_packages/test_package_2_23/curl_release.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_1_23" - ], - "Git": { - "URI": "https://github.com/curl/curl.git", - "Revision": "curl-7_79_1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_2_23", - "VersionTag": "v7.79.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_3/lz4_debug.json b/tests/test_data/test_packages/test_package_3/lz4_debug.json deleted file mode 100644 index b200be8..0000000 --- a/tests/test_data/test_packages/test_package_3/lz4_debug.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_2" - ], - "Git": { - "URI": "https://github.com/bringauto/lz4-cmake-build.git", - "Revision": "master" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug", - "LZ4_VERSION": "1.9.3" - } - } - }, - "Package": { - "Name": "test_package_3", - "VersionTag": "v1.9.3", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_3/lz4_release.json b/tests/test_data/test_packages/test_package_3/lz4_release.json deleted file mode 100644 index f38957f..0000000 --- a/tests/test_data/test_packages/test_package_3/lz4_release.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_2" - ], - "Git": { - "URI": "https://github.com/bringauto/lz4-cmake-build.git", - "Revision": "master" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release", - "LZ4_VERSION": "1.9.3" - } - } - }, - "Package": { - "Name": "test_package_3", - "VersionTag": "v1.9.3", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_3_06/lz4_debug.json b/tests/test_data/test_packages/test_package_3_06/lz4_debug.json deleted file mode 100644 index 8e9bbfe..0000000 --- a/tests/test_data/test_packages/test_package_3_06/lz4_debug.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_2_06" - ], - "Git": { - "URI": "https://github.com/bringauto/lz4-cmake-build.git", - "Revision": "master" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug", - "LZ4_VERSION": "1.9.3" - } - } - }, - "Package": { - "Name": "test_package_3_06", - "VersionTag": "v1.9.3", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_3_06/lz4_release.json b/tests/test_data/test_packages/test_package_3_06/lz4_release.json deleted file mode 100644 index 064a08b..0000000 --- a/tests/test_data/test_packages/test_package_3_06/lz4_release.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_2_06" - ], - "Git": { - "URI": "https://github.com/bringauto/lz4-cmake-build.git", - "Revision": "master" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release", - "LZ4_VERSION": "1.9.3" - } - } - }, - "Package": { - "Name": "test_package_3_06", - "VersionTag": "v1.9.3", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_4/bzip2_debug.json b/tests/test_data/test_packages/test_package_4/bzip2_debug.json deleted file mode 100644 index ed845b4..0000000 --- a/tests/test_data/test_packages/test_package_4/bzip2_debug.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_3" - ], - "Git": { - "URI": "https://github.com/bringauto/bzip2.git", - "Revision": "1ea1ac188ad4b9cb662e3f8314673c63df95a589" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_4", - "VersionTag": "v1.0.8", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_4/bzip2_release.json b/tests/test_data/test_packages/test_package_4/bzip2_release.json deleted file mode 100644 index 2ebe558..0000000 --- a/tests/test_data/test_packages/test_package_4/bzip2_release.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_3" - ], - "Git": { - "URI": "https://github.com/bringauto/bzip2.git", - "Revision": "1ea1ac188ad4b9cb662e3f8314673c63df95a589" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_4", - "VersionTag": "v1.0.8", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_4_06/bzip2_debug.json b/tests/test_data/test_packages/test_package_4_06/bzip2_debug.json deleted file mode 100644 index 42ff886..0000000 --- a/tests/test_data/test_packages/test_package_4_06/bzip2_debug.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_3_06" - ], - "Git": { - "URI": "https://github.com/bringauto/bzip2.git", - "Revision": "1ea1ac188ad4b9cb662e3f8314673c63df95a589" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_4_06", - "VersionTag": "v1.0.8", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_4_06/bzip2_release.json b/tests/test_data/test_packages/test_package_4_06/bzip2_release.json deleted file mode 100644 index 087e9d2..0000000 --- a/tests/test_data/test_packages/test_package_4_06/bzip2_release.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_3_06" - ], - "Git": { - "URI": "https://github.com/bringauto/bzip2.git", - "Revision": "1ea1ac188ad4b9cb662e3f8314673c63df95a589" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_4_06", - "VersionTag": "v1.0.8", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_5/nlohmann_json_debug.json b/tests/test_data/test_packages/test_package_5/nlohmann_json_debug.json deleted file mode 100644 index f9b39d4..0000000 --- a/tests/test_data/test_packages/test_package_5/nlohmann_json_debug.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_5" - ], - "Git": { - "URI": "https://github.com/nlohmann/json.git", - "Revision": "v3.10.5" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug", - "JSON_BuildTests": "OFF" - } - } - }, - "Package": { - "Name": "test_package_5", - "VersionTag": "v3.10.5", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_5/nlohmann_json_release.json b/tests/test_data/test_packages/test_package_5/nlohmann_json_release.json deleted file mode 100644 index ce11d64..0000000 --- a/tests/test_data/test_packages/test_package_5/nlohmann_json_release.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_5" - ], - "Git": { - "URI": "https://github.com/nlohmann/json.git", - "Revision": "v3.10.5" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release", - "JSON_BuildTests": "OFF" - } - } - }, - "Package": { - "Name": "test_package_5", - "VersionTag": "v3.10.5", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_6/protozero_debug.json b/tests/test_data/test_packages/test_package_6/protozero_debug.json deleted file mode 100644 index 7a6b1d6..0000000 --- a/tests/test_data/test_packages/test_package_6/protozero_debug.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_7" - ], - "Git": { - "URI": "https://github.com/mapbox/protozero.git", - "Revision": "v1.7.1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug", - "BUILD_TESTING": "OFF" - } - } - }, - "Package": { - "Name": "test_package_6", - "VersionTag": "v1.7.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_6/protozero_release.json b/tests/test_data/test_packages/test_package_6/protozero_release.json deleted file mode 100644 index 6ddba82..0000000 --- a/tests/test_data/test_packages/test_package_6/protozero_release.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_7" - ], - "Git": { - "URI": "https://github.com/mapbox/protozero.git", - "Revision": "v1.7.1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release", - "BUILD_TESTING": "OFF" - } - } - }, - "Package": { - "Name": "test_package_6", - "VersionTag": "v1.7.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_7/modbuspp_debug.json b/tests/test_data/test_packages/test_package_7/modbuspp_debug.json deleted file mode 100644 index 9114596..0000000 --- a/tests/test_data/test_packages/test_package_7/modbuspp_debug.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_8" - ], - "Git": { - "URI": "https://github.com/bringauto/modbuspp.git", - "Revision": "v0.3.1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_7", - "VersionTag": "v0.3.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_7/modbuspp_release.json b/tests/test_data/test_packages/test_package_7/modbuspp_release.json deleted file mode 100644 index b0a7ab1..0000000 --- a/tests/test_data/test_packages/test_package_7/modbuspp_release.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_8" - ], - "Git": { - "URI": "https://github.com/bringauto/modbuspp.git", - "Revision": "v0.3.1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_7", - "VersionTag": "v0.3.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_8/gtest_debug.json b/tests/test_data/test_packages/test_package_8/gtest_debug.json deleted file mode 100644 index eeac5aa..0000000 --- a/tests/test_data/test_packages/test_package_8/gtest_debug.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_6" - ], - "Git": { - "URI": "https://github.com/google/googletest.git", - "Revision": "v1.12.1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug" - } - } - }, - "Package": { - "Name": "test_package_8", - "VersionTag": "v1.12.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_8/gtest_release.json b/tests/test_data/test_packages/test_package_8/gtest_release.json deleted file mode 100644 index 9c9b13f..0000000 --- a/tests/test_data/test_packages/test_package_8/gtest_release.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_6" - ], - "Git": { - "URI": "https://github.com/google/googletest.git", - "Revision": "v1.12.1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release" - } - } - }, - "Package": { - "Name": "test_package_8", - "VersionTag": "v1.12.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_9/spdlog_debug.json b/tests/test_data/test_packages/test_package_9/spdlog_debug.json deleted file mode 100644 index f276173..0000000 --- a/tests/test_data/test_packages/test_package_9/spdlog_debug.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_1", - "test_package_2", - "test_package_4" - ], - "Git": { - "URI": "https://github.com/gabime/spdlog.git", - "Revision": "v1.14.1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Debug", - "SPDLOG_BUILD_EXAMPLE": "OFF", - "CPACK_PACKAGE_GENERATOR": "ZIP" - } - } - }, - "Package": { - "Name": "test_package_9", - "VersionTag": "v1.14.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": true - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_data/test_packages/test_package_9/spdlog_release.json b/tests/test_data/test_packages/test_package_9/spdlog_release.json deleted file mode 100644 index 7b046b8..0000000 --- a/tests/test_data/test_packages/test_package_9/spdlog_release.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "Env": {}, - "DependsOn": [ - "test_package_1", - "test_package_2", - "test_package_4" - ], - "Git": { - "URI": "https://github.com/gabime/spdlog.git", - "Revision": "v1.14.1" - }, - "Build": { - "CMake": { - "Defines": { - "CMAKE_BUILD_TYPE": "Release", - "SPDLOG_BUILD_EXAMPLE": "OFF", - "CPACK_PACKAGE_GENERATOR": "ZIP" - } - } - }, - "Package": { - "Name": "test_package_9", - "VersionTag": "v1.14.1", - "PlatformString": { - "Mode": "auto" - }, - "IsLibrary": true, - "IsDevLib": true, - "IsDebug": false - }, - "DockerMatrix": { - "ImageNames": [ - "fleet-os-2", - "debian12", - "ubuntu2404", - "fedora40", - "fedora41" - ] - } -} \ No newline at end of file diff --git a/tests/test_utils/test_utils.py b/tests/test_utils/test_utils.py index 3306882..012b875 100644 --- a/tests/test_utils/test_utils.py +++ b/tests/test_utils/test_utils.py @@ -7,18 +7,38 @@ from test_utils.common import PackagerReturnCode, PackagerExpectedResult +TEST_CONTEXT_URL = "https://github.com/bacpack-system/test-context.git" +TEST_CONTEXT_PATH = "test_data/test_context" + test_config = { - "test_data_examples": os.path.abspath("test_data/example"), - "test_apps": os.path.abspath("test_data/example/app"), - "test_dockers": os.path.abspath("../example_context/docker"), - "test_packages": os.path.abspath("test_data/example/package"), + "test_apps": os.path.abspath(TEST_CONTEXT_PATH + "/app"), + "test_dockers": os.path.abspath(TEST_CONTEXT_PATH + "/docker"), + "test_packages": os.path.abspath(TEST_CONTEXT_PATH + "/package"), "packager_binary": os.path.abspath("../cmd/bap-builder/bap-builder"), "test_repo": os.path.abspath("test_data/test_repo"), "test_sysroot": os.path.abspath("test_data/test_sysroot"), "install_sysroot": os.path.abspath("install_sysroot"), - "test_packages_source": os.path.abspath("test_data/test_packages"), + "test_packages_source": os.path.abspath(TEST_CONTEXT_PATH + "/test_packages"), + "test_context": os.path.abspath(TEST_CONTEXT_PATH), + "test_images": [], } -test_config["test_images"] = sorted(os.listdir(test_config["test_dockers"])) + + +def init_context(): + """Update the context with the latest changes from the repository.""" + os.makedirs(test_config["test_context"], exist_ok=True) + if os.path.exists(test_config["test_context"] + "/.git"): + test_context = git.Repo(test_config["test_context"]) + test_context.git.pull() + else: + test_context = git.Repo.clone_from( + TEST_CONTEXT_URL, test_config["test_context"] + ) + + test_config["test_images"] = sorted(os.listdir(test_config["test_dockers"])) + + +init_context() def init_test_repo(): @@ -203,10 +223,12 @@ 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, expected_returncode: PackagerReturnCode = PackagerReturnCode.SUCCESS, + show_output: bool = True, ) -> subprocess.CompletedProcess: """TODO""" @@ -267,8 +289,12 @@ 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") + if show_output: + print("\033[95m\nRunning command:", " ".join(parameters), "\033[0m") result = subprocess.Popen( parameters, @@ -280,10 +306,11 @@ def run_packager( stdout, stderr = result.communicate() - print("-" * 10, "Stdout", "-" * 10) - print(stdout) - print("-" * 10, "Stderr", "-" * 10) - print(stderr) + if show_output: + print("-" * 10, "Stdout", "-" * 10) + print(stdout) + print("-" * 10, "Stderr", "-" * 10) + print(stderr) if expected_result == PackagerExpectedResult.SUCCESS: assert result.returncode == PackagerReturnCode.SUCCESS.value