mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Added a few checks to the CIDR Subset checking util
This commit is contained in:
@@ -175,6 +175,23 @@ func TestCIDRUtil_Subset(t *testing.T) {
|
||||
if subset {
|
||||
t.Fatalf("expected CIDR %q to not be a subset of CIDR %q", cidr2, cidr1)
|
||||
}
|
||||
|
||||
cidr1 = "192.168.0.128/25"
|
||||
cidr2 = "192.168.0.0/24"
|
||||
subset, err = Subset(cidr1, cidr2)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if subset {
|
||||
t.Fatalf("expected CIDR %q to not be a subset of CIDR %q", cidr2, cidr1)
|
||||
}
|
||||
subset, err = Subset(cidr2, cidr1)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !subset {
|
||||
t.Fatal("expected CIDR %q to be a subset of CIDR %q", cidr1, cidr2)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCIDRUtil_SubsetBlocks(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user