예제 #1
0
def check_child_signal_to_thread():
    '''
    This test checks the following scenario:
    * main thread is waiting for signal
    * another thread is running a subprocess
    * the subprocess exits before another thread dies

    This leads to signal being sent to another thread but not the main thread.
    This test makes sure main thread is woken up.
    '''

    def thread_target():
        subprocess.Popen(['true'])
        time.sleep(1)  # sleep so SIGCHLD is delivered here.
    threading.Thread(target=thread_target).start()
    sigutils.wait_for_signal()
예제 #2
0
def check_child_signal_to_thread():
    '''
    This test checks the following scenario:
    * main thread is waiting for signal
    * another thread is running a subprocess
    * the subprocess exits before another thread dies

    This leads to signal being sent to another thread but not the main thread.
    This test makes sure main thread is woken up.
    '''
    def thread_target():
        subprocess.Popen(['true'])
        time.sleep(1)  # sleep so SIGCHLD is delivered here.

    threading.Thread(target=thread_target).start()
    sigutils.wait_for_signal()
예제 #3
0
def check_signal_times():
    sigutils.wait_for_signal()
    sys.stdout.write('woke up\n')
    sigutils.wait_for_signal()
    sys.stdout.write('woke up\n')
    sigutils.wait_for_signal()
    sys.stdout.write('woke up\n')
예제 #4
0
파일: tests_child.py 프로젝트: txomon/vdsm
def check_signal_times():
    sigutils.wait_for_signal()
    sys.stdout.write("woke up\n")
    sigutils.wait_for_signal()
    sys.stdout.write("woke up\n")
    sigutils.wait_for_signal()
    sys.stdout.write("woke up\n")
예제 #5
0
def check_uninitialized():
    try:
        sigutils.wait_for_signal()
    except RuntimeError:
        sys.stdout.write('exception\n')
예제 #6
0
def check_signal_timeout(timeout):
    sigutils.wait_for_signal(float(timeout))
예제 #7
0
def check_signal_received():
    sigutils.wait_for_signal()
예제 #8
0
파일: tests_child.py 프로젝트: txomon/vdsm
def check_uninitialized():
    try:
        sigutils.wait_for_signal()
    except RuntimeError:
        sys.stdout.write("exception\n")
예제 #9
0
파일: tests_child.py 프로젝트: txomon/vdsm
def check_signal_timeout(timeout):
    sigutils.wait_for_signal(float(timeout))
예제 #10
0
파일: tests_child.py 프로젝트: txomon/vdsm
def check_signal_received():
    sigutils.wait_for_signal()