Skip to content

Commit

Permalink
test: remove mismatched arch checks from init test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Rodriguez committed May 31, 2024
1 parent 0c02643 commit 00d46ee
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
24 changes: 0 additions & 24 deletions src/test/e2e/20_zarf_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ package test
import (
"encoding/base64"
"fmt"
"runtime"
"testing"

"encoding/json"
Expand All @@ -26,29 +25,6 @@ func TestZarfInit(t *testing.T) {
initComponents = "k3s,logging,git-server"
}

initPackageVersion := e2e.GetZarfVersion(t)

var (
mismatchedArch = e2e.GetMismatchedArch()
mismatchedInitPackage = fmt.Sprintf("zarf-init-%s-%s.tar.zst", mismatchedArch, initPackageVersion)
expectedErrorMessage = "unable to run component before action: command \"Check that the host architecture matches the package architecture\""
)
t.Cleanup(func() {
e2e.CleanFiles(mismatchedInitPackage)
})

if runtime.GOOS == "linux" {
// Build init package with different arch than the cluster arch.
stdOut, stdErr, err := e2e.Zarf("package", "create", "src/test/packages/20-mismatched-arch-init", "--architecture", mismatchedArch, "--confirm")
require.NoError(t, err, stdOut, stdErr)

// Check that `zarf init` returns an error because of the mismatched architectures.
// We need to use the --architecture flag here to force zarf to find the package.
_, stdErr, err = e2e.Zarf("init", "--architecture", mismatchedArch, "--components=k3s", "--confirm")
require.Error(t, err, stdErr)
require.Contains(t, stdErr, expectedErrorMessage)
}

if !e2e.ApplianceMode {
// throw a pending pod into the cluster to ensure we can properly ignore them when selecting images
_, _, err := e2e.Kubectl("apply", "-f", "https://raw.githubusercontent.com/kubernetes/website/main/content/en/examples/pods/pod-with-node-affinity.yaml")
Expand Down
12 changes: 0 additions & 12 deletions src/test/packages/20-mismatched-arch-init/zarf.yaml

This file was deleted.

0 comments on commit 00d46ee

Please sign in to comment.