| 12345678910111213141516171819 |
- package validator
- import (
- "testing"
- "nettool/internal/model"
- )
- func TestValidateAllowsStaticInterfaceWithoutIPv4Address(t *testing.T) {
- result := New().Validate(model.InterfaceConfig{
- Interface: "enp2s0",
- Dhcp4: false,
- Addresses: []model.InterfaceAddressConfig{},
- })
- if !result.Valid {
- t.Fatalf("expected configuration without IPv4 addresses to be valid, got errors: %v", result.Errors)
- }
- }
|