Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
62df1d46
Commit
62df1d46
authored
Nov 27, 2012
by
Michal 'vorner' Vaner
Browse files
[2378] Basic test for incremental loading
parent
8743e25c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/datasrc/tests/zone_loader_unittest.cc
View file @
62df1d46
...
...
@@ -169,4 +169,33 @@ TEST_F(ZoneLoaderTest, copyUnsigned) {
EXPECT_THROW
(
loader
.
loadIncremental
(
0
),
isc
::
InvalidOperation
);
}
// Try loading incrementally.
TEST_F
(
ZoneLoaderTest
,
copyUnsignedIncremental
)
{
prepareSource
(
Name
::
ROOT_NAME
(),
"root.zone"
);
ZoneLoader
loader
(
destination_client_
,
Name
::
ROOT_NAME
(),
source_client_
);
// Try loading few RRs first.
loader
.
loadIncremental
(
10
);
// We should get the 10 we asked for
EXPECT_EQ
(
10
,
destination_client_
.
rrsets_
.
size
());
// Not committed yet, we didn't complete the loading
EXPECT_FALSE
(
destination_client_
.
commit_called_
);
// This is unusual, but allowed. Check it doesn't do anything
loader
.
loadIncremental
(
0
);
EXPECT_EQ
(
10
,
destination_client_
.
rrsets_
.
size
());
EXPECT_FALSE
(
destination_client_
.
commit_called_
);
// We can finish the rest
loader
.
loadIncremental
(
30
);
EXPECT_EQ
(
34
,
destination_client_
.
rrsets_
.
size
());
EXPECT_TRUE
(
destination_client_
.
commit_called_
);
// No more loading now
EXPECT_THROW
(
loader
.
load
(),
isc
::
InvalidOperation
);
EXPECT_THROW
(
loader
.
loadIncremental
(
1
),
isc
::
InvalidOperation
);
EXPECT_THROW
(
loader
.
loadIncremental
(
0
),
isc
::
InvalidOperation
);
}
}
Write
Preview
Supports
Markdown
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