コード例 #1
0
ファイル: bgpNgpf.py プロジェクト: kwmcglon/IxNetwork
                                                      },
                                                      prefixLength=32)

    networkGroupObj2 = protocolObj.configNetworkGroup(create=deviceGroupObj2,
                                                      name='networkGroup2',
                                                      multiplier=100,
                                                      networkAddress={
                                                          'start': '180.1.0.0',
                                                          'step': '0.0.0.1',
                                                          'direction':
                                                          'increment'
                                                      },
                                                      prefixLength=32)

    protocolObj.startAllProtocols()
    protocolObj.verifyAllProtocolSessionsNgpf()

    # For all parameter options, go to the API configTrafficItem.
    # mode = create or modify
    trafficObj = Traffic(mainObj)
    trafficStatus = trafficObj.configTrafficItem(
        mode='create',
        trafficItem={
            'name': 'Topo1 to Topo2',
            'trafficType': 'ipv4',
            'biDirectional': True,
            'srcDestMesh': 'one-to-one',
            'routeMesh': 'oneToOne',
            'allowSelfDestined': False,
            'trackBy': ['flowGroup0', 'vlanVlanId0']
        },
コード例 #2
0
    # If the license is activated on the chassis's license server, this variable should be True.
    # Otherwise, if the license is in a remote server or remote chassis, this variable should be False.
    # Configuring license requires releasing all ports even for ports that is not used for this test.
    if licenseIsInChassis == False:
        portObj.releaseAllPorts()
        mainObj.configLicenseServerDetails([licenseServerIp], licenseModel,
                                           licenseTier)

    fileMgmtObj.importJsonConfigFile(jsonConfigFile, option='newConfig')
    fileMgmtObj.jsonAssignPorts(jsonData, portList, timeout=90)
    portObj.verifyPortState()

    protocolObj = Protocol(mainObj)
    protocolObj.startAllProtocols()
    protocolObj.verifyArp(ipType='ipv4')
    protocolObj.verifyAllProtocolSessionsNgpf(timeout=120)

    trafficObj = Traffic(mainObj)
    trafficObj.startTraffic(regenerateTraffic=True, applyTraffic=True)

    # Uncomment this if traffic is fixed packet count because you want to assure that
    # the stats are completely stopped before getting stats
    #trafficObj.checkTrafficState(expectedState=['stopped', 'stoppedWaitingForStats'], timeout=45)

    statObj = Statistics(mainObj)
    stats = statObj.getStats(viewName='Flow Statistics')

    print(
        '\n{txPort:10} {txFrames:15} {rxPort:10} {rxFrames:15} {frameLoss:10}'.
        format(txPort='txPort',
               txFrames='txFrames',