@@ -30,23 +30,14 @@ func TestSingleNodeInstallation(t *testing.T) {
30
30
})
31
31
defer tc .Destroy ()
32
32
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" }
34
34
stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
35
35
if err != nil {
36
36
t .Log ("stdout:" , stdout )
37
37
t .Log ("stderr:" , stderr )
38
38
t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
39
39
}
40
40
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
-
50
41
runPuppeteerAppStatusCheck (t , 0 , tc )
51
42
52
43
t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
@@ -71,31 +62,32 @@ func TestSingleNodeInstallationRockyLinux8(t *testing.T) {
71
62
EmbeddedClusterPath : "../output/bin/embedded-cluster" ,
72
63
})
73
64
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" }
76
68
stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
77
69
if err != nil {
78
70
t .Log ("stdout:" , stdout )
79
71
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 )
81
73
}
82
74
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 " }
85
77
stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
86
78
if err != nil {
87
79
t .Log ("stdout:" , stdout )
88
80
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 )
90
82
}
91
83
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" ) }
94
86
stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
95
87
if err != nil {
96
88
t .Log ("stdout:" , stdout )
97
89
t .Log ("stderr:" , stderr )
98
- t .Fatalf ("fail to check postupgrade state: %v" , err )
90
+ t .Fatalf ("fail to check installation state: %v" , err )
99
91
}
100
92
101
93
t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
@@ -132,7 +124,7 @@ func TestSingleNodeInstallationDebian12(t *testing.T) {
132
124
}
133
125
134
126
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" }
136
128
stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
137
129
if err != nil {
138
130
t .Log ("stdout:" , stdout )
@@ -141,7 +133,7 @@ func TestSingleNodeInstallationDebian12(t *testing.T) {
141
133
}
142
134
143
135
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" ) }
145
137
stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
146
138
if err != nil {
147
139
t .Log ("stdout:" , stdout )
@@ -171,31 +163,32 @@ func TestSingleNodeInstallationCentos8Stream(t *testing.T) {
171
163
EmbeddedClusterPath : "../output/bin/embedded-cluster" ,
172
164
})
173
165
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" }
176
169
stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
177
170
if err != nil {
178
171
t .Log ("stdout:" , stdout )
179
172
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 )
181
174
}
182
175
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 " }
185
178
stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
186
179
if err != nil {
187
180
t .Log ("stdout:" , stdout )
188
181
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 )
190
183
}
191
184
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" ) }
194
187
stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
195
188
if err != nil {
196
189
t .Log ("stdout:" , stdout )
197
190
t .Log ("stderr:" , stderr )
198
- t .Fatalf ("fail to check postupgrade state: %v" , err )
191
+ t .Fatalf ("fail to check installation state: %v" , err )
199
192
}
200
193
201
194
t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
@@ -257,27 +250,18 @@ func TestMultiNodeInstallation(t *testing.T) {
257
250
// bootstrap the first node and makes sure it is healthy. also executes the kots
258
251
// ssl certificate configuration (kurl-proxy).
259
252
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 {
261
254
t .Logf ("stdout: %s\n stderr: %s" , stdout , stderr )
262
255
t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
263
256
}
264
257
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
-
274
258
runPuppeteerAppStatusCheck (t , 0 , tc )
275
259
276
260
// generate all node join commands (2 for controllers and 1 for worker).
277
261
t .Logf ("%s: generating two new controller token commands" , time .Now ().Format (time .RFC3339 ))
278
262
controllerCommands := []string {}
279
263
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" }
281
265
stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
282
266
if err != nil {
283
267
t .Logf ("stdout: %s\n stderr: %s" , stdout , stderr )
@@ -295,8 +279,8 @@ func TestMultiNodeInstallation(t *testing.T) {
295
279
t .Log ("controller join token command:" , command )
296
280
}
297
281
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 )
300
284
if err != nil {
301
285
t .Logf ("stdout: %s\n stderr: %s" , stdout , stderr )
302
286
t .Fatalf ("fail to generate controller join token: %s" , stdout )
@@ -384,15 +368,15 @@ func TestInstallFromReplicatedApp(t *testing.T) {
384
368
}
385
369
386
370
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" }
388
372
if stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
389
373
t .Log ("install stdout:" , stdout )
390
374
t .Log ("install stderr:" , stderr )
391
375
t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
392
376
}
393
377
394
378
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" ) }
396
380
stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
397
381
if err != nil {
398
382
t .Log ("stdout:" , stdout )
@@ -423,15 +407,15 @@ func TestResetAndReinstall(t *testing.T) {
423
407
})
424
408
defer tc .Destroy ()
425
409
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" }
427
411
if stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
428
412
t .Log ("install stdout:" , stdout )
429
413
t .Log ("install stderr:" , stderr )
430
414
t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
431
415
}
432
416
433
417
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" ) }
435
419
stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
436
420
if err != nil {
437
421
t .Log ("stdout:" , stdout )
@@ -449,15 +433,15 @@ func TestResetAndReinstall(t *testing.T) {
449
433
}
450
434
451
435
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" }
453
437
if stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line ); err != nil {
454
438
t .Log ("install stdout:" , stdout )
455
439
t .Log ("install stderr:" , stderr )
456
440
t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
457
441
}
458
442
459
443
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" ) }
461
445
stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
462
446
if err != nil {
463
447
t .Log ("stdout:" , stdout )
@@ -476,23 +460,21 @@ func runPuppeteerAppStatusCheck(t *testing.T, node int, tc *cluster.Output) {
476
460
t .Log ("stderr:" , stderr )
477
461
t .Fatalf ("fail to install puppeteer on node %s: %v" , tc .Nodes [0 ], err )
478
462
}
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" }
481
465
stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
482
466
if err != nil {
483
467
t .Log ("stdout:" , stdout )
484
468
t .Log ("stderr:" , stderr )
485
469
t .Fatalf ("fail to access kotsadm interface and state: %v" , err )
486
470
}
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 {
494
476
t .Log ("stdout:" , stdout )
495
477
t .Log ("stderr:" , stderr )
496
- t .Fatalf ("cluster or app not ready : %s " , stdout )
478
+ t .Fatalf ("fail to check installation state : %v " , err )
497
479
}
498
480
}
0 commit comments