예제 #1
0
def test_XinetdConf_5():
    xinetd_conf = XinetdConf(context_wrap(XINETD_CONF_5, path=CONF_PATH))
    data = xinetd_conf.data
    assert xinetd_conf.is_valid
    assert not xinetd_conf.is_includedir
    assert data.get("includedir") == "/etc/xinetd.d/abc"
    assert data.get("defaults") == {'umask': '002'}
예제 #2
0
def test_XinetdConf_0():
    xinetd_conf = XinetdConf(context_wrap(XINETD_CONF_0, path=CONF_PATH))
    data = xinetd_conf.data
    assert xinetd_conf.is_valid
    assert xinetd_conf.is_includedir
    assert data.get("includedir") == "/etc/xinetd.d"
    assert data.get("defaults") == {}
예제 #3
0
def test_XinetdConf_tftp():
    d_tftp = XinetdConf(context_wrap(XINETD_D_TFTP, path=D_TFTP_PATH))
    data = d_tftp.data
    assert d_tftp.is_valid
    assert not d_tftp.is_includedir
    assert data.get("includedir") is None
    assert data.get("tftp") == {
        'protocol': 'udp',
        'socket_type': 'dgram',
        'server': '/usr/sbin/in.tftpd',
        'server_args': '-s /var/lib/tftpboot',
        'disable': 'yes',
        'flags': 'IPv4',
        'user': '******',
        'per_source': '11',
        'cps': '100 2',
        'wait': 'yes'
    }
    assert d_tftp.file_name == 'tftp'
    assert d_tftp.file_path == D_TFTP_PATH
예제 #4
0
def test_XinetdConf_1():
    xinetd_conf = XinetdConf(context_wrap(XINETD_CONF_1, path=CONF_PATH))
    data = xinetd_conf.data
    assert xinetd_conf.is_valid
    assert xinetd_conf.is_includedir
    assert data.get("includedir") == "/etc/xinetd.d"
    assert data.get("defaults") == {
        'enabled': '',
        'v6only': 'no',
        'log_on_failure': 'HOST',
        'umask': '002',
        'log_on_success': 'PID HOST DURATION EXIT',
        'instances': '50',
        'per_source': '10',
        'groups': 'yes',
        'cps': '50 10',
        'log_type': 'SYSLOG daemon info'
    }
    assert xinetd_conf.file_name == 'xinetd.conf'
    assert xinetd_conf.file_path == CONF_PATH
예제 #5
0
def test_XinetdConf_4():
    xinetd_conf = XinetdConf(context_wrap(XINETD_CONF_4_BAD, path=CONF_PATH))
    assert not xinetd_conf.is_valid