def test_virt_who_conf_1():
    vw_sysconf = VirtWhoSysconfig(context_wrap(SYS_VIRTWHO))
    vwho_conf = VirtWhoConf(context_wrap(VWHO_CONF))
    vwhod_conf1 = VirtWhoConf(context_wrap(VWHO_D_CONF_HYPER))
    vwhod_conf2 = VirtWhoConf(context_wrap(VWHO_D_CONF_ESX))
    result = AllVirtWhoConf(vw_sysconf, [vwho_conf, vwhod_conf1, vwhod_conf2])
    assert result.background is False
    assert result.oneshot is True
    assert result.interval == 1000
    assert result.sm_type == 'sat6'
    assert sorted(result.hypervisor_types) == sorted(['esx', 'hyperv'])

    expected = [{
        'name': 'esx_1',
        'server': '10.72.32.219',
        'env': 'Satellite',
        'owner': 'Satellite',
        'type': 'esx'
    }, {
        'name': 'hyperv_1',
        'server': '10.72.32.209',
        'env': 'Satellite',
        'owner': 'Satellite',
        'type': 'hyperv'
    }]
    for d in result.hypervisors:
        assert d in expected
Example #2
0
def test_virt_who_conf_2():
    vw_sysconf = VirtWhoSysconfig(context_wrap(SYS_VIRTWHO_SAT_LEGACY))
    vwho_conf = VirtWhoConf(context_wrap(VWHO_CONF))
    result = AllVirtWhoConf(vw_sysconf, [vwho_conf])
    assert result.background is True
    assert result.oneshot is False
    assert result.interval == 3600
    assert result.sm_type == 'sat5'
Example #3
0
def test_virt_who_conf_4():
    vw_sysconf = VirtWhoSysconfig(context_wrap(SYS_VIRTWHO_CP))
    vwho_conf = VirtWhoConf(context_wrap(VWHO_CONF))
    result = AllVirtWhoConf(vw_sysconf, [vwho_conf])
    assert result.sm_type == 'cp'