def test_doc_examples(): env = { 'docker_service': config.SystemdDocker(context_wrap(SYSTEMD_DOCKER)), 'system_conf': config.SystemdSystemConf(context_wrap(SYSTEMD_SYSTEM_CONF)), 'system_origin_accounting': config.SystemdOriginAccounting(context_wrap(SYSTEMD_SYSTEM_ORIGIN_ACCOUNTING)), 'openshift_node_service': config.SystemdOpenshiftNode(context_wrap(SYSTEMD_OPENSHIFT_NODE)), 'logind_conf': config.SystemdLogindConf(context_wrap(SYSTEMD_LOGIND_CONF)), 'rpcbind_socket': config.SystemdRpcbindSocketConf(context_wrap(SYSTEMD_RPCBIND_SOCKET)) } failed, total = doctest.testmod(config, globs=env) assert failed == 0
def test_systemd_empty(): with pytest.raises(SkipException): assert config.SystemdLogindConf(context_wrap('')) is None
def test_systemd_logind_conf(): logind_conf = config.SystemdLogindConf(context_wrap(SYSTEMD_LOGIND_CONF)) assert "Login" in logind_conf assert logind_conf["Login"]["RemoveIPC"] == "False" assert logind_conf["Login"]["RuntimeDirectorySize"] == "10%"