def test_vbr_flowfilter_audit_1():

    print "****CREATE Controller with valid IP****"
    retval = controller.add_controller_ex('ControllerFirst')
    if retval != 0:
        print "Controller Create Failed"
        exit(1)

    print """TEST 1 : create VTN and VBR FLOWFILTER when controller is down
             change the controller status to up trigger Audit and validate"""
  # Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst',"up")
    if retval != 0:
      print "controller state change failed"
      exit(1)
    print "****Create VTN****"
    retval = vtn_vbr.create_vtn('VtnOne')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    print "****Create VBR****"
    retval = vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
    if retval != 0:
        print "VBRIF Create Failed"
        exit(1)

    retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
    if retval != 0:
      print "VTN Create Failed"
      exit(1)

    retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
    if retval != 0:
      print "VBRIF Create Failed"
      exit(1)

    retval =  vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    retval =  vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
    if retval != 0:
        print "VBR Validate Failed"
        exit(1)

    retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
    if retval != 0:
        print "After Create VBRIF Validate Failed"
        exit(1)

    retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence = 'yes', position = 1)
    if retval != 0:
      print "VBR Validate Failed"
      exit(1)

    retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
    if retval != 0:
      print "After Create VBRIF Validate Failed"
      exit(1)

    retval=flowlistentry.create_flowlist('FlowlistOne')
    if retval != 0:
        print "FlowList Create Failed"
        exit(1)

    retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
    if retval != 0:
        print "FlowlistEntry Create Failed"
        exit(1)

    print "****UPDATE Controller IP to invalid****"
    test_invalid_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerFirst')['invalid_ipaddr']
    retval = controller.update_controller_ex('ControllerFirst',ipaddr=test_invalid_ipaddr)
    if retval != 0:
        print "controller invalid_ip update failed"
        exit(1)
  # Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst',"down")
    if retval != 0:
      print "controller state change failed"
      exit(1)

    retval=flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOne')
    if retval != 0:
        print "VBRFlowFilter Create Failed"
        exit(1)

    retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne')
    if retval != 0:
        print "VBRFlowFilterEntry Create Failed"
        exit(1)

    print "****UPDATE Controller IP to Valid****"
    test_controller_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerFirst')['ipaddr']
    retval = controller.update_controller_ex('ControllerFirst',ipaddr=test_controller_ipaddr)
    if retval != 0:
        print "controller valid_ip update failed"
        exit(1)
  # Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst',"up")
    if retval != 0:
      print "controller state change failed"
      exit(1)

    retval=flowfilter.validate_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne', presence='yes', position=0)
    if retval != 0:
        print "VBRFlowFilterEntry Validate Failed at Co-ordinator"
        exit(1)

    retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOne', presence='yes', position=0)
    if retval != 0:
        print "FlowFilter validation Failed at Controller"
        exit(1)

    retval = flowfilter.delete_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne')
    if retval != 0:
       print "VBRFlowFilterEntry deletete Failed"
       exit(1)
    retval = flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOne')
    if retval != 0:
       print "VBRFlowFilter deletete Failed"
       exit(1)

    retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
    if retval != 0:
      print "FlowilistEntry deletete Failed"
      exit(1)

    retval=flowlistentry.delete_flowlist('FlowlistOne')
    if retval != 0:
      print "Flowilist deletete Failed"
      exit(1)

    print "****Delete VTN****"
    retval = vtn_vbr.delete_vtn('VtnOne')
    if retval != 0:
        print "VTN Delete Failed in coordinator"
        exit(1)

    retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOne', presence='no', position=0)
    if retval != 0:
      print "FlowFilter validation Failed after deleting"
      exit(1)

    retval =  vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no")
    if retval != 0:
      print "VTN Validate Failed"
      exit(1)

    print "DELETE CONTROLLER"
    retval = controller.delete_controller_ex('ControllerFirst')
    if retval != 0:
        print "CONTROLLER delete failed"
        exit(1)
    print "VBR->FLOWFILTER AUDIT_1 TEST SUCCESS"
Esempio n. 2
0
def negative_vbr_flowfilter():
  print "CREATE Controller"
  retval = controller.add_controller_ex('ControllerFirst')
  if retval != 0:
    print "Controller Create Failed"
    exit(1)
  print "Negative test scenario test cases"
  print 'TEST 3 : VBR->FLOWFILTER TEST: Create Three VBR and VbrFlowFilterEntry with vbrone negative  the VbrFlowFilterEntry to vbrthree'
  # Delay for AUDIT
  retval=controller.wait_until_state('ControllerFirst', "up")
  if retval != 0:
    print "Controller state check Failed"
    exit(1)

  retval=vtn_vbr.create_vtn('VtnOne')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence = 'yes', position = 1)
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=flowlistentry.create_flowlist('FlowlistOne')
  if retval != 0:
    print "FlowList Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
  if retval != 0:
    print "FlowlistEntry Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOne')
  if retval != 0:
    print "VBRFlowFilter Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne')
  if retval != 0:
    print "VBRFlowFilterEntry Create Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print "VBRFlowFilterEntry Validation at Co-ordinator Failed "
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print "FlowFilter validation at Controller Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree', 'VbrIfThree')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=flowfilter.update_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne', 'NegativeFlowfilter')
  if retval != 0:
    print "VBRFlowFilterEntry at negative  priority and dscp has  Failed"
    print "Because flowfilter priority range up 63 and dscp range up to 7 its more than test was faild its showing Bad error"
    exit(1)

  retval=flowfilter.validate_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne|NegativeFlowfilter', presence='yes', position=0)
  if retval != 0:
    print "VBRFlowFilterEntry Negative  Validate Failed at Co-ordinator"
    exit(1)

  retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne')
  if retval != 0:
    print "VBRFlowFilterEntry deletete Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOne')
  if retval != 0:
    print "VBRFlowFilter deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
  if retval != 0:
    print "FlowilistEntry deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlist('FlowlistOne')
  if retval != 0:
    print "Flowilist deletete Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrTwo', 'ControllerFirst', 'FlowfilterOne', presence='no', position=0)
  if retval != 0:
    print "FlowFilter validation Failed after deleting"
    exit(1)

  retval=vtn_vbr.delete_vtn('VtnOne')
  if retval != 0:
    print "DELETE VTN Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  print "DELETE CONTROLLER"
  retval=controller.delete_controller_ex('ControllerFirst')
  if retval != 0:
     print "CONTROLLER delete failed"
     exit(1)
  print "VBR->UPDATE FLOWFILTER TEST SUCCESS"
