From f84c9dbd82b485f5f99f9797ce8d1b7460c13c83 Mon Sep 17 00:00:00 2001 From: Alexander Chuzhoy Date: Tue, 18 Jun 2024 22:03:11 -0400 Subject: [PATCH] lca: negative test to cover unsupported stage update. Tests updating ibu stage from upgrade to prep. Signed-off-by: Alexander Chuzhoy --- .../mgmt/upgrade/tests/e2e-upgrade-test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/lca/imagebasedupgrade/mgmt/upgrade/tests/e2e-upgrade-test.go b/tests/lca/imagebasedupgrade/mgmt/upgrade/tests/e2e-upgrade-test.go index 7ed104949..7d29c89fa 100644 --- a/tests/lca/imagebasedupgrade/mgmt/upgrade/tests/e2e-upgrade-test.go +++ b/tests/lca/imagebasedupgrade/mgmt/upgrade/tests/e2e-upgrade-test.go @@ -331,6 +331,20 @@ var _ = Describe( Expect(originalTargetProxy.Object.Spec.NoProxy).To(Equal(targetProxyPostUpgrade.Object.Spec.NoProxy), "NO_PROXY postupgrade config does not match pre upgrade config") }) + + It("fails because from Upgrade it's not possible to move to Prep stage", reportxml.ID("71741"), func() { + By("Pull the imagebasedupgrade from the cluster") + ibu, err = lca.PullImageBasedUpgrade(APIClient) + Expect(err).NotTo(HaveOccurred(), "error pulling imagebasedupgrade resource") + + if ibu.Object.Spec.Stage != "Upgrade" { + Skip("IBU is not in Upgrade stage") + } + + _, err := ibu.WithStage("Prep").Update() + Expect(err.Error()).To(ContainSubstring("the stage transition is not permitted"), + "error: ibu seedimage updated with wrong next stage") + }) }) //nolint:funlen