Skip to content

Commit

Permalink
de
Browse files Browse the repository at this point in the history
Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Sep 6, 2023
1 parent 6f2eb7f commit e859aec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
19 changes: 18 additions & 1 deletion .github/workflows/reusable-provider-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ on:

jobs:
test:
runs-on: ubuntu-latest
runs-on:
group: Kairos core
labels: release
permissions:
id-token: write # OIDC support
contents: write
Expand All @@ -32,6 +34,20 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libvirt-clients libvirt-daemon-system libvirt-daemon virtinst bridge-utils qemu qemu-system-x86 qemu-system-x86 qemu-utils qemu-kvm acl udev
# https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
sudo usermod -a -G kvm,libvirt runner
#
# TODO: Switch back to the above solution when we switch to the github runners
# https://askubuntu.com/a/1081326
sudo setfacl -m u:runner:rwx /dev/kvm
- name: block all traffic to metadata ip
run: |
iptables -I INPUT -s 169.254.169.254 -j DROP
iptables -I OUTPUT -d 169.254.169.254 -j DROP
- name: Install earthly
uses: jimmykarily/[email protected]
with:
Expand All @@ -45,6 +61,7 @@ jobs:
- name: Run tests
env:
USE_QEMU: true
KVM: true
MEMORY: 4000
CPUS: 2
DRIVE_SIZE: 30000
Expand Down
15 changes: 0 additions & 15 deletions tests/provider_upgrade_k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,14 @@ var _ = Describe("k3s upgrade test", Label("provider", "provider-upgrade-k8s"),
Expect(out).Should(ContainSubstring("active (waiting)"))
}

vm.EventuallyConnects(1200)

By("find the correct device (qemu vs vbox)")
device, err := vm.Sudo(`[[ -e /dev/sda ]] && echo "/dev/sda" || echo "/dev/vda"`)
Expect(err).ToNot(HaveOccurred(), device)

vm.EventuallyConnects(1200)

By("find the correct device (qemu vs vbox)")
device, err = vm.Sudo(`[[ -e /dev/sda ]] && echo "/dev/sda" || echo "/dev/vda"`)
Expect(err).ToNot(HaveOccurred(), device)

vm.EventuallyConnects(1200)

By("copy the config")
err = vm.Scp("assets/single.yaml", "/tmp/config.yaml", "0770")
Expect(err).ToNot(HaveOccurred())

vm.EventuallyConnects(1200)

By("installing")
cmd := fmt.Sprintf("kairos-agent --debug manual-install --device %s /tmp/config.yaml", strings.TrimSpace(device))
out, err := vm.Sudo(cmd)
Expand All @@ -96,7 +84,6 @@ var _ = Describe("k3s upgrade test", Label("provider", "provider-upgrade-k8s"),
ContainSubstring("kairos-agent")))
} else {
Eventually(func() string {
vm.EventuallyConnects(1200)
out, _ := vm.Sudo("systemctl status kairos-agent")
return out
}, 30*time.Second, 10*time.Second).Should(ContainSubstring(
Expand All @@ -109,11 +96,9 @@ var _ = Describe("k3s upgrade test", Label("provider", "provider-upgrade-k8s"),
"loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: disabled)"))
}

vm.EventuallyConnects(1200)
By("checking if kairos-agent has started")
Eventually(func() string {
var out string
vm.EventuallyConnects(1200)
if isFlavor(vm, "alpine") {
out, _ = vm.Sudo("rc-service kairos-agent status")
} else {
Expand Down

0 comments on commit e859aec

Please sign in to comment.