From c39d671e23c42f4aa0656ee3d31ab80f84a23976 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Thu, 10 Jun 2010 03:12:11 +0000 Subject: Add -keep_going flag to let us kill and restart individual daemons without shutting down the whole test. svn path=/rpkid/tests/yamltest.py; revision=3280 --- rpkid/tests/yamltest.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'rpkid/tests') diff --git a/rpkid/tests/yamltest.py b/rpkid/tests/yamltest.py index 169ce7be..aa68375a 100644 --- a/rpkid/tests/yamltest.py +++ b/rpkid/tests/yamltest.py @@ -522,14 +522,17 @@ time.tzset() cfg_file = "yamltest.conf" pidfile = None +keep_going = False -opts, argv = getopt.getopt(sys.argv[1:], "c:hp:?", ["config=", "help", "pidfile="]) +opts, argv = getopt.getopt(sys.argv[1:], "c:hkp:?", ["config=", "help", "keep_going", "pidfile="]) for o, a in opts: if o in ("-h", "--help", "-?"): print __doc__ sys.exit(0) if o in ("-c", "--config"): cfg_file = a + elif o in ("-k", "--keep_going"): + keep_going = True elif o in ("-p", "--pidfile"): pidfile = a @@ -685,7 +688,9 @@ try: # Wait until something terminates. signal.signal(signal.SIGCHLD, lambda *dont_care: None) - if all(p.poll() is None for p in progs): + while (any(p.poll() is None for p in progs) + if keep_going else + all(p.poll() is None for p in progs)): signal.pause() finally: -- cgit v1.2.3