From abe54c2f5dd3c2d7d8ab04a1fe4bd9e70d44f7a3 Mon Sep 17 00:00:00 2001 From: lilyLuLiu Date: Tue, 7 Jan 2025 12:03:49 +0800 Subject: [PATCH] [QE]fix get arm64 image failure --- test/e2e/features/story_openshift.feature | 2 +- test/e2e/testsuite/testsuite.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test/e2e/features/story_openshift.feature b/test/e2e/features/story_openshift.feature index ffd00c4c5b..31150dec2a 100644 --- a/test/e2e/features/story_openshift.feature +++ b/test/e2e/features/story_openshift.feature @@ -41,7 +41,7 @@ Feature: 4 Openshift stories Given executing "oc new-project testproj" succeeds # mirror When executing "oc registry login --insecure=true" succeeds - Then executing "oc image mirror registry.access.redhat.com/ubi8/httpd-24:latest=default-route-openshift-image-registry.apps-crc.testing/testproj/hello:test --insecure=true" succeeds + Then OC mirror http image And executing "oc set image-lookup hello" succeeds # deploy When executing "oc apply -f hello.yaml" succeeds diff --git a/test/e2e/testsuite/testsuite.go b/test/e2e/testsuite/testsuite.go index 2741a376fe..3e8b4de15a 100644 --- a/test/e2e/testsuite/testsuite.go +++ b/test/e2e/testsuite/testsuite.go @@ -534,6 +534,8 @@ func InitializeScenario(s *godog.ScenarioContext) { s.Step(`^kubeconfig is cleaned up$`, EnsureKubeConfigIsCleanedUp) + s.Step(`^OC mirror http image$`,OCmirrorHttpImage) + s.After(func(ctx context.Context, _ *godog.Scenario, err error) (context.Context, error) { if usingPreexistingCluster() { @@ -557,6 +559,12 @@ func InitializeScenario(s *godog.ScenarioContext) { }) } +func OCmirrorHttpImage() error { + oc_mirror_cmd := fmt.Sprintf("oc image mirror registry.access.redhat.com/ubi8/httpd-24:latest=default-route-openshift-image-registry.apps-crc.testing/testproj/hello:test --insecure=true --filter-by-os=linux/%s",runtime.GOARCH) + err := util.ExecuteCommandSucceedsOrFails(oc_mirror_cmd,"succeeds") + return err +} + func usingPreexistingCluster() bool { return strings.Contains(GodogTags, "~@startstop") }