Esempio n. 3
0
def test_vtn_flowfilter_audit_1():

    print "****CREATE Controller with valid IP****"
    retval = controller.add_controller_ex('ControllerFirst')
    if retval != 0:
        print "Controller Create Failed"
        exit(1)

    print """TEST 1 : create VTN FLOWFILTER when controller is up
             change the controller status to down delete VTN and VBR
             trigger Audit"""
    # Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst', "up")
    if retval != 0:
        print "controller state change failed"
        exit(1)
    print "****Create VTN****"
    retval = vtn_vbr.create_vtn('VtnOne')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    print "****Create VBR****"
    retval = vtn_vbr.create_vbr('VtnOne', 'VbrOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    retval = vtn_vbr.validate_vbr_at_controller('VtnOne', 'VbrOne',
                                                'ControllerFirst')
    if retval != 0:
        print "VBR Validate Failed"
        exit(1)

    retval = flowlistentry.create_flowlist('FlowlistOne')
    if retval != 0:
        print "FlowList Create Failed"
        exit(1)

    retval = flowlistentry.create_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne',
                                                'ControllerFirst')
    if retval != 0:
        print "FlowlistEntry Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilter Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter_entry('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilterEntry Create Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_entry('VtnOne',
                                                  'VTNFlowfilterOne',
                                                  presence='yes',
                                                  position=0)
    if retval != 0:
        print "VTNFlowFilterEntry Validate Failed at Co-ordinator"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne',
                                                          'ControllerFirst',
                                                          'VTNFlowfilterOne',
                                                          presence='yes',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation Failed"
        exit(1)

    print "****UPDATE Controller IP to invalid****"
    test_invalid_ipaddr = vtn_testconfig.ReadValues(
        CONTROLLERDATA, 'ControllerFirst')['invalid_ipaddr']
    retval = controller.update_controller_ex('ControllerFirst',
                                             ipaddr=test_invalid_ipaddr)
    if retval != 0:
        print "controller invalid_ip update failed"
        exit(1)
# Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst', "down")
    if retval != 0:
        print "controller state change failed"
        exit(1)

    retval = flowfilter.delete_flowfilter_entry('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilterEntry deletete Failed"
        exit(1)

    retval = flowfilter.delete_flowfilter('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilter deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne')
    if retval != 0:
        print "FlowilistEntry deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlist('FlowlistOne')
    if retval != 0:
        print "Flowilist deletete Failed"
        exit(1)

    print "****Delete VTN****"
    retval = vtn_vbr.delete_vtn('VtnOne')
    if retval != 0:
        print "VTN Delete Failed in coordinator"
        exit(1)

    print "****UPDATE Controller IP to Valid****"
    test_controller_ipaddr = vtn_testconfig.ReadValues(
        CONTROLLERDATA, 'ControllerFirst')['ipaddr']
    retval = controller.update_controller_ex('ControllerFirst',
                                             ipaddr=test_controller_ipaddr)
    if retval != 0:
        print "controller valid_ip update failed"
        exit(1)

# Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst', "up")
    if retval != 0:
        print "controller state change failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne',
                                                          'ControllerFirst',
                                                          'VTNFlowfilterOne',
                                                          presence='no',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation Failed after deleting"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne',
                                                'ControllerFirst',
                                                presence="no")
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    print "DELETE CONTROLLER"
    retval = controller.delete_controller_ex('ControllerFirst')
    if retval != 0:
        print "CONTROLLER delete failed"
        exit(1)
    print "VTN->FLOWFILTER TEST SUCCESS"
Esempio n. 4
0
def update_vbrif_flowfilter_pass_audit():
  print "CREATE Controller"
  retval = controller.add_controller_ex('ControllerFirst')
  if retval != 0:
    print "Controller Create Failed"
    exit(1)

  print "TEST 4 : VBRIF->Update AUDIT FLOWFILTER DROP TEST"
  # Delay for AUDIT
  retval=controller.wait_until_state('ControllerFirst', "up")
  if retval != 0:
    print "Controller state check Failed"
    exit(1)

  retval=vtn_vbr.create_vtn('VtnOne')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence = 'yes', position = 0)
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  print "****UPDATE Controller IP to invalid****"
  test_invalid_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerFirst')['invalid_ipaddr']
  retval = controller.update_controller_ex('ControllerFirst',ipaddr=test_invalid_ipaddr)
  if retval != 0:
    print "controller invalid_ip update failed"
    exit(1)
  # Delay for AUDIT
  retval = controller.wait_until_state('ControllerFirst',"down")
  if retval != 0:
    print "controller state change failed"
    exit(1)



  retval=flowlistentry.create_flowlist('FlowlistOne')
  if retval != 0:
    print "FlowList Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
  if retval != 0:
    print "FlowlistEntry Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOnePass')
  if retval != 0:
    print "VBRFlowFilter Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOnePass')
  if retval != 0:
    print "VBRFlowFilterEntry Create Failed"
    exit(1)

  print "****UPDATE Controller IP to Valid****"
  test_controller_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerFirst')['ipaddr']
  retval = controller.update_controller_ex('ControllerFirst',ipaddr=test_controller_ipaddr)
  if retval != 0:
    print "controller valid_ip update failed"
    exit(1)
  # Delay for AUDIT
  retval = controller.wait_until_state('ControllerFirst',"up")
  if retval != 0:
    print "controller state change failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst', 'FlowfilterOnePass', presence='yes', position=0)
  if retval != 0:
    print "FlowFilter validation at Controller Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree', 'VbrIfThree')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=flowfilter.update_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOnePass', 'UpdateFlowfilterOnePass')
  if retval != 0:
    print "VBRFIFlowFilterEntry Update Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst','UpdateFlowfilterOnePass', presence='yes', position=0)
  if retval != 0:
    print "VBRFIFlowFilterEntry Updatation Validate Failed at Co-ordinator"
    exit(1)

  retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOnePass')
  if retval != 0:
    print "VBRFlowFilterEntry deletete Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOnePass')
  if retval != 0:
    print "VBRFlowFilter deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
  if retval != 0:
    print "FlowilistEntry deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlist('FlowlistOne')
  if retval != 0:
    print "Flowilist deletete Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst', 'FlowfilterOnePass', presence='no', position=0)
  if retval != 0:
    print "FlowFilter validation Failed after deleting"
    exit(1)

  retval=vtn_vbr.delete_vtn('VtnOne')
  if retval != 0:
    print "DELETE VTN Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  print "DELETE CONTROLLER"
  retval=controller.delete_controller_ex('ControllerFirst')
  if retval != 0:
     print "CONTROLLER delete failed"
     exit(1)
  print "VBR->AUDIT UPDATE FLOWFILTER DROP TEST SUCCESS"
