示例#1
0
def test_corosync_conf():
    conf = corosync.CorosyncConf(context_wrap(COROSYNC_CONF))
    assert conf['totem']['token'][first].value == 10000
    assert conf['quorum']['provider'][first].value == 'corosync_votequorum'
    assert conf['nodelist']['node']['nodeid'][last].value == 3

    conf = corosync.CorosyncConf(context_wrap(COROSYNC_CONF_2))
    assert conf['totem']['version'][first].value == 2
示例#2
0
def test_doc_examples():
    failed, total = doctest.testmod(
        corosync,
        globs={
            'csconfig':
            corosync.CoroSyncConfig(context_wrap(corosync_content)),
            'corosync_conf': corosync.CorosyncConf(context_wrap(COROSYNC_CONF))
        })
    assert failed == 0
示例#3
0
def test_corosync_conf_empty():
    with pytest.raises(SkipException):
        assert corosync.CorosyncConf(context_wrap('')) is None