Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ipv4 addr plus port #63

Open
wants to merge 56 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
233950b
added address plus port
Feb 1, 2018
43f201b
fixed merge
Feb 1, 2018
a238b7c
add static casts
Feb 1, 2018
67483dc
minor changes
Feb 1, 2018
0868823
minor changes
Feb 1, 2018
6012b29
fixed unit tests
Feb 2, 2018
62ce579
updated unit tests
Feb 2, 2018
26e8bf4
removed unsupported options
Feb 3, 2018
a875ea1
updated cql schema and added minor changes (including spelling mistak…
Feb 7, 2018
f804d7e
minor chnages
Feb 9, 2018
7ecf8fb
Merge remote-tracking branch 'isc-kea/master' into cql_clean_code
Feb 15, 2018
01d56b8
Merge remote-tracking branch 'isc-kea/master' into cql_clean_code
Feb 15, 2018
098865d
Merge remote-tracking branch 'isc-kea/master' into HEAD
Feb 15, 2018
10e19f3
Merge branch 'cql_clean_code' of https://github.com/razvan-becheriu/k…
Feb 15, 2018
e2317a1
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Feb 19, 2018
448cf73
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Feb 28, 2018
ae60f3f
Merge remote-tracking branch 'isc-kea/master' into cql_clean_code
Feb 28, 2018
14c3a55
minor changes - fixed eventual memory leak
Mar 1, 2018
45464c5
minor changes
Mar 1, 2018
16c80de
minor changes
Mar 1, 2018
5637d01
minor changes
Mar 1, 2018
4637a23
refactored cql recount leases plus minor changes
Mar 1, 2018
d3f8281
minor changes
Mar 1, 2018
b2d80eb
minor changes
Mar 1, 2018
ffc8c78
Merge remote-tracking branch 'isc-kea/master' into cassandra_improvem…
Mar 2, 2018
afddd8a
Merge remote-tracking branch 'isc-kea/master' into cql_clean_code
Mar 7, 2018
d32a318
Merge remote-tracking branch 'isc-kea/master' into cassandra_improvem…
Mar 7, 2018
c3e4fe2
enabled tests for cql
Mar 7, 2018
e728823
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Mar 7, 2018
8b1f21a
src/lib/dhcpsrv/tests/generic_host_data_source_unittest.cc
Mar 7, 2018
55a57d4
enabled tests for cql
Mar 7, 2018
38b5430
fixed unit tests
Mar 7, 2018
400abf1
fixed merge
Mar 13, 2018
33e4b4f
Merge remote-tracking branch 'isc-kea/master' into cassandra_improvem…
Mar 13, 2018
42d8ad3
minor changes
Mar 13, 2018
1b6df23
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Mar 13, 2018
39bc0b7
fixed merge
Mar 13, 2018
61f9562
Merge branch 'cql_clean_code' into ipv4_addr_plus_port
Mar 13, 2018
b65cd1f
fixed merge
Mar 13, 2018
a1ab751
fixed comments
Mar 13, 2018
387ffa4
minor changes
Mar 13, 2018
746acc8
minor changes
Mar 13, 2018
78f3ad6
Merge branch 'cassandra_improvements' into cql_clean_code
Mar 13, 2018
38a837f
minor changes
Mar 14, 2018
9ed1f3d
minor changes
Mar 14, 2018
d61a05b
minor changes
Mar 14, 2018
cc59e9a
minor changes
Mar 14, 2018
365e64f
minor changes
Mar 14, 2018
85e88a2
Merge remote-tracking branch 'isc-kea/master' into cql_clean_code
Mar 15, 2018
594bd9e
Merge branch 'cql_clean_code' into ipv4_addr_plus_port
Mar 15, 2018
053d2f3
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Mar 19, 2018
aac7d46
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
May 24, 2018
8670f46
minor changes
May 24, 2018
552f467
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Jun 5, 2018
3d23cef
minor changes
Jun 14, 2018
0872bf5
Merge remote-tracking branch 'isc-kea/master' into ipv4_addr_plus_port
Jun 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'isc-kea/master' into cassandra_improvem…
…ents
  • Loading branch information
Razvan Becheriu committed Mar 13, 2018
commit 33e4b4fac270c44c4246ba816b2f200d12c7b467
6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1623,9 +1623,9 @@ if test "$CQL_CPPFLAGS" != "" ; then
cat >> config.report << END

Cassandra CQL:
CQL_VERSION: ${CQL_VERSION}
CQL_CPPFLAGS: ${CQL_CPPFLAGS}
CQL_LIBS: ${CQL_LIBS}
CQL_VERSION: ${CQL_VERSION}
CQL_CPPFLAGS: ${CQL_CPPFLAGS}
CQL_LIBS: ${CQL_LIBS}
END
else
cat >> config.report << END
Expand Down
24 changes: 11 additions & 13 deletions src/lib/dhcpsrv/cql_host_data_source.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ class CqlHostDataSourceImpl {
/// See @ref CqlHostDataSource::add() for parameter details.
///
/// @param host host to be added or deleted
/// @param insert insert or delete the host
/// @param insert insert (true) or delete (false) the host
virtual bool insertOrDelete(const HostPtr& host, bool insert);

/// @brief Implementation of @ref CqlHostDataSource::get4()
Expand Down Expand Up @@ -1974,7 +1974,8 @@ CqlHostDataSourceImpl::insertOrDeleteHostWithOptions(bool insert,
}
option_found = true;
/// @todo: Assign actual value to subnet id.
result = insertOrDeleteHost(insert, host, OptionalValue<SubnetID>(), reservation, space, option);
result = insertOrDeleteHost(insert, host, OptionalValue<SubnetID>(), reservation,
space, option);
}
}
}
Expand Down Expand Up @@ -2082,17 +2083,14 @@ CqlHostDataSourceImpl::insertOrDeleteHost(bool insert,

try {
if (insert) {
host_exchange->createBindForMutation(
host, subnet_id, reservation, option_space, option_descriptor,
CqlHostExchange::INSERT_HOST, assigned_values);
host_exchange->createBindForMutation(host, subnet_id, reservation, option_space,
option_descriptor, CqlHostExchange::INSERT_HOST, assigned_values);


host_exchange->executeMutation(dbconn_, assigned_values, CqlHostExchange::INSERT_HOST);
} else {
host_exchange->createBindForDelete(
host, subnet_id, reservation, option_space, option_descriptor,
CqlHostExchange::DELETE_HOST, assigned_values);

host_exchange->createBindForDelete(host, subnet_id, reservation, option_space,
option_descriptor, CqlHostExchange::DELETE_HOST, assigned_values);

host_exchange->executeMutation(dbconn_, assigned_values, CqlHostExchange::DELETE_HOST);
}
Expand Down Expand Up @@ -2155,17 +2153,17 @@ CqlHostDataSource::del(const SubnetID& subnet_id, const asiolink::IOAddress& add
bool
CqlHostDataSource::del4(const SubnetID& subnet_id, const Host::IdentifierType& identifier_type,
const uint8_t* identifier_begin, const size_t identifier_len) {
HostPtr host = boost::const_pointer_cast<Host>(impl_->get4(
subnet_id, identifier_type, identifier_begin, identifier_len));
HostPtr host = boost::const_pointer_cast<Host>(impl_->get4(subnet_id, identifier_type,
identifier_begin, identifier_len));

return (impl_->insertOrDelete(host, false));
}

bool
CqlHostDataSource::del6(const SubnetID& subnet_id, const Host::IdentifierType& identifier_type,
const uint8_t* identifier_begin, const size_t identifier_len) {
HostPtr host = boost::const_pointer_cast<Host>(impl_->get6(
subnet_id, identifier_type, identifier_begin, identifier_len));
HostPtr host = boost::const_pointer_cast<Host>(impl_->get6(subnet_id, identifier_type,
identifier_begin, identifier_len));

return (impl_->insertOrDelete(host, false));
}
Expand Down
4 changes: 3 additions & 1 deletion src/lib/dhcpsrv/cql_host_data_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,9 @@ class CqlHostDataSource : public BaseHostDataSource {

/// @brief Returns a collection of all the hosts.
///
/// This method may return multiple @ref Host objects.
/// This method may return multiple @ref Host objects. It is only used in
/// testing. It may be very slow when running on a production server with
/// lots of hosts.
///
/// @return Collection of const @ref Host objects.
virtual ConstHostCollection
Expand Down
1 change: 1 addition & 0 deletions src/lib/dhcpsrv/tests/cql_host_data_source_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ TEST(CqlConnection, checkTimeConversion) {
}

// This test verifies that database backend can operate in Read-Only mode.
// We currently don't test Cassandra in read-only mode.
TEST_F(CqlHostDataSourceTest, DISABLED_testReadOnlyDatabase) {
testReadOnlyDatabase(CQL_VALID_TYPE);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/dhcpsrv/tests/cql_lease_mgr_unittest.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2015-2017 Deutsche Telekom AG.
//
// Authors: Razvan Becheriu <razvan.becheriu@qualitance.com>
Expand Down
1 change: 1 addition & 0 deletions src/lib/dhcpsrv/tests/generic_lease_mgr_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1970,6 +1970,7 @@ GenericLeaseMgrTest::testDeleteExpiredReclaimedLeases4() {
EXPECT_FALSE(lease) << "The following lease should have been"
" deleted: " << leases[i]->toText();
++should_delete_num;

} else {
// If the lease is not reclaimed or it has expired less than
// 15 seconds ago, the lease should still be there.
Expand Down
30 changes: 30 additions & 0 deletions src/lib/dhcpsrv/tests/pgsql_host_data_source_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,36 @@ TEST(PgSqlHostDataSource, OpenDatabase) {
destroyPgSQLSchema();
}

/// @brief Flag used to detect calls to db_lost_callback function
bool callback_called = false;

/// @brief Callback function used in open database testing
bool db_lost_callback(ReconnectCtlPtr /* db_conn_retry */) {
return (callback_called = true);
}

/// @brief Make sure open failures do NOT invoke db lost callback
/// The db lost callback should only be invoked after succesfully
/// opening the DB and then subsequently losing it. Failing to
/// open should be handled directly by the application layer.
/// There is simply no good way to break the connection in a
/// unit test environment. So testing the callback invocation
/// in a unit test is next to impossible. That has to be done
/// as a system test.
TEST(PgSqlHostDataSource, NoCallbackOnOpenFail) {
// Schema needs to be created for the test to work.
destroyPgSQLSchema();
createPgSQLSchema();

callback_called = false;
EXPECT_THROW(HostDataSourceFactory::create(connectionString(
PGSQL_VALID_TYPE, VALID_NAME, INVALID_HOST, VALID_USER, VALID_PASSWORD),
db_lost_callback), DbOpenError);

EXPECT_FALSE(callback_called);
destroyPgSQLSchema();
}

// This test verifies that database backend can operate in Read-Only mode.
TEST_F(PgSqlHostDataSourceTest, testReadOnlyDatabase) {
testReadOnlyDatabase(PGSQL_VALID_TYPE);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,12 @@ TEST_F(PgSqlLeaseMgrTest, nullDuid) {
testNullDuid();
}

/// @brief Tests whether memfile can store and retrieve hardware addresses
/// @brief Tests whether Postgres can store and retrieve hardware addresses
TEST_F(PgSqlLeaseMgrTest, testLease6Mac) {
testLease6MAC();
}

/// @brief Tests whether memfile can store and retrieve hardware addresses
/// @brief Tests whether Postgres can store and retrieve hardware addresses
TEST_F(PgSqlLeaseMgrTest, testLease6HWTypeAndSource) {
testLease6HWTypeAndSource();
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.