Commit 8e360e66 authored by Francis Dupont's avatar Francis Dupont
Browse files

[3927] Simplified option-data tests

parent df49e49a
......@@ -1836,15 +1836,11 @@ TEST_F(Dhcp4ParserTest, optionDataDefaults) {
"\"renew-timer\": 1000,"
"\"option-data\": [ {"
" \"name\": \"dhcp-message\","
" \"space\": \"dhcp4\","
" \"code\": 56,"
" \"data\": \"ABCDEF0105\","
" \"csv-format\": False"
" },"
" {"
" \"name\": \"default-ip-ttl\","
" \"space\": \"dhcp4\","
" \"code\": 23,"
" \"data\": \"01\","
" \"csv-format\": False"
" } ],"
......@@ -1909,17 +1905,13 @@ TEST_F(Dhcp4ParserTest, optionDataTwoSpaces) {
"\"renew-timer\": 1000,"
"\"option-data\": [ {"
" \"name\": \"dhcp-message\","
" \"space\": \"dhcp4\","
" \"code\": 56,"
" \"data\": \"ABCDEF0105\","
" \"csv-format\": False"
" },"
" {"
" \"name\": \"foo\","
" \"space\": \"isc\","
" \"code\": 56,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......@@ -1987,16 +1979,12 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) {
"\"option-data\": [ {"
" \"name\": \"foo\","
" \"space\": \"isc\","
" \"code\": 1,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" },"
" {"
" \"name\": \"foo2\","
" \"space\": \"isc\","
" \"code\": 2,"
" \"data\": \"192.168.2.1\","
" \"csv-format\": True"
" \"data\": \"192.168.2.1\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......@@ -2032,24 +2020,17 @@ TEST_F(Dhcp4ParserTest, optionDataEncapsulate) {
"\"renew-timer\": 1000,"
"\"option-data\": [ {"
" \"name\": \"base-option\","
" \"space\": \"dhcp4\","
" \"code\": 222,"
" \"data\": \"11\","
" \"csv-format\": True"
" \"data\": \"11\""
" },"
" {"
" \"name\": \"foo\","
" \"space\": \"isc\","
" \"code\": 1,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" },"
" {"
" \"name\": \"foo2\","
" \"space\": \"isc\","
" \"code\": 2,"
" \"data\": \"192.168.2.1\","
" \"csv-format\": True"
" \"data\": \"192.168.2.1\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"base-option\","
......@@ -2120,8 +2101,6 @@ TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) {
"\"renew-timer\": 1000, "
"\"option-data\": [ {"
" \"name\": \"dhcp-message\","
" \"space\": \"dhcp4\","
" \"code\": 56,"
" \"data\": \"AB\","
" \"csv-format\": False"
" } ],"
......@@ -2130,15 +2109,11 @@ TEST_F(Dhcp4ParserTest, optionDataInSingleSubnet) {
" \"subnet\": \"192.0.2.0/24\", "
" \"option-data\": [ {"
" \"name\": \"dhcp-message\","
" \"space\": \"dhcp4\","
" \"code\": 56,"
" \"data\": \"ABCDEF0105\","
" \"csv-format\": False"
" },"
" {"
" \"name\": \"default-ip-ttl\","
" \"space\": \"dhcp4\","
" \"code\": 23,"
" \"data\": \"01\","
" \"csv-format\": False"
" } ]"
......@@ -2277,8 +2252,6 @@ TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) {
" \"subnet\": \"192.0.2.0/24\", "
" \"option-data\": [ {"
" \"name\": \"dhcp-message\","
" \"space\": \"dhcp4\","
" \"code\": 56,"
" \"data\": \"0102030405060708090A\","
" \"csv-format\": False"
" } ]"
......@@ -2288,8 +2261,6 @@ TEST_F(Dhcp4ParserTest, optionDataInMultipleSubnets) {
" \"subnet\": \"192.0.3.0/24\", "
" \"option-data\": [ {"
" \"name\": \"default-ip-ttl\","
" \"space\": \"dhcp4\","
" \"code\": 23,"
" \"data\": \"FF\","
" \"csv-format\": False"
" } ]"
......@@ -2550,16 +2521,12 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
"\"option-data\": [ {"
" \"name\": \"foo\","
" \"space\": \"vendor-encapsulated-options-space\","
" \"code\": 1,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" },"
" {"
" \"name\": \"foo2\","
" \"space\": \"vendor-encapsulated-options-space\","
" \"code\": 2,"
" \"data\": \"192.168.2.1\","
" \"csv-format\": True"
" \"data\": \"192.168.2.1\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......@@ -2599,17 +2566,12 @@ TEST_F(Dhcp4ParserTest, stdOptionDataEncapsulate) {
"\"renew-timer\": 1000,"
"\"option-data\": [ {"
" \"name\": \"vendor-encapsulated-options\","
" \"space\": \"dhcp4\","
" \"code\": 43,"
" \"data\": \"\","
" \"csv-format\": False"
" },"
" {"
" \"name\": \"foo\","
" \"space\": \"vendor-encapsulated-options-space\","
" \"code\": 1,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" },"
" {"
" \"name\": \"foo2\","
......@@ -2762,8 +2724,7 @@ TEST_F(Dhcp4ParserTest, vendorOptionsCsv) {
" \"name\": \"foo\","
" \"space\": \"vendor-4491\","
" \"code\": 100,"
" \"data\": \"this is a string vendor-opt\","
" \"csv-format\": True"
" \"data\": \"this is a string vendor-opt\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......@@ -2836,17 +2797,13 @@ buildHooksLibrariesConfig(const std::vector<std::string>& libraries) {
"\"renew-timer\": 1000,"
"\"option-data\": [ {"
" \"name\": \"dhcp-message\","
" \"space\": \"dhcp4\","
" \"code\": 56,"
" \"data\": \"ABCDEF0105\","
" \"csv-format\": False"
" },"
" {"
" \"name\": \"foo\","
" \"space\": \"isc\","
" \"code\": 56,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......
......@@ -53,10 +53,7 @@ const char* DECLINE_CONFIGS[] = {
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
" \"option-data\": [ {"
" \"name\": \"routers\","
" \"code\": 3,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" } ]"
" } ]"
"}"
......
......@@ -77,31 +77,19 @@ const char* DORA_CONFIGS[] = {
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
" \"option-data\": [ {"
" \"name\": \"routers\","
" \"code\": 3,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" },"
" {"
" \"name\": \"domain-name-servers\","
" \"code\": 6,"
" \"data\": \"10.0.0.202,10.0.0.203\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.202,10.0.0.203\""
" },"
" {"
" \"name\": \"log-servers\","
" \"code\": 7,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" },"
" {"
" \"name\": \"cookie-servers\","
" \"code\": 8,"
" \"data\": \"10.0.0.202,10.0.0.203\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.202,10.0.0.203\""
" } ]"
" } ]"
"}",
......@@ -116,31 +104,19 @@ const char* DORA_CONFIGS[] = {
" \"subnet\": \"192.0.2.0/24\", "
" \"option-data\": [ {"
" \"name\": \"routers\","
" \"code\": 3,"
" \"data\": \"192.0.2.200,192.0.2.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"192.0.2.200,192.0.2.201\""
" },"
" {"
" \"name\": \"domain-name-servers\","
" \"code\": 6,"
" \"data\": \"192.0.2.202,192.0.2.203\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"192.0.2.202,192.0.2.203\""
" },"
" {"
" \"name\": \"log-servers\","
" \"code\": 7,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" },"
" {"
" \"name\": \"cookie-servers\","
" \"code\": 8,"
" \"data\": \"10.0.0.202,10.0.0.203\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.202,10.0.0.203\""
" } ]"
" } ]"
"}",
......@@ -174,10 +150,7 @@ const char* DORA_CONFIGS[] = {
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
" \"option-data\": [ {"
" \"name\": \"routers\","
" \"code\": 3,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" } ]"
" } ]"
"}",
......
......@@ -47,10 +47,7 @@ const char* CONFIGS[] = {
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
" \"option-data\": [ {"
" \"name\": \"routers\","
" \"code\": 3,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" } ],"
" \"reservations\": ["
" {"
......@@ -74,10 +71,7 @@ const char* CONFIGS[] = {
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
" \"option-data\": [ {"
" \"name\": \"routers\","
" \"code\": 3,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" } ],"
" \"reservations\": ["
" {"
......
......@@ -58,31 +58,19 @@ const char* INFORM_CONFIGS[] = {
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
" \"option-data\": [ {"
" \"name\": \"routers\","
" \"code\": 3,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" },"
" {"
" \"name\": \"domain-name-servers\","
" \"code\": 6,"
" \"data\": \"10.0.0.202,10.0.0.203\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.202,10.0.0.203\""
" },"
" {"
" \"name\": \"log-servers\","
" \"code\": 7,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" },"
" {"
" \"name\": \"cookie-servers\","
" \"code\": 8,"
" \"data\": \"10.0.0.202,10.0.0.203\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.202,10.0.0.203\""
" } ]"
" } ]"
"}",
......@@ -96,31 +84,19 @@ const char* INFORM_CONFIGS[] = {
" \"subnet\": \"192.0.2.0/24\", "
" \"option-data\": [ {"
" \"name\": \"routers\","
" \"code\": 3,"
" \"data\": \"192.0.2.200,192.0.2.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"192.0.2.200,192.0.2.201\""
" },"
" {"
" \"name\": \"domain-name-servers\","
" \"code\": 6,"
" \"data\": \"192.0.2.202,192.0.2.203\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"192.0.2.202,192.0.2.203\""
" },"
" {"
" \"name\": \"log-servers\","
" \"code\": 7,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" },"
" {"
" \"name\": \"cookie-servers\","
" \"code\": 8,"
" \"data\": \"10.0.0.202,10.0.0.203\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.202,10.0.0.203\""
" } ]"
" } ]"
"}"
......
......@@ -53,10 +53,7 @@ const char* RELEASE_CONFIGS[] = {
" \"pools\": [ { \"pool\": \"10.0.0.10-10.0.0.100\" } ],"
" \"option-data\": [ {"
" \"name\": \"routers\","
" \"code\": 3,"
" \"data\": \"10.0.0.200,10.0.0.201\","
" \"csv-format\": true,"
" \"space\": \"dhcp4\""
" \"data\": \"10.0.0.200,10.0.0.201\""
" } ]"
" } ]"
"}"
......
......@@ -2068,17 +2068,12 @@ TEST_F(Dhcp6ParserTest, optionDataDefaults) {
"\"renew-timer\": 1000,"
"\"option-data\": [ {"
" \"name\": \"subscriber-id\","
" \"space\": \"dhcp6\","
" \"code\": 38,"
" \"data\": \"ABCDEF0105\","
" \"csv-format\": False"
" },"
" {"
" \"name\": \"preference\","
" \"space\": \"dhcp6\","
" \"code\": 7,"
" \"data\": \"01\","
" \"csv-format\": True"
" \"data\": \"01\""
" } ],"
"\"subnet6\": [ { "
" \"pools\": [ { \"pool\": \"2001:db8:1::/80\" } ],"
......@@ -2150,17 +2145,13 @@ TEST_F(Dhcp6ParserTest, optionDataTwoSpaces) {
"\"renew-timer\": 1000,"
"\"option-data\": [ {"
" \"name\": \"subscriber-id\","
" \"space\": \"dhcp6\","
" \"code\": 38,"
" \"data\": \"ABCDEF0105\","
" \"csv-format\": False"
" },"
" {"
" \"name\": \"foo\","
" \"space\": \"isc\","
" \"code\": 38,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......@@ -2229,16 +2220,12 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) {
"\"option-data\": [ {"
" \"name\": \"foo\","
" \"space\": \"isc\","
" \"code\": 110,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" },"
" {"
" \"name\": \"foo2\","
" \"space\": \"isc\","
" \"code\": 111,"
" \"data\": \"192.168.2.1\","
" \"csv-format\": True"
" \"data\": \"192.168.2.1\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......@@ -2275,24 +2262,17 @@ TEST_F(Dhcp6ParserTest, optionDataEncapsulate) {
"\"renew-timer\": 1000,"
"\"option-data\": [ {"
" \"name\": \"base-option\","
" \"space\": \"dhcp6\","
" \"code\": 100,"
" \"data\": \"11\","
" \"csv-format\": True"
" \"data\": \"11\""
" },"
" {"
" \"name\": \"foo\","
" \"space\": \"isc\","
" \"code\": 110,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" },"
" {"
" \"name\": \"foo2\","
" \"space\": \"isc\","
" \"code\": 111,"
" \"data\": \"192.168.2.1\","
" \"csv-format\": True"
" \"data\": \"192.168.2.1\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"base-option\","
......@@ -2366,8 +2346,6 @@ TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) {
" \"subnet\": \"2001:db8:1::/64\", "
" \"option-data\": [ {"
" \"name\": \"subscriber-id\","
" \"space\": \"dhcp6\","
" \"code\": 38,"
" \"data\": \"0102030405060708090A\","
" \"csv-format\": False"
" } ]"
......@@ -2377,8 +2355,6 @@ TEST_F(Dhcp6ParserTest, optionDataInMultipleSubnets) {
" \"subnet\": \"2001:db8:2::/64\", "
" \"option-data\": [ {"
" \"name\": \"user-class\","
" \"space\": \"dhcp6\","
" \"code\": 15,"
" \"data\": \"FFFEFDFCFB\","
" \"csv-format\": False"
" } ]"
......@@ -2741,8 +2717,7 @@ TEST_F(Dhcp6ParserTest, vendorOptionsCsv) {
" \"name\": \"foo\","
" \"space\": \"vendor-4491\","
" \"code\": 100,"
" \"data\": \"this is a string vendor-opt\","
" \"csv-format\": True"
" \"data\": \"this is a string vendor-opt\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......@@ -2803,16 +2778,12 @@ TEST_F(Dhcp6ParserTest, DISABLED_stdOptionDataEncapsulate) {
"\"option-data\": [ {"
" \"name\": \"foo\","
" \"space\": \"vendor-opts-space\","
" \"code\": 110,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" },"
" {"
" \"name\": \"foo2\","
" \"space\": \"vendor-opts-space\","
" \"code\": 111,"
" \"data\": \"192.168.2.1\","
" \"csv-format\": True"
" \"data\": \"192.168.2.1\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......@@ -2851,24 +2822,17 @@ TEST_F(Dhcp6ParserTest, DISABLED_stdOptionDataEncapsulate) {
"\"renew-timer\": 1000,"
"\"option-data\": [ {"
" \"name\": \"vendor-opts\","
" \"space\": \"dhcp6\","
" \"code\": 17,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" },"
" {"
" \"name\": \"foo\","
" \"space\": \"vendor-opts-space\","
" \"code\": 110,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" },"
" {"
" \"name\": \"foo2\","
" \"space\": \"vendor-opts-space\","
" \"code\": 111,"
" \"data\": \"192.168.2.1\","
" \"csv-format\": True"
" \"data\": \"192.168.2.1\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......@@ -2971,16 +2935,12 @@ buildHooksLibrariesConfig(const std::vector<std::string>& libraries) {
"\"option-data\": [ {"
" \"name\": \"foo\","
" \"space\": \"vendor-opts-space\","
" \"code\": 110,"
" \"data\": \"1234\","
" \"csv-format\": True"
" \"data\": \"1234\""
" },"
" {"
" \"name\": \"foo2\","
" \"space\": \"vendor-opts-space\","
" \"code\": 111,"
" \"data\": \"192.168.2.1\","
" \"csv-format\": True"
" \"data\": \"192.168.2.1\""
" } ],"
"\"option-def\": [ {"
" \"name\": \"foo\","
......
......@@ -300,15 +300,10 @@ TEST_F(Dhcpv6SrvTest, advertiseOptions) {
" \"interface\": \"eth0\", "
" \"option-data\": [ {"
" \"name\": \"dns-servers\","
" \"space\": \"dhcp6\","
" \"code\": 23,"
" \"data\": \"2001:db8:1234:FFFF::1, 2001:db8:1234:FFFF::2\","
" \"csv-format\": True"
" \"data\": \"2001:db8:1234:FFFF::1, 2001:db8:1234:FFFF::2\""
" },"
" {"
" \"name\": \"subscriber-id\","
" \"space\": \"dhcp6\","
" \"code\": 38,"
" \"data\": \"1234\","
" \"csv-format\": False"
" } ]"
......@@ -1564,17 +1559,12 @@ TEST_F(Dhcpv6SrvTest, vendorOptionsORO) {
" \"name\": \"config-file\","
" \"code\": 33,"
" \"type\": \"string\","
" \"array\": False,"
" \"record-types\": \"\","
" \"space\": \"vendor-4491\","
" \"encapsulate\": \"\""