Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
4c07c122
Commit
4c07c122
authored
Jul 12, 2016
by
Marcin Siodelski
Browse files
[4489] Added unit test for read only mode in PgSQL backend.
parent
65d3817d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/mysql_host_data_source.cc
View file @
4c07c122
...
...
@@ -1787,8 +1787,6 @@ public:
/// @brief Indicates if the database is opened in read only mode.
bool
is_readonly_
;
namespace
{
};
...
...
@@ -1948,8 +1946,6 @@ TaggedStatementArray tagged_statements = { {
" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, 3)"
}}
};
};
// end anonymouse namespace
MySqlHostDataSourceImpl
::
MySqlHostDataSourceImpl
(
const
MySqlConnection
::
ParameterMap
&
parameters
)
:
host_exchange_
(
new
MySqlHostWithOptionsExchange
(
MySqlHostWithOptionsExchange
::
DHCP4_ONLY
)),
...
...
src/lib/dhcpsrv/tests/pgsql_host_data_source_unittest.cc
View file @
4c07c122
...
...
@@ -64,8 +64,13 @@ public:
/// close the database. Then reopen it and delete everything created by
/// the test.
virtual
~
PgSqlHostDataSourceTest
()
{
hdsptr_
->
rollback
();
try
{
hdsptr_
->
rollback
();
}
catch
(...)
{
// Rollback may fail if backend is in read only mode. That's ok.
}
HostDataSourceFactory
::
destroy
();
hdsptr_
.
reset
();
destroyPgSQLSchema
();
}
...
...
@@ -168,6 +173,12 @@ TEST(PgSqlHostDataSource, OpenDatabase) {
destroyPgSQLSchema
();
}
// This test verifies that database backend can operate in Read-Only mode.
TEST_F
(
PgSqlHostDataSourceTest
,
testReadOnlyDatabase
)
{
testReadOnlyDatabase
(
PGSQL_VALID_TYPE
);
}
// Test verifies if a host reservation can be added and later retrieved by IPv4
// address. Host uses hw address as identifier.
TEST_F
(
PgSqlHostDataSourceTest
,
basic4HWAddr
)
{
...
...
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