Example #1
0
def test_signal_server(os_kill):
    unix.pid_store("test_signal_server", pid_file_path="/tmp")
    unix.kill_server("test_signal_server", pid_file_path="/tmp")
    assert_true(os_kill.called)
    os_kill.reset

    unix.reload_server("test_signal_server", pid_file_path="/tmp")
    assert_true(os_kill.called)
    os_kill.reset

    os.unlink("/tmp/test_signal_server.pid")
Example #2
0
def test_signal_server(os_kill):
    unix.pid_store("test_signal_server", pid_file_path="/tmp")
    unix.kill_server("test_signal_server", pid_file_path="/tmp")
    assert_true(os_kill.called)
    os_kill.reset

    unix.reload_server("test_signal_server", pid_file_path="/tmp")
    assert_true(os_kill.called)
    os_kill.reset

    os.unlink("/tmp/test_signal_server.pid")
Example #3
0
def test_pid_remove_dead_still_running():
    unix.pid_store("test_pid_remove_dead", pid_file_path="/tmp")
    unix.pid_remove_dead("test_pid_remove_dead", pid_file_path="/tmp")
    assert_true(os.path.exists("/tmp/test_pid_remove_dead.pid"))
Example #4
0
def test_pid_remove_dead():
    unix.pid_store("test_pid_remove_dead", pid_file_path="/tmp")
    unix.pid_remove_dead("test_pid_remove_dead", pid_file_path="/tmp")
    assert_false(os.path.exists("/tmp/test_pid_remove_dead.pid"))
Example #5
0
def test_still_running_stale_process():
    unix.pid_store("test_still_running", pid_file_path="/tmp")
    assert_false(unix.still_running("test_still_running",
                                    pid_file_path="/tmp"))
    os.unlink("/tmp/test_still_running.pid")
Example #6
0
def test_still_running():
    unix.pid_store("test_still_running", pid_file_path="/tmp")
    assert_true(unix.still_running("test_still_running", pid_file_path="/tmp"))
    os.unlink("/tmp/test_still_running.pid")
Example #7
0
def test_pid_read():
    unix.pid_store("test_pid_read", pid_file_path="/tmp")
    pid = unix.pid_read("test_pid_read", pid_file_path="/tmp")
    assert_equal(pid, os.getpid())
    os.unlink("/tmp/test_pid_read.pid")
Example #8
0
def test_pid_store():
    unix.pid_store("testing", pid_file_path="/tmp")
    assert_equal(os.path.exists("/tmp/testing.pid"), True,
                 "Didn't make /tmp/testing.pid")
    os.unlink("/tmp/testing.pid")
Example #9
0
def test_pid_remove_dead_still_running():
    unix.pid_store("test_pid_remove_dead", pid_file_path="/tmp")
    unix.pid_remove_dead("test_pid_remove_dead", pid_file_path="/tmp")
    assert_true(os.path.exists("/tmp/test_pid_remove_dead.pid"))
Example #10
0
def test_pid_remove_dead():
    unix.pid_store("test_pid_remove_dead", pid_file_path="/tmp")
    unix.pid_remove_dead("test_pid_remove_dead", pid_file_path="/tmp")
    assert_false(os.path.exists("/tmp/test_pid_remove_dead.pid"))
Example #11
0
def test_still_running_stale_process():
    unix.pid_store("test_still_running", pid_file_path="/tmp")
    assert_false(unix.still_running("test_still_running", pid_file_path="/tmp"))
    os.unlink("/tmp/test_still_running.pid")
Example #12
0
def test_still_running():
    unix.pid_store("test_still_running", pid_file_path="/tmp")
    assert_true(unix.still_running("test_still_running", pid_file_path="/tmp"))
    os.unlink("/tmp/test_still_running.pid")
Example #13
0
def test_pid_read():
    unix.pid_store("test_pid_read", pid_file_path="/tmp")
    pid = unix.pid_read("test_pid_read", pid_file_path="/tmp")
    assert_equal(pid, os.getpid())
    os.unlink("/tmp/test_pid_read.pid")
Example #14
0
def test_pid_store():
    unix.pid_store("testing", pid_file_path="/tmp")
    assert_equal(os.path.exists("/tmp/testing.pid"), True,
                           "Didn't make /tmp/testing.pid")
    os.unlink("/tmp/testing.pid")