Explorar el Código

Adding test for new attribute defaults

adantop hace 2 años
padre
commit
0a43b55d53
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      authority/provisioner/gcp_test.go

+ 9 - 0
authority/provisioner/gcp_test.go

@@ -186,6 +186,7 @@ func TestGCP_Init(t *testing.T) {
 		args    args
 		wantErr bool
 	}{
+		{"ok", fields{"GCP", "name", nil, zero, nil}, args{config, srv.URL}, false},
 		{"ok", fields{"GCP", "name", nil, zero, nil}, args{config, srv.URL}, false},
 		{"ok", fields{"GCP", "name", []string{"service-account"}, zero, nil}, args{config, srv.URL}, false},
 		{"ok", fields{"GCP", "name", []string{"service-account"}, Duration{Duration: 1 * time.Minute}, nil}, args{config, srv.URL}, false},
@@ -211,6 +212,14 @@ func TestGCP_Init(t *testing.T) {
 			if err := p.Init(tt.args.config); (err != nil) != tt.wantErr {
 				t.Errorf("GCP.Init() error = %v, wantErr %v", err, tt.wantErr)
 			}
+
+			if p.EnableSSHCAUser {
+				t.Errorf("By default EnableSSHCAUser should be false")
+			}
+
+			if p.DisableSSHCAHost {
+				t.Errorf("By default DisableSSHCAHost should be false")
+			}
 		})
 	}
 }