diff --git a/.github/workflows/nightly-install.yaml b/.github/workflows/nightly-install.yaml index 01bbe9ad2c..e61f92029f 100644 --- a/.github/workflows/nightly-install.yaml +++ b/.github/workflows/nightly-install.yaml @@ -67,3 +67,12 @@ jobs: - name: "rke2-procps" if: ${{ !contains(matrix.vm, 'windows') }} run: vagrant provision --provision-with=rke2-procps + - name: "rke2-mount-directory" + if: ${{ !contains(matrix.vm, 'windows') }} + run: vagrant provision --provision-with=rke2-mount-directory + - name: "rke2-killall" + if: ${{ !contains(matrix.vm, 'windows') }} + run: vagrant provision --provision-with=rke2-killall + - name: "rke2-check-mount" + if: ${{ !contains(matrix.vm, 'windows') }} + run: vagrant provision --provision-with=rke2-check-mount diff --git a/bundle/bin/rke2-killall.sh b/bundle/bin/rke2-killall.sh index 371849482a..ec5d3910fc 100755 --- a/bundle/bin/rke2-killall.sh +++ b/bundle/bin/rke2-killall.sh @@ -62,7 +62,6 @@ systemctl stop rke2-agent.service || true killtree $({ set +x; } 2>/dev/null; getshims; set -x) do_unmount_and_remove '/run/k3s' -do_unmount_and_remove "${RKE2_DATA_DIR}" do_unmount_and_remove '/var/lib/kubelet/pods' do_unmount_and_remove '/run/netns/cni-' diff --git a/tests/install/install_util.rb b/tests/install/install_util.rb index 114a71bd65..06a340d6cf 100644 --- a/tests/install/install_util.rb +++ b/tests/install/install_util.rb @@ -87,4 +87,37 @@ def kubectlStatus(vm) kubectl get node,all -A -o wide SHELL end -end \ No newline at end of file +end + +def mountDirs(vm) + vm.provision "rke2-mount-directory", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh| + sh.inline = <<~SHELL + #!/usr/bin/env bash + set -eu -o pipefail + echo 'Mounting server dir' + mount --bind /var/lib/rancher/rke2/server /var/lib/rancher/rke2/server + SHELL + end +end + +def checkMountPoint(vm) + vm.provision "rke2-check-mount", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh| + sh.inline = <<~SHELL + #!/usr/bin/env bash + set -eu -o pipefail + echo 'Check the mount' + mount | grep /var/lib/rancher/rke2/server + SHELL + end +end + +def runKillAllScript(vm) + vm.provision "rke2-killall", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh| + sh.inline = <<~SHELL + #!/usr/bin/env bash + set -eu -o pipefail + echo 'Run kill all' + rke2-killall.sh + SHELL + end +end diff --git a/tests/install/opensuse-leap/Vagrantfile b/tests/install/opensuse-leap/Vagrantfile index 8b43db4638..c96c170963 100644 --- a/tests/install/opensuse-leap/Vagrantfile +++ b/tests/install/opensuse-leap/Vagrantfile @@ -40,6 +40,10 @@ Vagrant.configure("2") do |config| kubectlStatus(test.vm) checkRKE2Processes(test.vm) + + mountDirs(test.vm) + runKillAllScript(test.vm) + checkMountPoint(test.vm) end config.vm.provision "install-packages", type: "shell", run: "once" do |sh| diff --git a/tests/install/rocky-8/Vagrantfile b/tests/install/rocky-8/Vagrantfile index 02ec340aa6..0e98f1084c 100644 --- a/tests/install/rocky-8/Vagrantfile +++ b/tests/install/rocky-8/Vagrantfile @@ -41,6 +41,10 @@ Vagrant.configure("2") do |config| kubectlStatus(test.vm) checkRKE2Processes(test.vm) + + mountDirs(test.vm) + runKillAllScript(test.vm) + checkMountPoint(test.vm) end config.vm.provision "install-packages", type: "shell", run: "once" do |sh| diff --git a/tests/install/ubuntu-2004/Vagrantfile b/tests/install/ubuntu-2004/Vagrantfile index 92ea543007..47e47a8b58 100644 --- a/tests/install/ubuntu-2004/Vagrantfile +++ b/tests/install/ubuntu-2004/Vagrantfile @@ -46,6 +46,10 @@ Vagrant.configure("2") do |config| ps auxZ | grep -E 'etcd|kube|rke2|container|confined' | grep -v grep SHELL end + + mountDirs(test.vm) + runKillAllScript(test.vm) + checkMountPoint(test.vm) end config.vm.provision "install-packages", type: "shell", run: "once" do |sh|