Skip to content
GitLab
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
78763269
Commit
78763269
authored
Jul 06, 2011
by
JINMEI Tatuya
Browse files
[master] fixed a trivial typo in test names. pushing directly.
parent
025f40af
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bin/auth/tests/command_unittest.cc
View file @
78763269
...
...
@@ -48,9 +48,9 @@ using namespace isc::datasrc;
using
namespace
isc
::
config
;
namespace
{
class
AuthCo
n
mmandTest
:
public
::
testing
::
Test
{
class
AuthCommandTest
:
public
::
testing
::
Test
{
protected:
AuthCo
n
mmandTest
()
:
server
(
false
,
xfrout
),
rcode
(
-
1
)
{
AuthCommandTest
()
:
server
(
false
,
xfrout
),
rcode
(
-
1
)
{
server
.
setStatisticsSession
(
&
statistics_session
);
}
void
checkAnswer
(
const
int
expected_code
)
{
...
...
@@ -67,14 +67,14 @@ public:
void
stopServer
();
// need to be public for boost::bind
};
TEST_F
(
AuthCo
n
mmandTest
,
unknownCommand
)
{
TEST_F
(
AuthCommandTest
,
unknownCommand
)
{
result
=
execAuthServerCommand
(
server
,
"no_such_command"
,
ConstElementPtr
());
parseAnswer
(
rcode
,
result
);
EXPECT_EQ
(
1
,
rcode
);
}
TEST_F
(
AuthCo
n
mmandTest
,
DISABLED_unexpectedException
)
{
TEST_F
(
AuthCommandTest
,
DISABLED_unexpectedException
)
{
// execAuthServerCommand() won't catch standard exceptions.
// Skip this test for now: ModuleCCSession doesn't seem to validate
// commands.
...
...
@@ -83,7 +83,7 @@ TEST_F(AuthConmmandTest, DISABLED_unexpectedException) {
runtime_error
);
}
TEST_F
(
AuthCo
n
mmandTest
,
sendStatistics
)
{
TEST_F
(
AuthCommandTest
,
sendStatistics
)
{
result
=
execAuthServerCommand
(
server
,
"sendstats"
,
ConstElementPtr
());
// Just check some message has been sent. Detailed tests specific to
// statistics are done in its own tests.
...
...
@@ -92,15 +92,15 @@ TEST_F(AuthConmmandTest, sendStatistics) {
}
void
AuthCo
n
mmandTest
::
stopServer
()
{
AuthCommandTest
::
stopServer
()
{
result
=
execAuthServerCommand
(
server
,
"shutdown"
,
ConstElementPtr
());
parseAnswer
(
rcode
,
result
);
assert
(
rcode
==
0
);
// make sure the test stops when something is wrong
}
TEST_F
(
AuthCo
n
mmandTest
,
shutdown
)
{
TEST_F
(
AuthCommandTest
,
shutdown
)
{
isc
::
asiolink
::
IntervalTimer
itimer
(
server
.
getIOService
());
itimer
.
setup
(
boost
::
bind
(
&
AuthCo
n
mmandTest
::
stopServer
,
this
),
1
);
itimer
.
setup
(
boost
::
bind
(
&
AuthCommandTest
::
stopServer
,
this
),
1
);
server
.
getIOService
().
run
();
EXPECT_EQ
(
0
,
rcode
);
}
...
...
@@ -165,7 +165,7 @@ newZoneChecks(AuthSrv& server) {
find
(
Name
(
"ns.test2.example"
),
RRType
::
AAAA
()).
code
);
}
TEST_F
(
AuthCo
n
mmandTest
,
loadZone
)
{
TEST_F
(
AuthCommandTest
,
loadZone
)
{
configureZones
(
server
);
ASSERT_EQ
(
0
,
system
(
INSTALL_PROG
" "
TEST_DATA_DIR
...
...
@@ -182,7 +182,7 @@ TEST_F(AuthConmmandTest, loadZone) {
newZoneChecks
(
server
);
}
TEST_F
(
AuthCo
n
mmandTest
,
loadBrokenZone
)
{
TEST_F
(
AuthCommandTest
,
loadBrokenZone
)
{
configureZones
(
server
);
ASSERT_EQ
(
0
,
system
(
INSTALL_PROG
" "
TEST_DATA_DIR
...
...
@@ -195,7 +195,7 @@ TEST_F(AuthConmmandTest, loadBrokenZone) {
zoneChecks
(
server
);
// zone shouldn't be replaced
}
TEST_F
(
AuthCo
n
mmandTest
,
loadUnreadableZone
)
{
TEST_F
(
AuthCommandTest
,
loadUnreadableZone
)
{
configureZones
(
server
);
// install the zone file as unreadable
...
...
@@ -209,7 +209,7 @@ TEST_F(AuthConmmandTest, loadUnreadableZone) {
zoneChecks
(
server
);
// zone shouldn't be replaced
}
TEST_F
(
AuthCo
n
mmandTest
,
loadZoneWithoutDataSrc
)
{
TEST_F
(
AuthCommandTest
,
loadZoneWithoutDataSrc
)
{
// try to execute load command without configuring the zone beforehand.
// it should fail.
result
=
execAuthServerCommand
(
server
,
"loadzone"
,
...
...
@@ -218,7 +218,7 @@ TEST_F(AuthConmmandTest, loadZoneWithoutDataSrc) {
checkAnswer
(
1
);
}
TEST_F
(
AuthCo
n
mmandTest
,
loadSqlite3DataSrc
)
{
TEST_F
(
AuthCommandTest
,
loadSqlite3DataSrc
)
{
// For sqlite3 data source we don't have to do anything (the data source
// (re)loads itself automatically)
result
=
execAuthServerCommand
(
server
,
"loadzone"
,
...
...
@@ -228,7 +228,7 @@ TEST_F(AuthConmmandTest, loadSqlite3DataSrc) {
checkAnswer
(
0
);
}
TEST_F
(
AuthCo
n
mmandTest
,
loadZoneInvalidParams
)
{
TEST_F
(
AuthCommandTest
,
loadZoneInvalidParams
)
{
configureZones
(
server
);
// null arg
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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