chore: Add integration test for disableuserns.sh (#104)

This commit is contained in:
Gerald Pinder 2024-03-02 15:09:21 -05:00 committed by GitHub
parent 6d2a21160d
commit 2c8776d2f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 92 additions and 5 deletions

View file

@ -3,17 +3,34 @@ PROJECT blue-build/cli
all:
ARG NIGHTLY=false
BUILD +build-template --NIGHTLY=$NIGHTLY
BUILD +test-image --NIGHTLY=$NIGHTLY
BUILD +test-secureblue --NIGHTLY=$NIGHTLY
BUILD +build --NIGHTLY=$NIGHTLY
BUILD +rebase --NIGHTLY=$NIGHTLY
BUILD +upgrade --NIGHTLY=$NIGHTLY
test-image:
ARG NIGHTLY=false
FROM +build-template --NIGHTLY=$NIGHTLY --src=template-containerfile
WORKDIR /tmp/test
COPY ./test-scripts/*.sh ./
DO +RUN_TESTS
test-secureblue:
ARG NIGHTLY=false
FROM +build-template --NIGHTLY=$NIGHTLY --src=template-secureblue
WORKDIR /tmp/test
COPY ./test-scripts/secureblue/*.sh ./
DO +RUN_TESTS
build-template:
ARG NIGHTLY=false
ARG --required src
FROM DOCKERFILE \
-f +template-containerfile/test/Containerfile \
+template-containerfile/test/* --NIGHTLY=$NIGHTLY
RUN [ -f /usr/test-file ]
-f +$src/test/Containerfile \
+$src/test/* --NIGHTLY=$NIGHTLY
template-containerfile:
ARG NIGHTLY=false
@ -22,6 +39,13 @@ template-containerfile:
SAVE ARTIFACT /test
template-secureblue:
ARG NIGHTLY=false
FROM +secureblue-base --NIGHTLY=$NIGHTLY
RUN bluebuild -vv template -o Containerfile config/recipes/desktop/recipe-silverblue-nvidia.yml
SAVE ARTIFACT /test
build:
ARG NIGHTLY=false
FROM +test-base --NIGHTLY=$NIGHTLY
@ -41,6 +65,13 @@ upgrade:
RUN --privileged bluebuild -vv upgrade config/recipe.yml
secureblue-base:
ARG NIGHTLY=false
FROM +test-base --NIGHTLY=$NIGHTLY
RUN rm -fr /test
GIT CLONE https://github.com/secureblue/secureblue.git /test
test-base:
ARG NIGHTLY=false
@ -56,3 +87,11 @@ test-base:
ENV COSIGN_PRIVATE_KEY=$(cat cosign.key)
RUN rm cosign.key
RUN_TESTS:
FUNCTION
FOR script IN $(ls *.sh)
RUN --no-cache chmod +x $script \
&& echo "Running test $script" \
&& ./$script
END