@@ -250,78 +250,6 @@ func TestUpgradeFromReplicatedAppPreviousK0s(t *testing.T) {
250250 t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
251251}
252252
253- func TestSingleNodeAirgapUpgrade (t * testing.T ) {
254- t .Parallel ()
255-
256- RequireEnvVars (t , []string {"SHORT_SHA" })
257-
258- tc := cmx .NewCluster (& cmx.ClusterInput {
259- T : t ,
260- Nodes : 1 ,
261- Distribution : "ubuntu" ,
262- Version : "22.04" ,
263- })
264- defer tc .Cleanup ()
265-
266- t .Logf ("%s: downloading airgap files on node 0" , time .Now ().Format (time .RFC3339 ))
267- // Previous stable EC version with a -1 minor k0s version
268- initialVersion := fmt .Sprintf ("appver-%s-previous-stable" , os .Getenv ("SHORT_SHA" ))
269- runInParallel (t ,
270- func (t * testing.T ) error {
271- return downloadAirgapBundleOnNode (t , tc , 0 , initialVersion , AirgapInstallBundlePath , AirgapLicenseID )
272- }, func (t * testing.T ) error {
273- return downloadAirgapBundleOnNode (t , tc , 0 , fmt .Sprintf ("appver-%s-upgrade" , os .Getenv ("SHORT_SHA" )), AirgapUpgradeBundlePath , AirgapLicenseID )
274- },
275- )
276-
277- t .Logf ("%s: airgapping cluster" , time .Now ().Format (time .RFC3339 ))
278- if err := tc .Airgap (); err != nil {
279- t .Fatalf ("failed to airgap cluster: %v" , err )
280- }
281-
282- t .Logf ("%s: preparing embedded cluster airgap files" , time .Now ().Format (time .RFC3339 ))
283- line := []string {"airgap-prepare.sh" }
284- if _ , _ , err := tc .RunCommandOnNode (0 , line ); err != nil {
285- t .Fatalf ("fail to prepare airgap files on node %s: %v" , tc .Nodes [0 ], err )
286- }
287-
288- installSingleNodeWithOptions (t , tc , installOptions {
289- isAirgap : true ,
290- version : initialVersion ,
291- localArtifactMirrorPort : "50001" , // choose an alternate lam port
292- })
293-
294- if stdout , stderr , err := tc .SetupPlaywrightAndRunTest ("deploy-app" ); err != nil {
295- t .Fatalf ("fail to run playwright test deploy-app: %v: %s: %s" , err , stdout , stderr )
296- }
297-
298- t .Logf ("%s: checking installation state after app deployment" , time .Now ().Format (time .RFC3339 ))
299- line = []string {"check-airgap-installation-state.sh" , initialVersion , k8sVersionPreviousStable ()}
300- if _ , _ , err := tc .RunCommandOnNode (0 , line ); err != nil {
301- t .Fatalf ("fail to check installation state: %v" , err )
302- }
303-
304- checkNodeJoinCommand (t , tc , 0 )
305-
306- t .Logf ("%s: running airgap update" , time .Now ().Format (time .RFC3339 ))
307- line = []string {"airgap-update.sh" }
308- if _ , _ , err := tc .RunCommandOnNode (0 , line ); err != nil {
309- t .Fatalf ("fail to run airgap update: %v" , err )
310- }
311-
312- appUpgradeVersion := fmt .Sprintf ("appver-%s-upgrade" , os .Getenv ("SHORT_SHA" ))
313- testArgs := []string {appUpgradeVersion }
314-
315- t .Logf ("%s: upgrading cluster" , time .Now ().Format (time .RFC3339 ))
316- if stdout , stderr , err := tc .RunPlaywrightTest ("deploy-upgrade" , testArgs ... ); err != nil {
317- t .Fatalf ("fail to run playwright test deploy-upgrade: %v: %s: %s" , err , stdout , stderr )
318- }
319-
320- checkPostUpgradeState (t , tc )
321-
322- t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
323- }
324-
325253func TestSingleNodeAirgapUpgradeSelinux (t * testing.T ) {
326254 t .Parallel ()
327255
@@ -601,135 +529,6 @@ func TestMultiNodeHAInstallation(t *testing.T) {
601529 t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
602530}
603531
604- // This test creates 4 airgap nodes, installs on the first one and then generate 2 join tokens
605- // for controllers and one join token for worker nodes. Joins the nodes as airgap HA and then waits
606- // for them to report ready. Runs additional high availability validations afterwards.
607- func TestMultiNodeAirgapHAInstallation (t * testing.T ) {
608- t .Parallel ()
609-
610- RequireEnvVars (t , []string {"SHORT_SHA" })
611-
612- tc := cmx .NewCluster (& cmx.ClusterInput {
613- T : t ,
614- Nodes : 4 ,
615- Distribution : "ubuntu" ,
616- Version : "22.04" ,
617- InstanceType : "r1.medium" ,
618- SupportBundleNodeIndex : 2 ,
619- })
620- defer tc .Cleanup ()
621-
622- t .Logf ("%s: downloading airgap files on nodes" , time .Now ().Format (time .RFC3339 ))
623- initialVersion := fmt .Sprintf ("appver-%s" , os .Getenv ("SHORT_SHA" ))
624- upgradeVersion := fmt .Sprintf ("appver-%s-upgrade" , os .Getenv ("SHORT_SHA" ))
625- runInParallel (t ,
626- func (t * testing.T ) error {
627- return downloadAirgapBundleOnNode (t , tc , 0 , initialVersion , AirgapInstallBundlePath , AirgapLicenseID )
628- },
629- func (t * testing.T ) error {
630- return downloadAirgapBundleOnNode (t , tc , 0 , upgradeVersion , AirgapUpgradeBundlePath , AirgapLicenseID )
631- },
632- )
633-
634- // install "expect" dependency on node 3 as that's where the HA join command will run.
635- t .Logf ("%s: installing expect package on node 3" , time .Now ().Format (time .RFC3339 ))
636- if stdout , stderr , err := tc .RunCommandOnNode (3 , []string {"apt-get" , "install" , "-y" , "expect" }); err != nil {
637- t .Fatalf ("fail to install expect package on node 3: %v: %s: %s" , err , stdout , stderr )
638- }
639-
640- t .Logf ("%s: airgapping cluster" , time .Now ().Format (time .RFC3339 ))
641- if err := tc .Airgap (); err != nil {
642- t .Fatalf ("failed to airgap cluster: %v" , err )
643- }
644-
645- t .Logf ("%s: preparing embedded cluster airgap files on node 0" , time .Now ().Format (time .RFC3339 ))
646- line := []string {"airgap-prepare.sh" }
647- if stdout , stderr , err := tc .RunCommandOnNode (0 , line ); err != nil {
648- t .Fatalf ("fail to prepare airgap files on node 0: %v: %s: %s" , err , stdout , stderr )
649- }
650-
651- installSingleNodeWithOptions (t , tc , installOptions {
652- isAirgap : true ,
653- })
654-
655- checkWorkerProfile (t , tc , 0 )
656-
657- if stdout , stderr , err := tc .SetupPlaywrightAndRunTest ("deploy-app" ); err != nil {
658- t .Fatalf ("fail to run playwright test deploy-app: %v: %s: %s" , err , stdout , stderr )
659- }
660-
661- t .Logf ("%s: checking installation state after app deployment" , time .Now ().Format (time .RFC3339 ))
662- line = []string {"check-airgap-installation-state.sh" , fmt .Sprintf ("appver-%s" , os .Getenv ("SHORT_SHA" )), k8sVersion ()}
663- if stdout , stderr , err := tc .RunCommandOnNode (0 , line ); err != nil {
664- t .Fatalf ("fail to check installation state: %v: %s: %s" , err , stdout , stderr )
665- }
666-
667- // join a worker
668- joinWorkerNode (t , tc , 1 )
669- checkWorkerProfile (t , tc , 1 )
670-
671- // join a controller
672- joinControllerNode (t , tc , 2 )
673- checkWorkerProfile (t , tc , 2 )
674-
675- // join another controller in HA mode
676- joinControllerNodeWithOptions (t , tc , 3 , joinOptions {isHA : true })
677- checkWorkerProfile (t , tc , 3 )
678-
679- // wait for the nodes to report as ready.
680- waitForNodes (t , tc , 4 , nil )
681-
682- t .Logf ("%s: checking installation state after enabling high availability" , time .Now ().Format (time .RFC3339 ))
683- line = []string {"check-airgap-post-ha-state.sh" , os .Getenv ("SHORT_SHA" ), k8sVersion ()}
684- if stdout , stderr , err := tc .RunCommandOnNode (0 , line ); err != nil {
685- t .Fatalf ("fail to check post ha state: %v: %s: %s" , err , stdout , stderr )
686- }
687-
688- t .Logf ("%s: running airgap update" , time .Now ().Format (time .RFC3339 ))
689- line = []string {"airgap-update.sh" }
690- if stdout , stderr , err := tc .RunCommandOnNode (0 , line ); err != nil {
691- t .Fatalf ("fail to run airgap update: %v: %s: %s" , err , stdout , stderr )
692- }
693-
694- appUpgradeVersion := fmt .Sprintf ("appver-%s-upgrade" , os .Getenv ("SHORT_SHA" ))
695- testArgs := []string {appUpgradeVersion }
696-
697- t .Logf ("%s: upgrading cluster" , time .Now ().Format (time .RFC3339 ))
698- if stdout , stderr , err := tc .RunPlaywrightTest ("deploy-upgrade" , testArgs ... ); err != nil {
699- t .Fatalf ("fail to run playwright test deploy-upgrade: %v: %s: %s" , err , stdout , stderr )
700- }
701-
702- checkPostUpgradeState (t , tc )
703-
704- stdout , stderr , err := resetInstallationWithError (t , tc , 0 , resetInstallationOptions {})
705- if err != nil {
706- t .Fatalf ("fail to reset the installation on node 0: %v: %s: %s" , err , stdout , stderr )
707- }
708- if ! strings .Contains (stdout , "High-availability is enabled and requires at least three controller-test nodes" ) {
709- t .Logf ("reset output does not contain the ha warning: stdout: %s\n stderr: %s" , stdout , stderr )
710- }
711-
712- stdout , stderr , err = tc .RunCommandOnNode (2 , []string {"check-nodes-removed.sh" , "3" })
713- if err != nil {
714- t .Fatalf ("fail to check nodes removed: %v: %s: %s" , err , stdout , stderr )
715- }
716-
717- t .Logf ("%s: checking nllb" , time .Now ().Format (time .RFC3339 ))
718- line = []string {"check-nllb.sh" }
719- if stdout , stderr , err := tc .RunCommandOnNode (2 , line ); err != nil {
720- t .Fatalf ("fail to check nllb: %v: %s: %s" , err , stdout , stderr )
721- }
722-
723- checkPostUpgradeStateWithOptions (t , tc , postUpgradeStateOptions {
724- node : 2 ,
725- withEnv : map [string ]string {
726- "ALLOW_PENDING_PODS" : "true" ,
727- },
728- })
729-
730- t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
731- }
732-
733532func TestSingleNodeInstallationNoopUpgrade (t * testing.T ) {
734533 t .Parallel ()
735534
0 commit comments