Skip to content

Commit

Permalink
fix nic creation without mac params
Browse files Browse the repository at this point in the history
The additional empty string check on the mac param is required here. If the mac param is not set, a mac for the nic will be generated anyway when testing against a real oVirt engine - and cause this assert func to fail (for example in TestVMNICCreation)

Co-authored-by: Michael Engel <[email protected]>
  • Loading branch information
Vatson112 and engelmi committed Nov 29, 2022
1 parent c879a79 commit 855f684
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ func assertCanCreateNIC(
t.Fatalf("VM ID mismatch between NIC and VM (%s != %s)", nic.VMID(), vm.ID())
}
if params != nil {
if nic.Mac() != params.Mac() {
t.Fatalf("Failed to create NIC with custom mac address: %s", nic.Mac())
if params.Mac() != "" && params.Mac() != nic.Mac() {
t.Fatalf("Failed to create NIC with custom mac address. Expected '%s', but created mac is '%s'", params.Mac(), nic.Mac())
}
}
return nic
Expand Down

0 comments on commit 855f684

Please sign in to comment.