]> git.ipfire.org Git - thirdparty/pdns.git/blob - modules/remotebackend/test-remotebackend-post.cc
8549c1fea95b71a348a7ba18b83dcf36d40cce68
[thirdparty/pdns.git] / modules / remotebackend / test-remotebackend-post.cc
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
4 #include "pdns/namespaces.hh"
5 #include "pdns/dns.hh"
6 #include "pdns/dnsbackend.hh"
7 #include "pdns/dnspacket.hh"
8 #include "pdns/ueberbackend.hh"
9 #include "pdns/pdnsexception.hh"
10 #include "pdns/logger.hh"
11 #include "pdns/arguments.hh"
12 #include "pdns/json.hh"
13 #include "pdns/statbag.hh"
14 #include "pdns/packetcache.hh"
15
16 StatBag S;
17 PacketCache PC;
18 ArgvMap &arg()
19 {
20 static ArgvMap arg;
21 return arg;
22 };
23
24 class RemoteLoader
25 {
26 public:
27 RemoteLoader();
28 };
29
30 DNSBackend *be;
31
32 #define BOOST_TEST_DYN_LINK
33 #define BOOST_TEST_MAIN
34 #define BOOST_TEST_MODULE unit
35
36 #include <boost/test/unit_test.hpp>
37 #include <boost/assign/list_of.hpp>
38
39 #include <boost/tuple/tuple.hpp>
40
41 struct RemotebackendSetup {
42 RemotebackendSetup() {
43 be = 0;
44 try {
45 // setup minimum arguments
46 ::arg().set("module-dir")="./.libs";
47 new RemoteLoader();
48 BackendMakers().launch("remote");
49 // then get us a instance of it
50 ::arg().set("remote-connection-string")="http:url=http://localhost:62434/dns,post=1";
51 ::arg().set("remote-dnssec")="yes";
52 be = BackendMakers().all()[0];
53 } catch (PDNSException &ex) {
54 BOOST_TEST_MESSAGE("Cannot start remotebackend: " << ex.reason );
55 };
56 }
57 ~RemotebackendSetup() { }
58 };
59
60 BOOST_GLOBAL_FIXTURE( RemotebackendSetup );