From 5936c80ab4fd336174e8efe2248e29d30deb6ad5 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 5 Aug 2022 14:16:49 +0200 Subject: [PATCH 1/2] test: assist with debugging QEMU startup When kubeadm fails, the error is followed by lots of diagnostics. That's good for the CI, but can hide the actual error. Some extra message at the end helps. When running interactively, pausing the shutdown gives an opportunity to debug without having to start again with a modified script. --- test/setup-kubernetes.sh | 1 + test/start-kubernetes.sh | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/test/setup-kubernetes.sh b/test/setup-kubernetes.sh index d8f491ce2..b7bc18cb6 100755 --- a/test/setup-kubernetes.sh +++ b/test/setup-kubernetes.sh @@ -252,6 +252,7 @@ sudo kubeadm init $kubeadm_args $kubeadm_args_init || ( # Dump some information that might explain the failure. sudo systemctl status docker crio containerd kubelet sudo journalctl -xe -u docker -u crio -u containerd -u kubelet + echo "ERROR: kubeadm init failed, see above." exit 1 ) mkdir -p $HOME/.kube diff --git a/test/start-kubernetes.sh b/test/start-kubernetes.sh index 615abc174..6c88624c4 100755 --- a/test/start-kubernetes.sh +++ b/test/start-kubernetes.sh @@ -523,6 +523,12 @@ function cleanup() ( echo "Docker log for $name:" docker logs $name | sed -e "s/^/$name: /" fi + + if [ -t 0 ]; then + echo "Press RETURN to clean up." + read input + fi + for vm in $(govm list -f '{{select (filterRegexp . "Name" "^'$(node_filter ${NODES[@]})'$") "Name"}}'); do govm remove "$vm" done From 42423d40dba9e424dcbe6166bc5823cacedd2f6d Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 5 Aug 2022 14:18:54 +0200 Subject: [PATCH 2/2] test: bump to Fedora 36 Fedora 34 is EOL. --- test/start-kubernetes.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/start-kubernetes.sh b/test/start-kubernetes.sh index 6c88624c4..0b2bc6557 100755 --- a/test/start-kubernetes.sh +++ b/test/start-kubernetes.sh @@ -71,8 +71,8 @@ case ${TEST_DISTRO} in fedora) CLOUD_USER=${CLOUD_USER:-fedora} EFI=${EFI:-false} - TEST_DISTRO_VERSION=${TEST_DISTRO_VERSION:-34} - FEDORA_CLOUDIMG_REL=${FEDORA_CLOUDIMG_REL:-1.2} + TEST_DISTRO_VERSION=${TEST_DISTRO_VERSION:-36} + FEDORA_CLOUDIMG_REL=${FEDORA_CLOUDIMG_REL:-1.5} IMAGE_URL=${IMAGE_URL:-https://download.fedoraproject.org/pub/fedora/linux/releases/${TEST_DISTRO_VERSION}/Cloud/x86_64/images} CLOUD_IMAGE=${CLOUD_IMAGE:-Fedora-Cloud-Base-${TEST_DISTRO_VERSION}-${FEDORA_CLOUDIMG_REL}.x86_64.raw.xz} ;; @@ -371,10 +371,14 @@ function init_kubernetes_cluster() ( vm_id=0 pids="" IPS=$(print_ips) - # in Fedora-3[123] case, add a flag to kernel cmdline and reboot to disable cgroups v2 - if [[ "$TEST_DISTRO" = "fedora" && "$TEST_DISTRO_VERSION" =~ 3[1-4] ]]; then + # in Fedora-3[123...] case, add a flag to kernel cmdline and reboot to disable cgroups v2 + if [[ "$TEST_DISTRO" = "fedora" && "$TEST_DISTRO_VERSION" =~ 3[1-9] ]]; then SYSTEMD_UNIFIED_CGROUP_HIERARCHY=systemd.unified_cgroup_hierarchy for ip in ${IPS}; do + # Disable zswap, permanently (https://fedoraproject.org/wiki/Changes/SwapOnZRAM#How_can_it_be_disabled?). + ssh $SSH_ARGS ${CLOUD_USER}@${ip} "sudo dnf -q -y remove zram-generator-defaults" + ssh $SSH_ARGS ${CLOUD_USER}@${ip} "sudo sed -i -e '/swap/d' /etc/fstab" + GRUB_BFS=$(ssh $SSH_ARGS ${CLOUD_USER}@${ip} "grep ^GRUB_ENABLE_BLSCFG /etc/default/grub | sed -e \"s;\(GRUB_ENABLE_BLSCFG=\)\(.*\);\2;g\"") # If BFS enabled use 'grubby' to modify kernel parameters if [ $GRUB_BFS = "true" ]; then