Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MIT License

Copyright 2025 BringAuto

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# test-context
Package Context for Packager integration tests
# Package Context fro Packager integration tests

This is a repository with Package Context for [Packager] integration tests.

[Packager]: https://github.com/bacpack-system/packager
33 changes: 33 additions & 0 deletions app/test-app-a/app_a_debug.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"Env": {},
"Git": {
"URI": "https://github.com/bacpack-system/test-packages.git",
"Revision": "master"
},
"Build": {
"CMake": {
"Defines": {
"USE_APP_A": "ON",
"CMAKE_BUILD_TYPE": "Debug"
}
}
},
"Package": {
"Name": "test-app-a",
"VersionTag": "v1.0.0",
"PlatformString": {
"Mode": "auto"
},
"IsLibrary": false,
"IsDevLib": false,
"IsDebug": true
},
"DockerMatrix": {
"ImageNames": [
"debian13",
"ubuntu2404",
"fedora43"
]
}
}

33 changes: 33 additions & 0 deletions app/test-app-a/app_a_release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"Env": {},
"Git": {
"URI": "https://github.com/bacpack-system/test-packages.git",
"Revision": "master"
},
"Build": {
"CMake": {
"Defines": {
"USE_APP_A": "ON",
"CMAKE_BUILD_TYPE": "Release"
}
}
},
"Package": {
"Name": "test-app-a",
"VersionTag": "v1.0.0",
"PlatformString": {
"Mode": "auto"
},
"IsLibrary": false,
"IsDevLib": false,
"IsDebug": false
},
"DockerMatrix": {
"ImageNames": [
"debian13",
"ubuntu2404",
"fedora43"
]
}
}

33 changes: 33 additions & 0 deletions app/test-app-b/app_b_debug.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"Env": {},
"Git": {
"URI": "https://github.com/bacpack-system/test-packages.git",
"Revision": "master"
},
"Build": {
"CMake": {
"Defines": {
"USE_APP_B": "ON",
"CMAKE_BUILD_TYPE": "Debug"
}
}
},
"Package": {
"Name": "test-app-b",
"VersionTag": "v1.0.0",
"PlatformString": {
"Mode": "auto"
},
"IsLibrary": false,
"IsDevLib": false,
"IsDebug": true
},
"DockerMatrix": {
"ImageNames": [
"debian13",
"ubuntu2404",
"fedora43"
]
}
}

33 changes: 33 additions & 0 deletions app/test-app-b/app_b_release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"Env": {},
"Git": {
"URI": "https://github.com/bacpack-system/test-packages.git",
"Revision": "master"
},
"Build": {
"CMake": {
"Defines": {
"USE_APP_B": "ON",
"CMAKE_BUILD_TYPE": "Release"
}
}
},
"Package": {
"Name": "test-app-b",
"VersionTag": "v1.0.0",
"PlatformString": {
"Mode": "auto"
},
"IsLibrary": false,
"IsDevLib": false,
"IsDebug": false
},
"DockerMatrix": {
"ImageNames": [
"debian13",
"ubuntu2404",
"fedora43"
]
}
}

33 changes: 33 additions & 0 deletions app/test-app-c/app_c_debug.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"Env": {},
"Git": {
"URI": "https://github.com/bacpack-system/test-packages.git",
"Revision": "master"
},
"Build": {
"CMake": {
"Defines": {
"USE_APP_C": "ON",
"CMAKE_BUILD_TYPE": "Debug"
}
}
},
"Package": {
"Name": "test-app-c",
"VersionTag": "v1.0.0",
"PlatformString": {
"Mode": "auto"
},
"IsLibrary": false,
"IsDevLib": false,
"IsDebug": true
},
"DockerMatrix": {
"ImageNames": [
"debian13",
"ubuntu2404",
"fedora43"
]
}
}

33 changes: 33 additions & 0 deletions app/test-app-c/app_c_release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"Env": {},
"Git": {
"URI": "https://github.com/bacpack-system/test-packages.git",
"Revision": "master"
},
"Build": {
"CMake": {
"Defines": {
"USE_APP_C": "ON",
"CMAKE_BUILD_TYPE": "Release"
}
}
},
"Package": {
"Name": "test-app-c",
"VersionTag": "v1.0.0",
"PlatformString": {
"Mode": "auto"
},
"IsLibrary": false,
"IsDevLib": false,
"IsDebug": false
},
"DockerMatrix": {
"ImageNames": [
"debian13",
"ubuntu2404",
"fedora43"
]
}
}

14 changes: 14 additions & 0 deletions config/CMCONF_TEST_SYSTEMConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# Test configuration for CMCONF system.
#

FIND_PACKAGE(CMLIB REQUIRED COMPONENTS CMCONF)

CMCONF_INIT_SYSTEM(TEST_SYSTEM)

#
# Setting using local Package Repository by default for this test system. The
# path is set to be the same as Packager sets it.
#
CMCONF_SET(BA_PACKAGE_LOCAL_USE ON)
CMCONF_SET(BA_PACKAGE_LOCAL_PATH "/lfsrepo")
33 changes: 33 additions & 0 deletions docker/debian13/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM debian:13.0

