-
Notifications
You must be signed in to change notification settings - Fork 20
/
nic_update_test.go
35 lines (31 loc) · 983 Bytes
/
nic_update_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package ovirtclient_test
import (
"fmt"
"testing"
ovirtclient "github.com/ovirt/go-ovirt-client/v3"
)
func TestVMNICUpdate(t *testing.T) {
t.Parallel()
helper := getHelper(t)
vm := assertCanCreateVM(
t,
helper,
fmt.Sprintf("nic_test_%s", helper.GenerateRandomID(5)),
ovirtclient.CreateVMParams(),
)
assertNICCount(t, vm, 0)
nic := assertCanCreateNIC(
t,
helper,
vm,
fmt.Sprintf("test-%s", helper.GenerateRandomID(5)),
ovirtclient.CreateNICParams(),
)
nic = assertCanUpdateNICName(t, nic, fmt.Sprintf("test-%s", helper.GenerateRandomID(5)))
vnicProfile := assertCanCreateVNICProfile(t, helper)
nic = assertCanUpdateNICVNICProfile(t, nic, vnicProfile.ID())
nic = assertCanUpdateNICMac(t, nic, "a1:b2:c3:d4:e5:f6")
_ = assertCantUpdateNICMac(t, nic, "invalid mac address")
// Go back to the original VNIC profile ID to make sure we don't block deleting the test VNIC profile.
_ = assertCanUpdateNICVNICProfile(t, nic, helper.GetVNICProfileID())
}