summaryrefslogtreecommitdiff
path: root/keama/tests
diff options
context:
space:
mode:
Diffstat (limited to 'keama/tests')
-rw-r--r--keama/tests/groupclass4.in435
-rw-r--r--keama/tests/groupclass4.out109
-rw-r--r--keama/tests/grouphost4.in438
-rw-r--r--keama/tests/grouphost4.out75
-rw-r--r--keama/tests/groupsubnet4.in427
-rw-r--r--keama/tests/groupsubnet4.out36
-rw-r--r--keama/tests/groupsubnet6.in627
-rw-r--r--keama/tests/groupsubnet6.out42
-rw-r--r--keama/tests/groupsubnetif.err422
-rw-r--r--keama/tests/groupsubnetif.msg1
-rw-r--r--keama/tests/subclass4.out9
-rw-r--r--keama/tests/subclass6.out9
-rw-r--r--keama/tests/subclassbinsel4.out6
-rw-r--r--keama/tests/subclassbinsel6.out9
14 files changed, 423 insertions, 22 deletions
diff --git a/keama/tests/groupclass4.in4 b/keama/tests/groupclass4.in4
new file mode 100644
index 00000000..ebf4f7fc
--- /dev/null
+++ b/keama/tests/groupclass4.in4
@@ -0,0 +1,35 @@
+# group and class declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# options
+option mysystem code 250 = text;
+option myversion code 251 = unsigned integer 16;
+
+# superclass declaration
+class "foobar" {
+ match option mysystem;
+ option myversion 1;
+}
+
+# simple subclass declaration
+subclass "foobar" "version1";
+
+group machin {
+ next-server 10.10.10.1;
+ # this option is not propagated because the superclass takes precedence
+ option myversion 99;
+
+ # option setting subclass declaration
+ subclass "foobar" "version2" { option myversion 2; }
+
+ # complex subclass declaration
+ subclass "foobar" "version3" {
+ option myversion 3;
+ next-server 192.168.0.1;
+ }
+
+ # another simple subclass declaration
+ subclass "foobar" "version10";
+}
diff --git a/keama/tests/groupclass4.out b/keama/tests/groupclass4.out
new file mode 100644
index 00000000..d079d031
--- /dev/null
+++ b/keama/tests/groupclass4.out
@@ -0,0 +1,109 @@
+{
+ # group and 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": [
+ # superclass declaration
+ {
+ "name": "foobar",
+// "spawning": false,
+// "submatch": {
+// "option": {
+// "universe": "dhcp",
+// "name": "mysystem"
+// }
+// },
+ "option-data": [
+ {
+ "space": "dhcp4",
+ "name": "myversion",
+ "code": 251,
+ "data": "1"
+ }
+ ]
+ },
+ # simple subclass declaration
+ /// subclass selector 'version1'
+ {
+ "name": "sub#foobar#0",
+ "option-data": [
+ {
+ "space": "dhcp4",
+ "name": "myversion",
+ "code": 251,
+ "data": "1"
+ }
+ ],
+ /// from: match option dhcp.mysystem
+ /// data: 'version1'
+ "test": "option[250].hex == 'version1'"
+ },
+ # option setting subclass declaration
+ /// subclass selector 'version2'
+ {
+ "name": "sub#foobar#1",
+ "option-data": [
+ {
+ "space": "dhcp4",
+ "name": "myversion",
+ "code": 251,
+ "data": "2"
+ }
+ ],
+ /// from: match option dhcp.mysystem
+ /// data: 'version2'
+ "test": "option[250].hex == 'version2'",
+ "next-server": "10.10.10.1"
+ },
+ # complex subclass declaration
+ /// subclass selector 'version3'
+ {
+ "name": "sub#foobar#2",
+ "option-data": [
+ {
+ "space": "dhcp4",
+ "name": "myversion",
+ "code": 251,
+ "data": "3"
+ }
+ ],
+ "next-server": "192.168.0.1",
+ /// from: match option dhcp.mysystem
+ /// data: 'version3'
+ "test": "option[250].hex == 'version3'"
+ },
+ # another simple subclass declaration
+ /// subclass selector 'version10'
+ {
+ "name": "sub#foobar#3",
+ "option-data": [
+ {
+ "space": "dhcp4",
+ "name": "myversion",
+ "code": 251,
+ "data": "1"
+ }
+ ],
+ /// from: match option dhcp.mysystem
+ /// data: 'version10'
+ "test": "option[250].hex == 'version10'",
+ "next-server": "10.10.10.1"
+ }
+ ]
+ }
+}
diff --git a/keama/tests/grouphost4.in4 b/keama/tests/grouphost4.in4
new file mode 100644
index 00000000..370f3baf
--- /dev/null
+++ b/keama/tests/grouphost4.in4
@@ -0,0 +1,38 @@
+# group and host declarations config
+
+# authoritative is mandatory
+authoritative;
+
+# subnet4 declaration
+subnet 10.5.5.0 netmask 255.255.255.224 {
+ range 10.5.5.5 10.5.5.10;
+}
+
+# host declaration
+host test1 {
+ hardware ethernet 00:0B:FD:32:E6:FA;
+ fixed-address 10.5.5.1, 10.10.10.10;
+}
+
+# group declaration
+group "foobar" {
+ default-lease-time 1800;
+ option domain-search "example.com", "example.org";
+ next-server 192.168.0.1;
+
+ # host declarations
+ host test2 {
+ hardware ethernet 00:07:0E:36:48:19;
+ fixed-address 10.5.5.2;
+ option domain-name "example.com";
+ option domain-search "example.com", "com";
+ }
+
+ host test3 {
+ hardware fddi 00:07:0E:36:48:19;
+ fixed-address 10.10.10.1;
+ default-lease-time 3600;
+ }
+}
+
+subnet 10.10.10.0 netmask 255.255.255.224 { }
diff --git a/keama/tests/grouphost4.out b/keama/tests/grouphost4.out
new file mode 100644
index 00000000..a6a9ccef
--- /dev/null
+++ b/keama/tests/grouphost4.out
@@ -0,0 +1,75 @@
+{
+ # group and host declarations config
+ # authoritative is mandatory
+ /// This configuration declares some subnets but has no interfaces-config
+ /// Reference Kea #5256
+ "Dhcp4": {
+ "subnet4": [
+ # subnet4 declaration
+ {
+ "subnet": "10.5.5.0/27",
+ "pools": [
+ {
+ "pool": "10.5.5.5 - 10.5.5.10"
+ }
+ ],
+ "reservations": [
+ # host declaration
+ {
+ "hostname": "test1",
+ "hw-address": "00:0b:fd:32:e6:fa",
+ "ip-address": "10.5.5.1"
+// "extra-ip-addresses": [
+// "10.10.10.10"
+// ]
+ },
+ # host declarations
+ {
+ "hostname": "test2",
+ "hw-address": "00:07:0e:36:48:19",
+ "ip-address": "10.5.5.2",
+ "option-data": [
+ {
+ "space": "dhcp4",
+ "name": "domain-name",
+ "code": 15,
+ "data": "example.com"
+ },
+ {
+ "space": "dhcp4",
+ "name": "domain-search",
+ "code": 119,
+ "data": "example.com, com"
+ }
+ ],
+ "next-server": "192.168.0.1"
+ }
+ ]
+ },
+ {
+ "subnet": "10.10.10.0/27",
+ "reservations": [
+ {
+ "hostname": "test3",
+// "hw-address": "fddi 00:07:0e:36:48:19",
+ "ip-address": "10.10.10.1",
+// /// valid-lifetime in unsupported scope
+// "valid-lifetime": 3600,
+ "option-data": [
+ {
+ "space": "dhcp4",
+ "name": "domain-search",
+ "code": 119,
+ "data": "example.com, example.org"
+ }
+ ],
+ "next-server": "192.168.0.1"
+ }
+ ]
+ }
+ ],
+ "host-reservation-identifiers": [
+ "hw-address"
+ ]
+ }
+}
diff --git a/keama/tests/groupsubnet4.in4 b/keama/tests/groupsubnet4.in4
new file mode 100644
index 00000000..a738f997
--- /dev/null
+++ b/keama/tests/groupsubnet4.in4
@@ -0,0 +1,27 @@
+# Group with DHCPv4 subnet declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# parameter which will be changed in subnet
+default-lease-time 1200;
+
+# group declaration
+group foobar {
+ # option
+ option domain-search "example.com", "example.org";
+
+ # parameters
+ default-lease-time 3600;
+ ignore-client-uids false;
+
+ # 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;
+ }
+ interface "bar";
+ default-lease-time 1800;
+ }
+}
diff --git a/keama/tests/groupsubnet4.out b/keama/tests/groupsubnet4.out
new file mode 100644
index 00000000..085933d5
--- /dev/null
+++ b/keama/tests/groupsubnet4.out
@@ -0,0 +1,36 @@
+{
+ # Group with DHCPv4 subnet declaration config
+ # authoritative is mandatory
+ "Dhcp4": {
+ "valid-lifetime": 1200,
+ "interfaces-config": {
+ "interfaces": [
+ "bar"
+ ]
+ },
+ "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"
+ }
+ ],
+ "interface": "bar",
+ "valid-lifetime": 1800,
+ "option-data": [
+ # option
+ {
+ "space": "dhcp4",
+ "name": "domain-search",
+ "code": 119,
+ "data": "example.com, example.org"
+ }
+ ],
+ "match-client-id": true
+ }
+ ]
+ }
+}
diff --git a/keama/tests/groupsubnet6.in6 b/keama/tests/groupsubnet6.in6
new file mode 100644
index 00000000..be30b786
--- /dev/null
+++ b/keama/tests/groupsubnet6.in6
@@ -0,0 +1,27 @@
+# Group with DHCPv6 subnet declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# parameter which will be changed in subnet
+default-lease-time 1200;
+
+# group declaration
+group foobar {
+ # option
+ option dhcp6.domain-search "example.com", "example.org";
+
+ # parameters
+ default-lease-time 3600;
+
+ # DHCPv4 subnet declaration
+ subnet6 2001::/64 {
+ # at least one pool is required
+ pool6 {
+ range6 2001::100 2001::200;
+ }
+ interface "bar";
+ default-lease-time 1800;
+ option dhcp6.lq-relay-data 2001::1, "foobar";
+ }
+}
diff --git a/keama/tests/groupsubnet6.out b/keama/tests/groupsubnet6.out
new file mode 100644
index 00000000..7a02e25a
--- /dev/null
+++ b/keama/tests/groupsubnet6.out
@@ -0,0 +1,42 @@
+{
+ # Group with DHCPv6 subnet declaration config
+ # authoritative is mandatory
+ "Dhcp6": {
+ "valid-lifetime": 1200,
+ "interfaces-config": {
+ "interfaces": [
+ "bar"
+ ]
+ },
+ "subnet6": [
+ # DHCPv4 subnet declaration
+ {
+ "subnet": "2001::/64",
+ "pools": [
+ # at least one pool is required
+ {
+ "pool": "2001::100 - 2001::200"
+ }
+ ],
+ "interface": "bar",
+ "valid-lifetime": 1800,
+ "option-data": [
+ {
+ "space": "dhcp6",
+ "name": "lq-relay-data",
+ "code": 47,
+// "original-data": "2001::1, \"foobar\"",
+ "data": "2001::1, foobar"
+ },
+ # option
+ {
+ "space": "dhcp6",
+ "name": "domain-search",
+ "code": 24,
+ "data": "example.com, example.org"
+ }
+ ]
+ }
+ ]
+ }
+}
diff --git a/keama/tests/groupsubnetif.err4 b/keama/tests/groupsubnetif.err4
new file mode 100644
index 00000000..7c3801e9
--- /dev/null
+++ b/keama/tests/groupsubnetif.err4
@@ -0,0 +1,22 @@
+# bad (interface unlnown in this cope) group declaration config
+
+# authoritative is mandatory
+authoritative;
+
+# parameter which will be changed in subnet
+default-lease-time 1200;
+
+# group declaration
+group foobar {
+ # interface
+ interface "foo";
+
+ # 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;
+ }
+ interface "bar";
+ }
+}
diff --git a/keama/tests/groupsubnetif.msg b/keama/tests/groupsubnetif.msg
new file mode 100644
index 00000000..f89aed88
--- /dev/null
+++ b/keama/tests/groupsubnetif.msg
@@ -0,0 +1 @@
+groupsubnetif.err4 line 10: expecting a parameter or declaration
diff --git a/keama/tests/subclass4.out b/keama/tests/subclass4.out
index 716a7a6e..7113240a 100644
--- a/keama/tests/subclass4.out
+++ b/keama/tests/subclass4.out
@@ -38,9 +38,8 @@
]
},
# simple subclass declaration
+ /// subclass selector 'version1'
{
-// "super": "foobar",
-// "string": "version1",
"name": "sub#foobar#0",
"option-data": [
{
@@ -55,9 +54,8 @@
"test": "option[250].hex == 'version1'"
},
# option setting subclass declaration
+ /// subclass selector 'version2'
{
-// "super": "foobar",
-// "string": "version2",
"name": "sub#foobar#1",
"option-data": [
{
@@ -72,9 +70,8 @@
"test": "option[250].hex == 'version2'"
},
# complex subclass declaration
+ /// subclass selector 'version3'
{
-// "super": "foobar",
-// "string": "version3",
"name": "sub#foobar#2",
"option-data": [
{
diff --git a/keama/tests/subclass6.out b/keama/tests/subclass6.out
index 237c20cd..2de8b63b 100644
--- a/keama/tests/subclass6.out
+++ b/keama/tests/subclass6.out
@@ -38,9 +38,8 @@
]
},
# simple subclass declaration
+ /// subclass selector 'version1'
{
-// "super": "foobar",
-// "string": "version1",
"name": "sub#foobar#0",
"option-data": [
{
@@ -55,9 +54,8 @@
"test": "option[1250].hex == 'version1'"
},
# option setting subclass declaration
+ /// subclass selector 'version2'
{
-// "super": "foobar",
-// "string": "version2",
"name": "sub#foobar#1",
"option-data": [
{
@@ -72,9 +70,8 @@
"test": "option[1250].hex == 'version2'"
},
# complex subclass declaration
+ /// subclass selector 'version3'
{
-// "super": "foobar",
-// "string": "version3",
"name": "sub#foobar#2",
"option-data": [
{
diff --git a/keama/tests/subclassbinsel4.out b/keama/tests/subclassbinsel4.out
index 94b8a84c..aa70c9cd 100644
--- a/keama/tests/subclassbinsel4.out
+++ b/keama/tests/subclassbinsel4.out
@@ -29,9 +29,8 @@
]
},
# simple subclass declaration
+ /// subclass selector 0x0x0100070e364819
{
-// "super": "foobar",
-// "binary": "0x0100070e364819",
"name": "sub#foobar#0",
"option-data": [
{
@@ -46,9 +45,8 @@
"test": "concat(substring(pkt4.htype,-1,all),pkt4.mac) == 0x0100070e364819"
},
# option setting subclass declaration
+ /// subclass selector 0x0x01000bfd32e6fa
{
-// "super": "foobar",
-// "binary": "0x01000bfd32e6fa",
"name": "sub#foobar#1",
"option-data": [
{
diff --git a/keama/tests/subclassbinsel6.out b/keama/tests/subclassbinsel6.out
index f89d99ad..300deaf3 100644
--- a/keama/tests/subclassbinsel6.out
+++ b/keama/tests/subclassbinsel6.out
@@ -39,9 +39,8 @@
]
},
# simple subclass declaration
+ /// subclass selector 0x0x0100070e364819
{
-// "super": "foobar",
-// "binary": "0x0100070e364819",
"name": "sub#foobar#0",
"option-data": [
# no harware in DHCPv6
@@ -57,9 +56,8 @@
"test": "option[1250].hex == 0x0100070e364819"
},
# option setting subclass declaration
+ /// subclass selector 0x0x01000bfd32e6fa
{
-// "super": "foobar",
-// "binary": "0x01000bfd32e6fa",
"name": "sub#foobar#1",
"option-data": [
{
@@ -74,9 +72,8 @@
"test": "option[1250].hex == 0x01000bfd32e6fa"
},
# complex subclass declaration
+ /// subclass selector 0x0x010002b388c527
{
-// "super": "foobar",
-// "binary": "0x010002b388c527",
"name": "sub#foobar#2",
"option-data": [
{