Esempio n. 1
0
        help=
        "Use authenticated access to REST (username: '******', password: '******'); default=False"
    )
    parser.add_argument('--startflow',
                        type=int,
                        default=0,
                        help='The starting Flow ID; default=0')

    in_args = parser.parse_args()

    # Initialize
    ic = InventoryCrawler(in_args.host, in_args.port, 0, 'operational',
                          in_args.auth, False)

    fct = FlowConfigBlaster(in_args.host, in_args.port, in_args.cycles,
                            in_args.threads, in_args.nodes, in_args.flows,
                            in_args.startflow, in_args.auth, JSON_FLOW_MOD1)

    # Get baseline stats
    ic.crawl_inventory()
    reported = ic.reported_flows
    found = ic.found_flows

    print 'Baseline:'
    print '   Reported nodes: %d' % reported
    print '   Found nodes:    %d' % found

    # Run through <cycles>, where <threads> are started in each cycle and <flows> are added from each thread
    fct.add_blaster()

    print '\n*** Total flows added: %s' % fct.get_total_flows()
                        help='Time to monitor inventory after flows are de configured in seconds; default=60')
    parser.add_argument('--monitor_period', type=int, default=10,
                        help='Monitor period of triggering inventory crawler in seconds; default=10')
    parser.add_argument('--monitor_outfile', default=None, help='Output file(if specified)')

    in_args = parser.parse_args()

    # Initialize
    if in_args.file != '':
        flow_template = get_json_from_file(in_args.file)
    else:
        flow_template = None

    ic = InventoryCrawler(in_args.host, in_args.port, 0, 'operational', in_args.auth, False)

    fct = FlowConfigBlaster(in_args.host, in_args.port, in_args.cycles, in_args.threads, in_args.fpr,
                            16, in_args.flows, in_args.startflow, in_args.auth)
    # Get the baseline stats. Required in Step 3 to validate if the delete
    # function gets the controller back to the baseline
    ic.crawl_inventory()
    reported = ic.reported_flows
    found = ic.found_flows

    print 'Baseline:'
    print '   Reported nodes: %d' % reported
    print '   Found nodes:    %d' % found

    stats = []
    stats.append((time.time(), ic.nodes, ic.reported_flows, ic.found_flows))
    # Run through <CYCLES> add cycles, where <THREADS> threads are started in
    # each cycle and <FLOWS> flows are added from each thread
    fct.add_blaster()
    parser.add_argument('--delete', dest='delete', action='store_true', default=True,
                        help='Delete all added flows one by one, benchmark delete '
                             'performance.')
    parser.add_argument('--bulk-delete', dest='bulk_delete', action='store_true', default=False,
                        help='Delete all flows in bulk; default=False')
    parser.add_argument('--auth', dest='auth', action='store_true',
                        help="Use authenticated access to REST (username: '******', password: '******'); default=False")
    parser.add_argument('--startflow', type=int, default=0,
                        help='The starting Flow ID; default=0')

    in_args = parser.parse_args()

    # Initialize
    ic = InventoryCrawler(in_args.host, in_args.port, 0, 'operational', in_args.auth, False)

    fct = FlowConfigBlaster(in_args.host, in_args.port, in_args.cycles, in_args.threads, in_args.nodes,
                            in_args.flows, in_args.startflow, in_args.auth, JSON_FLOW_MOD1)

    # Get baseline stats
    ic.crawl_inventory()
    reported = ic.reported_flows
    found = ic.found_flows

    print 'Baseline:'
    print '   Reported nodes: %d' % reported
    print '   Found nodes:    %d' % found

    # Run through <cycles>, where <threads> are started in each cycle and <flows> are added from each thread
    fct.add_blaster()

    print '\n*** Total flows added: %s' % fct.get_total_flows()
    print '    HTTP[OK] results:  %d\n' % fct.get_ok_flows()
Esempio n. 4
0
        'File from which to read the JSON flow template; default: no file, use a built in '
        'template.')

    in_args = parser.parse_args()

    # Initialize
    if in_args.file != '':
        flow_template = get_json_from_file(in_args.file)
    else:
        flow_template = None

    ic = InventoryCrawler(in_args.host, in_args.port, 0, 'operational',
                          in_args.auth, False)

    fct = FlowConfigBlaster(in_args.host, in_args.port, in_args.cycles,
                            in_args.threads, in_args.fpr, 16, in_args.flows,
                            in_args.startflow, in_args.auth)
    # Get the baseline stats. Required in Step 3 to validate if the delete
    # function gets the controller back to the baseline
    ic.crawl_inventory()
    reported = ic.reported_flows
    found = ic.found_flows

    print 'Baseline:'
    print '   Reported flows: %d' % reported
    print '   Found flows:    %d' % found

    # Run through <CYCLES> add cycles, where <THREADS> threads are started in
    # each cycle and <FLOWS> flows are added from each thread
    fct.add_blaster()
