system-tests: add Dockerfile

This commit is contained in:
André Roth
2024-02-04 22:47:49 +01:00
parent a71186bcc3
commit a69aa7c533
3 changed files with 35 additions and 1 deletions

15
Dockerfile Normal file
View File

@@ -0,0 +1,15 @@
FROM debian:bookworm-slim
RUN apt-get update -y && apt-get install -y --no-install-recommends curl gnupg && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN echo deb http://deb.debian.org/debian bookworm-backports main > /etc/apt/sources.list.d/backports.list
RUN apt-get update && \
apt-get install -y --no-install-recommends apg bzip2 xz-utils ca-certificates golang/bookworm-backports golang-go/bookworm-backports golang-doc/bookworm-backports golang-src/bookworm-backports make git python3 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN useradd -m --shell /bin/sh --home-dir /var/lib/aptly aptly
RUN mkdir app
WORKDIR /app
CMD /app/system/run-system-tests

View File

@@ -82,4 +82,10 @@ man:
version:
@echo $(VERSION)
.PHONY: man modules version release goxc
docker-build:
docker build -f system/Dockerfile --no-cache . -t aptly-system-test
docker-system-tests:
docker run --rm -it -v ${PWD}:/app aptly-system-test
.PHONY: man modules version release goxc docker-build docker-system-tests

13
system/run-system-tests Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
rm -rf /tmp/aptly*
rm -rf /home/test/.*
rm -rf /home/test/aptly-fixture-*
usermod -u `stat -c %u /app` aptly
chown -R `stat -c %u /app` /var/lib/aptly
mkdir -p /home/runner
chown -R `stat -c %u /app` /home/runner
exec su - aptly -c "cd /app; go mod tidy; HOME=/home/runner make system-test"