Commit 8857b873 authored by douomo's avatar douomo
Browse files

fixed test on PEB svc

parent bed1f5cc
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -90,20 +90,18 @@ Test Net


Test Service
Test Service
    [Arguments]    ${info}    @{args}
    [Arguments]    ${info}    @{args}
    ${svc_inventory}=    Inventory Request    ${info}    @{args[0]}
    ${svc_inventory}=    Inventory Request    ${info}    ${args[0]}
    ${passed}=    Check SVC Inventory    ${svc_inventory}    ${args[2]}
    ${passed}=    Check SVC Inventory    ${svc_inventory}    ${args[2]}
    Log    ${passed}    console=yes
    Log    ${passed}    console=yes
    Should Be Equal    ${passed}    SUCCESS
    Should Be Equal    ${passed}    SUCCESS
    IF    ${args[2]}=="PEB"
    IF    "${args[2]}"=="PEB"
        ${iface_inventory}=    Inventory Request    ${info}    @{args[1]}
        ${iface_inventory}=    Inventory Request    ${info}    ${args[1]}
        ${passed}=    Check SVC PEB Inventory    ${iface_inventory}
        ${passed}=    Check SVC PEB Inventory    ${iface_inventory}
        Log    ${passed}    console=yes
        Log    ${passed}    console=yes
        Should Be Equal    ${passed}    SUCCESS    
        Should Be Equal    ${passed}    SUCCESS    
    END
    END






Inventory Request
Inventory Request
    [Arguments]    ${par}    @{filter}
    [Arguments]    ${par}    @{filter}
    ${m}=    Connect With Key    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["key_filename"]}
    ${m}=    Connect With Key    ${par["host"]}    ${par["port"]}    ${par["username"]}    ${par["key_filename"]}
+4 −4
Original line number Original line Diff line number Diff line
@@ -372,10 +372,10 @@ def check_SVC_PEB_inventory(xml_reply):
    #bridge_ports = tree.findall(".//ns0:bridge-port", namespaces={"ns0": "urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge"})
    #bridge_ports = tree.findall(".//ns0:bridge-port", namespaces={"ns0": "urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge"})
    expected_params = 4
    expected_params = 4
    actual_params = 4
    actual_params = 4
    cvid = tree.findall(".//ns0:cvid", namespaces={"ns0": "urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge"})
    cvid = tree.findall(".//ns0:cvid", namespaces={"ns0": "urn:ieee:std:802.1Q:yang:ieee802-dot1q-pb"})
    svid = tree.findall(".//ns0:svid", namespaces={"ns0": "urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge"})
    svid = tree.findall(".//ns0:svid", namespaces={"ns0": "urn:ieee:std:802.1Q:yang:ieee802-dot1q-pb"})
    cep = tree.findall(".//ns0:untagged-cep", namespaces={"ns0": "urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge"})
    cep = tree.findall(".//ns0:untagged-cep", namespaces={"ns0": "urn:ieee:std:802.1Q:yang:ieee802-dot1q-pb"})
    pep = tree.findall(".//ns0:untagged-pep", namespaces={"ns0": "urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge"})
    pep = tree.findall(".//ns0:untagged-pep", namespaces={"ns0": "urn:ieee:std:802.1Q:yang:ieee802-dot1q-pb"})
    actual_params = min([1,len(cvid)]) + min([1,len(svid)]) + min([1,len(cep)]) + min([1,len(pep)])
    actual_params = min([1,len(cvid)]) + min([1,len(svid)]) + min([1,len(cep)]) + min([1,len(pep)])
    if actual_params == expected_params:
    if actual_params == expected_params:
        return "SUCCESS"
        return "SUCCESS"