Skip to content

Commit 4ab3150

Browse files
committed
TestGetNetworkConfigDataForDevice_MissingIPAddress: flip logic
It's now ok to create an interface without an IP address and doing so should create a valid iface with no IPConfig
1 parent c0a53ee commit 4ab3150

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

internal/service/vmservice/bootstrap_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,18 +195,16 @@ func TestGetBootstrapData_MissingSecretValue(t *testing.T) {
195195
require.Nil(t, err)
196196
}
197197

198-
// TODO: Do we need to error on not having a pool?
199-
/*
200198
func TestGetNetworkConfigDataForDevice_MissingIPAddress(t *testing.T) {
201199
machineScope, _, _ := setupReconcilerTest(t)
202200
vm := newVMWithNets("virtio=A6:23:64:4D:84:CB,bridge=vmbr0")
203201
machineScope.SetVirtualMachine(vm)
204202

205203
cfg, err := getNetworkConfigDataForDevice(context.Background(), machineScope, "net0", nil)
206-
require.Error(t, err)
207-
require.Nil(t, cfg)
204+
require.NoError(t, err)
205+
require.Equal(t, cfg.MacAddress, "A6:23:64:4D:84:CB")
206+
require.Len(t, cfg.IPConfigs, 0)
208207
}
209-
*/
210208

211209
func TestGetNetworkConfigDataForDevice_MissingMACAddress(t *testing.T) {
212210
machineScope, _, _ := setupReconcilerTest(t)

0 commit comments

Comments
 (0)