Skip to content

Commit 65b332b

Browse files
kate-goldenringMossaka
authored andcommitted
Add logging around systemd verification
Signed-off-by: Kate Goldenring <[email protected]>
1 parent 3a015cd commit 65b332b

File tree

4 files changed

+25
-6
lines changed

4 files changed

+25
-6
lines changed

node-installer/tests/integration-test-k3s.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,15 @@ echo "Applying KWasm node installer job..."
5151
kubectl apply -f ./k3s-kwasm-job.yml
5252

5353
echo "Waiting for node installer job to complete..."
54-
kubectl wait -n kwasm --for=condition=Ready pod --selector=job-name=k3s-provision-kwasm --timeout=90s || true
5554
kubectl wait -n kwasm --for=jsonpath='{.status.phase}'=Succeeded pod --selector=job-name=k3s-provision-kwasm --timeout=60s
5655

5756
# Verify the SystemdCgroup is set to true
58-
sudo cat /var/lib/rancher/k3s/agent/etc/containerd/config.toml | grep -A2 "runtimes.spin.options" | grep "SystemdCgroup = true"
57+
if sudo cat /var/lib/rancher/k3s/agent/etc/containerd/config.toml | grep -A2 "runtimes.spin.options" | grep -q "SystemdCgroup = true"; then
58+
echo "SystemdCgroup is set to true"
59+
else
60+
echo "SystemdCgroup is not set to true"
61+
exit 1
62+
fi
5963

6064
if ! kubectl get pods -n kwasm | grep -q "k3s-provision-kwasm.*Completed"; then
6165
echo "Node installer job failed!"

node-installer/tests/integration-test-kind.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ kubectl --context=kind-spin-test wait -n kwasm --for=condition=Ready pod --selec
5656
kubectl --context=kind-spin-test wait -n kwasm --for=jsonpath='{.status.phase}'=Succeeded pod --selector=job-name=spin-test-control-plane-provision-kwasm --timeout=60s
5757

5858
# Verify the SystemdCgroup is set to true
59-
docker exec spin-test-control-plane cat /etc/containerd/config.toml | grep -A5 "spin" | grep "SystemdCgroup = true"
59+
if docker exec spin-test-control-plane cat /etc/containerd/config.toml | grep -A5 "spin" | grep -q "SystemdCgroup = true"; then
60+
echo "SystemdCgroup is set to true"
61+
else
62+
echo "SystemdCgroup is not set to true"
63+
exit 1
64+
fi
6065

6166
if ! kubectl --context=kind-spin-test get pods -n kwasm | grep -q "spin-test-control-plane-provision-kwasm.*Completed"; then
6267
echo "Node installer job failed!"

node-installer/tests/integration-test-microk8s.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,13 @@ kubectl apply -f ./microk8s-kwasm-job.yml
6262
echo "Waiting for node installer job to complete..."
6363
kubectl wait -n kwasm --for=jsonpath='{.status.phase}'=Succeeded pod --selector=job-name=microk8s-provision-kwasm --timeout=60s
6464

65-
# Verify the SystemdCgroup is set to true
66-
sudo cat /var/snap/microk8s/current/args/containerd.toml | grep -A5 "spin" | grep "SystemdCgroup = true"
65+
# Ensure the SystemdCgroup is not set to true
66+
if sudo cat /var/snap/microk8s/current/args/containerd.toml | grep -A5 "spin" | grep -q "SystemdCgroup = true"; then
67+
echo "Failed: SystemdCgroup is set to true"
68+
exit 1
69+
else
70+
echo "Passed: SystemdCgroup is not set to true"
71+
fi
6772

6873
if ! kubectl get pods -n kwasm | grep -q "microk8s-provision-kwasm.*Completed"; then
6974
echo "Node installer job failed!"

node-installer/tests/integration-test-minikube.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ kubectl wait -n kwasm --for=condition=Ready pod --selector=job-name=minikube-pro
4545
kubectl wait -n kwasm --for=jsonpath='{.status.phase}'=Succeeded pod --selector=job-name=minikube-provision-kwasm --timeout=60s
4646

4747
# Verify the SystemdCgroup is set to true
48-
docker exec $NODE_NAME cat /etc/containerd/config.toml | grep -A5 "spin" | grep "SystemdCgroup = true"
48+
if docker exec $NODE_NAME cat /etc/containerd/config.toml | grep -A5 "spin" | grep -q "SystemdCgroup = true"; then
49+
echo "SystemdCgroup is set to true"
50+
else
51+
echo "SystemdCgroup is not set to true"
52+
exit 1
53+
fi
4954

5055
if ! kubectl get pods -n kwasm | grep -q "minikube-provision-kwasm.*Completed"; then
5156
echo "Node installer job failed!"

0 commit comments

Comments
 (0)