@@ -1026,113 +1026,6 @@ func TestSingleNodeAirgapUpgrade(t *testing.T) {
10261026 t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
10271027}
10281028
1029- func TestSingleNodeAirgapUpgradeUmask (t * testing.T ) {
1030- t .Parallel ()
1031-
1032- RequireEnvVars (t , []string {"SHORT_SHA" , "AIRGAP_LICENSE_ID" })
1033-
1034- t .Logf ("%s: downloading airgap files" , time .Now ().Format (time .RFC3339 ))
1035- airgapInstallBundlePath := "/tmp/airgap-install-bundle.tar.gz"
1036- airgapUpgradeBundlePath := "/tmp/airgap-upgrade-bundle.tar.gz"
1037- initialVersion := fmt .Sprintf ("appver-%s-previous-k0s" , os .Getenv ("SHORT_SHA" ))
1038- runInParallel (t ,
1039- func (t * testing.T ) error {
1040- return downloadAirgapBundle (t , initialVersion , airgapInstallBundlePath , os .Getenv ("AIRGAP_LICENSE_ID" ))
1041- }, func (t * testing.T ) error {
1042- return downloadAirgapBundle (t , fmt .Sprintf ("appver-%s-upgrade" , os .Getenv ("SHORT_SHA" )), airgapUpgradeBundlePath , os .Getenv ("AIRGAP_LICENSE_ID" ))
1043- },
1044- )
1045-
1046- tc := lxd .NewCluster (& lxd.ClusterInput {
1047- T : t ,
1048- Nodes : 1 ,
1049- Image : "debian/12" ,
1050- WithProxy : true ,
1051- AirgapInstallBundlePath : airgapInstallBundlePath ,
1052- AirgapUpgradeBundlePath : airgapUpgradeBundlePath ,
1053- })
1054- defer tc .Cleanup ()
1055-
1056- // delete airgap bundles once they've been copied to the nodes
1057- if err := os .Remove (airgapInstallBundlePath ); err != nil {
1058- t .Logf ("failed to remove airgap install bundle: %v" , err )
1059- }
1060- if err := os .Remove (airgapUpgradeBundlePath ); err != nil {
1061- t .Logf ("failed to remove airgap upgrade bundle: %v" , err )
1062- }
1063-
1064- // install "curl" dependency on node 0 for app version checks.
1065- tc .InstallTestDependenciesDebian (t , 0 , true )
1066-
1067- stdout , stderr , err := tc .RunCommandOnNode (0 , []string {"echo" , "'umask 0077'" , ">>" , "/etc/profile" })
1068- if err != nil {
1069- t .Fatalf ("failed to set umask on node 0: %v" , err )
1070- }
1071- t .Logf ("set umask stdout: %s" , stdout )
1072- t .Logf ("stderr: %s" , stderr )
1073-
1074- stdout , stderr , err = tc .RunCommandOnNode (0 , []string {"bash" , "-c" , "umask" })
1075- if err != nil {
1076- t .Fatalf ("failed to check umask on node 0: %v" , err )
1077- }
1078- t .Logf ("check umask stdout: %s" , stdout )
1079- t .Logf ("stderr: %s" , stderr )
1080-
1081- t .Logf ("%s: preparing embedded cluster airgap files" , time .Now ().Format (time .RFC3339 ))
1082- line := []string {"airgap-prepare.sh" }
1083- if _ , _ , err := tc .RunCommandOnNode (0 , line ); err != nil {
1084- t .Fatalf ("fail to prepare airgap files on node %s: %v" , tc .Nodes [0 ], err )
1085- }
1086-
1087- t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
1088- line = []string {"single-node-airgap-install.sh" , initialVersion , "--local-artifact-mirror-port" , "50001" } // choose an alternate lam port
1089- if _ , _ , err := tc .RunCommandOnNode (0 , line ); err != nil {
1090- t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
1091- }
1092- // remove the airgap bundle after installation
1093- line = []string {"rm" , "/assets/release.airgap" }
1094- if _ , _ , err := tc .RunCommandOnNode (0 , line ); err != nil {
1095- t .Fatalf ("fail to remove airgap bundle on node %s: %v" , tc .Nodes [0 ], err )
1096- }
1097-
1098- if _ , _ , err := tc .SetupPlaywrightAndRunTest ("deploy-app" ); err != nil {
1099- t .Fatalf ("fail to run playwright test deploy-app: %v" , err )
1100- }
1101-
1102- t .Logf ("%s: checking installation state after app deployment" , time .Now ().Format (time .RFC3339 ))
1103- line = []string {"check-airgap-installation-state.sh" , initialVersion , k8sVersionPrevious ()}
1104- if _ , _ , err := tc .RunCommandOnNode (0 , line ); err != nil {
1105- t .Fatalf ("fail to check installation state: %v" , err )
1106- }
1107-
1108- t .Logf ("%s: running airgap update" , time .Now ().Format (time .RFC3339 ))
1109- line = []string {"airgap-update.sh" }
1110- if _ , _ , err := tc .RunCommandOnNode (0 , line ); err != nil {
1111- t .Fatalf ("fail to run airgap update: %v" , err )
1112- }
1113- // remove the airgap bundle after upgrade
1114- line = []string {"rm" , "/assets/upgrade/release.airgap" }
1115- if _ , _ , err := tc .RunCommandOnNode (0 , line ); err != nil {
1116- t .Fatalf ("fail to remove airgap bundle on node %s: %v" , tc .Nodes [0 ], err )
1117- }
1118-
1119- appUpgradeVersion := fmt .Sprintf ("appver-%s-upgrade" , os .Getenv ("SHORT_SHA" ))
1120- testArgs := []string {appUpgradeVersion }
1121-
1122- t .Logf ("%s: upgrading cluster" , time .Now ().Format (time .RFC3339 ))
1123- if _ , _ , err := tc .RunPlaywrightTest ("deploy-upgrade" , testArgs ... ); err != nil {
1124- t .Fatalf ("fail to run playwright test deploy-app: %v" , err )
1125- }
1126-
1127- t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
1128- line = []string {"check-postupgrade-state.sh" , k8sVersion (), ecUpgradeTargetVersion ()}
1129- if _ , _ , err := tc .RunCommandOnNode (0 , line ); err != nil {
1130- t .Fatalf ("fail to check postupgrade state: %v" , err )
1131- }
1132-
1133- t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
1134- }
1135-
11361029func TestSingleNodeAirgapUpgradeCustomCIDR (t * testing.T ) {
11371030 t .Parallel ()
11381031
0 commit comments