]> granicus.if.org Git - pdns/commitdiff
Init required args before calling dns_random()
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 20 Feb 2019 08:44:04 +0000 (09:44 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 20 Feb 2019 09:25:03 +0000 (10:25 +0100)
No clue why this only happens only on Ubuntu trusty...

pdns/test-recpacketcache_cc.cc

index 5caccd0d1fdcaa0871f916ea4d7256e0e8935241..3c8bfe13da52e06cc9f9b017ea5aaac30c5ba8b5 100644 (file)
@@ -5,6 +5,7 @@
 #include "config.h"
 #endif
 #include <boost/test/unit_test.hpp>
+#include "arguments.hh"
 #include "dnswriter.hh"
 #include "dnsrecords.hh"
 #include "dns_random.hh"
@@ -24,6 +25,9 @@ BOOST_AUTO_TEST_CASE(test_recPacketCacheSimple) {
   uint32_t ttd=3600;
   BOOST_CHECK_EQUAL(rpc.size(), 0);
 
+  ::arg().set("rng")="auto";
+  ::arg().set("entropy-source")="/dev/urandom";
+
   DNSName qname("www.powerdns.com");
   vector<uint8_t> packet;
   DNSPacketWriter pw(packet, qname, QType::A);
@@ -96,6 +100,9 @@ BOOST_AUTO_TEST_CASE(test_recPacketCache_Tags) {
   uint32_t ttd=3600;
   BOOST_CHECK_EQUAL(rpc.size(), 0);
 
+  ::arg().set("rng")="auto";
+  ::arg().set("entropy-source")="/dev/urandom";
+
   DNSName qname("www.powerdns.com");
   vector<uint8_t> packet;
   DNSPacketWriter pw(packet, qname, QType::A);