@@ -30,23 +30,14 @@ func TestSingleNodeInstallation(t *testing.T) {
3030 })
3131 defer tc .Destroy ()
3232 t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
33- line := []string {"single-node-install.sh" }
33+ line := []string {"single-node-install.sh" , "ui" }
3434 stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
3535 if err != nil {
3636 t .Log ("stdout:" , stdout )
3737 t .Log ("stderr:" , stderr )
3838 t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
3939 }
4040
41- t .Logf ("%s: checking installation state" , time .Now ().Format (time .RFC3339 ))
42- line = []string {"check-installation-state.sh" }
43- stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
44- if err != nil {
45- t .Log ("stdout:" , stdout )
46- t .Log ("stderr:" , stderr )
47- t .Fatalf ("fail to check installation state: %v" , err )
48- }
49-
5041 runPuppeteerAppStatusCheck (t , 0 , tc )
5142
5243 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
@@ -71,31 +62,32 @@ func TestSingleNodeInstallationRockyLinux8(t *testing.T) {
7162 EmbeddedClusterPath : "../output/bin/embedded-cluster" ,
7263 })
7364 defer tc .Destroy ()
74- t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
75- line := []string {"single-node-install.sh" }
65+
66+ t .Logf ("%s: installing tar" , time .Now ().Format (time .RFC3339 ))
67+ line := []string {"yum-install-tar.sh" }
7668 stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
7769 if err != nil {
7870 t .Log ("stdout:" , stdout )
7971 t .Log ("stderr:" , stderr )
80- t .Fatalf ("fail to install embedded-cluster on node %s : %v" , tc . Nodes [ 0 ] , err )
72+ t .Fatalf ("fail to check postupgrade state : %v" , err )
8173 }
8274
83- t .Logf ("%s: checking installation state " , time .Now ().Format (time .RFC3339 ))
84- line = []string {"check-installation-state .sh" }
75+ t .Logf ("%s: installing embedded-cluster on node 0 " , time .Now ().Format (time .RFC3339 ))
76+ line = []string {"single-node-install .sh" , "cli " }
8577 stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
8678 if err != nil {
8779 t .Log ("stdout:" , stdout )
8880 t .Log ("stderr:" , stderr )
89- t .Fatalf ("fail to check installation state : %v" , err )
81+ t .Fatalf ("fail to install embedded-cluster on node %s : %v" , tc . Nodes [ 0 ] , err )
9082 }
9183
92- t .Logf ("%s: installing tar " , time .Now ().Format (time .RFC3339 ))
93- line = []string {"yum-install-tar .sh" }
84+ t .Logf ("%s: checking installation state " , time .Now ().Format (time .RFC3339 ))
85+ line = []string {"check-installation-state .sh" , os . Getenv ( "SHORT_SHA" ) }
9486 stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
9587 if err != nil {
9688 t .Log ("stdout:" , stdout )
9789 t .Log ("stderr:" , stderr )
98- t .Fatalf ("fail to check postupgrade state: %v" , err )
90+ t .Fatalf ("fail to check installation state: %v" , err )
9991 }
10092
10193 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
@@ -132,7 +124,7 @@ func TestSingleNodeInstallationDebian12(t *testing.T) {
132124 }
133125
134126 t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
135- line := []string {"single-node-install.sh" }
127+ line := []string {"single-node-install.sh" , "cli" }
136128 stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
137129 if err != nil {
138130 t .Log ("stdout:" , stdout )
@@ -141,7 +133,7 @@ func TestSingleNodeInstallationDebian12(t *testing.T) {
141133 }
142134
143135 t .Logf ("%s: checking installation state" , time .Now ().Format (time .RFC3339 ))
144- line = []string {"check-installation-state.sh" }
136+ line = []string {"check-installation-state.sh" , os . Getenv ( "SHORT_SHA" ) }
145137 stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
146138 if err != nil {
147139 t .Log ("stdout:" , stdout )
@@ -171,31 +163,32 @@ func TestSingleNodeInstallationCentos8Stream(t *testing.T) {
171163 EmbeddedClusterPath : "../output/bin/embedded-cluster" ,
172164 })
173165 defer tc .Destroy ()
174- t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
175- line := []string {"single-node-install.sh" }
166+
167+ t .Logf ("%s: installing tar" , time .Now ().Format (time .RFC3339 ))
168+ line := []string {"yum-install-tar.sh" }
176169 stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
177170 if err != nil {
178171 t .Log ("stdout:" , stdout )
179172 t .Log ("stderr:" , stderr )
180- t .Fatalf ("fail to install embedded-cluster on node %s : %v" , tc . Nodes [ 0 ] , err )
173+ t .Fatalf ("fail to check postupgrade state : %v" , err )
181174 }
182175
183- t .Logf ("%s: checking installation state " , time .Now ().Format (time .RFC3339 ))
184- line = []string {"check-installation-state .sh" }
176+ t .Logf ("%s: installing embedded-cluster on node 0 " , time .Now ().Format (time .RFC3339 ))
177+ line = []string {"single-node-install .sh" , "cli " }
185178 stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
186179 if err != nil {
187180 t .Log ("stdout:" , stdout )
188181 t .Log ("stderr:" , stderr )
189- t .Fatalf ("fail to check installation state : %v" , err )
182+ t .Fatalf ("fail to install embedded-cluster on node %s : %v" , tc . Nodes [ 0 ] , err )
190183 }
191184
192- t .Logf ("%s: installing tar " , time .Now ().Format (time .RFC3339 ))
193- line = []string {"yum-install-tar .sh" }
185+ t .Logf ("%s: checking installation state " , time .Now ().Format (time .RFC3339 ))
186+ line = []string {"check-installation-state .sh" , os . Getenv ( "SHORT_SHA" ) }
194187 stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
195188 if err != nil {
196189 t .Log ("stdout:" , stdout )
197190 t .Log ("stderr:" , stderr )
198- t .Fatalf ("fail to check postupgrade state: %v" , err )
191+ t .Fatalf ("fail to check installation state: %v" , err )
199192 }
200193
201194 t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
@@ -257,27 +250,18 @@ func TestMultiNodeInstallation(t *testing.T) {
257250 // bootstrap the first node and makes sure it is healthy. also executes the kots
258251 // ssl certificate configuration (kurl-proxy).
259252 t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
260- if stdout , stderr , err := RunCommandOnNode (t , tc , 0 , []string {"single-node-install.sh" }); err != nil {
253+ if stdout , stderr , err := RunCommandOnNode (t , tc , 0 , []string {"single-node-install.sh" , "ui" }); err != nil {
261254 t .Logf ("stdout: %s\n stderr: %s" , stdout , stderr )
262255 t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
263256 }
264257
265- t .Logf ("%s: checking installation state" , time .Now ().Format (time .RFC3339 ))
266- line := []string {"check-installation-state.sh" }
267- stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
268- if err != nil {
269- t .Log ("stdout:" , stdout )
270- t .Log ("stderr:" , stderr )
271- t .Fatalf ("fail to check installation state: %v" , err )
272- }
273-
274258 runPuppeteerAppStatusCheck (t , 0 , tc )
275259
276260 // generate all node join commands (2 for controllers and 1 for worker).
277261 t .Logf ("%s: generating two new controller token commands" , time .Now ().Format (time .RFC3339 ))
278262 controllerCommands := []string {}
279263 for i := 0 ; i < 2 ; i ++ {
280- line = []string {"puppeteer.sh" , "generate-controller-join-token.js" , "10.0.0.2" }
264+ line : = []string {"puppeteer.sh" , "generate-controller-join-token.js" , "10.0.0.2" }
281265 stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
282266 if err != nil {
283267 t .Logf ("stdout: %s\n stderr: %s" , stdout , stderr )
@@ -295,8 +279,8 @@ func TestMultiNodeInstallation(t *testing.T) {
295279 t .Log ("controller join token command:" , command )
296280 }
297281 t .Logf ("%s: generating a new worker token command" , time .Now ().Format (time .RFC3339 ))
298- line = []string {"puppeteer.sh" , "generate-worker-join-token.js" , "10.0.0.2" }
299- stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
282+ line : = []string {"puppeteer.sh" , "generate-worker-join-token.js" , "10.0.0.2" }
283+ stdout , stderr , err : = RunCommandOnNode (t , tc , 0 , line )
300284 if err != nil {
301285 t .Logf ("stdout: %s\n stderr: %s" , stdout , stderr )
302286 t .Fatalf ("fail to generate controller join token: %s" , stdout )
@@ -384,15 +368,15 @@ func TestInstallFromReplicatedApp(t *testing.T) {
384368 }
385369
386370 t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
387- line = []string {"single-node-install.sh" }
371+ line = []string {"single-node-install.sh" , "cli" }
388372 if stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
389373 t .Log ("install stdout:" , stdout )
390374 t .Log ("install stderr:" , stderr )
391375 t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
392376 }
393377
394378 t .Logf ("%s: checking installation state" , time .Now ().Format (time .RFC3339 ))
395- line = []string {"check-installation-state.sh" }
379+ line = []string {"check-installation-state.sh" , os . Getenv ( "SHORT_SHA" ) }
396380 stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
397381 if err != nil {
398382 t .Log ("stdout:" , stdout )
@@ -423,15 +407,15 @@ func TestResetAndReinstall(t *testing.T) {
423407 })
424408 defer tc .Destroy ()
425409 t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
426- line := []string {"single-node-install.sh" }
410+ line := []string {"single-node-install.sh" , "cli" }
427411 if stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
428412 t .Log ("install stdout:" , stdout )
429413 t .Log ("install stderr:" , stderr )
430414 t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
431415 }
432416
433417 t .Logf ("%s: checking installation state" , time .Now ().Format (time .RFC3339 ))
434- line = []string {"check-installation-state.sh" }
418+ line = []string {"check-installation-state.sh" , os . Getenv ( "SHORT_SHA" ) }
435419 stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
436420 if err != nil {
437421 t .Log ("stdout:" , stdout )
@@ -449,15 +433,15 @@ func TestResetAndReinstall(t *testing.T) {
449433 }
450434
451435 t .Logf ("%s: installing embedded-cluster on node 0 after reset" , time .Now ().Format (time .RFC3339 ))
452- line = []string {"single-node-install.sh" }
436+ line = []string {"single-node-install.sh" , "cli" }
453437 if stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line ); err != nil {
454438 t .Log ("install stdout:" , stdout )
455439 t .Log ("install stderr:" , stderr )
456440 t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
457441 }
458442
459443 t .Logf ("%s: checking installation state after reinstall" , time .Now ().Format (time .RFC3339 ))
460- line = []string {"check-installation-state.sh" }
444+ line = []string {"check-installation-state.sh" , os . Getenv ( "SHORT_SHA" ) }
461445 stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
462446 if err != nil {
463447 t .Log ("stdout:" , stdout )
@@ -476,23 +460,21 @@ func runPuppeteerAppStatusCheck(t *testing.T, node int, tc *cluster.Output) {
476460 t .Log ("stderr:" , stderr )
477461 t .Fatalf ("fail to install puppeteer on node %s: %v" , tc .Nodes [0 ], err )
478462 }
479- t .Logf ("%s: accessing kotsadm interface and checking app and cluster state " , time .Now ().Format (time .RFC3339 ))
480- line = []string {"puppeteer.sh" , "check-app-and-cluster-status .js" , "10.0.0.2" }
463+ t .Logf ("%s: accessing kotsadm interface and deploying app" , time .Now ().Format (time .RFC3339 ))
464+ line = []string {"puppeteer.sh" , "deploy-kots-application .js" , "10.0.0.2" }
481465 stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
482466 if err != nil {
483467 t .Log ("stdout:" , stdout )
484468 t .Log ("stderr:" , stderr )
485469 t .Fatalf ("fail to access kotsadm interface and state: %v" , err )
486470 }
487- var r clusterStatusResponse
488- if err := json .Unmarshal ([]byte (stdout ), & r ); err != nil {
489- t .Log ("stdout:" , stdout )
490- t .Log ("stderr:" , stderr )
491- t .Fatalf ("fail to parse script response: %v" , err )
492- }
493- if r .App != "Ready" || r .Cluster != "Up to date" {
471+
472+ t .Logf ("%s: checking installation state after app deployment" , time .Now ().Format (time .RFC3339 ))
473+ line = []string {"check-installation-state.sh" , os .Getenv ("SHORT_SHA" )}
474+ stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
475+ if err != nil {
494476 t .Log ("stdout:" , stdout )
495477 t .Log ("stderr:" , stderr )
496- t .Fatalf ("cluster or app not ready : %s " , stdout )
478+ t .Fatalf ("fail to check installation state : %v " , err )
497479 }
498480}
0 commit comments