Esempio n. 5
0
def update_vbr_flowfilter_pass():
    print "CREATE Controller"
    retval = controller.add_controller_ex('ControllerFirst')
    if retval != 0:
        print "Controller Create Failed"
        exit(1)

    print 'TEST 6 : VBR->FLOWFILTER TEST: Create Three VBR and VbrFlowFilterEntry with vbrone update the VbrFlowFilterEntry to vbrthree'
    # Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst', "up")
    if retval != 0:
        print "Controller state check Failed"
        exit(1)

    retval = vtn_vbr.create_vtn('VtnOne')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vtn_vbr.create_vbr('VtnOne', 'VbrOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrOne', 'VbrIfOne')
    if retval != 0:
        print "VBRIF Create Failed"
        exit(1)

    retval = vtn_vbr.create_vbr('VtnOne', 'VbrTwo', 'ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrTwo', 'VbrIfTwo')
    if retval != 0:
        print "VBRIF Create Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    retval = vtn_vbr.validate_vbr_at_controller('VtnOne', 'VbrOne',
                                                'ControllerFirst')
    if retval != 0:
        print "VBR Validate Failed"
        exit(1)

    retval = vbrif_portmap.validate_vbrif_at_controller(
        'VtnOne', 'VbrOne', 'VbrIfOne', 'ControllerFirst')
    if retval != 0:
        print "After Create VBRIF Validate Failed"
        exit(1)

    retval = vtn_vbr.validate_vbr_at_controller('VtnOne',
                                                'VbrTwo',
                                                'ControllerFirst',
                                                presence='yes',
                                                position=1)
    if retval != 0:
        print "VBR Validate Failed"
        exit(1)

    retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne',
                                                        'VbrTwo',
                                                        'VbrIfTwo',
                                                        'ControllerFirst',
                                                        presence='yes',
                                                        position=0)
    if retval != 0:
        print "After Create VBRIF Validate Failed"
        exit(1)

    retval = flowlistentry.create_flowlist('FlowlistOne')
    if retval != 0:
        print "FlowList Create Failed"
        exit(1)

    retval = flowlistentry.create_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne',
                                                'ControllerFirst')
    if retval != 0:
        print "FlowlistEntry Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOnePass')
    if retval != 0:
        print "VBRFlowFilter Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter_entry('VtnOne|VbrOne',
                                                'FlowfilterOnePass')
    if retval != 0:
        print "VBRFlowFilterEntry Create Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne',
                                                          'ControllerFirst',
                                                          'FlowfilterOnePass',
                                                          presence='yes',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation at Controller Failed"
        exit(1)

    retval = flowfilter.update_flowfilter_entry('VtnOne|VbrOne',
                                                'FlowfilterOnePass',
                                                'UpdateFlowfilterOnePass')
    if retval != 0:
        print "VBRFlowFilterEntry Update Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller(
        'VtnOne|VbrOne',
        'ControllerFirst',
        'UpdateFlowfilterOnePass',
        presence='yes',
        position=0)
    if retval != 0:
        print "VBRFlowFilterEntry Updatation Validate Failed at Co-ordinator"
        exit(1)

    retval = flowfilter.delete_flowfilter_entry('VtnOne|VbrOne',
                                                'FlowfilterOnePass')
    if retval != 0:
        print "VBRFlowFilterEntry deletete Failed"
        exit(1)

    retval = flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOnePass')
    if retval != 0:
        print "VBRFlowFilter deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne')
    if retval != 0:
        print "FlowilistEntry deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlist('FlowlistOne')
    if retval != 0:
        print "Flowilist deletete Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne|VbrTwo',
                                                          'ControllerFirst',
                                                          'FlowfilterOnePass',
                                                          presence='no',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation Failed after deleting"
        exit(1)

    retval = vtn_vbr.delete_vtn('VtnOne')
    if retval != 0:
        print "DELETE VTN Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne',
                                                'ControllerFirst',
                                                presence='no')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    print "DELETE CONTROLLER"
    retval = controller.delete_controller_ex('ControllerFirst')
    if retval != 0:
        print "CONTROLLER delete failed"
        exit(1)
    print "VBR->UPDATE FLOWFILTER TEST SUCCESS"
Esempio n. 6
0
def test_vbr_flowfilter_drop():
    print "CREATE Controller"
    retval = controller.add_controller_ex('ControllerFirst')
    if retval != 0:
        print "Controller Create Failed"
        exit(1)

    print "TEST 1 : VBR->FLOWFILTER TEST"
    # Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst', "up")
    if retval != 0:
        print "Controller state check Failed"
        exit(1)

    retval = vtn_vbr.create_vtn('VtnOne')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vtn_vbr.create_vbr('VtnOne', 'VbrOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrOne', 'VbrIfOne')
    if retval != 0:
        print "VBRIF Create Failed"
        exit(1)

    retval = vtn_vbr.create_vbr('VtnOne', 'VbrTwo', 'ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrTwo', 'VbrIfTwo')
    if retval != 0:
        print "VBRIF Create Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    retval = vtn_vbr.validate_vbr_at_controller('VtnOne', 'VbrOne',
                                                'ControllerFirst')
    if retval != 0:
        print "VBR Validate Failed"
        exit(1)

    retval = vbrif_portmap.validate_vbrif_at_controller(
        'VtnOne', 'VbrOne', 'VbrIfOne', 'ControllerFirst')
    if retval != 0:
        print "After Create VBRIF Validate Failed"
        exit(1)

    retval = vtn_vbr.validate_vbr_at_controller('VtnOne',
                                                'VbrTwo',
                                                'ControllerFirst',
                                                presence='yes',
                                                position=1)
    if retval != 0:
        print "VBR Validate Failed"
        exit(1)

    retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne',
                                                        'VbrTwo',
                                                        'VbrIfTwo',
                                                        'ControllerFirst',
                                                        presence='yes',
                                                        position=0)
    if retval != 0:
        print "After Create VBRIF Validate Failed"
        exit(1)

    retval = flowlistentry.create_flowlist('FlowlistOne')
    if retval != 0:
        print "FlowList Create Failed"
        exit(1)

    retval = flowlistentry.create_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne',
                                                'ControllerFirst')
    if retval != 0:
        print "FlowlistEntry Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOneDrop')
    if retval != 0:
        print "VBRFlowFilter Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter_entry('VtnOne|VbrOne',
                                                'FlowfilterOneDrop')
    if retval != 0:
        print "VBRFlowFilterEntry Create Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne',
                                                          'ControllerFirst',
                                                          'FlowfilterOneDrop',
                                                          presence='yes',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation at Controller Failed"
        exit(1)

    retval = flowfilter.delete_flowfilter_entry('VtnOne|VbrOne',
                                                'FlowfilterOneDrop')
    if retval != 0:
        print "VBRFlowFilterEntry deletete Failed"
        exit(1)

    retval = flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOneDrop')
    if retval != 0:
        print "VBRFlowFilter deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne')
    if retval != 0:
        print "FlowilistEntry deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlist('FlowlistOne')
    if retval != 0:
        print "Flowilist deletete Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne',
                                                          'ControllerFirst',
                                                          'FlowfilterOneDrop',
                                                          presence='no',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation Failed after deleting"
        exit(1)

    retval = vtn_vbr.delete_vtn('VtnOne')
    if retval != 0:
        print "DELETE VTN Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne',
                                                'ControllerFirst',
                                                presence='no')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    print "DELETE CONTROLLER"
    retval = controller.delete_controller_ex('ControllerFirst')
    if retval != 0:
        print "CONTROLLER delete failed"
        exit(1)
    print "VBR->FLOWFILTER TEST SUCCESS"
