Commit 7e77f043 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[master] Merge branch 'github54' (various changes)

parents 38e33d2b 2efa7494
......@@ -2,3 +2,5 @@
/kea-guide.txt
/kea-messages.html
/kea-messages.xml
/kea-guide.pdf
/kea-messages.pdf
......@@ -49,7 +49,7 @@ $(HTMLDOCS) $(DOCS):
@echo Doc generation disabled. Creating dummy $@. Configure with --enable-generate-docs to enable it.
@echo Doc generation disabled. Remove this file, configure with --enable-generate-docs, and rebuild Kea > $@
endif
endif
if HAVE_DBLATEX
......
......@@ -18,12 +18,26 @@
mysql_execute() {
QUERY=$1
shift
if [ $# -gt 1 ]; then
mysql -N -B "$@" -e "${QUERY}"
retcode=$?
else
mysql -N -B --database="${db_name}" --user="${db_user}" --password="${db_password}" -e "${QUERY}"
retcode=$?
fi
return $retcode
}
mysql_execute_script() {
file=$1
shift
if [ $# -ge 1 ]; then
mysql -N -B $* -e "${QUERY}"
mysql -N -B "$@" < "${file}"
retcode=$?
else
mysql -N -B --host=$db_host --user=$db_user --password=$db_password -e "${QUERY}" $db_name
retcode="$?"
mysql -N -B --database="${db_name}" --user="${db_user}" --password="${db_password}" < "${file}"
retcode=$?
fi
return $retcode
......@@ -47,12 +61,12 @@ mysql_version() {
pgsql_execute() {
QUERY=$1
shift
if [ $# -ge 1 ]; then
echo $QUERY | psql --set ON_ERROR_STOP=1 -A -t -h localhost -q $*
if [ $# -gt 0 ]; then
echo "${QUERY}" | psql --set ON_ERROR_STOP=1 -A -t -h localhost -q "$@"
retcode=$?
else
export PGPASSWORD=$db_password
echo $QUERY | psql --set ON_ERROR_STOP=1 -A -t -h $db_host -q -U $db_user -d $db_name
echo "${QUERY}" | psql --set ON_ERROR_STOP=1 -A -t -h localhost -q -U "${db_user}" -d "${db_name}"
retcode=$?
fi
return $retcode
......@@ -71,12 +85,12 @@ pgsql_execute() {
pgsql_execute_script() {
file=$1
shift
if [ $# -ge 1 ]; then
psql --set ON_ERROR_STOP=1 -A -t -h localhost -q -f $file $*
if [ $# -gt 0 ]; then
psql --set ON_ERROR_STOP=1 -A -t -h localhost -q -f "${file}" "$@"
retcode=$?
else
export PGPASSWORD=$db_password
psql --set ON_ERROR_STOP=1 -A -t -h $db_host -q -U $db_user -d $db_name -f $file
psql --set ON_ERROR_STOP=1 -A -t -h localhost -q -U "${db_user}" -d "${db_name}" -f "${file}"
retcode=$?
fi
return $retcode
......@@ -90,16 +104,16 @@ pgsql_version() {
cql_execute() {
query=$1
shift
if [ $# -ge 1 ]; then
if [ $# -gt 1 ]; then
cqlsh "$@" -e "$query"
retcode=$?
else
cqlsh -u $db_user -p $db_password -k $db_name -e "$query"
cqlsh -u "${db_user}" -p "${db_password}" -k "${db_name}" -e "${query}"
retcode=$?
fi
if [ $retcode -ne 0 ]; then
printf "cqlsh returned with exit status $retcode\n"
printf "cqlsh returned with exit status %s\n" "${retcode}"
exit $retcode
fi
......@@ -109,16 +123,16 @@ cql_execute() {
cql_execute_script() {
file=$1
shift
if [ $# -ge 1 ]; then
cqlsh "$@" -f "$file"
if [ $# -gt 1 ]; then
cqlsh "$@" -e "$file"
retcode=$?
else
cqlsh -u $db_user -p $db_password -k $db_name -f "$file"
cqlsh -u "${db_user}" -p "${db_password}" -k "${db_name}" -f "${file}"
retcode=$?
fi
if [ $retcode -ne 0 ]; then
printf "cqlsh returned with exit status $retcode\n"
printf "cqlsh returned with exit status %s\n" "${retcode}"
exit $retcode
fi
......@@ -126,9 +140,8 @@ cql_execute_script() {
}
cql_version() {
version=$(cql_execute "SELECT version, minor FROM schema_version" "$@")
error=$?
version=$(echo "$version" | grep -A 1 "+" | grep -v "+" | tr -d ' ' | cut -d "|" -f 1-2 --output-delimiter=".")
echo "$version"
return $error
version=$(cql_execute "SELECT version, minor FROM schema_version" "$@")
version=$(echo "$version" | grep -A 1 "+" | grep -v "+" | tr -d ' ' | cut -d "|" -f 1-2 --output-delimiter=".")
echo "${version}"
return $?
}
......@@ -103,7 +103,6 @@
migrating between old and new Kea versions.</para>
</listitem>
</varlistentry>
</variablelist>
<varlistentry>
<term>lease-dump</term>
......@@ -114,6 +113,7 @@
The first line of file is a header line containing the column names.</para>
</listitem>
</varlistentry>
</variablelist>
</listitem>
</varlistentry>
......
......@@ -25,21 +25,20 @@ using namespace isc::dns::rdata;
using namespace isc::util;
namespace {
// @brief Test fixture class for testing D2UpdateMessage object.
/// @brief Test fixture class for testing D2UpdateMessage object
class D2UpdateMessageTest : public ::testing::Test {
public:
// @brief Constructor.
/// @brief Constructor
//
// Does nothing.
D2UpdateMessageTest() { }
// @brief Destructor.
/// @brief Destructor
//
// Does nothing.
~D2UpdateMessageTest() { };
// @brief Return string representation of the name encoded in wire format.
/// @brief Returns string representation of the name encoded in wire format.
//
// This function reads the number of bytes specified in the second
// argument from the buffer. It doesn't check if buffer has sufficient
......
......@@ -36,8 +36,7 @@ const char* TEST_ADDRESS = "127.0.0.1";
const uint16_t TEST_PORT = 5301;
const size_t MAX_SIZE = 1024;
const long TEST_TIMEOUT = 5 * 1000;
// @brief Test Fixture class.
/// @brief Test Fixture class
//
// This test fixture class implements DNSClient::Callback so as it can be
// installed as a completion callback for tests it implements. This callback
......@@ -64,7 +63,7 @@ public:
int received_;
int expected_;
// @brief Constructor.
/// @brief Constructor
//
// This constructor overrides the default logging level of asiodns logger to
// prevent it from emitting debug messages from IOFetch class. Such an error
......@@ -88,14 +87,14 @@ public:
TEST_TIMEOUT);
}
// @brief Destructor.
/// @brief Destructor
//
// Sets the asiodns logging level back to DEBUG.
virtual ~DNSClientTest() {
asiodns::logger.setSeverity(isc::log::DEBUG);
};
// @brief Exchange completion callback.
/// @brief Exchange completion callback
//
// This callback is called when the exchange with the DNS server is
// complete or an error occurred. This includes the occurrence of a timeout.
......@@ -133,7 +132,7 @@ public:
}
}
// @brief Handler invoked when test timeout is hit.
/// @brief Handler invoked when test timeout is hit
//
// This callback stops all running (hanging) tasks on IO service.
void testTimeoutHandler() {
......@@ -141,7 +140,7 @@ public:
FAIL() << "Test timeout hit.";
}
// @brief Handler invoked when test request is received.
/// @brief Handler invoked when test request is received
//
// This callback handler is installed when performing async read on a
// socket to emulate reception of the DNS Update request by a server.
......@@ -180,7 +179,7 @@ public:
*remote);
}
// @brief Request handler for testing clients using TSIG
/// @brief Request handler for testing clients using TSIG
//
// This callback handler is installed when performing async read on a
// socket to emulate reception of the DNS Update request with TSIG by a
......
......@@ -176,6 +176,10 @@ a client's error or a server's purged database.
% DHCP4_DHCP4O6_BAD_PACKET received malformed DHCPv4o6 packet: %1
A malformed DHCPv4o6 packet was received.
% DHCP4_DHCP4O6_PACKET_RECEIVED received DHCPv4o6 packet from DHCPv4 server (type %1) for %2 on interface %3
This debug message is printed when the server is receiving a DHCPv4o6
from the DHCPv4 server over inter-process communication.
% DHCP4_DHCP4O6_PACKET_SEND %1: trying to send packet %2 (type %3) to %4 on interface %5 encapsulating %6: %7 (type %8)
The arguments specify the client identification information (HW address
and client identifier), DHCPv6 message name and type, source IPv6
......@@ -706,7 +710,3 @@ will drop its message if the received message was DHCPDISCOVER,
and will send DHCPNAK if the received message was DHCPREQUEST.
The argument includes the client and the transaction identification
information.
% DHCP6_DHCP4O6_PACKET_RECEIVED received DHCPv4o6 packet from DHCPv6 server (type %1) for %2 on interface %3
This debug message is printed when the server is receiving a DHCPv4o6
from the DHCPv6 server over inter-process communication.
......@@ -236,7 +236,7 @@ public:
/// @brief returns Kea version on stdout and exit.
/// redeclaration/redefinition. @ref Daemon::getVersion()
static std::string getVersion(bool extended);
/// @brief Main server processing loop.
///
/// Main server processing loop. Call the processing step routine
......
......@@ -63,7 +63,7 @@ void Dhcp4to6Ipc::handler() {
// from Dhcpv4Srv::run_one() after receivePacket()
if (pkt) {
LOG_DEBUG(packet4_logger, DBG_DHCP4_BASIC, DHCP6_DHCP4O6_PACKET_RECEIVED)
LOG_DEBUG(packet4_logger, DBG_DHCP4_BASIC, DHCP4_DHCP4O6_PACKET_RECEIVED)
.arg(static_cast<int>(pkt->getType()))
.arg(pkt->getRemoteAddr().toText())
.arg(pkt->getIface());
......@@ -89,7 +89,7 @@ void Dhcp4to6Ipc::handler() {
return;
}
// Get the DHCPv4 message
// Get the DHCPv4 message.
OptionPtr msg = msgs.begin()->second;
if (!msg) {
LOG_DEBUG(packet4_logger, DBG_DHCP4_DETAIL, DHCP4_DHCP4O6_BAD_PACKET)
......
......@@ -6900,7 +6900,7 @@ outputFormatted(const std::string& config) {
}
}
};
} // namespace
namespace isc {
namespace dhcp {
......@@ -6931,9 +6931,9 @@ extractConfig(const std::string& config) {
++extract_count;
}
};
};
};
} // namespace test
} // namespace dhcp
} // namespace isc
namespace {
......@@ -7120,8 +7120,16 @@ TEST_P(Dhcp4GetConfigTest, run) {
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
}
/// Define the parameterized test loop
INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest,
::testing::Range(static_cast<size_t>(0), max_config_counter));
class IntToString {
public:
std::string operator()(const testing::TestParamInfo<size_t>& n) {
return to_string(n.param);
}
};
/// Define the parameterized test loop.
INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest,
::testing::Range(static_cast<size_t>(0),
max_config_counter),
IntToString());
} // namespace
......@@ -344,8 +344,16 @@ TEST_P(Dhcp4GetConfigTest, run) {
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
}
/// Define the parameterized test loop
INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest,
::testing::Range(static_cast<size_t>(0), max_config_counter));
class IntToString {
public:
std::string operator()(const testing::TestParamInfo<size_t>& n) {
return to_string(n.param);
}
};
/// Define the parameterized test loop.
INSTANTIATE_TEST_CASE_P(Dhcp4GetConfigTest, Dhcp4GetConfigTest,
::testing::Range(static_cast<size_t>(0),
max_config_counter),
IntToString());
} // namespace
......@@ -763,7 +763,7 @@ processing will continue, but the response will only contain generic
configuration and no addresses or prefixes. The argument includes
the client and the transaction identification information.
% DHCP6_UNKNOWN_MSG_RECEIVED received unknown message (type %d) on interface %2
% DHCP6_UNKNOWN_MSG_RECEIVED received unknown message (type %1) on interface %2
This debug message is printed when server receives a message of unknown type.
That could either mean missing functionality or invalid or broken relay or client.
The list of formally defined message types is available here:
......
......@@ -6459,7 +6459,7 @@ outputFormatted(const std::string& config) {
}
}
};
}
namespace isc {
namespace dhcp {
......@@ -6490,9 +6490,9 @@ extractConfig(const std::string& config) {
++extract_count;
}
};
};
};
} // namespace test
} // namespace dhcp
} // namespace isc
namespace {
......@@ -6682,8 +6682,16 @@ TEST_P(Dhcp6GetConfigTest, run) {
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
}
/// Define the parameterized test loop
INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest,
::testing::Range(static_cast<size_t>(0), max_config_counter));
class IntToString {
public:
std::string operator()(const testing::TestParamInfo<size_t>& n) {
return to_string(n.param);
}
};
/// Define the parameterized test loop.
INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest,
::testing::Range(static_cast<size_t>(0),
max_config_counter),
IntToString());
} // namespace
......@@ -348,8 +348,16 @@ TEST_P(Dhcp6GetConfigTest, run) {
EXPECT_TRUE(isEquivalent(unparsed, unparsed2));
}
/// Define the parameterized test loop
INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest,
::testing::Range(static_cast<size_t>(0), max_config_counter));
class IntToString {
public:
std::string operator()(const testing::TestParamInfo<size_t>& n) {
return to_string(n.param);
}
};
/// Define the parameterized test loop.
INSTANTIATE_TEST_CASE_P(Dhcp6GetConfigTest, Dhcp6GetConfigTest,
::testing::Range(static_cast<size_t>(0),
max_config_counter),
IntToString());
} // namespace
/perfdhcp
/perfdhcp.1
/perfdhcp.8
......@@ -145,7 +145,7 @@ public:
/// \brief Creates an address from over wire data.
///
/// \param family AF_NET for IPv4 or AF_NET6 for IPv6.
/// \param family AF_INET for IPv4 or AF_INET6 for IPv6.
/// \param data pointer to first char of data
///
/// \return Created IOAddress object
......
......@@ -1235,7 +1235,7 @@ prettyPrint(ConstElementPtr element, std::ostream& out,
// open the list
out << "[" << (complex ? "\n" : " ");
// iterate on items
typedef std::vector<ElementPtr> ListType;
const ListType& l = element->listValue();
......
......@@ -5,12 +5,11 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <gtest/gtest.h>
#include <log/logger_support.h>
#include <util/unittests/run_all.h>
#include <gtest/gtest.h>
int
main(int argc, char* argv[]) {
::testing::InitGoogleTest(&argc, argv);
......
......@@ -7,7 +7,6 @@
#include <config.h>
#include <asiolink/io_address.h>
#include <exceptions/exceptions.h>
#include <dhcp/dhcp6.h>
#include <dhcp/option6_pdexclude.h>
#include <exceptions/exceptions.h>
......
......@@ -5,6 +5,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <config.h>
#include <dhcp/dhcp4.h>
#include <dhcp/dhcp6.h>
#include <dhcp/option4_addrlst.h>
......@@ -39,7 +40,6 @@ using namespace isc::util;
namespace isc {
namespace dhcp {
OptionDefinition::OptionDefinition(const std::string& name,
const uint16_t code,
const std::string& type,
......@@ -655,7 +655,6 @@ OptionDefinition::writeToBuffer(Option::Universe u,
<< " is not valid.");
}
// Write a prefix.
OptionDataTypeUtil::writePrefix(PrefixLen(len), address, buf);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment