@@ -2,6 +2,7 @@ package e2e
22
33import (
44 "encoding/json"
5+ "fmt"
56 "os"
67 "strings"
78 "testing"
@@ -452,6 +453,51 @@ func TestResetAndReinstall(t *testing.T) {
452453 t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
453454}
454455
456+ func TestOldVersionUpgrade (t * testing.T ) {
457+ t .Parallel ()
458+ tc := cluster .NewTestCluster (& cluster.Input {
459+ T : t ,
460+ Nodes : 1 ,
461+ Image : "ubuntu/jammy" ,
462+ })
463+ defer tc .Destroy ()
464+ t .Logf ("%s: downloading embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
465+ line := []string {"vandoor-prepare.sh" , fmt .Sprintf ("%s-pre-minio-removal" , os .Getenv ("SHORT_SHA" )), os .Getenv ("LICENSE_ID" )}
466+ if stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
467+ t .Log ("stdout:" , stdout )
468+ t .Log ("stderr:" , stderr )
469+ t .Fatalf ("fail to download embedded-cluster on node 0 %s: %v" , tc .Nodes [0 ], err )
470+ }
471+
472+ t .Logf ("%s: installing embedded-cluster on node 0" , time .Now ().Format (time .RFC3339 ))
473+ line = []string {"pre-minio-removal-install.sh" , "cli" }
474+ if stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line ); err != nil {
475+ t .Log ("install stdout:" , stdout )
476+ t .Log ("install stderr:" , stderr )
477+ t .Fatalf ("fail to install embedded-cluster on node %s: %v" , tc .Nodes [0 ], err )
478+ }
479+
480+ t .Logf ("%s: checking installation state" , time .Now ().Format (time .RFC3339 ))
481+ line = []string {"check-installation-state.sh" , fmt .Sprintf ("%s-pre-minio-removal" , os .Getenv ("SHORT_SHA" ))}
482+ stdout , stderr , err := RunCommandOnNode (t , tc , 0 , line )
483+ if err != nil {
484+ t .Log ("stdout:" , stdout )
485+ t .Log ("stderr:" , stderr )
486+ t .Fatalf ("fail to check installation state: %v" , err )
487+ }
488+
489+ t .Logf ("%s: checking installation state after upgrade" , time .Now ().Format (time .RFC3339 ))
490+ line = []string {"check-postupgrade-state.sh" , os .Getenv ("SHORT_SHA" )}
491+ stdout , stderr , err = RunCommandOnNode (t , tc , 0 , line )
492+ if err != nil {
493+ t .Log ("stdout:" , stdout )
494+ t .Log ("stderr:" , stderr )
495+ t .Fatalf ("fail to check postupgrade state: %v" , err )
496+ }
497+
498+ t .Logf ("%s: test complete" , time .Now ().Format (time .RFC3339 ))
499+ }
500+
455501func runPuppeteerAppStatusCheck (t * testing.T , node int , tc * cluster.Output ) {
456502 t .Logf ("%s: installing puppeteer on node %d" , time .Now ().Format (time .RFC3339 ), node )
457503 line := []string {"install-puppeteer.sh" }
0 commit comments