def test_vtn_flowfilter():
  print "CREATE Controller"
  retval = controller.add_controller_ex('ControllerFirst')
  if retval != 0:
    print "Controller Create Failed"
    exit(1)

  print "TEST 1 : VTN->FLOWFILTER TEST"
  # Delay for AUDIT
  retval=controller.wait_until_state('ControllerFirst', "up")
  if retval != 0:
    print "Controller state check Failed"
    exit(1)

  retval=vtn_vbr.create_vtn('VtnOne')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=flowlistentry.create_flowlist('FlowlistOne')
  if retval != 0:
    print "FlowList Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
  if retval != 0:
    print "FlowlistEntry Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter('VtnOne', 'VTNFlowfilterOne')
  if retval != 0:
    print "VTNFlowFilter Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter_entry('VtnOne', 'VTNFlowfilterOne')
  if retval != 0:
    print "VTNFlowFilterEntry Create Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_entry('VtnOne', 'VTNFlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print "VTNFlowFilterEntry Validate Failed at Co-ordinator"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne', 'ControllerFirst', 'VTNFlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print "FlowFilter validation Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter_entry('VtnOne', 'VTNFlowfilterOne')
  if retval != 0:
    print "VTNFlowFilterEntry deletete Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter('VtnOne', 'VTNFlowfilterOne')
  if retval != 0:
    print "VTNFlowFilter deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
  if retval != 0:
    print "FlowilistEntry deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlist('FlowlistOne')
  if retval != 0:
    print "Flowilist deletete Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne', 'ControllerFirst', 'VTNFlowfilterOne', presence='no', position=0)
  if retval != 0:
    print "FlowFilter validation Failed after deleting"
    exit(1)

  retval=vtn_vbr.delete_vtn('VtnOne')
  if retval != 0:
    print "DELETE VTN Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  print "DELETE CONTROLLER"
  retval=controller.delete_controller_ex('ControllerFirst')
  if retval != 0:
     print "CONTROLLER delete failed"
     exit(1)
  print "VTN->FLOWFILTER TEST SUCCESS"
Esempio n. 8
0
def negative_vbrif_flowfilter_out():
  print "CREATE Controller"
  retval = controller.add_controller_ex('ControllerFirst')
  if retval != 0:
    print "Controller Create Failed"
    exit(1)

  print "TEST 1 : VBRIF->Negative test scenario FLOWFILTER TEST"
  # Delay for AUDIT
  retval=controller.wait_until_state('ControllerFirst', "up")
  if retval != 0:
    print "Controller state check Failed"
    exit(1)

  retval=vtn_vbr.create_vtn('VtnOne')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
  if retval != 0:
    print "VBR Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence = 'yes', position = 1)
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlist('FlowlistOne')
  if retval != 0:
    print "FlowList Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
  if retval != 0:
    print "FlowlistEntry Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneOut')
  if retval != 0:
    print "VBRFlowFilter Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneOut')
  if retval != 0:
    print "VBRFlowFilterEntry Create Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneOut', presence='yes', position=0)
  if retval != 0:
    print "VBRFlowFilterEntry Validation at Co-ordinator Failed "
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst', 'FlowfilterOneOut', presence='yes', position=0)
  if retval != 0:
    print "FlowFilter validation at Controller Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree', 'VbrIfThree')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=flowfilter.update_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneOut', 'NegativeFlowfilterOne')
  if retval != 0:

    print "VBRFIFlowFilterEntry Negative test case DSCP,Priority  Failed"
    print "Because  DSCP range was up to (0-63) and priority range (0-7) its more than higher its showing Bad command so test failed "
    exit(1)

  retval=flowfilter.validate_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneOut|NegativeFlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print retval
    print "VBRFIFlowFilterEntry Updatation Validate Failed at Co-ordinator"
    exit(1)

  retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneOut')
  if retval != 0:
    print "VBRFlowFilterEntry deletete Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneOut')
  if retval != 0:
    print "VBRFlowFilter deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
  if retval != 0:
    print "FlowilistEntry deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlist('FlowlistOne')
  if retval != 0:
    print "Flowilist deletete Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst', 'FlowfilterOneOut', presence='no', position=0)
  if retval != 0:
    print "FlowFilter validation Failed after deleting"
    exit(1)

  retval=vtn_vbr.delete_vtn('VtnOne')
  if retval != 0:
    print "DELETE VTN Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  print "DELETE CONTROLLER"
  retval=controller.delete_controller_ex('ControllerFirst')
  if retval != 0:
     print "CONTROLLER delete failed"
     exit(1)
  print "VBR->UPDATE FLOWFILTER TEST SUCCESS"