Esempio n. 5
0
        help=
        'File from which to read the JSON flow template; default: no file, use a built in '
        'template.')

    in_args = parser.parse_args()

    # Initialize
    if in_args.file != '':
        flow_template = get_json_from_file(in_args.file)
    else:
        flow_template = None

    #ic = InventoryCrawler(in_args.host, in_args.port, 0, 'operational', in_args.auth, False)

    fct = FlowConfigBlaster(in_args.host, in_args.port, in_args.cycles,
                            in_args.threads, in_args.fpr, 16, in_args.flows,
                            in_args.startflow, in_args.auth, in_args.switch)
    # Get the baseline stats. Required in Step 3 to validate if the delete
    # function gets the controller back to the baseline
    #ic.crawl_inventory()
    #reported = ic.reported_flows
    #found = ic.found_flows

    #print 'Baseline:'
    #print '   Reported flows: %d' % reported
    #print '   Found flows:    %d' % found

    # Run through <CYCLES> add cycles, where <THREADS> threads are started in
    # each cycle and <FLOWS> flows are added from each thread
    fct.add_blaster()
Esempio n. 6
0
    def __init__(self, host, port, ncycles, nthreads, nnodes, nflows, startflow):
        FlowConfigBlaster.__init__(self, host, port, ncycles, nthreads, nnodes, nflows, startflow, False, '')

        # Create the service URL
        self.url = 'http://' + self.host + ":" + self.port + '/wm/staticflowentrypusher/json'
 def __init__(self, host, port, ncycles, nthreads, nnodes, nflows, startflow):
     FlowConfigBlaster.__init__(self, host, port, ncycles, nthreads, 1, nnodes, nflows, startflow, False)
                        help='The starting Flow ID; default=0')
    parser.add_argument('--file', default='',
                        help='File from which to read the JSON flow template; default: no file, use a built in '
                             'template.')

    in_args = parser.parse_args()

    # Initialize
    if in_args.file != '':
        flow_template = get_json_from_file(in_args.file)
    else:
        flow_template = None

    ic = InventoryCrawler(in_args.host, in_args.port, 0, 'operational', in_args.auth, False)

    fct = FlowConfigBlaster(in_args.host, in_args.port, in_args.cycles, in_args.threads, in_args.fpr,
                            16, in_args.flows, in_args.startflow, in_args.auth)
    # Get the baseline stats. Required in Step 3 to validate if the delete
    # function gets the controller back to the baseline
    ic.crawl_inventory()
    reported = ic.reported_flows
    found = ic.found_flows

    print 'Baseline:'
    print '   Reported flows: %d' % reported
    print '   Found flows:    %d' % found

    # Run through <CYCLES> add cycles, where <THREADS> threads are started in
    # each cycle and <FLOWS> flows are added from each thread
    fct.add_blaster()

    print '\n*** Total flows added: %d' % fct.get_ok_flows()
Esempio n. 9
0
        help=
        'File from which to read the JSON flow template; default: no file, use a built in '
        'template.')

    in_args = parser.parse_args()

    # Initialize
    if in_args.file != '':
        flow_template = get_json_from_file(in_args.file)
    else:
        flow_template = None

    #ic = InventoryCrawler(in_args.host, in_args.port, 0, 'operational', in_args.auth, False)

    fct = FlowConfigBlaster('192.168.1.1', in_args.port, in_args.cycles,
                            in_args.threads, in_args.fpr, 16, in_args.flows,
                            in_args.startflow, in_args.auth)
    fct2 = FlowConfigBlaster('192.168.1.2', in_args.port, in_args.cycles,
                             in_args.threads, in_args.fpr, 16, in_args.flows,
                             in_args.startflow, in_args.auth)
    fct3 = FlowConfigBlaster('192.168.1.3', in_args.port, in_args.cycles,
                             in_args.threads, in_args.fpr, 16, in_args.flows,
                             in_args.startflow, in_args.auth)
    # Get the baseline stats. Required in Step 3 to validate if the delete
    # function gets the controller back to the baseline
    #ic.crawl_inventory()
    #reported = ic.reported_flows
    #found = ic.found_flows

    #print 'Baseline:'
    #print '   Reported flows: %d' % reported
 def __init__(self, host, port, ncycles, nthreads, nnodes, nflows, startflow):
     FlowConfigBlaster.__init__(self, host, port, ncycles, nthreads, 1, nnodes, nflows, startflow, False)
Esempio n. 11
0
                        help='The starting Flow ID; default=0')
    parser.add_argument('--file', default='',
                        help='File from which to read the JSON flow template; default: no file, use a built in '
                             'template.')

    in_args = parser.parse_args()

    # Initialize
    if in_args.file != '':
        flow_template = get_json_from_file(in_args.file)
    else:
        flow_template = None

    #ic = InventoryCrawler(in_args.host, in_args.port, 0, 'operational', in_args.auth, False)

    fct = FlowConfigBlaster('192.168.1.1', in_args.port, in_args.cycles, in_args.threads, in_args.fpr,
                            16, in_args.flows, in_args.startflow, in_args.auth)
    fct2 = FlowConfigBlaster('192.168.1.2', in_args.port, in_args.cycles, in_args.threads, in_args.fpr,
                            16, in_args.flows, in_args.startflow, in_args.auth)
    fct3 = FlowConfigBlaster('192.168.1.3', in_args.port, in_args.cycles, in_args.threads, in_args.fpr,
                            16, in_args.flows, in_args.startflow, in_args.auth)
    # Get the baseline stats. Required in Step 3 to validate if the delete
    # function gets the controller back to the baseline
    #ic.crawl_inventory()
    #reported = ic.reported_flows
    #found = ic.found_flows

    #print 'Baseline:'
    #print '   Reported flows: %d' % reported
    #print '   Found flows:    %d' % found

    # Run through <CYCLES> add cycles, where <THREADS> threads are started in