BIND 10 master, updated. 4e8325e1b309f1d388a3055ec1e1df98c377f383 [master] Merge branch 'trac2479'
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Dec 6 07:30:24 UTC 2012
The branch, master has been updated
via 4e8325e1b309f1d388a3055ec1e1df98c377f383 (commit)
via 238b343266ec6c5e7c610781021d235b7fcfb22d (commit)
via e0c2fad3471896467ad0ae3576f93b39bcb76a7d (commit)
via 501a5e337373d10c40c05d0838f5711fbb961ee2 (commit)
via dbf7313f6bb3fd3ace97b50509a4208864c4c4ea (commit)
from a6865a7686a02c7026150be1304ee682e8ddbb51 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 4e8325e1b309f1d388a3055ec1e1df98c377f383
Merge: a6865a7 238b343
Author: Marcin Siodelski <marcin at isc.org>
Date: Thu Dec 6 08:29:25 2012 +0100
[master] Merge branch 'trac2479'
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 2 +-
tests/tools/perfdhcp/Makefile.am | 2 +-
tests/tools/perfdhcp/tests/Makefile.am | 3 +-
.../tools/perfdhcp/tests/test_control_unittest.cc | 34 +++++++++++++-------
.../{templates => tests/testdata}/.gitignore | 0
.../{templates => tests/testdata}/Makefile.am | 2 --
.../testdata}/discover-example.hex | 0
.../testdata}/request4-example.hex | 0
.../testdata}/request6-example.hex | 0
.../testdata}/solicit-example.hex | 0
10 files changed, 27 insertions(+), 16 deletions(-)
rename tests/tools/perfdhcp/{templates => tests/testdata}/.gitignore (100%)
rename tests/tools/perfdhcp/{templates => tests/testdata}/Makefile.am (90%)
rename tests/tools/perfdhcp/{templates => tests/testdata}/discover-example.hex (100%)
rename tests/tools/perfdhcp/{templates => tests/testdata}/request4-example.hex (100%)
rename tests/tools/perfdhcp/{templates => tests/testdata}/request6-example.hex (100%)
rename tests/tools/perfdhcp/{templates => tests/testdata}/solicit-example.hex (100%)
-----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 636f8aa..feeb9a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1308,7 +1308,7 @@ AC_CONFIG_FILES([Makefile
tests/tools/badpacket/tests/Makefile
tests/tools/perfdhcp/Makefile
tests/tools/perfdhcp/tests/Makefile
- tests/tools/perfdhcp/templates/Makefile
+ tests/tools/perfdhcp/tests/testdata/Makefile
dns++.pc
])
AC_OUTPUT([doc/version.ent
diff --git a/tests/tools/perfdhcp/Makefile.am b/tests/tools/perfdhcp/Makefile.am
index 08a21a4..c4b82b5 100644
--- a/tests/tools/perfdhcp/Makefile.am
+++ b/tests/tools/perfdhcp/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = . tests templates
+SUBDIRS = . tests
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/log -I$(top_builddir)/src/lib/log
diff --git a/tests/tools/perfdhcp/templates/.gitignore b/tests/tools/perfdhcp/templates/.gitignore
deleted file mode 100644
index 6f865da..0000000
--- a/tests/tools/perfdhcp/templates/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-/test1.hex
-/test2.hex
-/test3.hex
-/test4.hex
-/test5.hex
diff --git a/tests/tools/perfdhcp/templates/Makefile.am b/tests/tools/perfdhcp/templates/Makefile.am
deleted file mode 100644
index c22787f..0000000
--- a/tests/tools/perfdhcp/templates/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-SUBDIRS = .
-
-# The test[1-5].hex are created by the TestControl.PacketTemplates
-# unit tests and have to be removed.
-CLEANFILES = test1.hex test2.hex test3.hex test4.hex test5.hex
-
-perfdhcpdir = $(pkgdatadir)
-
-EXTRA_DIST = discover-example.hex request4-example.hex
-EXTRA_DIST += solicit-example.hex request6-example.hex
diff --git a/tests/tools/perfdhcp/templates/discover-example.hex b/tests/tools/perfdhcp/templates/discover-example.hex
deleted file mode 100644
index 9a6e5ea..0000000
--- a/tests/tools/perfdhcp/templates/discover-example.hex
+++ /dev/null
@@ -1 +0,0 @@
-01010601008b45d200000000000000000000000000000000ac100102000c0102030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501013707011c02030f060cff
\ No newline at end of file
diff --git a/tests/tools/perfdhcp/templates/request4-example.hex b/tests/tools/perfdhcp/templates/request4-example.hex
deleted file mode 100644
index 32447d6..0000000
--- a/tests/tools/perfdhcp/templates/request4-example.hex
+++ /dev/null
@@ -1 +0,0 @@
-01010601007b23f800000000000000000000000000000000ac100102000c0102030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633204ac1001813501033604ac1001013707011c02030f060cff
\ No newline at end of file
diff --git a/tests/tools/perfdhcp/templates/request6-example.hex b/tests/tools/perfdhcp/templates/request6-example.hex
deleted file mode 100644
index 1e3e76f..0000000
--- a/tests/tools/perfdhcp/templates/request6-example.hex
+++ /dev/null
@@ -1 +0,0 @@
-03da30c60001000e0001000117cf8e76000c010203060002000e0001000117cf8a5c080027a87b3400030028000000010000000a0000000e0005001820010db800010000000000000001b568000000be000000c8000800020000
\ No newline at end of file
diff --git a/tests/tools/perfdhcp/templates/solicit-example.hex b/tests/tools/perfdhcp/templates/solicit-example.hex
deleted file mode 100644
index 41c5ad3..0000000
--- a/tests/tools/perfdhcp/templates/solicit-example.hex
+++ /dev/null
@@ -1 +0,0 @@
-015f4e650001000e0001000117cf8e76000c010203040003000c0000000100000e01000015180006000400170018000800020000
\ No newline at end of file
diff --git a/tests/tools/perfdhcp/tests/Makefile.am b/tests/tools/perfdhcp/tests/Makefile.am
index 54602af..be67481 100644
--- a/tests/tools/perfdhcp/tests/Makefile.am
+++ b/tests/tools/perfdhcp/tests/Makefile.am
@@ -1,6 +1,7 @@
-SUBDIRS = .
+SUBDIRS = . testdata
AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
+AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(abs_srcdir)/testdata\"
AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CXXFLAGS = $(B10_CXXFLAGS)
diff --git a/tests/tools/perfdhcp/tests/test_control_unittest.cc b/tests/tools/perfdhcp/tests/test_control_unittest.cc
index abe8282..176644c 100644
--- a/tests/tools/perfdhcp/tests/test_control_unittest.cc
+++ b/tests/tools/perfdhcp/tests/test_control_unittest.cc
@@ -185,6 +185,18 @@ public:
return ("");
}
+ /// \brief Get full path to a file in testdata directory.
+ ///
+ /// \param filename filename being appended to absolute
+ /// path to testdata directory
+ ///
+ /// \return full path to a file in testdata directory.
+ std::string getFullPath(const std::string& filename) const {
+ std::ostringstream stream;
+ stream << TEST_DATA_DIR << "/" << filename;
+ return (stream.str());
+ }
+
/// \brief Match requested options in the buffer with given list.
///
/// This method iterates through options provided in the buffer
@@ -896,7 +908,7 @@ TEST_F(TestControlTest, Packet6) {
}
}
-TEST_F(TestControlTest, DISABLED_Packet4Exchange) {
+TEST_F(TestControlTest, Packet4Exchange) {
// Get the local loopback interface to open socket on
// it and test packets exchanges. We don't want to fail
// the test if interface is not available.
@@ -925,8 +937,8 @@ TEST_F(TestControlTest, DISABLED_Packet4Exchange) {
// Use templates for this test.
processCmdLine("perfdhcp -l " + loopback_iface
+ " -r 100 -R 20 -n 20 -D 10% -L 10547"
- + " -T ../templates/discover-example.hex"
- + " -T ../templates/request4-example.hex"
+ + " -T " + getFullPath("discover-example.hex")
+ + " -T " + getFullPath("request4-example.hex")
+ " 127.0.0.1");
// The number iterations is restricted by the percentage of
// dropped packets (-D 10%). We also have to bump up the number
@@ -939,7 +951,7 @@ TEST_F(TestControlTest, DISABLED_Packet4Exchange) {
EXPECT_EQ(12, iterations_performed);
}
-TEST_F(TestControlTest, DISABLED_Packet6Exchange) {
+TEST_F(TestControlTest, Packet6Exchange) {
// Get the local loopback interface to open socket on
// it and test packets exchanges. We don't want to fail
// the test if interface is not available.
@@ -967,8 +979,8 @@ TEST_F(TestControlTest, DISABLED_Packet6Exchange) {
use_templates = true;
processCmdLine("perfdhcp -l " + loopback_iface
+ " -6 -r 100 -n 10 -R 20 -D 3 -L 10547"
- + " -T ../templates/solicit-example.hex"
- + " -T ../templates/request6-example.hex ::1");
+ + " -T " + getFullPath("solicit-example.hex")
+ + " -T " + getFullPath("request6-example.hex ::1"));
// For the first 3 packets we are simulating responses from server.
// For other packets we don't so packet as 4,5,6 will be dropped and
// then test should be interrupted and actual number of iterations will
@@ -981,9 +993,9 @@ TEST_F(TestControlTest, DISABLED_Packet6Exchange) {
TEST_F(TestControlTest, PacketTemplates) {
std::vector<uint8_t> template1(256);
- std::string file1("../templates/test1.hex");
+ std::string file1(getFullPath("test1.hex"));
std::vector<uint8_t> template2(233);
- std::string file2("../templates/test2.hex");
+ std::string file2(getFullPath("test2.hex"));
for (int i = 0; i < template1.size(); ++i) {
template1[i] = static_cast<uint8_t>(random() % 256);
}
@@ -1011,7 +1023,7 @@ TEST_F(TestControlTest, PacketTemplates) {
EXPECT_TRUE(std::equal(template2.begin(), template2.end(), buf2.begin()));
// Try to read template file with odd number of digits.
- std::string file3("../templates/test3.hex");
+ std::string file3(getFullPath("test3.hex"));
// Size of the file is 2 times larger than binary data size and it is always
// even number. Substracting 1 makes file size odd.
ASSERT_TRUE(createTemplateFile(file3, template1, template1.size() * 2 - 1));
@@ -1021,7 +1033,7 @@ TEST_F(TestControlTest, PacketTemplates) {
EXPECT_THROW(tc.initPacketTemplates(), isc::OutOfRange);
// Try to read empty file.
- std::string file4("../templates/test4.hex");
+ std::string file4(getFullPath("test4.hex"));
ASSERT_TRUE(createTemplateFile(file4, template2, 0));
ASSERT_NO_THROW(
processCmdLine("perfdhcp -l 127.0.0.1 -T " + file4 + " all")
@@ -1029,7 +1041,7 @@ TEST_F(TestControlTest, PacketTemplates) {
EXPECT_THROW(tc.initPacketTemplates(), isc::OutOfRange);
// Try reading file with non hexadecimal characters.
- std::string file5("../templates/test5.hex");
+ std::string file5(getFullPath("test5.hex"));
ASSERT_TRUE(createTemplateFile(file5, template1, template1.size() * 2, true));
ASSERT_NO_THROW(
processCmdLine("perfdhcp -l 127.0.0.1 -T " + file5 + " all")
diff --git a/tests/tools/perfdhcp/tests/testdata/.gitignore b/tests/tools/perfdhcp/tests/testdata/.gitignore
new file mode 100644
index 0000000..6f865da
--- /dev/null
+++ b/tests/tools/perfdhcp/tests/testdata/.gitignore
@@ -0,0 +1,5 @@
+/test1.hex
+/test2.hex
+/test3.hex
+/test4.hex
+/test5.hex
diff --git a/tests/tools/perfdhcp/tests/testdata/Makefile.am b/tests/tools/perfdhcp/tests/testdata/Makefile.am
new file mode 100644
index 0000000..bbd9a73
--- /dev/null
+++ b/tests/tools/perfdhcp/tests/testdata/Makefile.am
@@ -0,0 +1,8 @@
+SUBDIRS = .
+
+# The test[1-5].hex are created by the TestControl.PacketTemplates
+# unit tests and have to be removed.
+CLEANFILES = test1.hex test2.hex test3.hex test4.hex test5.hex
+
+EXTRA_DIST = discover-example.hex request4-example.hex
+EXTRA_DIST += solicit-example.hex request6-example.hex
diff --git a/tests/tools/perfdhcp/tests/testdata/discover-example.hex b/tests/tools/perfdhcp/tests/testdata/discover-example.hex
new file mode 100644
index 0000000..9a6e5ea
--- /dev/null
+++ b/tests/tools/perfdhcp/tests/testdata/discover-example.hex
@@ -0,0 +1 @@
+01010601008b45d200000000000000000000000000000000ac100102000c0102030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633501013707011c02030f060cff
\ No newline at end of file
diff --git a/tests/tools/perfdhcp/tests/testdata/request4-example.hex b/tests/tools/perfdhcp/tests/testdata/request4-example.hex
new file mode 100644
index 0000000..32447d6
--- /dev/null
+++ b/tests/tools/perfdhcp/tests/testdata/request4-example.hex
@@ -0,0 +1 @@
+01010601007b23f800000000000000000000000000000000ac100102000c0102030400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000638253633204ac1001813501033604ac1001013707011c02030f060cff
\ No newline at end of file
diff --git a/tests/tools/perfdhcp/tests/testdata/request6-example.hex b/tests/tools/perfdhcp/tests/testdata/request6-example.hex
new file mode 100644
index 0000000..1e3e76f
--- /dev/null
+++ b/tests/tools/perfdhcp/tests/testdata/request6-example.hex
@@ -0,0 +1 @@
+03da30c60001000e0001000117cf8e76000c010203060002000e0001000117cf8a5c080027a87b3400030028000000010000000a0000000e0005001820010db800010000000000000001b568000000be000000c8000800020000
\ No newline at end of file
diff --git a/tests/tools/perfdhcp/tests/testdata/solicit-example.hex b/tests/tools/perfdhcp/tests/testdata/solicit-example.hex
new file mode 100644
index 0000000..41c5ad3
--- /dev/null
+++ b/tests/tools/perfdhcp/tests/testdata/solicit-example.hex
@@ -0,0 +1 @@
+015f4e650001000e0001000117cf8e76000c010203040003000c0000000100000e01000015180006000400170018000800020000
\ No newline at end of file
More information about the bind10-changes
mailing list