]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests: cleanup
authorMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 17 Sep 2015 11:35:44 +0000 (13:35 +0200)
committerMarek Vavruša <marek.vavrusa@nic.cz>
Thu, 17 Sep 2015 11:36:04 +0000 (13:36 +0200)
tests/pydnstest/scenario.py
tests/test.h
tests/test_integration.py

index 3080947ac35f8d3e6dd1f8189eede6dbbcc846fa..083d27178d9e13cd35b44e0d1d2d56ff7a391fc0 100644 (file)
@@ -278,7 +278,7 @@ class Step:
 
     def play(self, ctx, peeraddr):
         """ Play one step from a scenario. """
-        dprint('=> %d\t%s' % (self.id, self.type))
+        dprint('[ STEP %03d ] %s' % (self.id, self.type))
         if self.type == 'QUERY':
             dprint(self.data[0].message.to_text())
             return self.__query(ctx, peeraddr)
index 213f03016b542d99d8ed9c996d85c020612fbe4d..ceb43e0f95784eb06415b7c7113c171605f7cb59 100644 (file)
@@ -27,6 +27,9 @@
 #include <unistd.h>
 #include <cmocka.h>
 
+/* Silence clang/GCC warnings when using cmocka 1.0 */
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
 #include "lib/defines.h"
 #include <libknot/internal/mempattern.h>
 #include <libknot/descriptor.h>
index 7afd7786a0543a4d73eec3b4e76ac69ba042acf9..8e6f357e03a9ff51b14466f02d9d80fe0f996bb7 100755 (executable)
@@ -193,22 +193,12 @@ def setup_env(child_env, config, config_name, j2template):
         if k == 'query-minimization' and str2bool(v):
             no_minimize = "false"
         elif k == 'trust-anchor':
-            if ((v[0] == '"') and (v[-1] == '"')) or ((v[0] == '\'') and (v[-1] == '\'')):
-                trust_anchor_str = v[1:-1]
-            else:
-                trust_anchor_str = v
+            trust_anchor_str = v.strip('"\'')
         elif k == 'val-override-date':
-            override_date_str = ""
-            if ((v[0] == '"') and (v[-1] == '"')) or ((v[0] == '\'') and (v[-1] == '\'')):
-                override_date_str = v[1:-1]
-            else:
-                override_date_str = v
+            override_date_str = v.strip('"\'')
             write_timestamp_file(child_env["FAKETIME_TIMESTAMP_FILE"], int(override_date_str))
         elif k == 'stub-addr':
-            if ((v[0] == '"') and (v[-1] == '"')) or ((v[0] == '\'') and (v[-1] == '\'')):
-                stub_addr = v[1:-1]
-            else:
-                stub_addr = v
+            stub_addr = v.strip('"\'')
     if stub_addr.startswith('127.0.0.') or stub_addr.startswith('::'):
         selfaddr = stub_addr
     else:
@@ -278,6 +268,8 @@ def play_object(path, binary_name, config_name, j2template, binary_additional_pa
         server.stop()
         daemon_proc.terminate()
         daemon_proc.wait()
+        if 'VERBOSE' in os.environ:
+            print('[ LOG      ]\n%s' % open('%s/server.log' % TMPDIR).read())
     # Do not clear files if the server crashed (for analysis)
     del_files(TMPDIR)