summaryrefslogtreecommitdiff
path: root/keama/tests
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2017-04-27 10:38:23 +0200
committerFrancis Dupont <fdupont@isc.org>2019-11-12 09:57:37 +0100
commitbb6b7624c33d545140ba8a81bda81d152f3543aa (patch)
tree4d5a9bf3bfce49091852ba03769e067592ab9b0e /keama/tests
parent2fb8cbf54b054932783fc5804c9ec028a94d3ca5 (diff)
downloadisc-dhcp-bb6b7624c33d545140ba8a81bda81d152f3543aa.tar.gz
Checkpoint (finishing 2nd pass)
Diffstat (limited to 'keama/tests')
-rw-r--r--keama/tests/#{#66
-rw-r--r--keama/tests/class4.in414
-rw-r--r--keama/tests/class4.out37
-rw-r--r--keama/tests/class4empty.in48
-rw-r--r--keama/tests/class4empty.out12
-rw-r--r--keama/tests/class6.in614
-rw-r--r--keama/tests/class6.out37
-rw-r--r--keama/tests/class6empty.in68
-rw-r--r--keama/tests/class6empty.out12
-rw-r--r--keama/tests/classbadmatch.err10
-rw-r--r--keama/tests/classbadmatch.msg1
-rw-r--r--keama/tests/classbadmatchif.err10
-rw-r--r--keama/tests/classbadmatchif.msg1
-rw-r--r--keama/tests/empty.err0
-rw-r--r--keama/tests/empty.msg1
-rw-r--r--keama/tests/hostuid4.out2
-rw-r--r--keama/tests/noauth.msg1
-rw-r--r--keama/tests/noauth4.err4 (renamed from keama/tests/noauth.err)4
-rw-r--r--keama/tests/noauth4.msg1
-rw-r--r--keama/tests/noauth6.err66
-rw-r--r--keama/tests/noauth6.msg1
-rw-r--r--keama/tests/optdatagrouppool4.out2
-rw-r--r--keama/tests/optiondatapool4.out18
-rw-r--r--keama/tests/optiondatapool6.out2
-rw-r--r--keama/tests/permitauth4.out2
-rw-r--r--keama/tests/permitauth6.out2
-rw-r--r--keama/tests/pool4.out18
-rw-r--r--keama/tests/pool42.in418
-rw-r--r--keama/tests/pool42.out38
-rw-r--r--keama/tests/pool6.out8
-rw-r--r--keama/tests/prefix6.in6 (renamed from keama/tests/prefix.in6)0
-rw-r--r--keama/tests/prefix6.out (renamed from keama/tests/prefix.out)2
-rw-r--r--keama/tests/prefix62.in6 (renamed from keama/tests/prefix2.in6)1
-rw-r--r--keama/tests/prefix62.out (renamed from keama/tests/prefix2.out)10
-rw-r--r--keama/tests/range4.out2
-rw-r--r--keama/tests/range6.in61
-rw-r--r--keama/tests/range6.out10
-rw-r--r--keama/tests/subnet4.out2
-rw-r--r--keama/tests/subnet4auth.in421
-rw-r--r--keama/tests/subnet4auth.out31
-rw-r--r--keama/tests/subnet4noauth.in420
-rw-r--r--keama/tests/subnet4noauth.out38
-rw-r--r--keama/tests/subnet6.in61
-rw-r--r--keama/tests/subnet6.out6
-rw-r--r--keama/tests/subnet6auth.in624
-rw-r--r--keama/tests/subnet6auth.out41
-rw-r--r--keama/tests/subnet6multi.in622
-rw-r--r--keama/tests/subnet6multi.out47
-rw-r--r--keama/tests/subnet6noauth.in621
-rw-r--r--keama/tests/subnet6noauth.out40
-rw-r--r--keama/tests/subnet6one.in621
-rw-r--r--keama/tests/subnet6one.out43
-rw-r--r--keama/tests/temporary6.in6 (renamed from keama/tests/temporary.in6)0
-rw-r--r--keama/tests/temporary6.out (renamed from keama/tests/temporary.out)2
-rw-r--r--keama/tests/{36
55 files changed, 765 insertions, 31 deletions
diff --git a/keama/tests/#{# b/keama/tests/#{#
new file mode 100644
index 00000000..f748b166
--- /dev/null
+++ b/keama/tests/#{#
@@ -0,0 +1,66 @@
+ # DHCPv6 prefix config
+ # authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
+ "Dhcp6": {
+ "subnet6": [
+ # subnet declaration
+ {
+ "subnet": "2001::/64",
+ "option-data": [
+ # range declaration
+ {
+ "space": "dhcp6",
+ "name": "domain-search",
+ "code": 24,
+ "data": "example.com, example.org"
+ }
+ ],
+ "valid-lifetime": 1800,
+ "pd-pools": [
+ {
+ "prefix": "2001:0:0:10::",
+ "delegated-len": 64,
+ "prefix-len": 60
+ }
+ ]
+ }
+ ]
+ }
+ }
+ n# DHCPv6 subnet declaration config
+ # authoritative is mandatory
+ "Dhcp6": {
+ "valid-lifetime": 1800,
+ "subnet6": [
+ # DHCPv4 subnet declaration
+ {
+ "subnet": "2001::/64",
+ "pd-pools": [
+ # at least one pool is required
+ {
+ "prefix": "2001:0:0:10::",
+ "delegated-len": 64,
+ "prefix-len": 60
+ }
+ ],
+ "pools": [
+ # at least one pool is required
+ {
+ # the pool is shared between addresses and prefixes
+ "pool": "2001::100 - 2001::200"
+ }
+ ],
+ "option-data": [
+ {
+ "space": "dhcp6",
+ "name": "domain-search",
+ "code": 24,
+ "data": "example.com, example.org"
+ }
+ ],
+ "valid-lifetime": 3600
+ }
+ ]
+ }
+}
diff --git a/keama/tests/class4.in4 b/keama/tests/class4.in4
new file mode 100644
index 00000000..75ec0057
--- /dev/null
+++ b/keama/tests/class4.in4
@@ -0,0 +1,14 @@
+# class declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# options
+option mysystem code 250 = text;
+option myversion code 251 = unsigned integer 16;
+
+# class declaration
+class "foobar" {
+ match if option mysystem = "version1";
+ option myversion 1;
+}
diff --git a/keama/tests/class4.out b/keama/tests/class4.out
new file mode 100644
index 00000000..b1b4f37b
--- /dev/null
+++ b/keama/tests/class4.out
@@ -0,0 +1,37 @@
+{
+ # class declaration config
+ # authoritative is mandatory
+ "Dhcp4": {
+ "option-def": [
+ # options
+ {
+ "space": "dhcp4",
+ "name": "mysystem",
+ "code": 250,
+ "type": "string"
+ },
+ {
+ "space": "dhcp4",
+ "name": "myversion",
+ "code": 251,
+ "type": "uint16"
+ }
+ ],
+ "client-classes": [
+ # class declaration
+ {
+ "name": "foobar",
+ /// from: match if (option dhcp.mysystem) = 'version1'
+ "test": "option[250].hex == 'version1'",
+ "option-data": [
+ {
+ "space": "dhcp4",
+ "name": "myversion",
+ "code": 251,
+ "data": "1"
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/keama/tests/class4empty.in4 b/keama/tests/class4empty.in4
new file mode 100644
index 00000000..d56984be
--- /dev/null
+++ b/keama/tests/class4empty.in4
@@ -0,0 +1,8 @@
+# void class declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# class declaration
+class "foobar" {
+}
diff --git a/keama/tests/class4empty.out b/keama/tests/class4empty.out
new file mode 100644
index 00000000..ad44aefc
--- /dev/null
+++ b/keama/tests/class4empty.out
@@ -0,0 +1,12 @@
+{
+ # void class declaration config
+ # authoritative is mandatory
+ "Dhcp4": {
+ "client-classes": [
+ # class declaration
+ {
+ "name": "foobar"
+ }
+ ]
+ }
+}
diff --git a/keama/tests/class6.in6 b/keama/tests/class6.in6
new file mode 100644
index 00000000..0052642c
--- /dev/null
+++ b/keama/tests/class6.in6
@@ -0,0 +1,14 @@
+# class declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# options
+option dhcp6.mysystem code 1250 = text;
+option dhcp6.myversion code 1251 = unsigned integer 16;
+
+# class declaration
+class "foobar" {
+ match if option dhcp6.mysystem = "version1";
+ option dhcp6.myversion 1;
+}
diff --git a/keama/tests/class6.out b/keama/tests/class6.out
new file mode 100644
index 00000000..2f66346c
--- /dev/null
+++ b/keama/tests/class6.out
@@ -0,0 +1,37 @@
+{
+ # class declaration config
+ # authoritative is mandatory
+ "Dhcp6": {
+ "option-def": [
+ # options
+ {
+ "space": "dhcp6",
+ "name": "mysystem",
+ "code": 1250,
+ "type": "string"
+ },
+ {
+ "space": "dhcp6",
+ "name": "myversion",
+ "code": 1251,
+ "type": "uint16"
+ }
+ ],
+ "client-classes": [
+ # class declaration
+ {
+ "name": "foobar",
+ /// from: match if (option dhcp6.mysystem) = 'version1'
+ "test": "option[1250].hex == 'version1'",
+ "option-data": [
+ {
+ "space": "dhcp6",
+ "name": "myversion",
+ "code": 1251,
+ "data": "1"
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/keama/tests/class6empty.in6 b/keama/tests/class6empty.in6
new file mode 100644
index 00000000..d56984be
--- /dev/null
+++ b/keama/tests/class6empty.in6
@@ -0,0 +1,8 @@
+# void class declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# class declaration
+class "foobar" {
+}
diff --git a/keama/tests/class6empty.out b/keama/tests/class6empty.out
new file mode 100644
index 00000000..36f6a70e
--- /dev/null
+++ b/keama/tests/class6empty.out
@@ -0,0 +1,12 @@
+{
+ # void class declaration config
+ # authoritative is mandatory
+ "Dhcp6": {
+ "client-classes": [
+ # class declaration
+ {
+ "name": "foobar"
+ }
+ ]
+ }
+}
diff --git a/keama/tests/classbadmatch.err b/keama/tests/classbadmatch.err
new file mode 100644
index 00000000..74768a6b
--- /dev/null
+++ b/keama/tests/classbadmatch.err
@@ -0,0 +1,10 @@
+# bad (match with a boolean expression) class declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# class declaration
+class "foobar" {
+ match option server.duplicates = 0;
+ default-lease-time 1800;
+}
diff --git a/keama/tests/classbadmatch.msg b/keama/tests/classbadmatch.msg
new file mode 100644
index 00000000..73f6ce7e
--- /dev/null
+++ b/keama/tests/classbadmatch.msg
@@ -0,0 +1 @@
+classbadmatch.err line 8: Expecting a data expression.
diff --git a/keama/tests/classbadmatchif.err b/keama/tests/classbadmatchif.err
new file mode 100644
index 00000000..1949c994
--- /dev/null
+++ b/keama/tests/classbadmatchif.err
@@ -0,0 +1,10 @@
+# bad (match if with a data expression) class declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# class declaration
+class "foobar" {
+ match if option server.duplicates;
+ default-lease-time 1800;
+}
diff --git a/keama/tests/classbadmatchif.msg b/keama/tests/classbadmatchif.msg
new file mode 100644
index 00000000..79da9e24
--- /dev/null
+++ b/keama/tests/classbadmatchif.msg
@@ -0,0 +1 @@
+classbadmatchif.err line 8: Expecting a boolean expression.
diff --git a/keama/tests/empty.err b/keama/tests/empty.err
deleted file mode 100644
index e69de29b..00000000
--- a/keama/tests/empty.err
+++ /dev/null
diff --git a/keama/tests/empty.msg b/keama/tests/empty.msg
deleted file mode 100644
index 55209627..00000000
--- a/keama/tests/empty.msg
+++ /dev/null
@@ -1 +0,0 @@
-empty.err line 0: missing top level authoritative statement
diff --git a/keama/tests/hostuid4.out b/keama/tests/hostuid4.out
index 71825583..7f8cb52f 100644
--- a/keama/tests/hostuid4.out
+++ b/keama/tests/hostuid4.out
@@ -1,6 +1,8 @@
{
# host declaration with client-identfiers config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp4": {
"subnet4": [
# subnet4 declaration
diff --git a/keama/tests/noauth.msg b/keama/tests/noauth.msg
deleted file mode 100644
index 5556e8db..00000000
--- a/keama/tests/noauth.msg
+++ /dev/null
@@ -1 +0,0 @@
-noauth.err line 7: missing top level authoritative statement
diff --git a/keama/tests/noauth.err b/keama/tests/noauth4.err4
index 18276595..47ab68dc 100644
--- a/keama/tests/noauth.err
+++ b/keama/tests/noauth4.err4
@@ -3,5 +3,5 @@
# authoritative is mandatory
#authoritative;
-# empty configs are not accepted by Kea
-default-lease-time 1800;
+subnet 10.5.5.0 netmask 255.255.255.224 { }
+
diff --git a/keama/tests/noauth4.msg b/keama/tests/noauth4.msg
new file mode 100644
index 00000000..b99a243b
--- /dev/null
+++ b/keama/tests/noauth4.msg
@@ -0,0 +1 @@
+noauth4.err4 line 6: missing top level authoritative statement
diff --git a/keama/tests/noauth6.err6 b/keama/tests/noauth6.err6
new file mode 100644
index 00000000..eb3b2dcb
--- /dev/null
+++ b/keama/tests/noauth6.err6
@@ -0,0 +1,6 @@
+# no(t) authoritative config
+
+# authoritative is mandatory
+#authoritative;
+
+subnet6 2001::/64 { }
diff --git a/keama/tests/noauth6.msg b/keama/tests/noauth6.msg
new file mode 100644
index 00000000..3e5b0f54
--- /dev/null
+++ b/keama/tests/noauth6.msg
@@ -0,0 +1 @@
+noauth6.err6 line 6: missing top level authoritative statement
diff --git a/keama/tests/optdatagrouppool4.out b/keama/tests/optdatagrouppool4.out
index f154aca4..bf96172b 100644
--- a/keama/tests/optdatagrouppool4.out
+++ b/keama/tests/optdatagrouppool4.out
@@ -1,6 +1,8 @@
{
# embedded option-data in DHCPv4 pool config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp4": {
"valid-lifetime": 1800,
"subnet4": [
diff --git a/keama/tests/optiondatapool4.out b/keama/tests/optiondatapool4.out
index 60097801..ff141c78 100644
--- a/keama/tests/optiondatapool4.out
+++ b/keama/tests/optiondatapool4.out
@@ -1,19 +1,13 @@
{
# option-data in DHCPv4 pool config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp4": {
"subnet4": [
# subnet declaration
{
"subnet": "10.5.5.0/27",
- "pools": [
- # pool declaration
- /// option-data was moved from this DHCPv4 pool
- {
- # avoid empty pool
- "pool": "10.5.5.5 - 10.5.5.10"
- }
- ],
"option-data": [
# for a silly reason option-data is not allowed in DHCPv4 pools
{
@@ -22,6 +16,14 @@
"code": 119,
"data": "example.com, example.org"
}
+ ],
+ "pools": [
+ # pool declaration
+ /// option-data was moved from this DHCPv4 pool
+ {
+ # avoid empty pool
+ "pool": "10.5.5.5 - 10.5.5.10"
+ }
]
}
]
diff --git a/keama/tests/optiondatapool6.out b/keama/tests/optiondatapool6.out
index 880cb59d..405da57f 100644
--- a/keama/tests/optiondatapool6.out
+++ b/keama/tests/optiondatapool6.out
@@ -1,6 +1,8 @@
{
# option-data in DHCPv6 pool config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp6": {
"subnet6": [
# subnet declaration
diff --git a/keama/tests/permitauth4.out b/keama/tests/permitauth4.out
index 4cb4334b..c0b841e3 100644
--- a/keama/tests/permitauth4.out
+++ b/keama/tests/permitauth4.out
@@ -1,6 +1,8 @@
{
# DHCPv4 permit authenticated client config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp4": {
"valid-lifetime": 1800,
"subnet4": [
diff --git a/keama/tests/permitauth6.out b/keama/tests/permitauth6.out
index 6ca7af56..355184d9 100644
--- a/keama/tests/permitauth6.out
+++ b/keama/tests/permitauth6.out
@@ -1,6 +1,8 @@
{
# DHCPv4 permit authenticated client config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp6": {
"valid-lifetime": 1800,
"subnet6": [
diff --git a/keama/tests/pool4.out b/keama/tests/pool4.out
index 76dc7372..d30180eb 100644
--- a/keama/tests/pool4.out
+++ b/keama/tests/pool4.out
@@ -1,18 +1,13 @@
{
# DHCPv4 pool config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp4": {
"subnet4": [
# subnet declaration
{
"subnet": "10.5.5.0/27",
- "pools": [
- # pool declaration
- /// option-data was moved from this DHCPv4 pool
- {
- "pool": "10.5.5.5 - 10.5.5.10"
- }
- ],
"option-data": [
{
"space": "dhcp4",
@@ -22,7 +17,14 @@
}
],
/// valid-lifetime moved from an internal pool scope
- "valid-lifetime": 1800
+ "valid-lifetime": 1800,
+ "pools": [
+ # pool declaration
+ /// option-data was moved from this DHCPv4 pool
+ {
+ "pool": "10.5.5.5 - 10.5.5.10"
+ }
+ ]
}
]
}
diff --git a/keama/tests/pool42.in4 b/keama/tests/pool42.in4
new file mode 100644
index 00000000..e2ce953b
--- /dev/null
+++ b/keama/tests/pool42.in4
@@ -0,0 +1,18 @@
+# DHCPv4 pool with 2 ranges config
+
+# authoritative is mandatory
+authoritative;
+
+# subnet declaration
+subnet 10.5.5.0 netmask 255.255.255.224 {
+ # pool declaration
+ pool {
+ option domain-search "example.com", "example.org";
+ default-lease-time 1800;
+ range 10.5.5.5 10.5.5.10;
+ # add a second range
+ range 10.5.5.11 10.5.5.12;
+ }
+ # interface
+ interface "foo";
+}
diff --git a/keama/tests/pool42.out b/keama/tests/pool42.out
new file mode 100644
index 00000000..eaad99e4
--- /dev/null
+++ b/keama/tests/pool42.out
@@ -0,0 +1,38 @@
+{
+ # DHCPv4 pool with 2 ranges config
+ # authoritative is mandatory
+ "Dhcp4": {
+ "subnet4": [
+ # subnet declaration
+ {
+ "subnet": "10.5.5.0/27",
+ "option-data": [
+ {
+ "space": "dhcp4",
+ "name": "domain-search",
+ "code": 119,
+ "data": "example.com, example.org"
+ }
+ ],
+ /// valid-lifetime moved from an internal pool scope
+ "valid-lifetime": 1800,
+ "pools": [
+ {
+ "pool": "10.5.5.5 - 10.5.5.10"
+ },
+ # pool declaration
+ {
+ # add a second range
+ "pool": "10.5.5.11 - 10.5.5.12"
+ }
+ ],
+ "interface": "foo"
+ }
+ ],
+ "interfaces-config": {
+ "interfaces": [
+ "foo"
+ ]
+ }
+ }
+}
diff --git a/keama/tests/pool6.out b/keama/tests/pool6.out
index a2b4c550..7502e1c0 100644
--- a/keama/tests/pool6.out
+++ b/keama/tests/pool6.out
@@ -1,11 +1,15 @@
{
# DHCPv6 pool config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp6": {
"subnet6": [
# subnet declaration
{
"subnet": "2001::/64",
+ /// valid-lifetime moved from an internal pool scope
+ "valid-lifetime": 1800,
"pools": [
# pool declaration
{
@@ -19,9 +23,7 @@
],
"pool": "2001::100 - 2001::200"
}
- ],
- /// valid-lifetime moved from an internal pool scope
- "valid-lifetime": 1800
+ ]
}
]
}
diff --git a/keama/tests/prefix.in6 b/keama/tests/prefix6.in6
index 78e1f399..78e1f399 100644
--- a/keama/tests/prefix.in6
+++ b/keama/tests/prefix6.in6
diff --git a/keama/tests/prefix.out b/keama/tests/prefix6.out
index cccd3dd4..6c7df95b 100644
--- a/keama/tests/prefix.out
+++ b/keama/tests/prefix6.out
@@ -1,6 +1,8 @@
{
# DHCPv6 prefix config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp6": {
"subnet6": [
# subnet declaration
diff --git a/keama/tests/prefix2.in6 b/keama/tests/prefix62.in6
index f1f6b2ac..943aa9c8 100644
--- a/keama/tests/prefix2.in6
+++ b/keama/tests/prefix62.in6
@@ -9,4 +9,5 @@ subnet6 2001::/64 {
option dhcp6.domain-search "example.com", "example.org";
default-lease-time 1800;
prefix6 2001:0:0:1:: 2001:0:0:3:: / 64;
+ interface "foo";
}
diff --git a/keama/tests/prefix2.out b/keama/tests/prefix62.out
index d29c573f..1f3e5d90 100644
--- a/keama/tests/prefix2.out
+++ b/keama/tests/prefix62.out
@@ -22,8 +22,14 @@
// "delegated-len": 64,
// "prefix-highest": "2001:0:0:3::"
// }
- ]
+ ],
+ "interface": "foo"
}
- ]
+ ],
+ "interfaces-config": {
+ "interfaces": [
+ "foo"
+ ]
+ }
}
}
diff --git a/keama/tests/range4.out b/keama/tests/range4.out
index fcaf5162..4abbafbf 100644
--- a/keama/tests/range4.out
+++ b/keama/tests/range4.out
@@ -1,6 +1,8 @@
{
# DHCPv4 range config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp4": {
"subnet4": [
# subnet declaration
diff --git a/keama/tests/range6.in6 b/keama/tests/range6.in6
index 05f30b45..4dcb6595 100644
--- a/keama/tests/range6.in6
+++ b/keama/tests/range6.in6
@@ -10,4 +10,5 @@ subnet6 2001::/64 {
default-lease-time 1800;
range6 2001::100 2001::200;
range6 2001::1000/116;
+ interface "foo";
}
diff --git a/keama/tests/range6.out b/keama/tests/range6.out
index 706a2ade..64cb3c1b 100644
--- a/keama/tests/range6.out
+++ b/keama/tests/range6.out
@@ -23,8 +23,14 @@
{
"pool": "2001::1000/116"
}
- ]
+ ],
+ "interface": "foo"
}
- ]
+ ],
+ "interfaces-config": {
+ "interfaces": [
+ "foo"
+ ]
+ }
}
}
diff --git a/keama/tests/subnet4.out b/keama/tests/subnet4.out
index b9a6ac2d..9891495b 100644
--- a/keama/tests/subnet4.out
+++ b/keama/tests/subnet4.out
@@ -1,6 +1,8 @@
{
# DHCPv4 subnet declaration config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp4": {
"valid-lifetime": 1800,
"subnet4": [
diff --git a/keama/tests/subnet4auth.in4 b/keama/tests/subnet4auth.in4
new file mode 100644
index 00000000..1b78f58a
--- /dev/null
+++ b/keama/tests/subnet4auth.in4
@@ -0,0 +1,21 @@
+# DHCPv4 subnet declaration config
+
+# authoritative is mandatory
+not authoritative;
+
+# parameter which will be changed in subnet
+default-lease-time 1800;
+
+# DHCPv4 subnet declaration
+subnet 10.5.5.0 netmask 255.255.255.224 {
+ # at least one pool is required
+ pool {
+ range 10.5.5.5 10.5.5.10;
+ }
+ # authorize here
+ authoritative;
+ option domain-search "example.com", "example.org";
+ default-lease-time 3600;
+ ignore-client-uids false;
+}
+
diff --git a/keama/tests/subnet4auth.out b/keama/tests/subnet4auth.out
new file mode 100644
index 00000000..9891495b
--- /dev/null
+++ b/keama/tests/subnet4auth.out
@@ -0,0 +1,31 @@
+{
+ # DHCPv4 subnet declaration config
+ # authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
+ "Dhcp4": {
+ "valid-lifetime": 1800,
+ "subnet4": [
+ # DHCPv4 subnet declaration
+ {
+ "subnet": "10.5.5.0/27",
+ "pools": [
+ # at least one pool is required
+ {
+ "pool": "10.5.5.5 - 10.5.5.10"
+ }
+ ],
+ "option-data": [
+ {
+ "space": "dhcp4",
+ "name": "domain-search",
+ "code": 119,
+ "data": "example.com, example.org"
+ }
+ ],
+ "valid-lifetime": 3600,
+ "match-client-id": true
+ }
+ ]
+ }
+}
diff --git a/keama/tests/subnet4noauth.in4 b/keama/tests/subnet4noauth.in4
new file mode 100644
index 00000000..c528284e
--- /dev/null
+++ b/keama/tests/subnet4noauth.in4
@@ -0,0 +1,20 @@
+# DHCPv4 subnet declaration config
+
+# authoritative is mandatory
+not authoritative;
+
+# parameter which will be changed in subnet
+default-lease-time 1800;
+
+# DHCPv4 subnet declaration
+subnet 10.5.5.0 netmask 255.255.255.224 {
+ # at least one pool is required
+ pool {
+ range 10.5.5.5 10.5.5.10;
+ }
+ option domain-search "example.com", "example.org";
+ default-lease-time 3600;
+ interface "foo";
+ ignore-client-uids false;
+}
+
diff --git a/keama/tests/subnet4noauth.out b/keama/tests/subnet4noauth.out
new file mode 100644
index 00000000..0265c436
--- /dev/null
+++ b/keama/tests/subnet4noauth.out
@@ -0,0 +1,38 @@
+{
+ # DHCPv4 subnet declaration config
+ # authoritative is mandatory
+ "Dhcp4": {
+ "valid-lifetime": 1800,
+ "subnet4": [
+// # DHCPv4 subnet declaration
+// /// Not authorized subnet
+// /// This feature is not supported by Kea
+// /// Skipping the subnet only partially simulates it
+// {
+// "subnet": "10.5.5.0/27",
+// "pools": [
+// # at least one pool is required
+// {
+// "pool": "10.5.5.5 - 10.5.5.10"
+// }
+// ],
+// "option-data": [
+// {
+// "space": "dhcp4",
+// "name": "domain-search",
+// "code": 119,
+// "data": "example.com, example.org"
+// }
+// ],
+// "valid-lifetime": 3600,
+// "interface": "foo",
+// "match-client-id": true
+// }
+ ],
+ "interfaces-config": {
+ "interfaces": [
+ "foo"
+ ]
+ }
+ }
+}
diff --git a/keama/tests/subnet6.in6 b/keama/tests/subnet6.in6
index c2c126bf..7966d067 100644
--- a/keama/tests/subnet6.in6
+++ b/keama/tests/subnet6.in6
@@ -14,7 +14,6 @@ subnet6 2001::/64 {
}
option dhcp6.domain-search "example.com", "example.org";
default-lease-time 3600;
- # in future it will be possible to use the same pool6
pool6 {
prefix6 2001:0:0:10:: 2001:0:0:1f:: /64;
}
diff --git a/keama/tests/subnet6.out b/keama/tests/subnet6.out
index 48e9b811..51702545 100644
--- a/keama/tests/subnet6.out
+++ b/keama/tests/subnet6.out
@@ -1,6 +1,8 @@
{
# DHCPv6 subnet declaration config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp6": {
"valid-lifetime": 1800,
"subnet6": [
@@ -11,9 +13,7 @@
# at least one pool is required
{
"pool": "2001::100 - 2001::200"
- },
- # in future it will be possible to use the same pool6
- { }
+ }
],
"option-data": [
{
diff --git a/keama/tests/subnet6auth.in6 b/keama/tests/subnet6auth.in6
new file mode 100644
index 00000000..010af70b
--- /dev/null
+++ b/keama/tests/subnet6auth.in6
@@ -0,0 +1,24 @@
+# DHCPv6 subnet declaration config
+
+# authoritative is mandatory
+not authoritative;
+
+# parameter which will be changed in subnet
+default-lease-time 1800;
+
+# DHCPv4 subnet declaration
+subnet6 2001::/64 {
+ # at least one pool is required
+ pool6 {
+ range6 2001::100 2001::200;
+ }
+ # authorize here
+ authoritative;
+ option dhcp6.domain-search "example.com", "example.org";
+ default-lease-time 3600;
+ interface "foo";
+ pool6 {
+ prefix6 2001:0:0:10:: 2001:0:0:1f:: /64;
+ }
+}
+
diff --git a/keama/tests/subnet6auth.out b/keama/tests/subnet6auth.out
new file mode 100644
index 00000000..ba4c7d2a
--- /dev/null
+++ b/keama/tests/subnet6auth.out
@@ -0,0 +1,41 @@
+{
+ # DHCPv6 subnet declaration config
+ # authoritative is mandatory
+ "Dhcp6": {
+ "valid-lifetime": 1800,
+ "subnet6": [
+ # DHCPv4 subnet declaration
+ {
+ "subnet": "2001::/64",
+ "pools": [
+ # at least one pool is required
+ {
+ "pool": "2001::100 - 2001::200"
+ }
+ ],
+ "option-data": [
+ {
+ "space": "dhcp6",
+ "name": "domain-search",
+ "code": 24,
+ "data": "example.com, example.org"
+ }
+ ],
+ "valid-lifetime": 3600,
+ "interface": "foo",
+ "pd-pools": [
+ {
+ "prefix": "2001:0:0:10::",
+ "delegated-len": 64,
+ "prefix-len": 60
+ }
+ ]
+ }
+ ],
+ "interfaces-config": {
+ "interfaces": [
+ "foo"
+ ]
+ }
+ }
+}
diff --git a/keama/tests/subnet6multi.in6 b/keama/tests/subnet6multi.in6
new file mode 100644
index 00000000..cc8cf8e7
--- /dev/null
+++ b/keama/tests/subnet6multi.in6
@@ -0,0 +1,22 @@
+# DHCPv6 subnet declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# parameter which will be changed in subnet
+default-lease-time 1800;
+
+# DHCPv4 subnet declaration
+subnet6 2001::/64 {
+ # at least one pool is required
+ pool6 {
+ # the pool is shared between addresses and prefixes
+ range6 2001::100 2001::200;
+ range6 2001::1000 2001::2000;
+ prefix6 2001:0:0:10:: 2001:0:0:1f:: /64;
+ prefix6 2001:0:0:80:: 2001:0:0:ff:: /64;
+ }
+ option dhcp6.domain-search "example.com", "example.org";
+ default-lease-time 3600;
+}
+
diff --git a/keama/tests/subnet6multi.out b/keama/tests/subnet6multi.out
new file mode 100644
index 00000000..bccaf4db
--- /dev/null
+++ b/keama/tests/subnet6multi.out
@@ -0,0 +1,47 @@
+{
+ # DHCPv6 subnet declaration config
+ # authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
+ "Dhcp6": {
+ "valid-lifetime": 1800,
+ "subnet6": [
+ # DHCPv4 subnet declaration
+ {
+ "subnet": "2001::/64",
+ "pd-pools": [
+ {
+ "prefix": "2001:0:0:10::",
+ "delegated-len": 64,
+ "prefix-len": 60
+ },
+ # at least one pool is required
+ {
+ "prefix": "2001:0:0:80::",
+ "delegated-len": 64,
+ "prefix-len": 57
+ }
+ ],
+ "pools": [
+ {
+ # the pool is shared between addresses and prefixes
+ "pool": "2001::100 - 2001::200"
+ },
+ # at least one pool is required
+ {
+ "pool": "2001::1000 - 2001::2000"
+ }
+ ],
+ "option-data": [
+ {
+ "space": "dhcp6",
+ "name": "domain-search",
+ "code": 24,
+ "data": "example.com, example.org"
+ }
+ ],
+ "valid-lifetime": 3600
+ }
+ ]
+ }
+}
diff --git a/keama/tests/subnet6noauth.in6 b/keama/tests/subnet6noauth.in6
new file mode 100644
index 00000000..d29869b0
--- /dev/null
+++ b/keama/tests/subnet6noauth.in6
@@ -0,0 +1,21 @@
+# DHCPv6 subnet declaration config
+
+# authoritative is mandatory
+not authoritative;
+
+# parameter which will be changed in subnet
+default-lease-time 1800;
+
+# DHCPv4 subnet declaration
+subnet6 2001::/64 {
+ # at least one pool is required
+ pool6 {
+ range6 2001::100 2001::200;
+ }
+ option dhcp6.domain-search "example.com", "example.org";
+ default-lease-time 3600;
+ pool6 {
+ prefix6 2001:0:0:10:: 2001:0:0:1f:: /64;
+ }
+}
+
diff --git a/keama/tests/subnet6noauth.out b/keama/tests/subnet6noauth.out
new file mode 100644
index 00000000..905f161a
--- /dev/null
+++ b/keama/tests/subnet6noauth.out
@@ -0,0 +1,40 @@
+{
+ # DHCPv6 subnet declaration config
+ # authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
+ "Dhcp6": {
+ "valid-lifetime": 1800,
+ "subnet6": [
+// # DHCPv4 subnet declaration
+// /// Not authorized subnet
+// /// This feature is not supported by Kea
+// /// Skipping the subnet only partially simulates it
+// {
+// "subnet": "2001::/64",
+// "pools": [
+// # at least one pool is required
+// {
+// "pool": "2001::100 - 2001::200"
+// }
+// ],
+// "option-data": [
+// {
+// "space": "dhcp6",
+// "name": "domain-search",
+// "code": 24,
+// "data": "example.com, example.org"
+// }
+// ],
+// "valid-lifetime": 3600,
+// "pd-pools": [
+// {
+// "prefix": "2001:0:0:10::",
+// "delegated-len": 64,
+// "prefix-len": 60
+// }
+// ]
+// }
+ ]
+ }
+}
diff --git a/keama/tests/subnet6one.in6 b/keama/tests/subnet6one.in6
new file mode 100644
index 00000000..302a242f
--- /dev/null
+++ b/keama/tests/subnet6one.in6
@@ -0,0 +1,21 @@
+# DHCPv6 subnet declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# parameter which will be changed in subnet
+default-lease-time 1800;
+
+# DHCPv4 subnet declaration
+subnet6 2001::/64 {
+ # at least one pool is required
+ pool6 {
+ # the pool is shared between addresses and prefixes
+ range6 2001::100 2001::200;
+ prefix6 2001:0:0:10:: 2001:0:0:1f:: /64;
+ }
+ option dhcp6.domain-search "example.com", "example.org";
+ default-lease-time 3600;
+ interface "foo";
+}
+
diff --git a/keama/tests/subnet6one.out b/keama/tests/subnet6one.out
new file mode 100644
index 00000000..b656a44b
--- /dev/null
+++ b/keama/tests/subnet6one.out
@@ -0,0 +1,43 @@
+{
+ # DHCPv6 subnet declaration config
+ # authoritative is mandatory
+ "Dhcp6": {
+ "valid-lifetime": 1800,
+ "subnet6": [
+ # DHCPv4 subnet declaration
+ {
+ "subnet": "2001::/64",
+ "pd-pools": [
+ # at least one pool is required
+ {
+ "prefix": "2001:0:0:10::",
+ "delegated-len": 64,
+ "prefix-len": 60
+ }
+ ],
+ "pools": [
+ # at least one pool is required
+ {
+ # the pool is shared between addresses and prefixes
+ "pool": "2001::100 - 2001::200"
+ }
+ ],
+ "option-data": [
+ {
+ "space": "dhcp6",
+ "name": "domain-search",
+ "code": 24,
+ "data": "example.com, example.org"
+ }
+ ],
+ "valid-lifetime": 3600,
+ "interface": "foo"
+ }
+ ],
+ "interfaces-config": {
+ "interfaces": [
+ "foo"
+ ]
+ }
+ }
+}
diff --git a/keama/tests/temporary.in6 b/keama/tests/temporary6.in6
index 1be8e94e..1be8e94e 100644
--- a/keama/tests/temporary.in6
+++ b/keama/tests/temporary6.in6
diff --git a/keama/tests/temporary.out b/keama/tests/temporary6.out
index 5ab6c9da..0073184a 100644
--- a/keama/tests/temporary.out
+++ b/keama/tests/temporary6.out
@@ -1,6 +1,8 @@
{
# DHCPv6 temporary (aka IA_TA) range config
# authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
"Dhcp6": {
"subnet6": [
# subnet declaration
diff --git a/keama/tests/{ b/keama/tests/{
new file mode 100644
index 00000000..acc87393
--- /dev/null
+++ b/keama/tests/{
@@ -0,0 +1,36 @@
+ # DHCPv6 subnet declaration config
+ # authoritative is mandatory
+ "Dhcp6": {
+ "valid-lifetime": 1800,
+ "subnet6": [
+ # DHCPv4 subnet declaration
+ {
+ "subnet": "2001::/64",
+ "pd-pools": [
+ # at least one pool is required
+ {
+ "prefix": "2001:0:0:10::",
+ "delegated-len": 64,
+ "prefix-len": 60
+ }
+ ],
+ "pools": [
+ # at least one pool is required
+ {
+ # the pool is shared between addresses and prefixes
+ "pool": "2001::100 - 2001::200"
+ }
+ ],
+ "option-data": [
+ {
+ "space": "dhcp6",
+ "name": "domain-search",
+ "code": 24,
+ "data": "example.com, example.org"
+ }
+ ],
+ "valid-lifetime": 3600
+ }
+ ]
+ }
+}