Skip to content

Commit

Permalink
Zfs reuse iso (#1795)
Browse files Browse the repository at this point in the history
* 🤖 Use prebuilt iso on zfs test

Due to a mixup in the dirs, the zfs test was not finding the prebuilt
iso and was constructiing a new one on each run

Signed-off-by: Itxaka <itxaka@kairos.io>

* Do not run reset test twice

Just to check a simple grubenv file, just run it once as running it
twice means that we would drop the machine adn start from scratch again,
which makes no sense for a simple test.

Signed-off-by: Itxaka <itxaka@kairos.io>

---------

Signed-off-by: Itxaka <itxaka@kairos.io>
  • Loading branch information
Itxaka authored Sep 6, 2023
1 parent 2f2f5a8 commit 5fa35ab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/reusable-zfs-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ jobs:
runs-on: kvm
steps:
- uses: actions/checkout@v4
- name: Download artifacts
- name: Download ISO
id: iso
uses: actions/download-artifact@v3
with:
name: kairos-${{ inputs.flavor }}.iso.zip
path: ./build
- name: Display structure of downloaded files
run: ls -R
working-directory: ./build
- name: Install earthly
uses: jimmykarily/luet-install-action@v1.2
with:
Expand All @@ -30,5 +29,4 @@ jobs:
sudo iptables -I INPUT -s 169.254.169.254 -j DROP
sudo iptables -I OUTPUT -d 169.254.169.254 -j DROP
- run: |
export ISO=$(ls $PWD/kairos-*${{ inputs.flavor }}*).iso
earthly +run-qemu-test --TEST_SUITE=zfs --FLAVOR=${{ inputs.flavor }}
earthly +run-qemu-test --PREBUILT_ISO=$(ls kairos-core-*${{ inputs.flavor }}*.iso) --TEST_SUITE=zfs --FLAVOR=${{ inputs.flavor }}
5 changes: 3 additions & 2 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ run-qemu-netboot-test:

run-qemu-test:
FROM +go-deps-test
WORKDIR /test
ARG FLAVOR
ARG TEST_SUITE=upgrade-with-cli
ARG PREBUILT_ISO
Expand All @@ -969,10 +970,10 @@ run-qemu-test:

COPY . .
IF [ -n "$PREBUILT_ISO" ]
ENV ISO=/build/$PREBUILT_ISO
ENV ISO=/test/$PREBUILT_ISO
ELSE
COPY +iso/kairos.iso kairos.iso
ENV ISO=/build/kairos.iso
ENV ISO=/test/kairos.iso
END
COPY +go-deps-test/go.mod go.mod
COPY +go-deps-test/go.sum go.sum
Expand Down
6 changes: 1 addition & 5 deletions tests/reset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,14 @@ var _ = Describe("kairos reset test", Label("reset-test"), func() {
expectStartedInstallation(vm)
expectRebootedToActive(vm)
})

It("has grubenv file", func() {
It("resets", func() {
Eventually(func() string {
out, _ := vm.Sudo("cat /oem/grubenv")
return out
}, 10*time.Minute, 1*time.Second).Should(
Or(
ContainSubstring("foobarzz"),
))
})

It("resets", func() {
_, err := vm.Sudo("touch /usr/local/test")
Expect(err).ToNot(HaveOccurred())

Expand Down

0 comments on commit 5fa35ab

Please sign in to comment.