Esempio n. 9
0
def negative_vtn_flowfilter():
    print "CREATE Controller"
    retval = controller.add_controller_ex('ControllerFirst')
    if retval != 0:
        print "Controller Create Failed"
        exit(1)
    print "NEGATIVE FLOWFILTER TEST"
    print "TEST 3 : VTN->Negative FLOWFILTER TEST "
    # Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst', "up")
    if retval != 0:
        print "Controller state check Failed"
        exit(1)

    retval = vtn_vbr.create_vtn('VtnOne')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vtn_vbr.create_vbr('VtnOne', 'VbrOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    retval = vtn_vbr.validate_vbr_at_controller('VtnOne', 'VbrOne',
                                                'ControllerFirst')
    if retval != 0:
        print "VBR Validate Failed"
        exit(1)

    retval = flowlistentry.create_flowlist('FlowlistOne')
    if retval != 0:
        print "FlowList Create Failed"
        exit(1)

    retval = flowlistentry.create_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne',
                                                'ControllerFirst')
    if retval != 0:
        print "FlowlistEntry Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilter Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter_entry('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilterEntry Create Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_entry('VtnOne',
                                                  'VTNFlowfilterOne',
                                                  presence='yes',
                                                  position=0)
    if retval != 0:
        print "VTNFlowFilterEntry Validate Failed at Co-ordinator"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne',
                                                          'ControllerFirst',
                                                          'VTNFlowfilterOne',
                                                          presence='yes',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation Failed"
        exit(1)

    retval = flowfilter.update_flowfilter_entry('VtnOne', 'VTNFlowfilterOne',
                                                'NegativeVTNFlowfilter')
    if retval != 0:
        print "VTNFlowFilterEntry Negative test case  Failed at priority and dscp "
        print "Because at priority range up to 63 and dscp range up to 7 its more than its showing bad request so test has faild"
        exit(1)

    retval = flowfilter.validate_flowfilter_entry(
        'VtnOne',
        'VTNFlowfilterOne|NegativeVTNFlowfilter',
        presence='yes',
        position=0)
    if retval != 0:
        print "VTNFlowFilterEntry Updatation Validate Failed at Co-ordinator"
        exit(1)

    retval = flowfilter.delete_flowfilter_entry('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilterEntry deletete Failed"
        exit(1)

    retval = flowfilter.delete_flowfilter('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilter deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne')
    if retval != 0:
        print "FlowilistEntry deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlist('FlowlistOne')
    if retval != 0:
        print "Flowilist deletete Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne',
                                                          'ControllerFirst',
                                                          'VTNFlowfilterOne',
                                                          presence='no',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation Failed after deleting"
        exit(1)

    retval = vtn_vbr.delete_vtn('VtnOne')
    if retval != 0:
        print "DELETE VTN Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne',
                                                'ControllerFirst',
                                                presence='no')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    print "DELETE CONTROLLER"
    retval = controller.delete_controller_ex('ControllerFirst')
    if retval != 0:
        print "CONTROLLER delete failed"
        exit(1)
    print "VTN->UPDATE FLOWFILTER TEST SUCCESS"
Esempio n. 10
0
def negative_vtn_flowfilter():
  print "CREATE Controller"
  retval = controller.add_controller_ex('ControllerFirst')
  if retval != 0:
    print "Controller Create Failed"
    exit(1)
  print "NEGATIVE FLOWFILTER TEST"
  print "TEST 3 : VTN->Negative FLOWFILTER TEST "
  # Delay for AUDIT
  retval=controller.wait_until_state('ControllerFirst', "up")
  if retval != 0:
    print "Controller state check Failed"
    exit(1)

  retval=vtn_vbr.create_vtn('VtnOne')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=flowlistentry.create_flowlist('FlowlistOne')
  if retval != 0:
    print "FlowList Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
  if retval != 0:
    print "FlowlistEntry Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter('VtnOne', 'VTNFlowfilterOne')
  if retval != 0:
    print "VTNFlowFilter Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter_entry('VtnOne', 'VTNFlowfilterOne')
  if retval != 0:
    print "VTNFlowFilterEntry Create Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_entry('VtnOne', 'VTNFlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print "VTNFlowFilterEntry Validate Failed at Co-ordinator"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne', 'ControllerFirst', 'VTNFlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print "FlowFilter validation Failed"
    exit(1)

  retval=flowfilter.update_flowfilter_entry('VtnOne', 'VTNFlowfilterOne', 'NegativeVTNFlowfilter')
  if retval != 0:
    print "VTNFlowFilterEntry Negative test case  Failed at priority and dscp "
    print "Because at priority range up to 63 and dscp range up to 7 its more than its showing bad request so test has faild"
    exit(1)

  retval=flowfilter.validate_flowfilter_entry('VtnOne', 'VTNFlowfilterOne|NegativeVTNFlowfilter', presence='yes', position=0)
  if retval != 0:
    print "VTNFlowFilterEntry Updatation Validate Failed at Co-ordinator"
    exit(1)

  retval=flowfilter.delete_flowfilter_entry('VtnOne', 'VTNFlowfilterOne')
  if retval != 0:
    print "VTNFlowFilterEntry deletete Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter('VtnOne', 'VTNFlowfilterOne')
  if retval != 0:
    print "VTNFlowFilter deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
  if retval != 0:
    print "FlowilistEntry deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlist('FlowlistOne')
  if retval != 0:
    print "Flowilist deletete Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne', 'ControllerFirst', 'VTNFlowfilterOne', presence='no', position=0)
  if retval != 0:
    print "FlowFilter validation Failed after deleting"
    exit(1)

  retval=vtn_vbr.delete_vtn('VtnOne')
  if retval != 0:
    print "DELETE VTN Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  print "DELETE CONTROLLER"
  retval=controller.delete_controller_ex('ControllerFirst')
  if retval != 0:
     print "CONTROLLER delete failed"
     exit(1)
  print "VTN->UPDATE FLOWFILTER TEST SUCCESS"
