From: Kees Monshouwer Date: Sat, 8 Aug 2015 19:33:10 +0000 (+0200) Subject: run pdnssec test-algorithms in travis X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~62^2~21^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=166d86474da5b4546396cc4395fd6e56922c53b5;p=pdns run pdnssec test-algorithms in travis --- diff --git a/.travis.yml b/.travis.yml index 2e18f9457..24f7c2840 100644 --- a/.travis.yml +++ b/.travis.yml @@ -109,6 +109,7 @@ script: - cd pdns - make -k -j 4 pdns_recursor - rm -f pdns_recursor + - ./pdnssec test-algorithms - cd .. - ./build-scripts/dist-recursor - cd pdns/pdns-recursor-*/ diff --git a/pdns/dnssecinfra.cc b/pdns/dnssecinfra.cc index 6262b82fc..9547f7e3a 100644 --- a/pdns/dnssecinfra.cc +++ b/pdns/dnssecinfra.cc @@ -134,8 +134,10 @@ void DNSCryptoKeyEngine::report(unsigned int algo, maker_t* maker, bool fallback getMakers()[algo]=maker; } -void DNSCryptoKeyEngine::testAll() +bool DNSCryptoKeyEngine::testAll() { + bool ret=true; + BOOST_FOREACH(const allmakers_t::value_type& value, getAllMakers()) { BOOST_FOREACH(maker_t* creator, value.second) { @@ -150,15 +152,19 @@ void DNSCryptoKeyEngine::testAll() catch(std::exception& e) { cerr< DNSCryptoKeyEngine::testMakers(unsigned int algo, maker_t* creator, maker_t* signer, maker_t* verifier) diff --git a/pdns/dnssecinfra.hh b/pdns/dnssecinfra.hh index 6aa726318..31ff2936e 100644 --- a/pdns/dnssecinfra.hh +++ b/pdns/dnssecinfra.hh @@ -48,8 +48,8 @@ class DNSCryptoKeyEngine static void report(unsigned int algorithm, maker_t* maker, bool fallback=false); static std::pair testMakers(unsigned int algorithm, maker_t* creator, maker_t* signer, maker_t* verifier); - static void testAll(); - static void testOne(int algo); + static bool testAll(); + static bool testOne(int algo); private: typedef std::map makers_t; diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index b83968fa8..da017d841 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -854,14 +854,14 @@ int listAllZones(const string &type="") { return 0; } -void testAlgorithm(int algo) +bool testAlgorithm(int algo) { - DNSCryptoKeyEngine::testOne(algo); + return DNSCryptoKeyEngine::testOne(algo); } -void testAlgorithms() +bool testAlgorithms() { - DNSCryptoKeyEngine::testAll(); + return DNSCryptoKeyEngine::testAll(); } void testSpeed(DNSSECKeeper& dk, const string& zone, const string& remote, int cores) @@ -1351,13 +1351,15 @@ try cerr << "Syntax: pdnssec test-algorithm algonum"<(cmds[1])); - return 0; + if (testAlgorithm(lexical_cast(cmds[1]))) + return 0; + return 1; } if(cmds[0] == "test-algorithms") { - testAlgorithms(); - return 0; + if (testAlgorithms()) + return 0; + return 1; } loadMainConfig(g_vm["config-dir"].as());