コード例 #1
0
def test_ntp_conf_without_options():
    ntp_conf = NTP_CONF_STANZA
    for n in range(0, 3):
        s = "{}.pool.ntp.org".format(n)
        ntp_conf += "server {} iburst\n".format(s.lower())

    eq_(screenly_net_mgr.generate_ntp_conf(), ntp_conf)
コード例 #2
0
def test_ntp_conf_without_options():
    ntp_conf = NTP_CONF_STANZA
    for n in range(0, 3):
        s = '{}.pool.ntp.org'.format(n)
        ntp_conf += 'server {} iburst\n'.format(s.lower())

    eq_(screenly_net_mgr.generate_ntp_conf(), ntp_conf)
コード例 #3
0
def test_ntp_conf_with_two_option():
    servers = ["1.1.1.1", "2.2.2.2"]
    ntp_conf = NTP_CONF_STANZA

    for n in servers:
        ntp_conf += "server {} iburst\n".format(n)

    eq_(screenly_net_mgr.generate_ntp_conf(ntpservers=servers), ntp_conf)
コード例 #4
0
def test_ntp_conf_with_two_option():
    servers = ['1.1.1.1', '2.2.2.2']
    ntp_conf = NTP_CONF_STANZA

    for n in servers:
        ntp_conf += 'server {} iburst\n'.format(n)

    eq_(screenly_net_mgr.generate_ntp_conf(ntpservers=servers), ntp_conf)
コード例 #5
0
def test_ntp_conf_with_invalid_option():
    eq_(screenly_net_mgr.generate_ntp_conf(ntpservers="foobar"), False)
コード例 #6
0
def test_ntp_conf_with_one_option():
    servers = ["1.2.3.4"]
    ntp_conf = NTP_CONF_STANZA
    ntp_conf += "server {} iburst\n".format(servers[0])

    eq_(screenly_net_mgr.generate_ntp_conf(ntpservers=servers), ntp_conf)
コード例 #7
0
def test_ntp_conf_with_invalid_option():
    eq_(screenly_net_mgr.generate_ntp_conf(ntpservers='foobar'), False)
コード例 #8
0
def test_ntp_conf_with_one_option():
    servers = ['1.2.3.4']
    ntp_conf = NTP_CONF_STANZA
    ntp_conf += 'server {} iburst\n'.format(servers[0])

    eq_(screenly_net_mgr.generate_ntp_conf(ntpservers=servers), ntp_conf)