Esempio n. 11
0
def update_vtn_flowfilter():
    print "CREATE Controller"
    retval = controller.add_controller_ex('ControllerFirst')
    if retval != 0:
        print "Controller Create Failed"
        exit(1)

    print "TEST 2 : VTN->UPDATE FLOWFILTER TEST "
    # Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst', "up")
    if retval != 0:
        print "Controller state check Failed"
        exit(1)

    retval = vtn_vbr.create_vtn('VtnOne')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vtn_vbr.create_vbr('VtnOne', 'VbrOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    retval = vtn_vbr.validate_vbr_at_controller('VtnOne', 'VbrOne',
                                                'ControllerFirst')
    if retval != 0:
        print "VBR Validate Failed"
        exit(1)

    retval = flowlistentry.create_flowlist('FlowlistOne')
    if retval != 0:
        print "FlowList Create Failed"
        exit(1)

    retval = flowlistentry.create_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne',
                                                'ControllerFirst')
    if retval != 0:
        print "FlowlistEntry Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilter Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter_entry('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilterEntry Create Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_entry('VtnOne',
                                                  'VTNFlowfilterOne',
                                                  presence='yes',
                                                  position=0)
    if retval != 0:
        print "VTNFlowFilterEntry Validate Failed at Co-ordinator"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne',
                                                          'ControllerFirst',
                                                          'VTNFlowfilterOne',
                                                          presence='yes',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation Failed"
        exit(1)

    retval = flowfilter.update_flowfilter_entry('VtnOne', 'VTNFlowfilterOne',
                                                'UpdateVTNFlowfilter')
    if retval != 0:
        print "VTNFlowFilterEntry Update Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_entry(
        'VtnOne',
        'VTNFlowfilterOne|UpdateVTNFlowfilter',
        presence='yes',
        position=0)
    if retval != 0:
        print "VTNFlowFilterEntry Updatation Validate Failed at Co-ordinator"
        exit(1)

    retval = flowfilter.delete_flowfilter_entry('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilterEntry deletete Failed"
        exit(1)

    retval = flowfilter.delete_flowfilter('VtnOne', 'VTNFlowfilterOne')
    if retval != 0:
        print "VTNFlowFilter deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne')
    if retval != 0:
        print "FlowilistEntry deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlist('FlowlistOne')
    if retval != 0:
        print "Flowilist deletete Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne',
                                                          'ControllerFirst',
                                                          'VTNFlowfilterOne',
                                                          presence='no',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation Failed after deleting"
        exit(1)

    retval = vtn_vbr.delete_vtn('VtnOne')
    if retval != 0:
        print "DELETE VTN Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne',
                                                'ControllerFirst',
                                                presence='no')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    print "DELETE CONTROLLER"
    retval = controller.delete_controller_ex('ControllerFirst')
    if retval != 0:
        print "CONTROLLER delete failed"
        exit(1)
    print "VTN->UPDATE FLOWFILTER TEST SUCCESS"
def test_vtermif_flowfilter_drop_audit():
  print "CREATE Controller"
  retval = controller.add_controller_ex('ControllerFirst')
  if retval != 0:
    print "Controller Create Failed"
    exit(1)

  print "TEST 5 : VTERMIF->AUDIT FLOWFILTER TEST"
  # Delay for AUDIT
  retval=controller.wait_until_state('ControllerFirst', "up")
  if retval != 0:
    print "Controller state check Failed"
    exit(1)

  retval=vtn_vbr.create_vtn('VtnOne')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
  if retval != 0:
    print "VTERM Create Failed"
    exit(1)

  retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
  if retval != 0:
    print "VTERMIF Create Failed"
    exit(1)
    retval=flowlistentry.create_flowlist('FlowlistOne')

  retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlist('FlowlistOne')
  if retval != 0:
    print "FlowList Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
  if retval != 0:
    print "FlowlistEntry Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneDrop')
  if retval != 0:
    print "VTERMFlowFilter Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneDrop')
  if retval != 0:
    print "VTERMFlowFilterEntry Create Failed"
    exit(1)
  print "****UPDATE Controller IP to invalid****"
  test_invalid_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerFirst')['invalid_ipaddr']
  retval = controller.update_controller_ex('ControllerFirst',ipaddr=test_invalid_ipaddr)
  if retval != 0:
    print "controller invalid_ip update failed"
    exit(1)
  # Delay for AUDIT
  retval = controller.wait_until_state('ControllerFirst',"down")
  if retval != 0:
    print "controller state change failed"
    exit(1)

  retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneDrop')
  if retval != 0:
    print "VTERMFlowFilterEntry deletete Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneDrop')
  if retval != 0:
    print "VTERMFlowFilter deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
  if retval != 0:
    print "FlowilistEntry deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlist('FlowlistOne')
  if retval != 0:
    print "Flowilist deletete Failed"
    exit(1)


  retval=vtn_vbr.delete_vtn('VtnOne')
  if retval != 0:
    print "DELETE VTN Failed"
    exit(1)


  print "DELETE CONTROLLER"
  retval=controller.delete_controller_ex('ControllerFirst')
  if retval != 0:
     print "CONTROLLER delete failed"
     exit(1)
  print "VTERM->AUDIT FLOWFILTER TEST SUCCESS"
Esempio n. 13
0
def update_vbr_flowlist():
  print "CREATE Controller"
  retval = controller.add_controller_ex('ControllerFirst')
  if retval != 0:
    print "Controller Create Failed"
    exit(1)

  print 'TEST 3 : VBR->FLOWLISTTEST:Update the VbrFlowListEntry'
  # Delay for AUDIT
  retval=controller.wait_until_state('ControllerFirst', "up")
  if retval != 0:
    print "Controller state check Failed"
    exit(1)

  retval=vtn_vbr.create_vtn('VtnOne')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)
  retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)
  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)
  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst')
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)
  retval=vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',presence="yes");
  if retval != 0:
     print "Portmap Validate Failed"
     exit(1)

  retval=vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst',presence="yes");
  if retval != 0:
     print "Portmap Validate Failed"
     exit(1)
  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence="yes", position = 1)
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)


  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=flowlistentry.create_flowlist('FlowlistOne')
  if retval != 0:
    print "FlowList Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
  if retval != 0:
    print "FlowlistEntry Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOne')
  if retval != 0:
    print "VBRFlowFilter Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne')
  if retval != 0:
    print "VBRFlowFilterEntry Create Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print "VBRFlowFilterEntry Validation at Co-ordinator Failed "
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print "FlowFilter validation at Controller Failed"
    exit(1)

  retval=flowlistentry.update_flowlist_entry('FlowlistOne', 'UpdateFlowlistentryOne')
  if retval != 0:
    print "VBRFlowListEntry Update Failed"
    exit(1)
#  retval=flowlistentry.validate_flowlist_entry('FlowlistOne', 'UpdateFlowlistentryOne','ControllerFirst', presence='yes', position=0)
#  if retval != 0:
#    print "VBRFlowListEntry Updatation Validate Failed at Co-ordinator"
#    exit(1)

  retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne')
  if retval != 0:
    print "VBRFlowFilterEntry deletete Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOne')
  if retval != 0:
    print "VBRFlowFilter deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
  if retval != 0:
    print "FlowilistEntry deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlist('FlowlistOne')
  if retval != 0:
    print "Flowilist deletete Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrTwo', 'ControllerFirst', 'FlowfilterOne', presence='no', position=0)
  if retval != 0:
    print "FlowFilter validation Failed after deleting"
    exit(1)

  retval=flowlistentry.validate_flowlist_at_controller('FlowlistOne', 'ControllerFirst', presence='no', position=0)
  if retval != 0:
    print "Flowlist validation Failed after deleting"
    exit(1)

