Skip to content

Commit ac008db

Browse files
committed
Simplify zstd:chunked image test to use prebuilt image.
1 parent be1e34a commit ac008db

File tree

8 files changed

+11
-231
lines changed

8 files changed

+11
-231
lines changed

test/extended/node/zstd_chunked.go

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package node
22

33
import (
44
"context"
5-
"fmt"
65
"time"
76

87
g "github.com/onsi/ginkgo/v2"
@@ -13,35 +12,19 @@ import (
1312
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
1413

1514
exutil "github.com/openshift/origin/test/extended/util"
15+
"github.com/openshift/origin/test/extended/util/image"
1616
)
1717

18-
var _ = g.Describe("[sig-builds][sig-node][Feature:Builds][apigroup:build.openshift.io] zstd:chunked Image", func() {
18+
var _ = g.Describe("[sig-node] zstd:chunked Image", func() {
1919
defer g.GinkgoRecover()
2020
var (
21-
oc = exutil.NewCLI("zstd-chunked-image")
22-
customBuildAdd = exutil.FixturePath("testdata", "node", "zstd-chunked")
23-
customBuildFixture = exutil.FixturePath("testdata", "node", "zstd-chunked", "test-custom-build.yaml")
21+
oc = exutil.NewCLI("zstd-chunked-image")
2422
)
2523

2624
g.It("should successfully run date command", func(ctx context.Context) {
2725
namespace := oc.Namespace()
2826

29-
g.By("creating custom builder image")
30-
// Build with buildah with --compression-format zstd:chunked to ensure the image is compressed with zstd:chunked.
31-
// https://docs.redhat.com/en/documentation/openshift_container_platform/4.18/html/builds_using_buildconfig/custom-builds-buildah#builds-build-custom-builder-image_custom-builds-buildah
32-
err := oc.Run("new-build").Args("--binary", "--strategy=docker", "--name=custom-builder-image").Execute()
33-
o.Expect(err).NotTo(o.HaveOccurred())
34-
br, _ := exutil.StartBuildAndWait(oc, "custom-builder-image", fmt.Sprintf("--from-dir=%s", customBuildAdd))
35-
br.AssertSuccess()
36-
g.By("start custom build and build should complete")
37-
err = oc.AsAdmin().Run("create").Args("-f", customBuildFixture).Execute()
38-
o.Expect(err).NotTo(o.HaveOccurred())
39-
err = oc.AsAdmin().Run("start-build").Args("sample-custom-build").Execute()
40-
o.Expect(err).NotTo(o.HaveOccurred())
41-
err = exutil.WaitForABuild(oc.BuildClient().BuildV1().Builds(oc.Namespace()), "sample-custom-build-1", nil, nil, nil)
42-
o.Expect(err).NotTo(o.HaveOccurred())
43-
44-
// Define a pod that runs the date command using the zstd-chunked image
27+
// Define a pod that runs the date command using a prebuilt zstd:chunked image
4528
pod := &corev1.Pod{
4629
ObjectMeta: metav1.ObjectMeta{
4730
Name: "zstd-chunked-pod",
@@ -52,14 +35,15 @@ var _ = g.Describe("[sig-builds][sig-node][Feature:Builds][apigroup:build.opensh
5235
Containers: []corev1.Container{
5336
{
5437
Name: "zstd-chunked-container",
55-
Image: fmt.Sprintf("image-registry.openshift-image-registry.svc:5000/%s/sample-custom:latest", namespace),
38+
Image: image.LocationFor("quay.io/crio/zstd-chunked:1"),
5639
Command: []string{"date"},
5740
},
5841
},
5942
},
6043
}
6144

62-
g.By("Creating a pod")
45+
g.By("Creating a pod with prebuilt zstd:chunked image")
46+
var err error
6347
pod, err = oc.KubeClient().CoreV1().Pods(namespace).Create(context.Background(), pod, metav1.CreateOptions{})
6448
o.Expect(err).NotTo(o.HaveOccurred())
6549

test/extended/testdata/bindata.go

Lines changed: 0 additions & 145 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/extended/testdata/node/zstd-chunked/Dockerfile

Lines changed: 0 additions & 10 deletions
This file was deleted.

test/extended/testdata/node/zstd-chunked/Dockerfile.sample

Lines changed: 0 additions & 2 deletions
This file was deleted.

test/extended/testdata/node/zstd-chunked/build.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

test/extended/testdata/node/zstd-chunked/test-custom-build.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/extended/util/image/image.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ var (
6262

6363
// image required for OLMv1 tests in https://github.com/openshift/operator-framework-operator-controller/tree/main/openshift/tests-extension
6464
"quay.io/olmtest/webhook-operator:v0.0.5": -1,
65+
66+
// used by zstd:chunked image tests
67+
"quay.io/crio/zstd-chunked:1": -1,
6568
}
6669
)
6770

test/extended/util/image/zz_generated.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This file is generated by hack/update-generated.sh
22
docker.io/library/registry:2.8.0-beta.1 quay.io/openshift/community-e2e-images:e2e-docker-io-library-registry-2-8-0-beta-1-8x_YFKSuz9Xw6lZD
3+
quay.io/crio/zstd-chunked:1 quay.io/openshift/community-e2e-images:e2e-quay-io-crio-zstd-chunked-1-0WG37FZRdxgvrbPZ
34
quay.io/keycloak/keycloak:25.0 quay.io/openshift/community-e2e-images:e2e-quay-io-keycloak-keycloak-25-0-rEIw9B2Zcc3L1M6k
45
quay.io/kubevirt/fedora-with-test-tooling-container-disk:20241024_891122a6fc quay.io/openshift/community-e2e-images:e2e-quay-io-kubevirt-fedora-with-test-tooling-container-disk-20241024_891122a6fc-IycYTh-87XrXse4E
56
quay.io/olmtest/webhook-operator:v0.0.5 quay.io/openshift/community-e2e-images:e2e-quay-io-olmtest-webhook-operator-v0-0-5--2OhUsk-Xv-pLaTI

0 commit comments

Comments
 (0)