diff --git a/test/extended/image_ecosystem/s2i_perl.go b/test/extended/image_ecosystem/s2i_perl.go index 5146b260f5a4..d15959a81a13 100644 --- a/test/extended/image_ecosystem/s2i_perl.go +++ b/test/extended/image_ecosystem/s2i_perl.go @@ -3,7 +3,7 @@ package image_ecosystem import ( "context" "fmt" - "strings" + "os" "time" g "github.com/onsi/ginkgo/v2" @@ -11,7 +11,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/wait" e2e "k8s.io/kubernetes/test/e2e/framework" exutil "github.com/openshift/origin/test/extended/util" @@ -45,9 +44,7 @@ var _ = g.Describe("[sig-devex][Feature:ImageEcosystem][perl][Slow] hot deploy f modifyCommand = []string{"sed", "-ie", `s/initial value/modified value/`, "lib/My/Test.pm"} dcName = "perl" rcNameOne = fmt.Sprintf("%s-1", dcName) - rcNameTwo = fmt.Sprintf("%s-2", dcName) dcLabelOne = exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", rcNameOne)) - dcLabelTwo = exutil.ParseLabelsOrDie(fmt.Sprintf("deployment=%s", rcNameTwo)) ) g.Context("", func() { @@ -69,9 +66,14 @@ var _ = g.Describe("[sig-devex][Feature:ImageEcosystem][perl][Slow] hot deploy f if !archHasModPerl(oc) { g.Skip("mod_perl based builder image is not available on arm64") } + // Make sure the index.pl is executable in the fixture assets as it is in the sources. + // (FixturePath resets the perms on the files) + err := os.Chmod(exutil.FixturePath("testdata", "image_ecosystem", "perl-hotdeploy", "index.pl"), os.FileMode(0o755)) + o.Expect(err).NotTo(o.HaveOccurred()) + exutil.WaitForOpenShiftNamespaceImageStreams(oc) g.By(fmt.Sprintf("calling oc new-app -f %q", perlTemplate)) - err := oc.Run("new-app").Args("-f", perlTemplate, "-e", "HTTPD_START_SERVERS=1", "-e", "HTTPD_MAX_SPARE_SERVERS=1", "-e", "HTTPD_MAX_REQUEST_WORKERS=1").Execute() + err = oc.Run("new-app").Args("-f", perlTemplate, "-e", "HTTPD_START_SERVERS=1", "-e", "HTTPD_MAX_SPARE_SERVERS=1", "-e", "HTTPD_MAX_REQUEST_WORKERS=1").Execute() o.Expect(err).NotTo(o.HaveOccurred()) br, err := exutil.StartBuildAndWait(oc, "perl", fmt.Sprintf("--from-dir=%s", appSource)) @@ -91,8 +93,6 @@ var _ = g.Describe("[sig-devex][Feature:ImageEcosystem][perl][Slow] hot deploy f g.By("waiting for endpoint") err = exutil.WaitForEndpoint(oc.KubeFramework().ClientSet, oc.Namespace(), dcName) o.Expect(err).NotTo(o.HaveOccurred()) - oldEndpoint, err := oc.KubeFramework().ClientSet.CoreV1().Endpoints(oc.Namespace()).Get(context.Background(), dcName, metav1.GetOptions{}) - o.Expect(err).NotTo(o.HaveOccurred()) checkPage := func(expected string, dcLabel labels.Selector) { _, err := exutil.WaitForPods(oc.KubeClient().CoreV1().Pods(oc.Namespace()), dcLabel, exutil.CheckPodIsRunning, 1, 4*time.Minute) @@ -104,45 +104,12 @@ var _ = g.Describe("[sig-devex][Feature:ImageEcosystem][perl][Slow] hot deploy f checkPage("initial value", dcLabelOne) - g.By("modifying the source code with disabled hot deploy") + g.By("modifying the source code") err = RunInPodContainer(oc, dcLabelOne, modifyCommand) o.Expect(err).NotTo(o.HaveOccurred()) - checkPage("initial value", dcLabelOne) - - g.By("turning on hot-deploy") - err = oc.Run("set", "env").Args("dc", dcName, "PERL_APACHE2_RELOAD=true").Execute() - o.Expect(err).NotTo(o.HaveOccurred()) - err = exutil.WaitForDeploymentConfig(oc.KubeClient(), oc.AppsClient().AppsV1(), oc.Namespace(), dcName, 2, true, oc) - o.Expect(err).NotTo(o.HaveOccurred()) - g.By("waiting for a new endpoint") - err = exutil.WaitForEndpoint(oc.KubeFramework().ClientSet, oc.Namespace(), dcName) - o.Expect(err).NotTo(o.HaveOccurred()) - - // Ran into an issue where we'd try to hit the endpoint before it was updated, resulting in - // request timeouts against the previous pod's ip. So make sure the endpoint is pointing to the - // new pod before hitting it. - err = wait.Poll(1*time.Second, 1*time.Minute, func() (bool, error) { - newEndpoint, err := oc.KubeFramework().ClientSet.CoreV1().Endpoints(oc.Namespace()).Get(context.Background(), dcName, metav1.GetOptions{}) - if err != nil { - return false, err - } - if !strings.Contains(newEndpoint.Subsets[0].Addresses[0].TargetRef.Name, rcNameTwo) { - e2e.Logf("waiting on endpoint address ref %s to contain %s", newEndpoint.Subsets[0].Addresses[0].TargetRef.Name, rcNameTwo) - return false, nil - } - e2e.Logf("old endpoint was %#v, new endpoint is %#v", oldEndpoint, newEndpoint) - return true, nil - }) - o.Expect(err).NotTo(o.HaveOccurred()) - - g.By("modifying the source code with enabled hot deploy") - checkPage("initial value", dcLabelTwo) - err = RunInPodContainer(oc, dcLabelTwo, modifyCommand) - o.Expect(err).NotTo(o.HaveOccurred()) - checkPage("modified value", dcLabelTwo) + checkPage("modified value", dcLabelOne) }) }) - }) }) diff --git a/test/extended/testdata/bindata.go b/test/extended/testdata/bindata.go index 6c538463e697..29cc42fa7f3c 100644 --- a/test/extended/testdata/bindata.go +++ b/test/extended/testdata/bindata.go @@ -45639,7 +45639,7 @@ var _testExtendedTestdataImage_ecosystemPerlHotdeployPerlJson = []byte(`{ "from": { "kind": "ImageStreamTag", "namespace": "openshift", - "name": "perl:5.30-el7" + "name": "perl:5.32-ubi8" } } }, diff --git a/test/extended/testdata/image_ecosystem/perl-hotdeploy/perl.json b/test/extended/testdata/image_ecosystem/perl-hotdeploy/perl.json index bfa366f66417..0c4bd702e33c 100644 --- a/test/extended/testdata/image_ecosystem/perl-hotdeploy/perl.json +++ b/test/extended/testdata/image_ecosystem/perl-hotdeploy/perl.json @@ -47,7 +47,7 @@ "from": { "kind": "ImageStreamTag", "namespace": "openshift", - "name": "perl:5.30-el7" + "name": "perl:5.32-ubi8" } } },