#  retval=flowlistentry.validate_flowlist_entry('FlowlistOne', 'UpdateFlowlistentryOne','ControllerFirst', presence='no', position=0)
#  if retval != 0:
#    print "VBRFlowListEntry Delete Validate Failed at Co-ordinator"
#    exit(1)

  retval=vtn_vbr.delete_vtn('VtnOne')
  if retval != 0:
    print "DELETE VTN Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  print "DELETE CONTROLLER"
  retval=controller.delete_controller_ex('ControllerFirst')
  if retval != 0:
     print "CONTROLLER delete failed"
     exit(1)
  print "VBR->UPDATE FLOWLIST TEST SUCCESS"
Esempio n. 14
0
def test_vbr_flowfilter_pass():
  print "CREATE Controller"
  retval = controller.add_controller_ex('ControllerFirst')
  if retval != 0:
    print "Controller Create Failed"
    exit(1)
  print "action type create pass"
  print "TEST 5 : VBR->FLOWFILTER TEST"
  # Delay for AUDIT
  retval=controller.wait_until_state('ControllerFirst', "up")
  if retval != 0:
    print "Controller state check Failed"
    exit(1)

  retval=vtn_vbr.create_vtn('VtnOne')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence = 'yes', position = 1)
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=flowlistentry.create_flowlist('FlowlistOne')
  if retval != 0:
    print "FlowList Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
  if retval != 0:
    print "FlowlistEntry Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOnePass')
  if retval != 0:
    print "VBRFlowFilter Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOnePass')
  if retval != 0:
    print "VBRFlowFilterEntry Create Failed"
    exit(1)


  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOnePass', presence='yes', position=0)
  if retval != 0:
    print "FlowFilter validation at Controller Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOnePass')
  if retval != 0:
    print "VBRFlowFilterEntry deletete Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOnePass')
  if retval != 0:
    print "VBRFlowFilter deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
  if retval != 0:
    print "FlowilistEntry deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlist('FlowlistOne')
  if retval != 0:
    print "Flowilist deletete Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOnePass', presence='no', position=0)
  if retval != 0:
    print "FlowFilter validation Failed after deleting"
    exit(1)

  retval=vtn_vbr.delete_vtn('VtnOne')
  if retval != 0:
    print "DELETE VTN Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  print "DELETE CONTROLLER"
  retval=controller.delete_controller_ex('ControllerFirst')
  if retval != 0:
     print "CONTROLLER delete failed"
     exit(1)
  print "VBR->FLOWFILTER TEST SUCCESS"
Esempio n. 15
0
def negative_vbr_flowfilter():
    print "CREATE Controller"
    retval = controller.add_controller_ex('ControllerFirst')
    if retval != 0:
        print "Controller Create Failed"
        exit(1)
    print "Negative test scenario test cases"
    print 'TEST 3 : VBR->FLOWFILTER TEST: Create Three VBR and VbrFlowFilterEntry with vbrone negative  the VbrFlowFilterEntry to vbrthree'
    # Delay for AUDIT
    retval = controller.wait_until_state('ControllerFirst', "up")
    if retval != 0:
        print "Controller state check Failed"
        exit(1)

    retval = vtn_vbr.create_vtn('VtnOne')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vtn_vbr.create_vbr('VtnOne', 'VbrOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrOne', 'VbrIfOne')
    if retval != 0:
        print "VBRIF Create Failed"
        exit(1)

    retval = vtn_vbr.create_vbr('VtnOne', 'VbrTwo', 'ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrTwo', 'VbrIfTwo')
    if retval != 0:
        print "VBRIF Create Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne', 'ControllerFirst')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    retval = vtn_vbr.validate_vbr_at_controller('VtnOne', 'VbrOne',
                                                'ControllerFirst')
    if retval != 0:
        print "VBR Validate Failed"
        exit(1)

    retval = vbrif_portmap.validate_vbrif_at_controller(
        'VtnOne', 'VbrOne', 'VbrIfOne', 'ControllerFirst')
    if retval != 0:
        print "After Create VBRIF Validate Failed"
        exit(1)

    retval = vtn_vbr.validate_vbr_at_controller('VtnOne',
                                                'VbrTwo',
                                                'ControllerFirst',
                                                presence='yes',
                                                position=1)
    if retval != 0:
        print "VBR Validate Failed"
        exit(1)

    retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne',
                                                        'VbrTwo',
                                                        'VbrIfTwo',
                                                        'ControllerFirst',
                                                        presence='yes',
                                                        position=0)
    if retval != 0:
        print "After Create VBRIF Validate Failed"
        exit(1)

    retval = flowlistentry.create_flowlist('FlowlistOne')
    if retval != 0:
        print "FlowList Create Failed"
        exit(1)

    retval = flowlistentry.create_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne',
                                                'ControllerFirst')
    if retval != 0:
        print "FlowlistEntry Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOne')
    if retval != 0:
        print "VBRFlowFilter Create Failed"
        exit(1)

    retval = flowfilter.create_flowfilter_entry('VtnOne|VbrOne',
                                                'FlowfilterOne')
    if retval != 0:
        print "VBRFlowFilterEntry Create Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_entry('VtnOne|VbrOne',
                                                  'FlowfilterOne',
                                                  presence='yes',
                                                  position=0)
    if retval != 0:
        print "VBRFlowFilterEntry Validation at Co-ordinator Failed "
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne',
                                                          'ControllerFirst',
                                                          'FlowfilterOne',
                                                          presence='yes',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation at Controller Failed"
        exit(1)

    retval = vtn_vbr.create_vbr('VtnOne', 'VbrThree', 'ControllerFirst')
    if retval != 0:
        print "VTN Create Failed"
        exit(1)

    retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrThree', 'VbrIfThree')
    if retval != 0:
        print "VBRIF Create Failed"
        exit(1)

    retval = flowfilter.update_flowfilter_entry('VtnOne|VbrOne',
                                                'FlowfilterOne',
                                                'NegativeFlowfilter')
    if retval != 0:
        print "VBRFlowFilterEntry at negative  priority and dscp has  Failed"
        print "Because flowfilter priority range up 63 and dscp range up to 7 its more than test was faild its showing Bad error"
        exit(1)

    retval = flowfilter.validate_flowfilter_entry(
        'VtnOne|VbrOne',
        'FlowfilterOne|NegativeFlowfilter',
        presence='yes',
        position=0)
    if retval != 0:
        print "VBRFlowFilterEntry Negative  Validate Failed at Co-ordinator"
        exit(1)

    retval = flowfilter.delete_flowfilter_entry('VtnOne|VbrOne',
                                                'FlowfilterOne')
    if retval != 0:
        print "VBRFlowFilterEntry deletete Failed"
        exit(1)

    retval = flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOne')
    if retval != 0:
        print "VBRFlowFilter deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlistentry('FlowlistOne',
                                                'FlowlistentryOne')
    if retval != 0:
        print "FlowilistEntry deletete Failed"
        exit(1)

    retval = flowlistentry.delete_flowlist('FlowlistOne')
    if retval != 0:
        print "Flowilist deletete Failed"
        exit(1)

    retval = flowfilter.validate_flowfilter_at_controller('VtnOne|VbrTwo',
                                                          'ControllerFirst',
                                                          'FlowfilterOne',
                                                          presence='no',
                                                          position=0)
    if retval != 0:
        print "FlowFilter validation Failed after deleting"
        exit(1)

    retval = vtn_vbr.delete_vtn('VtnOne')
    if retval != 0:
        print "DELETE VTN Failed"
        exit(1)

    retval = vtn_vbr.validate_vtn_at_controller('VtnOne',
                                                'ControllerFirst',
                                                presence='no')
    if retval != 0:
        print "VTN Validate Failed"
        exit(1)

    print "DELETE CONTROLLER"
    retval = controller.delete_controller_ex('ControllerFirst')
    if retval != 0:
        print "CONTROLLER delete failed"
        exit(1)
    print "VBR->UPDATE FLOWFILTER TEST SUCCESS"
