Пример #1
0
def test_saphostcrtl_hana_2():
    lssap = Lssap(context_wrap(Lssap_all_TEST))
    inst = SAPHostCtrlInstances(context_wrap(SAPHOSTCTRL_HOSTINSTANCES_GOOD))
    hn = Hostname(HnF(context_wrap(HOSTNAME1)), None, None, None, None)
    sap = Sap(hn, inst, lssap)
    assert 'D50' not in sap
    assert 'HDB00' in sap
    assert sorted(sap.local_instances) == sorted(
        ['HDB88', 'HDB90', 'SMDA91', 'HDB62', 'HDB00'])
    assert sorted(sap.all_instances) == sorted([
        'ASCS07', 'ASCS52', 'D54', 'DVEBMGS09', 'ERS08', 'HDB00', 'HDB62',
        'HDB88', 'HDB90', 'SCS10', 'SMDA91'
    ])
    assert sorted(sap.business_instances) == sorted([
        'ASCS07', 'ASCS52', 'D54', 'DVEBMGS09', 'ERS08', 'HDB00', 'HDB62',
        'HDB88', 'HDB90', 'SCS10'
    ])
    assert sorted(sap.function_instances) == sorted(['SMDA91'])
    assert sap['HDB88'].number == '88'
    assert sap['HDB90'].hostname == 'li-ld-1810'
    assert sap['DVEBMGS09'].version == '749, patch 301, changelist 1779613'
    assert sap.version('HDB90') == '749, patch 211, changelist 1754007'
    assert sap.hostname('HDB62') == 'd62dbsrv'
    assert sap.type('SCS10') == 'SCS'
    assert sap.is_netweaver is True
    assert sap.is_hana is True
    assert sap.is_ascs is True
Пример #2
0
def test_doc_examples():
    env = {
        'saps':
        Sap(Hostname(HnF(context_wrap(HOSTNAME)), None, None, None, None),
            None, Lssap(context_wrap(Lssap_doc_TEST)))
    }
    failed, total = doctest.testmod(sap, globs=env)
    assert failed == 0
Пример #3
0
def test_lssap_hana():
    lssap = Lssap(context_wrap(Lssap_hana_TEST))
    hn = Hostname(HnF(context_wrap(HOSTNAME)), None, None, None, None)
    sap = Sap(hn, None, lssap)
    assert 'D50' not in sap
    assert sap.is_netweaver is False
    assert sap.is_hana is True
    assert sap.is_ascs is False
Пример #4
0
def test_lssap_ascs():
    lssap = Lssap(context_wrap(Lssap_ascs_TEST))
    hn = hostname(Hostname(context_wrap(HOSTNAME)), None, None)
    sap = Sap(hn, None, lssap)
    assert sap['ASCS16'].sid == 'HA2'
    assert sap.is_netweaver is False
    assert sap.is_hana is False
    assert sap.is_ascs is True
Пример #5
0
def test_all():
    lssap = Lssap(context_wrap(Lssap_all_TEST))
    hn = Hostname(HnF(context_wrap(HOSTNAME)), None, None, None, None)
    sap = Sap(hn, None, lssap)
    assert sap['D16'].version == '749, patch 10, changelist 1698137'
    assert sap['ASCS16'].hostname == 'lu0417'
    assert sap.is_netweaver is True
    assert sap.is_hana is True
    assert sap.is_ascs is True
Пример #6
0
def test_lssap_netweaver():
    lssap = Lssap(context_wrap(Lssap_nw_TEST))
    hn = Hostname(HnF(context_wrap(HOSTNAME)), None, None, None, None)
    sap = Sap(hn, None, lssap)
    assert sap['D50'].number == '50'
    assert 'D16' in sap.local_instances
    assert 'D51' in sap.all_instances
    assert 'D51' not in sap.local_instances
    assert sap.is_netweaver is True
    assert sap.is_hana is False
    assert sap.is_ascs is False
Пример #7
0
def test_saphostcrtl_hana():
    lssap = Lssap(context_wrap(Lssap_nw_TEST))
    inst = SAPHostCtrlInstances(context_wrap(SAPHOSTCTRL_HOSTINSTANCES))
    hn = Hostname(HnF(context_wrap(HOSTNAME)), None, None, None, None)
    sap = Sap(hn, inst, lssap)
    assert 'D50' not in sap
    assert sap.local_instances == ['HDB88']
    assert 'HDB90' in sap.all_instances
    assert sap['HDB88'].number == '88'
    assert sap['HDB90'].hostname == 'lu0418'
    assert sap['HDB90'].version == '749, patch 211, changelist 1754007'
    assert sap.number('HDB90') == '90'
    assert sap.sid('HDB88') == 'D89'
    assert sap.is_netweaver is False
    assert sap.is_hana is True
    assert sap.is_ascs is False