Skip to content

Commit

Permalink
Add uninstall test in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Savian <[email protected]>
  • Loading branch information
vitorsavian committed Aug 6, 2024
1 parent 99ef3b3 commit 00fe226
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,17 @@ jobs:
run: vagrant provision --provision-with=k3s-status
- name: "k3s-procps"
run: vagrant provision --provision-with=k3s-procps
- name: "k3s-mount-directory"
run: vagrant provision --provision-with=k3s-mount-directory
- name: "k3s-uninstall"
run: vagrant provision --provision-with=k3s-uninstall
- name: "k3s-check-mount"
run: vagrant provision --provision-with=k3s-check-mount
- name: Cleanup VM
run: vagrant destroy -f
- name: On Failure, launch debug session
uses: lhotari/action-upterm@v1
if: ${{ failure() }}
with:
## If no one connects after 5 minutes, shut down server.
wait-timeout-minutes: 5
wait-timeout-minutes: 5
2 changes: 1 addition & 1 deletion tests/install/install_util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def runUninstall(vm)
end
end
def checkMountPoint(vm)
vm.provision "k3s-check-mount", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh|
vm.provision "k3s-check-mount", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eu -o pipefail
Expand Down
24 changes: 24 additions & 0 deletions tests/install/opensuse-microos/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,30 @@ Vagrant.configure("2") do |config|
ps auxZ | grep -E 'k3s|kube|container' | grep -v grep
SHELL
end
test.vm.provision "k3s-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/k3s/server /var/lib/rancher/k3s/server
SHELL
end
test.vm.provision "k3s-uninstall", type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once' do |sh|
sh.inline = <<~SHELL
#!/usr/bin/env bash
set -eu -o pipefail
echo 'Uninstall k3s'
k3s-server-uninstall.sh
SHELL
end
test.vm.provision "k3s-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/k3s/server
SHELL
end
end

%w[libvirt virtualbox vmware_desktop].each do |p|
Expand Down

0 comments on commit 00fe226

Please sign in to comment.