@@ -33,6 +33,10 @@ const (
3333 // AppDefaultCloudConfig is a default cloud-init configuration for the VM which just
3434 // enables ssh password authentication and sets the password to "passw0rd".
3535 AppDefaultCloudConfig = "#cloud-config\n password: " + AppDefaultSSHPass + "\n chpasswd: { expire: False }\n ssh_pwauth: True\n "
36+ // Ubuntu2204 indicates the version of Ubuntu 22.04
37+ Ubuntu2204 = "22.04"
38+ // Ubuntu2004 indicates the version of Ubuntu 20.04
39+ Ubuntu2004 = "20.04"
3640)
3741
3842var (
4650 os : "ubuntu-server-cloudimg-amd64" ,
4751 version : "22.04" ,
4852 }
53+ ubuntu2004 = fixedAppInstanceConfig {
54+ appLink : "https://cloud-images.ubuntu.com/releases/20.04/release/ubuntu-20.04-server-cloudimg-amd64.img" ,
55+ sshPort : "8027" ,
56+ sshUser : AppDefaultSSHUser ,
57+ sshPass : AppDefaultSSHPass ,
58+ os : "ubuntu-server-cloudimg-amd64" ,
59+ version : Ubuntu2004 ,
60+ }
4961)
5062
5163type fixedAppInstanceConfig struct {
@@ -578,10 +590,30 @@ func (node *EveNode) LogTimeInfof(format string, args ...interface{}) {
578590 }
579591}
580592
593+ func (node * EveNode ) LogTimeErrorf (format string , args ... interface {}) {
594+ out := utils .AddTimestampf (format + "\n " , args ... )
595+ if node .t != nil {
596+ node .t .Fail ()
597+ node .t .Logf (out )
598+ } else {
599+ fmt .Print (out )
600+ }
601+ }
602+
581603func (node * EveNode ) SetTesting (t * testing.T ) {
582604 node .t = t
583605}
584606
607+ func (node * EveNode ) TestFailed () bool {
608+ if node .t == nil {
609+ return node .t .Failed ()
610+ }
611+
612+ fmt .Printf ("TestFailed called when t is nil\n " )
613+ os .Exit (1 )
614+ return false
615+ }
616+
585617func (node * EveNode ) discoverEveIP () error {
586618 if node .edgenode .GetRemoteAddr () == "" {
587619 eveIPCIDR , err := node .tc .GetState (node .edgenode ).LookUp ("Dinfo.Network[0].IPAddrs[0]" )
0 commit comments