USER root
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 wget libmpfr-dev libmpc-dev libgmp-dev meson ninja-build && \
rm -rf /var/lib/apt/lists/*

RUN wget "https://github.com/Kitware/CMake/releases/download/v3.31.10/cmake-3.31.10-linux-x86_64.sh" -O cmake.sh && \
chmod +x cmake.sh && \
./cmake.sh --skip-license --prefix=/usr/local && \
rm ./cmake.sh

RUN apt-get update && \
apt-get purge -y \
wget && \
rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib
RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc

# Install Test CMCONF system
COPY --from=package-context config/CMCONF_TEST_SYSTEMConfig.cmake /etc
ENV CMLIB_DIR=/cmakelib
RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_TEST_SYSTEMConfig.cmake

RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN mkdir -p /run/sshd

ENTRYPOINT ["/usr/sbin/sshd", "-D", "-o", "ListenAddress=0.0.0.0"]
33 changes: 33 additions & 0 deletions docker/fedora43/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM fedora:43

USER root
RUN echo root:1234 | chpasswd

RUN dnf -y update && \
dnf -y install \
automake binutils gcc gcc-c++ git kernel-devel lsb-release make openssh-server openssl-devel patchelf wget meson ninja-build \
&& dnf clean all

RUN wget "https://github.com/Kitware/CMake/releases/download/v3.31.10/cmake-3.31.10-linux-x86_64.sh" -O cmake.sh && \
chmod +x cmake.sh && \
./cmake.sh --skip-license --prefix=/usr/local && \
rm ./cmake.sh

RUN dnf -y update && \
dnf -y remove \
wget

RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib
RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc

# Install Test CMCONF system
COPY --from=package-context config/CMCONF_TEST_SYSTEMConfig.cmake /etc
ENV CMLIB_DIR=/cmakelib
RUN cmake -DCMCONF_INSTALL_AS_SYMLINK=ON -P /etc/CMCONF_TEST_SYSTEMConfig.cmake

RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN mkdir -p /run/sshd

RUN ssh-keygen -A

ENTRYPOINT ["/usr/sbin/sshd", "-D", "-o", "ListenAddress=0.0.0.0"]
38 changes: 38 additions & 0 deletions docker/ubuntu1804-aarch64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM ubuntu:18.04

USER root
RUN echo root:1234 | chpasswd

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential make libssl-dev pkg-config coreutils lsb-release wget g++-8 gcc-8 gcc-8-aarch64-linux-gnu g++-8-aarch64-linux-gnu patchelf unzip openssh-server git && \
rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-8

RUN wget "https://github.com/Kitware/CMake/releases/download/v3.31.10/cmake-3.31.10-linux-x86_64.sh" -O cmake.sh && \
chmod +x cmake.sh && \
./cmake.sh --skip-license --prefix=/usr/local && \
rm ./cmake.sh

RUN git clone https://github.com/cmakelib/cmakelib.git /cmakelib
RUN echo "export CMLIB_DIR=/cmakelib" >> /root/.bashrc

RUN sed -ri 's/#?PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN mkdir -p /run/sshd

ENV CXX=aarch64-linux-gnu-g++-8
ENV CC=aarch64-linux-gnu-gcc-8

RUN sed -ri 's/#?PermitUserEnvironment no/PermitUserEnvironment yes/' /etc/ssh/sshd_config
RUN mkdir /root/.ssh && \
echo "CXX=${CXX}" > /root/.ssh/environment && \
echo "CC=${CC}" >> /root/.ssh/environment

COPY init_toolchain.sh /root/
RUN chmod +x /root/init_toolchain.sh && \
/root/init_toolchain.sh /root/tools
COPY uname.txt /root/tools/

ENTRYPOINT ["/usr/sbin/sshd", "-D", "-o", "ListenAddress=0.0.0.0"]

42 changes: 42 additions & 0 deletions docker/ubuntu1804-aarch64/init_toolchain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

set -e

TOOLS_INSTALL_DIR="$1"
TMP_DIR="/tmp/toolchain-install"

TOOLS_PACKAGE_URI="https://github.com/bacpack-system/packager-tools/releases/download/v1.0.0/bringauto-packager-tools_v1.0.0_x86-64-linux.zip"

if [[ ${TOOLS_INSTALL_DIR} = "" ]]
then
echo "Specify tools install dir absolute path as a second argument!" >&2
exit 1
fi

function install_tools() {
if [[ -d ${TMP_DIR} ]]
then
echo "TMP dir '${TMP_DIR}' exist"
fi
mkdir -p "${TMP_DIR}"
mkdir -p "${TOOLS_INSTALL_DIR}"

pushd "${TMP_DIR}"
wget ${TOOLS_PACKAGE_URI} \
-O "bringauto-packager-tools.zip"
unzip bringauto-packager-tools.zip
rm bringauto-packager-tools.zip
directory_name="$(echo ./*)"
mv "${directory_name}"/* "${TOOLS_INSTALL_DIR}"
rm -r "${directory_name}"
popd
rm -r "${TMP_DIR}"

chmod +x "${TOOLS_INSTALL_DIR}/uname"
TMP_PATH=$PATH
echo 'PATH='"${TOOLS_INSTALL_DIR}"'/:'"${TMP_PATH}"'' >> /root/.ssh/environment

}


install_tools
1 change: 1 addition & 0 deletions docker/ubuntu1804-aarch64/uname.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Linux e25e113786d6 6.5.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Mar 12 10:22:43 UTC 2 aarch64 GNU/Linux
Loading