summaryrefslogtreecommitdiff
path: root/keama/tests
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2017-11-15 09:22:47 +0100
committerFrancis Dupont <fdupont@isc.org>2019-11-12 09:57:39 +0100
commit76a85fef33fa8a08f4533ba15b833ced57252eec (patch)
tree5289dfe00ad2ff2123f09f198887ac3b6a15e471 /keama/tests
parent96a5bb0bda0668422202086bca401eb325f71097 (diff)
downloadisc-dhcp-76a85fef33fa8a08f4533ba15b833ced57252eec.tar.gz
Added #5073 improvements
Diffstat (limited to 'keama/tests')
-rw-r--r--keama/tests/README1
-rw-r--r--keama/tests/czb/kea.json25
-rw-r--r--keama/tests/dhcp3/kea.json42
-rw-r--r--keama/tests/fordhcp/kea.json71
-rw-r--r--keama/tests/gcet/kea.json25
-rw-r--r--keama/tests/vendorspace4.in414
-rw-r--r--keama/tests/vendorspace4.out42
7 files changed, 141 insertions, 79 deletions
diff --git a/keama/tests/README b/keama/tests/README
index 55ddb858..36526d87 100644
--- a/keama/tests/README
+++ b/keama/tests/README
@@ -27,6 +27,7 @@ Check output syntax with kea-dhcp4 and kea-dhcp6
Set KEA4 and KEA6 environment variables to kea-dhcp4 and kea-dhcp6
The en0 interface is supposed to exist (or replace "en0" in all files)
+Note that runall.sh must be run before checkall.sh
checkone.sh xyz.out
-> check the syntax of xyz.out
diff --git a/keama/tests/czb/kea.json b/keama/tests/czb/kea.json
index f4511495..98b8d6ac 100644
--- a/keama/tests/czb/kea.json
+++ b/keama/tests/czb/kea.json
@@ -281,16 +281,21 @@
{
"name": "SunRay",
/// from: match if (option dhcp.vendor-class-identifier) = 'SUNW.NewT.SUNW'
- "test": "option[60].hex == 'SUNW.NewT.SUNW'"
-// "config": [
-// /// vendor-option-space is not (yet?) supported
-// /// Reference Kea #5073
-// {
-// "name": "vendor-option-space",
-// "code": 19,
-// "value": "SunRay"
-// }
-// ]
+ "test": "option[60].hex == 'SUNW.NewT.SUNW'",
+ "option-def": [
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43,
+ "type": "empty",
+ "encapsulate": "SunRay"
+ }
+ ],
+ "option-data": [
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43
+ }
+ ]
// "statement": {
// "log": {
// "priority": "info",
diff --git a/keama/tests/dhcp3/kea.json b/keama/tests/dhcp3/kea.json
index 93e84302..16ad1c53 100644
--- a/keama/tests/dhcp3/kea.json
+++ b/keama/tests/dhcp3/kea.json
@@ -866,17 +866,20 @@
"name": "ruckus",
/// from: match if ((option dhcp.vendor-class-identifier) = 'Ruckus CPE') or ((option dhcp.vendor-class-identifier) = 'Ruckus')
"test": "(option[60].hex == 'Ruckus CPE') or (option[60].hex == 'Ruckus')",
-// "config": [
-// /// vendor-option-space is not (yet?) supported
-// /// Reference Kea #5073
-// {
-// "name": "vendor-option-space",
-// "code": 19,
-// "value": "VendorInfo"
-// }
-// ],
+ "option-def": [
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43,
+ "type": "empty",
+ "encapsulate": "VendorInfo"
+ }
+ ],
"option-data": [
{
+ "name": "vendor-encapsulated-options",
+ "code": 43
+ },
+ {
"space": "VendorInfo",
"name": "acsurl",
"code": 1,
@@ -906,21 +909,24 @@
"data": "ubnt"
},
{
+ "name": "vendor-encapsulated-options",
+ "code": 43
+ },
+ {
"space": "ubnt",
"name": "unifi-address",
"code": 1,
"data": "66.253.253.32"
}
+ ],
+ "option-def": [
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43,
+ "type": "empty",
+ "encapsulate": "ubnt"
+ }
]
-// "config": [
-// /// vendor-option-space is not (yet?) supported
-// /// Reference Kea #5073
-// {
-// "name": "vendor-option-space",
-// "code": 19,
-// "value": "ubnt"
-// }
-// ]
},
{
"name": "unifi",
diff --git a/keama/tests/fordhcp/kea.json b/keama/tests/fordhcp/kea.json
index d22bf1bf..2e53726e 100644
--- a/keama/tests/fordhcp/kea.json
+++ b/keama/tests/fordhcp/kea.json
@@ -799,16 +799,21 @@
{
"name": "APC",
/// from: match if (substring(option dhcp.vendor-class-identifier, 0, 3)) = 'APC'
- "test": "substring(option[60].hex,0,3) == 'APC'"
-// "config": [
-// /// vendor-option-space is not (yet?) supported
-// /// Reference Kea #5073
-// {
-// "name": "vendor-option-space",
-// "code": 19,
-// "value": "APC"
-// }
-// ]
+ "test": "substring(option[60].hex,0,3) == 'APC'",
+ "option-def": [
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43,
+ "type": "empty",
+ "encapsulate": "APC"
+ }
+ ],
+ "option-data": [
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43
+ }
+ ]
},
{
"name": "MSFT",
@@ -855,6 +860,10 @@
"code": 60,
"data": "PXEClient"
},
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43
+ },
# Some PXE clients refuse to tftp if mtftp fails. Others take
# longer.
{
@@ -901,36 +910,18 @@
"data": "30"
}
],
-// "config": [
-// /// vendor-option-space is not (yet?) supported
-// /// Reference Kea #5073
-// {
-// "name": "vendor-option-space",
-// "code": 19,
-// "value": "PXE"
-// },
-// /// site-option-space is not supported
-// /// Reference Kea #5240
-// {
-// "name": "site-option-space",
-// "code": 21,
-// "value": "pxelinux"
-// },
-// /// vendor-option-space is not (yet?) supported
-// /// Reference Kea #5073
-// {
-// "name": "vendor-option-space",
-// "code": 19,
-// "value": "PXE"
-// },
-// /// site-option-space is not supported
-// /// Reference Kea #5240
-// {
-// "name": "site-option-space",
-// "code": 21,
-// "value": "pxelinux"
-// }
-// ],
+ /// site-option-space 'pxelinux'
+ /// Please to move private (code 224..254) option definitions from 'pxelinux' to 'dhcp4' space
+ /// site-option-space 'pxelinux'
+ /// Please to move private (code 224..254) option definitions from 'pxelinux' to 'dhcp4' space
+ "option-def": [
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43,
+ "type": "empty",
+ "encapsulate": "PXE"
+ }
+ ],
// /// Only global enable-updates is supported
// "enable-updates": false,
"boot-file-name": "pxelinux.0",
diff --git a/keama/tests/gcet/kea.json b/keama/tests/gcet/kea.json
index 4b0d0dba..6edf1636 100644
--- a/keama/tests/gcet/kea.json
+++ b/keama/tests/gcet/kea.json
@@ -71,6 +71,10 @@
"data": "Ruckus CPE"
},
{
+ "name": "vendor-encapsulated-options",
+ "code": 43
+ },
+ {
"space": "RKUS",
"name": "fm-address",
"code": 1,
@@ -88,18 +92,17 @@
"code": 6,
"data": "https://192.168.11.200/wsg/ap"
}
- ]
+ ],
// /// valid-lifetime in unsupported scope
-// "valid-lifetime": 86400
-// "config": [
-// /// vendor-option-space is not (yet?) supported
-// /// Reference Kea #5073
-// {
-// "name": "vendor-option-space",
-// "code": 19,
-// "value": "RKUS"
-// }
-// ]
+// "valid-lifetime": 86400,
+ "option-def": [
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43,
+ "type": "empty",
+ "encapsulate": "RKUS"
+ }
+ ]
}
]
}
diff --git a/keama/tests/vendorspace4.in4 b/keama/tests/vendorspace4.in4
new file mode 100644
index 00000000..7f9306b0
--- /dev/null
+++ b/keama/tests/vendorspace4.in4
@@ -0,0 +1,14 @@
+# vendor option space config
+
+# authoritative is mandatory
+authoritative;
+
+option space foo;
+option foo.bar code 1 = text;
+
+# class declaration
+class "foobar" {
+ match if option vendor-class-identifier = "foo";
+ vendor-option-space foo;
+ option foo.bar "foobar";
+}
diff --git a/keama/tests/vendorspace4.out b/keama/tests/vendorspace4.out
new file mode 100644
index 00000000..6c5e8d85
--- /dev/null
+++ b/keama/tests/vendorspace4.out
@@ -0,0 +1,42 @@
+{
+ # vendor option space config
+ # authoritative is mandatory
+ "Dhcp4": {
+ "option-def": [
+ {
+ "space": "foo",
+ "name": "bar",
+ "code": 1,
+ "type": "string"
+ }
+ ],
+ "client-classes": [
+ # class declaration
+ {
+ "name": "foobar",
+ /// from: match if (option dhcp.vendor-class-identifier) = 'foo'
+ "test": "option[60].hex == 'foo'",
+ "option-def": [
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43,
+ "type": "empty",
+ "encapsulate": "foo"
+ }
+ ],
+ "option-data": [
+ {
+ "name": "vendor-encapsulated-options",
+ "code": 43
+ },
+ {
+ "space": "foo",
+ "name": "bar",
+ "code": 1,
+ "data": "foobar"
+ }
+ ]
+ }
+ ]
+ }
+}