X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Ftest-daemon.py;h=816304fa075df1102630c347c8bb918763438532;hb=9b46cccc33bedc8b4d538b159804b5b45b8b0ea7;hp=386445d4434201aee064792a1aa271c036f1c972;hpb=6793129d369dee182d9260620d1db9188f09d986;p=openvswitch diff --git a/tests/test-daemon.py b/tests/test-daemon.py index 386445d4..816304fa 100644 --- a/tests/test-daemon.py +++ b/tests/test-daemon.py @@ -1,4 +1,4 @@ -# Copyright (c) 2010 Nicira Networks. +# Copyright (c) 2010, 2011 Nicira Networks. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ # limitations under the License. import getopt +import logging import signal import sys import time @@ -20,10 +21,13 @@ import time import ovs.daemon import ovs.util -def handler(signum, frame): + +def handler(signum, _): raise Exception("Signal handler called with %d" % signum) + def main(argv): + logging.basicConfig(level=logging.DEBUG) signal.signal(signal.SIGHUP, handler) @@ -45,7 +49,6 @@ def main(argv): % (ovs.util.PROGRAM_NAME, key)) sys.exit(1) - ovs.daemon.die_if_already_running() ovs.daemon.daemonize_start() if bail: sys.stderr.write("%s: exiting after daemonize_start() as requested\n" @@ -56,6 +59,7 @@ def main(argv): while True: time.sleep(1) + def usage(): sys.stdout.write("""\ %s: Open vSwitch daemonization test program for Python