]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
API tests: Add '--wait' option
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Fri, 7 Feb 2014 01:52:26 +0000 (02:52 +0100)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Fri, 7 Feb 2014 14:11:03 +0000 (15:11 +0100)
Keeps daemon process alive after testing.

regression-tests.api/runtests.py

index ce9551fb993d50a847668bed2417ccb226c154eb..92c5de19116ba46dbf7866436d87ca10c175a548 100755 (executable)
@@ -26,6 +26,10 @@ ACL_LIST_TPL = """
 ::1
 """
 
+wait = ('--wait' in sys.argv)
+if wait:
+    sys.argv.remove('--wait')
+
 daemon = (len(sys.argv) == 2) and sys.argv[1] or None
 if daemon not in ('authoritative', 'recursor'):
     print "Usage: ./runtests (authoritative|recursor)"
@@ -96,6 +100,9 @@ try:
 except subprocess.CalledProcessError as ex:
     rc = ex.returncode
 finally:
+    if wait:
+        print "Waiting as requested, press ENTER to stop."
+        raw_input()
     pdns.terminate()
     pdns.wait()