示例#1
0
def test_systemd_notify_init_thread_failure_rhel_6(exists, thread):
    '''
    Test calling systemd-notify on RHEL 6
    On RHEL 6, exists(/usr/bin/systemd-notify) == False
    '''
    exists.return_value = False
    util.systemd_notify_init_thread()
    thread.assert_not_called()
示例#2
0
def test_systemd_notify_init_thread_failure_bad_pid(exists, thread):
    '''
    Test initializing systemd-notify loop with an invalid PID
    On RHEL 7, exists(/usr/bin/systemd-notify) == True
    '''
    exists.return_value = True
    util.systemd_notify_init_thread()
    exists.assert_not_called()
    thread.assert_not_called()
示例#3
0
def test_systemd_notify_init_thread_no_socket(exists, thread):
    '''
    Test this function when NOTIFY_SOCKET is
    undefined, i.e. when we run the client on demand
    and not via systemd job
    '''
    exists.return_value = True
    util.systemd_notify_init_thread()
    thread.assert_not_called()