Esempio n. 16
0
def update_vbr_flowfilter_drop():
  print "CREATE Controller"
  retval = controller.add_controller_ex('ControllerFirst')
  if retval != 0:
    print "Controller Create Failed"
    exit(1)

  print 'TEST 8 : VBR->FLOWFILTER TEST: Create Three VBR and VbrFlowFilterEntry with vbrone update the VbrFlowFilterEntry to vbrthree'
  # Delay for AUDIT
  retval=controller.wait_until_state('ControllerFirst', "up")
  if retval != 0:
    print "Controller state check Failed"
    exit(1)

  retval=vtn_vbr.create_vtn('VtnOne')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence = 'yes', position = 1)
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=flowlistentry.create_flowlist('FlowlistOne')
  if retval != 0:
    print "FlowList Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
  if retval != 0:
    print "FlowlistEntry Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOneDrop')
  if retval != 0:
    print "VBRFlowFilter Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOneDrop')
  if retval != 0:
    print "VBRFlowFilterEntry Create Failed"
    exit(1)


  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOneDrop', presence='yes', position=0)
  if retval != 0:
    print "FlowFilter validation at Controller Failed"
    exit(1)


  retval=flowfilter.update_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOneDrop', 'UpdateFlowfilterOneDrop')
  if retval != 0:
    print "VBRFlowFilterEntry Update Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst','UpdateFlowfilterOneDrop', presence='yes', position=0)
  if retval != 0:
    print "VBRFlowFilterEntry Updatation Validate Failed at Co-ordinator"
    exit(1)

  retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOneDrop')
  if retval != 0:
    print "VBRFlowFilterEntry deletete Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOneDrop')
  if retval != 0:
    print "VBRFlowFilter deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
  if retval != 0:
    print "FlowilistEntry deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlist('FlowlistOne')
  if retval != 0:
    print "Flowilist deletete Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrTwo', 'ControllerFirst', 'FlowfilterOneDrop', presence='no', position=0)
  if retval != 0:
    print "FlowFilter validation Failed after deleting"
    exit(1)

  retval=vtn_vbr.delete_vtn('VtnOne')
  if retval != 0:
    print "DELETE VTN Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  print "DELETE CONTROLLER"
  retval=controller.delete_controller_ex('ControllerFirst')
  if retval != 0:
     print "CONTROLLER delete failed"
     exit(1)
  print "VBR->UPDATE FLOWFILTER TEST SUCCESS"
def test_vtermif_flowfilter_1():
  print "CREATE Controller"
  retval = controller.add_controller_ex('ControllerFirst')
  if retval != 0:
    print "Controller Create Failed"
    exit(1)

  print "TEST 2 : VTERMIF->FLOWFILTER TEST"
  # Delay for AUDIT
  retval=controller.wait_until_state('ControllerFirst', "up")
  if retval != 0:
    print "Controller state check Failed"
    exit(1)

  retval=vtn_vbr.create_vtn('VtnOne')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
  if retval != 0:
    print "VTN Create Failed"
    exit(1)

  retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree','VbrIfThree')
  if retval != 0:
    print "VBRIF Create Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
  if retval != 0:
    print "VBR Validate Failed"
    exit(1)

  retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
  if retval != 0:
    print "After Create VBRIF Validate Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
  if retval != 0:
    print "VTERM Create Failed"
    exit(1)

  retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
  if retval != 0:
    print "VTERMIF Create Failed"
    exit(1)
    retval=flowlistentry.create_flowlist('FlowlistOne')

  retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
  if retval != 0:
    print "Portmap Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlist('FlowlistOne')
  if retval != 0:
    print "FlowList Create Failed"
    exit(1)

  retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
  if retval != 0:
    print "FlowlistEntry Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
  if retval != 0:
    print "VTERMFlowFilter Create Failed"
    exit(1)

  retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
  if retval != 0:
    print "VTERMFlowFilterEntry Create Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print "VTERMFlowFilterEntry Validation at Co-ordinator Failed "
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOne', presence='yes', position=0)
  if retval != 0:
    print "FlowFilter validation at Controller Failed"
    exit(1)

  retval=flowfilter.update_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne', 'UpdateFlowfilter')
  if retval != 0:
    print "VTERMIFFlowFilterEntry Update Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne|UpdateFlowfilter', presence='yes', position=0)
  if retval != 0:
    print "VTERMIFFlowFilterEntry Updatation Validate Failed at Co-ordinator"
    exit(1)

  retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
  if retval != 0:
    print "VTERMFlowFilterEntry deletete Failed"
    exit(1)

  retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
  if retval != 0:
    print "VTERMFlowFilter deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
  if retval != 0:
    print "FlowilistEntry deletete Failed"
    exit(1)

  retval=flowlistentry.delete_flowlist('FlowlistOne')
  if retval != 0:
    print "Flowilist deletete Failed"
    exit(1)

  retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOne', presence='no', position=0)
  if retval != 0:
    print "FlowFilter validation Failed after deleting"
    exit(1)

  retval=vtn_vbr.delete_vtn('VtnOne')
  if retval != 0:
    print "DELETE VTN Failed"
    exit(1)

  retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
  if retval != 0:
    print "VTN Validate Failed"
    exit(1)

  print "DELETE CONTROLLER"
  retval=controller.delete_controller_ex('ControllerFirst')
  if retval != 0:
     print "CONTROLLER delete failed"
     exit(1)
  print "VTERMIF->FLOWFILTER TEST SUCCESS"