Skip to content

Commit

Permalink
Add tests for direct backend command
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse committed Jun 30, 2015
1 parent 538b19e commit 7b1c39c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/remotebackend/regression-tests/backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,8 @@ def do_setdomainmetadata(args)
end
return true
end

def do_directbackendcmd(args)
return [args["query"]]
end
end
3 changes: 3 additions & 0 deletions modules/remotebackend/regression-tests/direct-command/command
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

../pdns/pdnssec --config-name=remote --config-dir=. backend-cmd remote HELLO
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Tests that direct backend command works
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
== HELLO
HELLO
5 changes: 5 additions & 0 deletions modules/remotebackend/test-remotebackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,9 @@ BOOST_AUTO_TEST_CASE(test_method_calculateSOASerial) {
BOOST_CHECK_EQUAL(serial, 2013060300);
}

BOOST_AUTO_TEST_CASE(test_method_directBackendCmd) {
BOOST_TEST_MESSAGE("Testing directBackendCmd method");
BOOST_CHECK_EQUAL(be->directBackendCmd("PING 1234"), "PING 1234");
}

BOOST_AUTO_TEST_SUITE_END();
4 changes: 4 additions & 0 deletions modules/remotebackend/unittest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,5 +249,9 @@ def do_calculatesoaserial(args)
return [2013060300] if args["sd"]["qname"] == "unit.test"
[false]
end

def do_directbackendcmd(args)
[args["query"]]
end
end

0 comments on commit 7b1c39c

Please sign in to comment.