@@ -48,7 +48,7 @@ func TestSingleNodeInstallation(t *testing.T) {
4848 }
4949
5050 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
51- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
51+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
5252 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
5353 t .Fatalf ("fail to check postupgrade state: %v" , err )
5454 }
@@ -104,7 +104,7 @@ func TestSingleNodeInstallationAlmaLinux8(t *testing.T) {
104104 }
105105
106106 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
107- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
107+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
108108 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
109109 t .Fatalf ("fail to check postupgrade state: %v" , err )
110110 }
@@ -164,7 +164,7 @@ func TestSingleNodeInstallationDebian12(t *testing.T) {
164164 }
165165
166166 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
167- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
167+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
168168 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
169169 t .Fatalf ("fail to check postupgrade state: %v" , err )
170170 }
@@ -224,7 +224,7 @@ func TestSingleNodeInstallationDebian11(t *testing.T) {
224224 }
225225
226226 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
227- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
227+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
228228 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
229229 t .Fatalf ("fail to check postupgrade state: %v" , err )
230230 }
@@ -280,7 +280,7 @@ func TestSingleNodeInstallationCentos9Stream(t *testing.T) {
280280 }
281281
282282 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
283- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
283+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
284284 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
285285 t .Fatalf ("fail to check postupgrade state: %v" , err )
286286 }
@@ -499,7 +499,61 @@ func TestInstallFromReplicatedApp(t *testing.T) {
499499 }
500500
501501 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
502- line = []string {"check-postupgrade-state.sh" , os .Getenv ("SHORT_SHA" )}
502+ line = []string {"check-postupgrade-state.sh" , k8sVersion ()}
503+ if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
504+ t .Fatalf ("fail to check postupgrade state: %v" , err )
505+ }
506+
507+ t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
508+ }
509+
510+ func TestUpgradeFromReplicatedApp (t * testing.T ) {
511+ t .Parallel ()
512+
513+ RequireEnvVars (t , []string {"SHORT_SHA" })
514+
515+ tc := cluster .NewTestCluster (& cluster.Input {
516+ T : t ,
517+ Nodes : 1 ,
518+ Image : "debian/12" ,
519+ })
520+ defer cleanupCluster (t , tc )
521+
522+ t .Logf ("%s: downloading embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
523+ line := []string {"vandoor-prepare.sh" , fmt .Sprintf ("%s-previous-k0s" , os .Getenv ("SHORT_SHA" )), os .Getenv ("LICENSE_ID" ), "false" }
524+ if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
525+ t .Fatalf ("fail to download embedded-cluster on node 0 %s: %v" , tc .Nodes [0 ], err )
526+ }
527+
528+ t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
529+ line = []string {"single-node-install.sh" , "ui" }
530+ if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
531+ t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
532+ }
533+
534+ if err := setupPlaywright (t , tc ); err != nil {
535+ t .Fatalf ("fail to setup playwright: %v" , err )
536+ }
537+ if _ , _ , err := runPlaywrightTest (t , tc , "deploy-app" ); err != nil {
538+ t .Fatalf ("fail to run playwright test deploy-app: %v" , err )
539+ }
540+
541+ t .Logf ("%s: checking installation state" , time .Now ().Format (time .RFC3339 ))
542+ line = []string {"check-installation-state.sh" , fmt .Sprintf ("%s-previous-k0s" , os .Getenv ("SHORT_SHA" ))}
543+ if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
544+ t .Fatalf ("fail to check installation state: %v" , err )
545+ }
546+
547+ appUpgradeVersion := fmt .Sprintf ("appver-%s-upgrade" , os .Getenv ("SHORT_SHA" ))
548+ testArgs := []string {appUpgradeVersion }
549+
550+ t .Logf ("%s: upgrading cluster" , time .Now ().Format (time .RFC3339 ))
551+ if _ , _ , err := runPlaywrightTest (t , tc , "deploy-upgrade" , testArgs ... ); err != nil {
552+ t .Fatalf ("fail to run playwright test deploy-app: %v" , err )
553+ }
554+
555+ t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
556+ line = []string {"check-postupgrade-state.sh" , k8sVersion ()}
503557 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
504558 t .Fatalf ("fail to check postupgrade state: %v" , err )
505559 }
@@ -653,7 +707,7 @@ func TestOldVersionUpgrade(t *testing.T) {
653707 }
654708
655709 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
656- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
710+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
657711 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
658712 t .Fatalf ("fail to check postupgrade state: %v" , err )
659713 }
@@ -763,7 +817,7 @@ func TestSingleNodeAirgapUpgrade(t *testing.T) {
763817 }
764818
765819 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
766- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
820+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
767821 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
768822 t .Fatalf ("fail to check postupgrade state: %v" , err )
769823 }
@@ -875,7 +929,7 @@ func TestSingleNodeAirgapUpgradeCustomCIDR(t *testing.T) {
875929 }
876930
877931 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
878- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
932+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
879933 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
880934 t .Fatalf ("fail to check postupgrade state: %v" , err )
881935 }
@@ -1055,7 +1109,7 @@ func TestMultiNodeAirgapUpgradeSameK0s(t *testing.T) {
10551109 }
10561110
10571111 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
1058- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
1112+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
10591113 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
10601114 t .Fatalf ("fail to check postupgrade state: %v" , err )
10611115 }
@@ -1219,7 +1273,7 @@ func TestMultiNodeAirgapUpgrade(t *testing.T) {
12191273 }
12201274
12211275 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
1222- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
1276+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
12231277 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
12241278 t .Fatalf ("fail to check postupgrade state: %v" , err )
12251279 }
@@ -1334,7 +1388,7 @@ func TestMultiNodeHAInstallation(t *testing.T) {
13341388 }
13351389
13361390 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
1337- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
1391+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
13381392 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
13391393 t .Fatalf ("fail to check postupgrade state: %v" , err )
13401394 }
@@ -1546,7 +1600,7 @@ func TestMultiNodeAirgapHAInstallation(t *testing.T) {
15461600 }
15471601
15481602 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
1549- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
1603+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
15501604 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
15511605 t .Fatalf ("fail to check postupgrade state: %v" , err )
15521606 }
@@ -1606,7 +1660,7 @@ func TestInstallSnapshotFromReplicatedApp(t *testing.T) {
16061660 }
16071661
16081662 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
1609- line = []string {"check-postupgrade-state.sh" , os . Getenv ( "SHORT_SHA" )}
1663+ line = []string {"check-postupgrade-state.sh" , k8sVersion ( )}
16101664 if _ , _ , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
16111665 t .Fatalf ("fail to check postupgrade state: %v" , err )
16121666 }
0 commit comments