Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
450
Issues
450
List
Boards
Labels
Service Desk
Milestones
Merge Requests
75
Merge Requests
75
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
Kea
Commits
33b56919
Commit
33b56919
authored
Dec 04, 2018
by
Marcin Siodelski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#86
,
!152
] Modified v6 FQDN option unit tests for case insensitive compare.
parent
51eb5d65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
src/lib/dhcp/option6_client_fqdn.h
src/lib/dhcp/option6_client_fqdn.h
+5
-1
src/lib/dhcp/tests/option6_client_fqdn_unittest.cc
src/lib/dhcp/tests/option6_client_fqdn_unittest.cc
+11
-11
No files found.
src/lib/dhcp/option6_client_fqdn.h
View file @
33b56919
// Copyright (C) 2013-201
6
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-201
8
Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
...
...
@@ -70,6 +70,10 @@ class Option6ClientFqdnImpl;
/// domain-names to indicate that server should generate complete fully
/// qualified domain-name.
///
/// Since domain names are case insensitive (see RFC 4343), this class
/// converts them to lower case format regardless if they are received over
/// the wire or created from strings.
///
/// <b>Design choice:</b> This class uses pimpl idiom to separate the interface
/// from implementation specifics. Implementations may use different approaches
/// to handle domain names (mostly validation of the domain-names). The existing
...
...
src/lib/dhcp/tests/option6_client_fqdn_unittest.cc
View file @
33b56919
// Copyright (C) 2013-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013-201
8
Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
...
...
@@ -146,9 +146,9 @@ TEST(Option6ClientFqdnTest, copyConstructEmptyDomainName) {
TEST
(
Option6ClientFqdnTest
,
constructFromWire
)
{
const
uint8_t
in_data
[]
=
{
Option6ClientFqdn
::
FLAG_S
,
// flags
6
,
109
,
121
,
104
,
111
,
115
,
116
,
// m
yhost.
7
,
101
,
120
,
97
,
109
,
112
,
108
,
101
,
// e
xample.
3
,
99
,
111
,
109
,
0
// c
om.
6
,
77
,
121
,
104
,
111
,
115
,
116
,
// M
yhost.
7
,
69
,
120
,
97
,
109
,
112
,
108
,
101
,
// E
xample.
3
,
67
,
111
,
109
,
0
// C
om.
};
size_t
in_data_size
=
sizeof
(
in_data
)
/
sizeof
(
in_data
[
0
]);
OptionBuffer
in_buf
(
in_data
,
in_data
+
in_data_size
);
...
...
@@ -210,7 +210,7 @@ TEST(Option6ClientFqdnTest, constructFromWireTruncated) {
TEST
(
Option6ClientFqdnTest
,
constructFromWirePartial
)
{
const
uint8_t
in_data
[]
=
{
Option6ClientFqdn
::
FLAG_N
,
// flags
6
,
109
,
121
,
104
,
111
,
115
,
116
// m
yhost
6
,
77
,
121
,
104
,
111
,
115
,
116
// M
yhost
};
size_t
in_data_size
=
sizeof
(
in_data
)
/
sizeof
(
in_data
[
0
]);
OptionBuffer
in_buf
(
in_data
,
in_data
+
in_data_size
);
...
...
@@ -274,7 +274,7 @@ TEST(Option6ClientFqdnTest, assignment) {
// Create first option.
Option6ClientFqdn
option
(
Option6ClientFqdn
::
FLAG_S
,
"
myhost.example.c
om"
,
"
Myhost.Example.C
om"
,
Option6ClientFqdn
::
FULL
);
// Verify that the values have been set correctly.
...
...
@@ -514,13 +514,13 @@ TEST(Option6ClientFqdnTest, setDomainName) {
ASSERT_EQ
(
Option6ClientFqdn
::
FULL
,
option
->
getDomainNameType
());
// Partial domain-name.
ASSERT_NO_THROW
(
option
->
setDomainName
(
"
m
yhost"
,
ASSERT_NO_THROW
(
option
->
setDomainName
(
"
M
yhost"
,
Option6ClientFqdn
::
PARTIAL
));
EXPECT_EQ
(
"myhost"
,
option
->
getDomainName
());
EXPECT_EQ
(
Option6ClientFqdn
::
PARTIAL
,
option
->
getDomainNameType
());
// Fully qualified domain-name.
ASSERT_NO_THROW
(
option
->
setDomainName
(
"
e
xample.com"
,
ASSERT_NO_THROW
(
option
->
setDomainName
(
"
E
xample.com"
,
Option6ClientFqdn
::
FULL
));
EXPECT_EQ
(
"example.com."
,
option
->
getDomainName
());
EXPECT_EQ
(
Option6ClientFqdn
::
FULL
,
option
->
getDomainNameType
());
...
...
@@ -664,8 +664,8 @@ TEST(Option6ClientFqdnTest, unpack) {
const
uint8_t
in_data
[]
=
{
Option6ClientFqdn
::
FLAG_S
,
// flags
6
,
109
,
121
,
104
,
111
,
115
,
116
,
// m
yhost.
7
,
101
,
120
,
97
,
109
,
112
,
108
,
101
,
// e
xample.
6
,
77
,
121
,
104
,
111
,
115
,
116
,
// M
yhost.
7
,
69
,
120
,
97
,
109
,
112
,
108
,
101
,
// E
xample.
3
,
99
,
111
,
109
,
0
// com.
};
size_t
in_data_size
=
sizeof
(
in_data
)
/
sizeof
(
in_data
[
0
]);
...
...
@@ -703,7 +703,7 @@ TEST(Option6ClientFqdnTest, unpackPartial) {
const
uint8_t
in_data
[]
=
{
Option6ClientFqdn
::
FLAG_S
,
// flags
6
,
109
,
121
,
104
,
111
,
115
,
116
// m
yhost
6
,
77
,
121
,
104
,
111
,
115
,
116
// M
yhost
};
size_t
in_data_size
=
sizeof
(
in_data
)
/
sizeof
(
in_data
[
0
]);
OptionBuffer
in_buf
(
in_data
,
in_data
+
in_data_size
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment