fix tests

This commit is contained in:
Adrien Delorme 2020-10-06 11:48:24 +02:00
parent 5b3ff89cb0
commit 25d7e7ce17
1 changed files with 13 additions and 3 deletions

View File

@ -116,7 +116,7 @@ func TestAgentSetToFalse(t *testing.T) {
cfg["qemu_agent"] = false cfg["qemu_agent"] = false
var c Config var c Config
warn, err := c.Prepare(cfg) _, warn, err := c.Prepare(cfg)
if err != nil { if err != nil {
t.Fatal(err, warn) t.Fatal(err, warn)
} }
@ -159,7 +159,7 @@ func TestPacketQueueSupportForNetworkAdapters(t *testing.T) {
cfg["network_adapters"] = devices cfg["network_adapters"] = devices
var c Config var c Config
_, err := c.Prepare(cfg) _, _, err := c.Prepare(cfg)
if tt.expectedToFail == true && err == nil { if tt.expectedToFail == true && err == nil {
t.Error("expected config preparation to fail, but no error occured") t.Error("expected config preparation to fail, but no error occured")
@ -208,7 +208,7 @@ func TestHardDiskControllerIOThreadSupport(t *testing.T) {
cfg["scsi_controller"] = tt.controller cfg["scsi_controller"] = tt.controller
var c Config var c Config
_, err := c.Prepare(cfg) _, _, err := c.Prepare(cfg)
if tt.expectedToFail == true && err == nil { if tt.expectedToFail == true && err == nil {
t.Error("expected config preparation to fail, but no error occured") t.Error("expected config preparation to fail, but no error occured")
@ -219,3 +219,13 @@ func TestHardDiskControllerIOThreadSupport(t *testing.T) {
} }
} }
} }
func mandatoryConfig(t *testing.T) map[string]interface{} {
return map[string]interface{}{
"proxmox_url": "https://my-proxmox.my-domain:8006/api2/json",
"username": "apiuser@pve",
"password": "supersecret",
"node": "my-proxmox",
"ssh_username": "root",
}
}