use alternate vsphere account in tests

This commit is contained in:
Michael Kuzmin 2018-12-03 20:10:48 +03:00
parent 1b1ef09706
commit b107245aed
2 changed files with 23 additions and 4 deletions

View File

@ -7,6 +7,7 @@ import (
"github.com/jetbrains-infra/packer-builder-vsphere/common"
"github.com/jetbrains-infra/packer-builder-vsphere/driver"
"math/rand"
"os"
"testing"
"time"
)
@ -33,10 +34,19 @@ func RenderConfig(config map[string]interface{}) string {
}
func TestConn(t *testing.T) *driver.Driver {
username := os.Getenv("VSPHERE_USERNAME")
if username == "" {
username = "root"
}
password := os.Getenv("VSPHERE_PASSWORD")
if password == "" {
password = "jetbrains"
}
d, err := driver.NewDriver(&driver.ConnectConfig{
VCenterServer: "vcenter.vsphere65.test",
Username: "root",
Password: "jetbrains",
Username: username,
Password: password,
InsecureConnection: true,
})
if err != nil {

View File

@ -381,10 +381,19 @@ func TestISOBuilderAcc_full(t *testing.T) {
}
func fullConfig() map[string]interface{} {
username := os.Getenv("VSPHERE_USERNAME")
if username == "" {
username = "root"
}
password := os.Getenv("VSPHERE_PASSWORD")
if password == "" {
password = "jetbrains"
}
config := map[string]interface{}{
"vcenter_server": "vcenter.vsphere65.test",
"username": "root",
"password": "jetbrains",
"username": username,
"password": password,
"insecure_connection": true,
"vm_name": commonT.NewVMName(),