From 96a5bb0bda0668422202086bca401eb325f71097 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Tue, 14 Nov 2017 00:36:29 +0100 Subject: Added always-sent reference for PRL/ORO hack --- keama/tests/README | 1 + keama/tests/czb/kea.json | 40 +++++++++++++++++++++ keama/tests/fordhcp/kea.json | 6 ++++ keama/tests/hostidentifier4.out | 78 ---------------------------------------- keama/tests/hostidentifier4.outL | 78 ++++++++++++++++++++++++++++++++++++++++ keama/tests/optiondata4.out | 2 ++ keama/tests/runone.sh | 7 +++- 7 files changed, 133 insertions(+), 79 deletions(-) delete mode 100644 keama/tests/hostidentifier4.out create mode 100644 keama/tests/hostidentifier4.outL (limited to 'keama/tests') diff --git a/keama/tests/README b/keama/tests/README index 48372b6a..55ddb858 100644 --- a/keama/tests/README +++ b/keama/tests/README @@ -12,6 +12,7 @@ Extensions: - .in4 = source for working test in DHCPv4 - .in6 = source for working test in DHCPv6 - .inL = source for working test in DHCPv4 with -l $HOOK + - .outL = resultat for working test with default hook library path - .out = resultat for working test There is no working test in DHCPv4 and DHCPv6. The body of the name of a working test must include 4 or 6 so diff --git a/keama/tests/czb/kea.json b/keama/tests/czb/kea.json index 221a81d5..f4511495 100644 --- a/keama/tests/czb/kea.json +++ b/keama/tests/czb/kea.json @@ -253816,6 +253816,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -290158,6 +290160,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -290332,6 +290336,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -290506,6 +290512,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -290680,6 +290688,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -290854,6 +290864,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -291028,6 +291040,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -291202,6 +291216,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -291376,6 +291392,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -291550,6 +291568,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -291724,6 +291744,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -291898,6 +291920,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -292072,6 +292096,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -292246,6 +292272,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -292420,6 +292448,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -292666,6 +292696,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -407078,6 +407110,8 @@ "code": 46, "data": "8" }, + /// Possible PRL hack + /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 { "space": "dhcp4", "name": "dhcp-parameter-request-list", @@ -407245,6 +407279,8 @@ "code": 46, "data": "8" }, + /// Possible PRL hack + /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 { "space": "dhcp4", "name": "dhcp-parameter-request-list", @@ -423219,6 +423255,8 @@ "code": 6, "data": "11.2.2.26, 142.20.10.156" }, + /// Possible PRL hack + /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 { "space": "dhcp4", "name": "dhcp-parameter-request-list", @@ -432933,6 +432971,8 @@ // } // }, // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", diff --git a/keama/tests/fordhcp/kea.json b/keama/tests/fordhcp/kea.json index de723e43..d22bf1bf 100644 --- a/keama/tests/fordhcp/kea.json +++ b/keama/tests/fordhcp/kea.json @@ -816,6 +816,8 @@ "test": "substring(option[60].hex,0,4) == 'MSFT'", "option-data": [ // # Windows doesn't put WPAD on its PRL, but does consume it. +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -945,6 +947,8 @@ // }, // "then": [ // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", @@ -1006,6 +1010,8 @@ // }, // "then": [ // { +// /// Possible PRL hack +// /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 // "option": { // "space": "dhcp4", // "name": "dhcp-parameter-request-list", diff --git a/keama/tests/hostidentifier4.out b/keama/tests/hostidentifier4.out deleted file mode 100644 index 43a8dce3..00000000 --- a/keama/tests/hostidentifier4.out +++ /dev/null @@ -1,78 +0,0 @@ -{ - # host declaration with flexible identifiers 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 declarations - { - "hostname": "test1", - "flex-id": "'test1'", - "option-data": [ - { - "space": "dhcp4", - "name": "domain-search", - "code": 119, -// "original-data": "\"example.com\", \"example.org\"", - "data": "example.com, example.org" - } - ], -// /// valid-lifetime in unsupported scope -// "valid-lifetime": 1800, - "ip-address": "10.5.5.1" -// "extra-ip-addresses": [ -// "10.10.10.10" -// ] - }, - { - "hostname": "test2", - "hw-address": "00:07:0e:36:48:19", - "ip-address": "10.5.5.2" - } - ] - }, - { - "subnet": "10.10.10.0/27", - "reservations": [ -// { -// "hostname": "test3", -// "hw-address": "fddi 00:07:0e:36:48:19", -// "ip-address": "10.10.10.1" -// } - ] - } - ], - "option-def": [ - # option definition - { - "space": "dhcp4", - "name": "my-id", - "code": 250, - "type": "string" - } - ], - "host-reservation-identifiers": [ - "flex-id", - "hw-address" - ], - /// The flexible host identifier is a premium feature - "hooks-libraries": [ - { - "library": "/tmp/kea/premium/src/hooks/dhcp/flex_id/.libs/libdhcp_flex_id.so", - "parameters": { - "identifier-expression": "option[250].hex" - } - } - ] - } -} diff --git a/keama/tests/hostidentifier4.outL b/keama/tests/hostidentifier4.outL new file mode 100644 index 00000000..c56ef414 --- /dev/null +++ b/keama/tests/hostidentifier4.outL @@ -0,0 +1,78 @@ +{ + # host declaration with flexible identifiers 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 declarations + { + "hostname": "test1", + "flex-id": "'test1'", + "option-data": [ + { + "space": "dhcp4", + "name": "domain-search", + "code": 119, +// "original-data": "\"example.com\", \"example.org\"", + "data": "example.com, example.org" + } + ], +// /// valid-lifetime in unsupported scope +// "valid-lifetime": 1800, + "ip-address": "10.5.5.1" +// "extra-ip-addresses": [ +// "10.10.10.10" +// ] + }, + { + "hostname": "test2", + "hw-address": "00:07:0e:36:48:19", + "ip-address": "10.5.5.2" + } + ] + }, + { + "subnet": "10.10.10.0/27", + "reservations": [ +// { +// "hostname": "test3", +// "hw-address": "fddi 00:07:0e:36:48:19", +// "ip-address": "10.10.10.1" +// } + ] + } + ], + "option-def": [ + # option definition + { + "space": "dhcp4", + "name": "my-id", + "code": 250, + "type": "string" + } + ], + "host-reservation-identifiers": [ + "flex-id", + "hw-address" + ], + /// The flexible host identifier is a premium feature + "hooks-libraries": [ + { + "library": "/path/libdhcp_flex_id.so", + "parameters": { + "identifier-expression": "option[250].hex" + } + } + ] + } +} diff --git a/keama/tests/optiondata4.out b/keama/tests/optiondata4.out index e51be66d..78c2d5cc 100644 --- a/keama/tests/optiondata4.out +++ b/keama/tests/optiondata4.out @@ -101,6 +101,8 @@ "code": 18, "data": "" }, + /// Possible PRL hack + /// Consider setting "always-send" to true when setting data for relevant options, cf Kea #5241 { "space": "dhcp4", "name": "dhcp-parameter-request-list", diff --git a/keama/tests/runone.sh b/keama/tests/runone.sh index 4fbcfb5f..e47f6034 100644 --- a/keama/tests/runone.sh +++ b/keama/tests/runone.sh @@ -38,6 +38,7 @@ fi options="" dual=0 +hook=0 case $trail in '') dual=1;; @@ -45,7 +46,7 @@ case $trail in 6) options="-6";; F) options="-4 -r fatal";; P) options="-4 -r pass";; - L) options="-4 -l ${HOOK:-/path/}";; + L) options="-4 -l ${HOOK:-/path/}"; hook=1;; *) echo "unrecognized trail '$trail' in '$full'" >&2; exit 1;; esac @@ -94,6 +95,10 @@ else fi fi +if [ $hook -eq 1 ]; then + sed s,/path/,${HOOK:-/path/}, < ${expected}L > $expected +fi + if [ $errcase -ne 0 ]; then cat $out | head -1 | diff --brief - $expected if [ $? -ne 0 ]; then -- cgit v1.2.1