diff --git a/test/e2e/constellation/eth/anvil.yml b/test/e2e/constellation/miniconstellation/eth/anvil.yml similarity index 100% rename from test/e2e/constellation/eth/anvil.yml rename to test/e2e/constellation/miniconstellation/eth/anvil.yml diff --git a/test/e2e/constellation/helmfile.yaml b/test/e2e/constellation/miniconstellation/helmfile.yaml similarity index 100% rename from test/e2e/constellation/helmfile.yaml rename to test/e2e/constellation/miniconstellation/helmfile.yaml diff --git a/test/e2e/constellation/ipfs/ipfs.yml b/test/e2e/constellation/miniconstellation/ipfs/ipfs.yml similarity index 100% rename from test/e2e/constellation/ipfs/ipfs.yml rename to test/e2e/constellation/miniconstellation/ipfs/ipfs.yml diff --git a/test/e2e/constellation/ipfs/serviceaccount.yml b/test/e2e/constellation/miniconstellation/ipfs/serviceaccount.yml similarity index 100% rename from test/e2e/constellation/ipfs/serviceaccount.yml rename to test/e2e/constellation/miniconstellation/ipfs/serviceaccount.yml diff --git a/test/e2e/constellation/keda/ingress.yml b/test/e2e/constellation/miniconstellation/keda/ingress.yml similarity index 100% rename from test/e2e/constellation/keda/ingress.yml rename to test/e2e/constellation/miniconstellation/keda/ingress.yml diff --git a/test/e2e/constellation/loki/values.yml b/test/e2e/constellation/miniconstellation/loki/values.yml similarity index 100% rename from test/e2e/constellation/loki/values.yml rename to test/e2e/constellation/miniconstellation/loki/values.yml diff --git a/test/e2e/constellation/run-test.sh b/test/e2e/constellation/miniconstellation/run-test.sh similarity index 100% rename from test/e2e/constellation/run-test.sh rename to test/e2e/constellation/miniconstellation/run-test.sh diff --git a/test/e2e/constellation/trustedpods/serviceaccount.yml b/test/e2e/constellation/miniconstellation/trustedpods/serviceaccount.yml similarity index 100% rename from test/e2e/constellation/trustedpods/serviceaccount.yml rename to test/e2e/constellation/miniconstellation/trustedpods/serviceaccount.yml diff --git a/test/e2e/constellation/trustedpods/tpodserver.yml b/test/e2e/constellation/miniconstellation/trustedpods/tpodserver.yml similarity index 100% rename from test/e2e/constellation/trustedpods/tpodserver.yml rename to test/e2e/constellation/miniconstellation/trustedpods/tpodserver.yml diff --git a/test/e2e/constellation/qemu/run-test.sh b/test/e2e/constellation/qemu/run-test.sh new file mode 100755 index 00000000..031b0e4b --- /dev/null +++ b/test/e2e/constellation/qemu/run-test.sh @@ -0,0 +1,61 @@ +#!/bin/sh + +# Check the number of arguments +if [ "$#" -lt 2 ]; then + echo "Usage: $0 " + exit 1 +fi + +current_dir=$(pwd) + +# Generate helm template and inject it into constellation base image +helmfile template -f $1 > $2/image/base/mkosi.skeleton/usr/lib/helmfile-template + +# cleanup leftover +cd $current_dir +cd constell-cluster +constellation terminate +cd $current_dir +sudo rm -r constell-cluster 2>/dev/null +mkdir constell-cluster + +cd $2 +# Get go dependecies +bazel run //:tidy + +# Build the image +bazel build //image/system:qemu_stable + +# Get the new image measurements +link=$(readlink -f bazel-out/k8-opt/bin/image/system/qemu_qemu-vtpm_stable) +output=$(bazel run --run_under="sudo -E" //image/measured-boot/cmd $link/constellation.raw $current_dir/custom-measurements.json 2>&1) + +# Extract relevant PCR values +PCR4=$(echo "$output" | sed -n '/PCR\[ *4\]/ s/.*: \(.*\)/\1/p') +PCR9=$(echo "$output" | sed -n '/PCR\[ *9\]/ s/.*: \(.*\)/\1/p') +PCR11=$(echo "$output" | sed -n '/PCR\[ *11\]/ s/.*: \(.*\)/\1/p') + +echo "PCR4: $PCR4" +echo "PCR9: $PCR9" +echo "PCR11: $PCR11" + +cd "$current_dir" +cd constell-cluster + +constellation config generate qemu + +# Replace the values in the configuration file +sed -i.bak -e "/^\s*4:/ {n;s/\( *expected: \).*$/\1$PCR4/}" \ + -e "/^\s*9:/ {n;s/\( *expected: \).*$/\1$PCR9/}" \ + -e "/^\s*11:/ {n;s/\( *expected: \).*$/\1$PCR11/}" constellation-conf.yaml +# Replace the control plance count & nodes to 1 +sed -i 's/initialCount: [0-9]*/initialCount: 1/' "constellation-conf.yaml" + +output=$(constellation version) +version=$(echo "$output" | grep -oP 'Version:\s+\K\S+' | head -n 1) + +# Copy the image & rename it to the current constellation version to bypass downloading upstream image +cp $link/constellation.raw "$version.raw" + +# Start the constellation cluster +constellation apply -y diff --git a/test/integration/lifecycle/devserver/devserver.yml b/test/integration/lifecycle/devserver/devserver.yml index 8450bdac..c9c26c9a 100644 --- a/test/integration/lifecycle/devserver/devserver.yml +++ b/test/integration/lifecycle/devserver/devserver.yml @@ -55,7 +55,7 @@ spec: spec: containers: - name: devserver - image: host.minikube.internal:5000/comradecoop/apocryph/devserver + image: ghcr.io/comrade-coop/apocryph/server:master env: - name: SERVER_PORT value: "8090"