Commit c65657eb authored by Jeremy C. Reed's avatar Jeremy C. Reed
Browse files

Due to some merge problem (renamed directory and files), my

r4165 commit lost some changes from the r4133 commit.
I manually put these back in.
This was reviewed via jabber.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@4167 e5f2f494-b856-4b98-b285-d166d9295462
parent 1fb8fa24
......@@ -27,6 +27,7 @@ run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
run_unittests_LDADD = $(GTEST_LDADD)
run_unittests_LDADD += $(SQLITE_LIBS)
run_unittests_LDADD += $(top_builddir)/src/lib/testutils/libtestutils.la
run_unittests_LDADD += $(top_builddir)/src/lib/datasrc/libdatasrc.la
run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
......
......@@ -12,10 +12,24 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
#include <string>
#include <gtest/gtest.h>
#include <cc/data.h>
#include <asiolink/asiolink.h>
#include <resolver/resolver.h>
#include <testutils/srv_unittest.h>
#include <dns/tests/unittest_util.h>
#include <testutils/srv_test.h>
using namespace std;
using namespace isc::data;
using namespace isc::testutils;
using namespace asiolink;
using isc::UnitTestUtil;
namespace {
class ResolverConfig : public ::testing::Test {
......
......@@ -12,10 +12,15 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
// $Id$
#include <dns/name.h>
#include <resolver/resolver.h>
#include <testutils/srv_unittest.h>
#include <dns/tests/unittest_util.h>
#include <testutils/srv_test.h>
using namespace isc::dns;
using namespace isc::testutils;
using isc::UnitTestUtil;
namespace {
const char* const TEST_PORT = "53535";
......@@ -23,48 +28,52 @@ const char* const TEST_PORT = "53535";
class ResolverTest : public SrvTestBase{
protected:
ResolverTest() : server(){}
virtual void processMessage() {
server.processMessage(*io_message, parse_message, response_obuffer,
&dnsserv);
}
Resolver server;
};
// Unsupported requests. Should result in NOTIMP.
TEST_F(ResolverTest, unsupportedRequest) {
UNSUPPORTED_REQUEST_TEST;
unsupportedRequest();
}
// Multiple questions. Should result in FORMERR.
TEST_F(ResolverTest, multiQuestion) {
MULTI_QUESTION_TEST;
multiQuestion();
}
// Incoming data doesn't even contain the complete header. Must be silently
// dropped.
TEST_F(ResolverTest, shortMessage) {
SHORT_MESSAGE_TEST;
shortMessage();
}
// Response messages. Must be silently dropped, whether it's a valid response
// or malformed or could otherwise cause a protocol error.
TEST_F(ResolverTest, response) {
RESPONSE_TEST;
response();
}
// Query with a broken question
TEST_F(ResolverTest, shortQuestion) {
SHORT_QUESTION_TEST;
shortQuestion();
}
// Query with a broken answer section
TEST_F(ResolverTest, shortAnswer) {
SHORT_ANSWER_TEST;
shortAnswer();
}
// Query with unsupported version of EDNS.
TEST_F(ResolverTest, ednsBadVers) {
EDNS_BADVERS_TEST;
ednsBadVers();
}
TEST_F(ResolverTest, AXFROverUDP) {
AXFR_OVER_UDP_TEST;
axfrOverUDP();
}
TEST_F(ResolverTest, AXFRFail) {
......
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