def test_multi_vtn_with_vbr_multi_controller(): print "TEST 3 : 2 Tenants with one VBridge each" print "CONTROLLER1->VTNONE->VBRONE" print "CONTROLLER1->VTNTWO->VBRONE" print "CONTROLLER2->VTNONE->VBRONE" print "CONTROLLER2->VTNTWO->VBRONE" print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller1 Create Failed" exit(1) retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "Controller2 Create Failed" exit(1) retval = controller.wait_until_state('ControllerSecond',"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_vtn('VtnTwo') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBR1 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnTwo','VbrOne','ControllerFirst') if retval != 0: print "VBR2 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "VBR3 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnTwo','VbrThree','ControllerSecond') if retval != 0: print "VBR4 Create Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',position=0) if retval != 0: print "VTN1/CONTROLLER1 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerFirst',position=0) if retval != 0: print "VTN2/CONTROLLER2 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerSecond',position=0) if retval != 0: print "VTN1/CONTROLLER2 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerSecond',position=0) if retval != 0: print "VTN2/CONTROLLER2 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBR1/VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrOne','ControllerFirst') if retval != 0: print "VBR1/VTN2 Validate Failed " exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "VBR2/VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrThree','ControllerSecond') if retval != 0: print "VBR2/VTN2 Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "VBR Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnTwo','VbrOne') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrOne','ControllerFirst',presence="no") if retval != 0: print "VBR2 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrThree') if retval != 0: print "VBR2/VTN1 Delete Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond',presence="no") if retval != 0: print "VBR2/VTN1 Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnTwo','VbrThree') if retval != 0: print "VBR2/VTN2 Delete Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrThree','ControllerSecond',presence="no") if retval != 0: print "VBR2/VTN2 Validate Failed" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) retval = vtn_vbr.delete_vtn('VtnTwo') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER1 delete failed" exit(1) retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "MULTI VTN->VBR MULTI-CONTROLLER TEST SUCCESS"
def test_multi_vtn_with_vbr_multi_controller_audit_test(): print "TEST 3 : 2 Tenants with one VBridge each in multi-controller and test AUDIT" print "CONTROLLER1->VTNONE->VBRONE" print "CONTROLLER1->VTNTWO->VBRONE" print "CONTROLLER2->VTNTHREE->VBRONE" print "CONTROLLER2->VTNFOUR->VBRONE" print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller1 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "Controller2 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vbr.create_vtn('VtnOne') if retval != 0: print "VTN1 Create Failed" exit(1) retval = vtn_vbr.create_vtn('VtnTwo') if retval != 0: print "VTN2 Create Failed" exit(1) retval = vtn_vbr.create_vtn('VtnThree') if retval != 0: print "VTN3 Create Failed" exit(1) retval = vtn_vbr.create_vtn('VtnFour') if retval != 0: print "VTN4 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBR1/VTN1 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnTwo','VbrOne','ControllerFirst') if retval != 0: print "VBR1/VTN2 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnThree','VbrThree','ControllerSecond') if retval != 0: print "VBR3/VTN3 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnFour','VbrThree','ControllerSecond') if retval != 0: print "VBR3/VTN4 Create Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',position=0) if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerFirst',position=1) if retval != 0: print "VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnThree','ControllerSecond',position=1) if retval != 0: print "VTN3 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnFour','ControllerSecond',position=0) if retval != 0: print "VTN4 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBR1/VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrOne','ControllerFirst') if retval != 0: print "VBR1/VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnThree','VbrThree','ControllerSecond') if retval != 0: print "VBR3/VTN3 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnFour','VbrThree','ControllerSecond') if retval != 0: print "VBR4/VTN4 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 "controller1 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"down") if retval != 0: print "Controller state check failed" exit(1) test_invalid_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerSecond')['invalid_ipaddr'] retval = controller.update_controller_ex('ControllerSecond',ipaddr=test_invalid_ipaddr) if retval != 0: print "controller2 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"down") if retval != 0: print "Controller state check failed" exit(1) print "****DELETE VBR****" retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR1/VTN1 Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnTwo','VbrOne') if retval != 0: print "VBR1/VTN2 Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnThree','VbrThree') if retval != 0: print "VBR3/VTN3 Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnFour','VbrThree') if retval != 0: print "VBR3/VTN4 Delete 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 "controller1 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) test_controller_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerSecond')['ipaddr'] retval = controller.update_controller_ex('ControllerSecond',ipaddr=test_controller_ipaddr) if retval != 0: print "controller2 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "VBR1/VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrOne','ControllerFirst',presence="no") if retval != 0: print "VBR1/VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerFirst',presence="no") if retval != 0: print "VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnThree','VbrThree','ControllerSecond',presence="no") if retval != 0: print "VBR3/VTN3 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnThree','ControllerSecond',presence="no") if retval != 0: print "VTN3 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnFour','VbrThree','ControllerSecond',presence="no") if retval != 0: print "VBR3/VTN4 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnFour','ControllerSecond',presence="no") if retval != 0: print "VTN4 Validate Failed" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN1 Delete Failed in coordinator" exit(1) retval = vtn_vbr.delete_vtn('VtnTwo') if retval != 0: print "VTN2 Delete Failed in coordinator" exit(1) retval = vtn_vbr.delete_vtn('VtnThree') if retval != 0: print "VTN3 Delete Failed in coordinator" exit(1) retval = vtn_vbr.delete_vtn('VtnFour') if retval != 0: print "VTN4 Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER1 delete failed" exit(1) retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "MULTI VTN->VBR MULTI_CONTROLLER AUDIT 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"
def test_vtn_multi_vbr_multi_controller(): print "TEST 2 : 1 Tenants with 2 VBridge each on different controllers" print "CONTROLLER1->VTNONE->VBRONE->VBRTWO" print "CONTROLLER2->VTNTWO->VBRTHREE->VBRFOUR" print "CREATE ControllerFirst" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller1 Create Failed" exit(1) retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) print "CREATE ControllerSecond" retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "Controller2 Create Failed" exit(1) retval = controller.wait_until_state('ControllerSecond',"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_vtn('VtnTwo') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBR1 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst') if retval != 0: print "VBR2 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnTwo','VbrThree','ControllerSecond') if retval != 0: print "VBR3 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnTwo','VbrFour','ControllerSecond') if retval != 0: print "VBR4 Create Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerSecond') if retval != 0: print "VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBR1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst',position=0) if retval != 0: print "VBR2 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrThree','ControllerSecond',position=0) if retval != 0: print "VBR3 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrFour','ControllerSecond') if retval != 0: print "VBR4 Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR1/VTN1 Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrTwo') if retval != 0: print "VBR2/VTN1 Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnTwo','VbrThree') if retval != 0: print "VBR3/VTN2 Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnTwo','VbrFour') if retval != 0: print "VBR4/VTN2 Delete Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "VBR1/VBR1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst',presence="no") if retval != 0: print "VBR2/VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrThree','ControllerSecond',presence="no") if retval != 0: print "VBR3/VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrFour','ControllerSecond',presence="no") if retval != 0: print "VBR4/VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerSecond', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) retval = vtn_vbr.delete_vtn('VtnTwo') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER1" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "DELETE CONTROLLER2" retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER delete failed" exit(1) print "MULTI CONTROLLER MULTI VBR VTN->VBR TEST SUCCESS"
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"
def test_vtn_vterm_multi_controller(): print "TEST 1 : 1 Tenants with 1 VTerminal each on different controllers" print "CONTROLLER1->VTNONE->VTERMONE" print "CONTROLLER2->VTNONE->VTERMTWO" print "CREATE ControllerFirst" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller Create Failed" exit(1) retval = controller.wait_until_state('ControllerFirst', "up") if retval != 0: print "Controller state check failed" exit(1) print "CREATE ControllerSecond" retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "Controller Create Failed" exit(1) retval = controller.wait_until_state('ControllerSecond', "up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne', 'VTermThree', 'ControllerSecond') if retval != 0: print "VTERM Create Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst', position=0) if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerSecond', position=0) if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERMOne Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermThree', 'ControllerSecond') if retval != 0: print "VTERMTwo Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne', 'VTermThree') if retval != 0: print "VTERM/VTN Delete Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermThree', 'ControllerSecond', presence="no") if retval != 0: print "VtnVTERMTwo Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VtnVTERM Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst') if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne', 'VTermOne') if retval != 0: print "VTERM/VTN Delete Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst', presence="no") if retval != 0: print "VTERM Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER1" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "DELETE CONTROLLER2" retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER delete failed" exit(1) print "MULTI CONTROLLER VTN->VTERM TEST SUCCESS"
def test_vbrif_flowfilter_pass(): print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller Create Failed" exit(1) print "TEST 3 : VBRIF->FLOWFILTER PASS 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', '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) 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=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->FLOWFILTER PASS TEST SUCCESS"
def test_multi_ctr_mininet_ping(): child = create_multicontroller_mininet_topology('MININETONE') if child.isalive() == True : print "Topology creation Success!!!" else: print "Topology creation Failed" mininet_test.mininet_test.close_topology(child) exit(1) retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 3 :Controller Create Failed" mininet_test.close_topology(child) exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "controller state change failed" exit(1) retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "TEST 3 :Controller Create Failed" mininet_test.close_topology(child) exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"up") if retval != 0: print "controller state change failed" exit(1) retval = create_boundary('BOUNDARY', 'ControllerFirst', 'ControllerSecond') if retval != 0: print "Boundary Create Failed" mininet_test.close_topology(child) exit(1) retval = validate_boundary('BOUNDARY', presence="yes", position=0) if retval != 0: print "Boundary Validate Failed after create" mininet_test.close_topology(child) exit(1) retval = vtn_vbr.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" mininet_test.close_topology(child) exit(1) retval = vtn_vbr.create_vbr('VtnOne', 'VbrOne', 'ControllerFirst') if retval != 0: print "VBR Create Failed" mininet_test.close_topology(child) exit(1) retval = vtn_vbr.create_vbr('VtnOne', 'VbrTwo', 'ControllerSecond') if retval != 0: print "VBRTWO Create Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrOne', 'MultiCtrVbrIfOne') if retval != 0: print "VBRIFONE Create Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrOne', 'MultiCtrVbrIfOne', 'ControllerFirst', position=0) if retval != 0: print "VBRIFONE Validate Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrOne', 'VbrIfTwo') if retval != 0: print "VBRIFONE Create Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrOne', 'VbrIfTwo', 'ControllerFirst', position=1) if retval != 0: print "VBRIFTWO Validate Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.create_portmap('VtnOne', 'VbrOne', 'MultiCtrVbrIfOne', vlan_tagged=0); if retval != 0: print "VBRIF1 Portmap Create Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne', 'VbrOne', 'MultiCtrVbrIfOne', 'ControllerFirst', presence="yes"); if retval != 0: print "VBRIF1 Portmap Validate Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrTwo', 'MultiCtrVbrIfThree') if retval != 0: print "VBRIFTHREE Create Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrTwo', 'MultiCtrVbrIfThree', 'ControllerSecond', position=0) if retval != 0: print "VBRIFTHREE Validate Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrTwo', 'VbrIfFour') if retval != 0: print "VBRIFFOUR Create Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrTwo', 'VbrIfFour', 'ControllerSecond', position=0) if retval != 0: print "VBRIFFOUR Validate Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.create_portmap('VtnOne', 'VbrTwo', 'MultiCtrVbrIfThree', vlan_tagged=0); if retval != 0: print "VBRIF3 Portmap Create Failed" mininet_test.close_topology(child) exit(1) retval = vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne', 'VbrTwo', 'MultiCtrVbrIfThree', 'ControllerSecond', presence="yes"); if retval != 0: print "VBRIF3 Portmap Validate Failed" mininet_test.close_topology(child) exit(1) retval = create_vlink('VLINK', 'BOUNDARY', 'VtnOne') if retval != 0: print "Vlink create Failed" mininet_test.close_topology(child) exit(1) retval = validate_vlink('VLINK', 'VtnOne', presence="yes", position=0) if retval != 0: print "Vlink validate Failed" mininet_test.close_topology(child) exit(1) retval = mininet_test.ping_mininet (child,'h2','h6') if retval != 0: print "MININET PING FAILED" mininet_test.close_topology(child) retval = delete_vlink('VLINK', 'VtnOne') if retval != 0: print "Vlink Delete Failed" exit(1) retval = validate_vlink('VLINK', 'VtnOne', presence="no") if retval != 0: print "After Delete validate vlink Failed" exit(1) retval = delete_boundary('BOUNDARY') if retval != 0: print "Delete boundary Failed" exit(1) retval = validate_boundary('BOUNDARY', presence="no") if retval != 0: print "After Delete validate boundary Failed" exit(1) retval = vbrif_portmap.delete_portmap('VtnOne', 'VbrTwo', 'MultiCtrVbrIfThree') if retval != 0: print "VBRIF3 portmap Delete Failed" exit(1) retval = vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne', 'VbrTwo', 'MultiCtrVbrIfThree', 'ControllerSecond', presence="no"); if retval != 0: print "After Delete VBRIF3 Portmap Validate Failed" exit(1) retval = vbrif_portmap.delete_portmap('VtnOne', 'VbrOne', 'MultiCtrVbrIfOne') if retval != 0: print "VBRIF1 portmap Delete Failed" exit(1) retval = vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne', 'VbrOne', 'MultiCtrVbrIfOne', 'ControllerFirst', presence="no"); if retval != 0: print "After Delete VBRIF1 Portmap Validate Failed" exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne', 'VbrOne', 'MultiCtrVbrIfOne') if retval != 0: print "VTN1->VBR1->VBRIF1 Delete Failed" exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrOne', 'MultiCtrVbrIfOne', 'ControllerFirst', presence="no") if retval != 0: print "After Delete VBRIFONE Validate Failed" exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne', 'VbrOne', 'VbrIfTwo') if retval != 0: print "VTN1->VBR1->VBRIF2 Delete Failed" exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrOne', 'VbrIfTwo', 'ControllerFirst', presence="no") if retval != 0: print "After Delete VBRIFTWO Validate Failed" exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne', 'VbrTwo', 'MultiCtrVbrIfThree') if retval != 0: print "VTN1->VBR2->VBRIF3 Delete Failed" exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrTwo', 'MultiCtrVbrIfThree', 'ControllerSecond', presence="no") if retval != 0: print "After Delete VBRIFTHREE Validate Failed" exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne', 'VbrTwo', 'VbrIfFour') if retval != 0: print "VTN1->VBR2->VBRIF4 Delete Failed" exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrTwo', 'VbrIfFour', 'ControllerSecond', presence="no") if retval != 0: print "After Delete VBRIFFOUR Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne', 'VbrOne') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne', 'VbrOne', 'ControllerFirst', presence="no") if retval != 0: print "After Delete VBR1 Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne', 'VbrTwo') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne', 'VbrTwo', 'ControllerSecond', presence="no") if retval != 0: print "After Delete VBR2 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne', 'ControllerFirst', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne', 'ControllerSecond', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER1 delete failed" exit(1) retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "MININET PING MULTI CONTROLLER TEST SUCCESS"
def test_audit_vtn_vterm_vtermif_portmap_multi_controller(): print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 4 :Controller1 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst', "up") if retval != 0: print "Controller state check failed" exit(1) retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "TEST 4 :Controller2 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond', "up") if retval != 0: print "Controller state check failed" exit(1) print "TEST 4 : VTenant with one VTerminal one VTERMIF and One PORTMAP with multi-controller" retval = vtn_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM1 Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne', 'VTermThree', 'ControllerSecond') if retval != 0: print "VTERM3 Create Failed" exit(1) retval = vtermif_portmap.create_vtermif('VtnOne', 'VTermOne', 'VTermIfOne') if retval != 0: print "VTERMIF1 Create Failed" exit(1) retval = vtermif_portmap.create_vtermif('VtnOne', 'VTermThree', 'VTermIfTwo') if retval != 0: print "VTERMIF2 Create Failed" exit(1) retval = vtermif_portmap.validate_vtermif_at_controller( 'VtnOne', 'VTermOne', 'VTermIfOne', 'ControllerFirst') if retval != 0: print "After Create VTERMIF1 Validate Failed" exit(1) retval = vtermif_portmap.validate_vtermif_at_controller( 'VtnOne', 'VTermThree', 'VTermIfTwo', 'ControllerSecond') if retval != 0: print "After Create VTERMIF2 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 "controller1 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst', "down") if retval != 0: print "Controller state check failed" exit(1) test_invalid_ipaddr = vtn_testconfig.ReadValues( CONTROLLERDATA, 'ControllerSecond')['invalid_ipaddr'] retval = controller.update_controller_ex('ControllerSecond', ipaddr=test_invalid_ipaddr) if retval != 0: print "controller2 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond', "down") if retval != 0: print "Controller state check failed" exit(1) retval = vtermif_portmap.create_portmap('VtnOne', 'VTermOne', 'VTermIfOne') if retval != 0: print "Portmap1 Create Failed" exit(1) retval = vtermif_portmap.create_portmap('VtnOne', 'VTermThree', 'VTermIfTwo') if retval != 0: print "Portmap2 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 "controller1 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst', "up") if retval != 0: print "Controller state check failed" exit(1) test_controller_ipaddr = vtn_testconfig.ReadValues( CONTROLLERDATA, 'ControllerSecond')['ipaddr'] retval = controller.update_controller_ex('ControllerSecond', ipaddr=test_controller_ipaddr) if retval != 0: print "controller2 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond', "up") if retval != 0: print "Controller state check failed" exit(1) retval = vtermif_portmap.validate_vtermif_portmap_at_controller( 'VtnOne', 'VTermOne', 'VTermIfOne', 'ControllerFirst', presence="yes") if retval != 0: print "Portmap1 Validate Failed" exit(1) retval = vtermif_portmap.validate_vtermif_portmap_at_controller( 'VtnOne', 'VTermThree', 'VTermIfTwo', 'ControllerSecond', presence="yes") if retval != 0: print "Portmap2 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "After Create VTERM1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermThree', 'ControllerSecond') if retval != 0: print "After Create VTERM3 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst') if retval != 0: print "VTN Validate Failed at controller1" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerSecond') if retval != 0: print "VTN Validate Failed at controller2" exit(1) retval = vtermif_portmap.delete_portmap('VtnOne', 'VTermOne', 'VTermIfOne') if retval != 0: print "Portmap1 Delete Failed" exit(1) retval = vtermif_portmap.delete_portmap('VtnOne', 'VTermThree', 'VTermIfTwo') if retval != 0: print "Portmap2 Delete Failed" exit(1) # retval=vtermif_portmap.validate_vtermif_portmap_at_controller('VtnOne','VTermOne','VTermIfOne','ControllerFirst',presence="no"); # if retval != 0: # print "After Delete Portmap1 Validate Failed" # exit(1) # retval=vtermif_portmap.validate_vtermif_portmap_at_controller('VtnOne','VTermThree','VTermIfTwo','ControllerSecond',presence="no"); # if retval != 0: # print "After Delete Portmap2 Validate Failed" # exit(1) retval = vtermif_portmap.delete_vtermif('VtnOne', 'VTermOne', 'VTermIfOne') if retval != 0: print "VTERMIF1 Delete Failed" exit(1) retval = vtermif_portmap.delete_vtermif('VtnOne', 'VTermThree', 'VTermIfTwo') if retval != 0: print "VTERMIF2 Delete Failed" exit(1) retval = vtermif_portmap.validate_vtermif_at_controller('VtnOne', 'VTermOne', 'VTermIfOne', 'ControllerFirst', presence="no", position=0) if retval != 0: print "After Delete VTERMIF1 Validate Failed" exit(1) retval = vtermif_portmap.validate_vtermif_at_controller('VtnOne', 'VTermThree', 'VTermIfTwo', 'ControllerSecond', presence="no", position=0) if retval != 0: print "After Delete VTERMIF2 Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne', 'VTermOne') if retval != 0: print "VTERM1/VTN Delete Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne', 'VTermThree') if retval != 0: print "VTERM3/VTN Delete Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst', presence="no") if retval != 0: print "After Delete VTERM1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermThree', 'ControllerSecond', presence="no") if retval != 0: print "After Delete VTERM2 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst', presence="no") if retval != 0: print "VTN Validate Failed after VTERM1 Deleted at controller1" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerSecond', presence="no") if retval != 0: print "VTN Validate Failed after VTERM3 Deleted at controller2" exit(1) retval = vtn_vterm.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER1 delete failed" exit(1) retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "VTN->VTERM->VTERMIF->PORTMAP MULTI-CONTROLER TEST SUCCESS"
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"
def test_multi_vtn_with_vbr_multi_controller_audit_test(): print "TEST 3 : 2 Tenants with one VBridge each in multi-controller and test AUDIT" print "CONTROLLER1->VTNONE->VBRONE" print "CONTROLLER1->VTNTWO->VBRONE" print "CONTROLLER2->VTNTHREE->VBRONE" print "CONTROLLER2->VTNFOUR->VBRONE" print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller1 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "Controller2 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vbr.create_vtn('VtnOne') if retval != 0: print "VTN1 Create Failed" exit(1) retval = vtn_vbr.create_vtn('VtnTwo') if retval != 0: print "VTN2 Create Failed" exit(1) retval = vtn_vbr.create_vtn('VtnThree') if retval != 0: print "VTN3 Create Failed" exit(1) retval = vtn_vbr.create_vtn('VtnFour') if retval != 0: print "VTN4 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBR1/VTN1 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnTwo','VbrOne','ControllerFirst') if retval != 0: print "VBR1/VTN2 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnThree','VbrThree','ControllerSecond') if retval != 0: print "VBR3/VTN3 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnFour','VbrThree','ControllerSecond') if retval != 0: print "VBR3/VTN4 Create Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',position=0) if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerFirst',position=0) if retval != 0: print "VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnThree','ControllerSecond',position=0) if retval != 0: print "VTN3 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnFour','ControllerSecond',position=0) if retval != 0: print "VTN4 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBR1/VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrOne','ControllerFirst') if retval != 0: print "VBR1/VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnThree','VbrThree','ControllerSecond') if retval != 0: print "VBR3/VTN3 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnFour','VbrThree','ControllerSecond') if retval != 0: print "VBR4/VTN4 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 "controller1 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"down") if retval != 0: print "Controller state check failed" exit(1) test_invalid_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerSecond')['invalid_ipaddr'] retval = controller.update_controller_ex('ControllerSecond',ipaddr=test_invalid_ipaddr) if retval != 0: print "controller2 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"down") if retval != 0: print "Controller state check failed" exit(1) print "****DELETE VBR****" retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR1/VTN1 Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnTwo','VbrOne') if retval != 0: print "VBR1/VTN2 Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnThree','VbrThree') if retval != 0: print "VBR3/VTN3 Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnFour','VbrThree') if retval != 0: print "VBR3/VTN4 Delete 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 "controller1 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) test_controller_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerSecond')['ipaddr'] retval = controller.update_controller_ex('ControllerSecond',ipaddr=test_controller_ipaddr) if retval != 0: print "controller2 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "VBR1/VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrOne','ControllerFirst',presence="no") if retval != 0: print "VBR1/VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerFirst',presence="no") if retval != 0: print "VTN2 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnThree','VbrThree','ControllerSecond',presence="no") if retval != 0: print "VBR3/VTN3 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnThree','ControllerSecond',presence="no") if retval != 0: print "VTN3 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnFour','VbrThree','ControllerSecond',presence="no") if retval != 0: print "VBR3/VTN4 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnFour','ControllerSecond',presence="no") if retval != 0: print "VTN4 Validate Failed" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN1 Delete Failed in coordinator" exit(1) retval = vtn_vbr.delete_vtn('VtnTwo') if retval != 0: print "VTN2 Delete Failed in coordinator" exit(1) retval = vtn_vbr.delete_vtn('VtnThree') if retval != 0: print "VTN3 Delete Failed in coordinator" exit(1) retval = vtn_vbr.delete_vtn('VtnFour') if retval != 0: print "VTN4 Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER1 delete failed" exit(1) retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "MULTI VTN->VBR MULTI_CONTROLLER AUDIT TEST SUCCESS"
def test_vtn_vbr_audit_multi_controller_2(): print """TEST 2 : create VTN and VBR when controller is down change the controller status to up trigger Audit""" print "****CREATE Controller with valid IP****" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller1 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "Controller2 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"up") if retval != 0: print "Controller state check 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 "controller1 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"down") if retval != 0: print "Controller state check failed" exit(1) test_invalid_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerSecond')['invalid_ipaddr'] retval = controller.update_controller_ex('ControllerSecond',ipaddr=test_invalid_ipaddr) if retval != 0: print "controller2 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"down") if retval != 0: print "Controller state check 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 "VBR1 Create Failed" exit(1) retval = vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "VBR3 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 "controller1 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) test_controller_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerSecond')['ipaddr'] retval = controller.update_controller_ex('ControllerSecond',ipaddr=test_controller_ipaddr) if retval != 0: print "controller2 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN Validate Failed at controller1" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerSecond') if retval != 0: print "VTN Validate Failed at controller2" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBR1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "VBR3 Validate Failed" exit(1) print "****Delete VBR****" retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR1/VTN Delete Failed" exit(1) iretval = vtn_vbr.delete_vbr('VtnOne','VbrThree') if retval != 0: print "VBR3/VTN Delete Failed" exit(1) print "****Delete VTN****" retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "VBR1 Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond',presence="no") if retval != 0: print "VBR3 Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed at controller1" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerSecond',presence="no") if retval != 0: print "VTN Validate Failed at controller2" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER1 delete failed" exit(1) retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "VTN->VBR Multi-controller AUDIT TEST SUCCESS"
def test_multi_vtn_with_vterm_multi_controller(): print "TEST 3 : 2 Tenants with one VTerminal each" print "CONTROLLER1->VTNONE->VTERMONE" print "CONTROLLER1->VTNTWO->VTERMONE" print "CONTROLLER2->VTNONE->VTERMONE" print "CONTROLLER2->VTNTWO->VTERMONE" print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller1 Create Failed" exit(1) retval = controller.wait_until_state('ControllerFirst', "up") if retval != 0: print "Controller state check failed" exit(1) retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "Controller2 Create Failed" exit(1) retval = controller.wait_until_state('ControllerSecond', "up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vtn('VtnTwo') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM1 Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnTwo', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM2 Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne', 'VTermThree', 'ControllerSecond') if retval != 0: print "VTERM3 Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnTwo', 'VTermThree', 'ControllerSecond') if retval != 0: print "VTERM4 Create Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst', position=0) if retval != 0: print "VTN1/CONTROLLER1 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnTwo', 'ControllerFirst', position=0) if retval != 0: print "VTN2/CONTROLLER2 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerSecond', position=0) if retval != 0: print "VTN1/CONTROLLER2 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnTwo', 'ControllerSecond', position=0) if retval != 0: print "VTN2/CONTROLLER2 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM1/VTN1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM1/VTN2 Validate Failed " exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermThree', 'ControllerSecond') if retval != 0: print "VTERM2/VTN1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo', 'VTermThree', 'ControllerSecond') if retval != 0: print "VTERM2/VTN2 Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne', 'VTermOne') if retval != 0: print "VTERM/VTN Delete Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst', presence="no") if retval != 0: print "VTERM Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst', presence="no") if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnTwo', 'VTermOne') if retval != 0: print "VTERM/VTN Delete Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo', 'VTermOne', 'ControllerFirst', presence="no") if retval != 0: print "VTERM2 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnTwo', 'ControllerFirst', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne', 'VTermThree') if retval != 0: print "VTERM2/VTN1 Delete Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermThree', 'ControllerSecond', presence="no") if retval != 0: print "VTERM2/VTN1 Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnTwo', 'VTermThree') if retval != 0: print "VTERM2/VTN2 Delete Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo', 'VTermThree', 'ControllerSecond', presence="no") if retval != 0: print "VTERM2/VTN2 Validate Failed" exit(1) retval = vtn_vterm.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) retval = vtn_vterm.delete_vtn('VtnTwo') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER1 delete failed" exit(1) retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "MULTI VTN->VTERM MULTI-CONTROLLER TEST SUCCESS"
def test_vtn_vterm_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 VTERM when controller is up change the controller status to down delete VTN and VTERM 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_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) print "****Create VTERM****" retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst') if retval != 0: print "VTERM 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) print "****Delete VTERM****" retval = vtn_vterm.delete_vterm('VtnOne','VTermOne') if retval != 0: print "VTERM/VTN Delete Failed" exit(1) print "****Delete VTN****" retval = vtn_vterm.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 = vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst',presence="no") if retval != 0: print "VTERM Validate Failed" exit(1) retval = vtn_vterm.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->VTERM AUDIT TEST SUCCESS"
def test_vtn_vbr_vlanmap_multi_controller(): print "TEST 1 : VTenant with one VBridge one VLANMAP without vlan_id and logicalport_id with multi-controller" print "CREATE Controller1" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 1 :Controller Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) print "CREATE Controller2" retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "TEST 1 :Controller Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"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=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "VBR Create Failed" exit(1) retval=vtn_vbr_vlanmap.create_vlanmap('VtnOne','VbrOne','VlanmapOne',no_vlan=0) if retval != 0: print "VLANMAP Create Failed" exit(1) retval=vtn_vbr_vlanmap.create_vlanmap('VtnOne','VbrThree','VlanmapTwo',no_vlan=0) if retval != 0: print "VLANMAP Create Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrOne','VlanmapOne','ControllerFirst',no_vlan_id=0) if retval != 0: print "After Create VLANMAP Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrThree','VlanmapTwo','ControllerSecond',no_vlan_id=0) if retval != 0: print "After Create VLANMAP Validate Failed" exit(1) retval=vtn_vbr_vlanmap.update_vlanmap('VtnOne','VbrOne','VlanmapOne',update_id=0) if retval != 0: print "VLANMAP update Failed" exit(1) retval=vtn_vbr_vlanmap.update_vlanmap('VtnOne','VbrThree','VlanmapTwo',update_id=0) if retval != 0: print "VLANMAP update Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_update('VtnOne','VbrOne','VlanmapOne','ControllerFirst',no_vlan_id=0) if retval != 0: print "After update VLANMAP Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_update('VtnOne','VbrThree','VlanmapTwo','ControllerSecond',no_vlan_id=0) if retval != 0: print "After update VLANMAP Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "After Create VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "After Create VBR Validate 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_vtn_at_controller('VtnOne','ControllerSecond') if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr_vlanmap.delete_vlanmap('VtnOne','VbrOne','VlanmapOne',no_vlan=0) if retval != 0: print "VLANMAP Delete Failed" exit(1) retval = vtn_vbr_vlanmap.delete_vlanmap('VtnOne','VbrThree','VlanmapTwo',no_vlan=0) if retval != 0: print "VLANMAP Delete Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrOne','VlanmapOne','ControllerFirst',presence="no",position=0,no_vlan_id=0) if retval != 0: print "After Delete VLANMAP Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrOne','VlanmapTwo','ControllerSecond',presence="no",position=0,no_vlan_id=0) if retval != 0: print "After Delete VLANMAP Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrThree') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "After Delete VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond',presence="no") if retval != 0: print "After Delete VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed after VBR Deleted" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerSecond',presence="no") if retval != 0: print "VTN Validate Failed after VBR Deleted" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER1" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "DELETE CONTROLLER2" retval=controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER delete failed" exit(1) print "VTN->VBR->VLANMAP no vlan_id with multi-controller 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"
def test_vtn_vbr_multi_vlanmap_multi_controller(): print "TEST 3 : VTenant with one VBridge two VLANMAP with multi-controller" print "CREATE Controller1" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 3 :Controller1 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) print "CREATE Controller2" retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "TEST 3 :Controller2 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"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 "VBROne Create Failed" exit(1) retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "VBRTwo Create Failed" exit(1) retval=vtn_vbr_vlanmap.create_vlanmap('VtnOne','VbrOne','VlanmapOne',no_vlan=0) if retval != 0: print "VLANMAP1 Create Failed" exit(1) retval=vtn_vbr_vlanmap.create_vlanmap('VtnOne','VbrThree','VlanmapThree',no_vlan=0) if retval != 0: print "VLANMAP3 Create Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrOne','VlanmapOne','ControllerFirst',position=0,no_vlan_id=0) if retval != 0: print "After Create VLANMAP1 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrThree','VlanmapThree','ControllerSecond',position=0,no_vlan_id=0) if retval != 0: print "After Create VLANMAP3 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.update_vlanmap('VtnOne','VbrOne','VlanmapOne',update_id=0) if retval != 0: print "VLANMAP1 update Failed" exit(1) retval=vtn_vbr_vlanmap.update_vlanmap('VtnOne','VbrThree','VlanmapThree',update_id=0) if retval != 0: print "VLANMAP3 update Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_update('VtnOne','VbrOne','VlanmapOne','ControllerFirst',position=0,no_vlan_id=0) if retval != 0: print "After update VLANMAP Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_update('VtnOne','VbrThree','VlanmapThree','ControllerSecond',position=0,no_vlan_id=0) if retval != 0: print "After update VLANMAP Validate Failed" exit(1) retval=vtn_vbr_vlanmap.create_vlanmap('VtnOne','VbrOne','VlanmapTwo',no_vlan=1) if retval != 0: print "VLANMAP2 Create Failed" exit(1) retval=vtn_vbr_vlanmap.create_vlanmap('VtnOne','VbrThree','VlanmapFour',no_vlan=1) if retval != 0: print "VLANMAP2 Create Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrOne','VlanmapTwo','ControllerFirst',position=1,no_vlan_id=1) if retval != 0: print "After Create VLANMAP2 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrThree','VlanmapFour','ControllerSecond',position=1,no_vlan_id=1) if retval != 0: print "After Create VLANMAP2 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.update_vlanmap('VtnOne','VbrOne','VlanmapTwo',update_id=1) if retval != 0: print "VLANMAP2 upadte Failed" exit(1) retval=vtn_vbr_vlanmap.update_vlanmap('VtnOne','VbrThree','VlanmapFour',update_id=1) if retval != 0: print "VLANMAP2 upadte Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_update('VtnOne','VbrOne','VlanmapTwo','ControllerFirst',position=1,no_vlan_id=1) if retval != 0: print "After update VLANMAP2 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_update('VtnOne','VbrThree','VlanmapFour','ControllerSecond',position=1,no_vlan_id=1) if retval != 0: print "After update VLANMAP2 Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "After Create VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "After Create VBR Validate 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_vtn_at_controller('VtnOne','ControllerSecond') if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr_vlanmap.delete_vlanmap('VtnOne','VbrOne','VlanmapOne',no_vlan=0) if retval != 0: print "VLANMAP1 Delete Failed" exit(1) retval = vtn_vbr_vlanmap.delete_vlanmap('VtnOne','VbrOne','VlanmapTwo',no_vlan=1) if retval != 0: print "VLANMAP2 Delete Failed" exit(1) retval = vtn_vbr_vlanmap.delete_vlanmap('VtnOne','VbrThree','VlanmapThree',no_vlan=0) if retval != 0: print "VLANMAP3 Delete Failed" exit(1) retval = vtn_vbr_vlanmap.delete_vlanmap('VtnOne','VbrThree','VlanmapFour',no_vlan=1) if retval != 0: print "VLANMAP4 Delete Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrOne','VlanmapOne','ControllerFirst',presence="no",position=0,no_vlan_id=0) if retval != 0: print "After Delete VLANMAP1 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrOne','VlanmapTwo','ControllerFirst',presence="no",position=1,no_vlan_id=1) if retval != 0: print "After Delete VLANMAP2 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrThree','VlanmapThree','ControllerSecond',presence="no",position=0,no_vlan_id=0) if retval != 0: print "After Delete VLANMAP3 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrThree','VlanmapFour','ControllerSecond',presence="no",position=1,no_vlan_id=1) if retval != 0: print "After Delete VLANMAP4 Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrThree') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "After Delete VBROne Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond',presence="no") if retval != 0: print "After Delete VBRTwo Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed after VBR Deleted" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerSecond',presence="no") if retval != 0: print "VTN Validate Failed after VBR Deleted" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER1" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER1 delete failed" exit(1) print "DELETE CONTROLLER2" retval=controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "VTN->VBR->TWO VLANMAP with multi_controller TEST SUCCESS"
def test_audit_vtn_vterm_vtermif_portmap(): print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 4 :Controller Create Failed" exit(1) print "TEST 4 : Test Audit with VTenant one VTerminal one VTERMIF and One PORTMAP" # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "controller state change failed" exit(1) retval=vtn_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) retval=vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst') if retval != 0: print "VTERM 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=vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne') if retval != 0: print "VTERMIF Create Failed" exit(1) retval=vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne'); if retval != 0: print "Portmap 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=vtermif_portmap.validate_vtermif_portmap_at_controller('VtnOne','VTermOne','VTermIfOne','ControllerFirst',presence="yes"); if retval != 0: print "Portmap Validate Failed" exit(1) retval=vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst') if retval != 0: print "After Create VTERM Validate Failed" exit(1) retval=vtn_vterm.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN Validate Failed" exit(1) retval=vtermif_portmap.delete_portmap('VtnOne','VTermOne','VTermIfOne'); if retval != 0: print "Portmap Delete Failed" exit(1) retval = vtermif_portmap.delete_vtermif('VtnOne','VTermOne','VTermIfOne') if retval != 0: print "VTERMIF Delete Failed" exit(1) retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermOne','VTermIfOne','ControllerFirst',presence="no",position=0) if retval != 0: print "After Delete VTERMIF Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne','VTermOne') if retval != 0: print "VTERM/VTN Delete Failed" exit(1) retval=vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst',presence="no") if retval != 0: print "After Delete VTERM Validate Failed" exit(1) retval=vtn_vterm.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed after VTERM Deleted" exit(1) retval = vtn_vterm.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "VTN->VTERM->VTERMIF->PORTMAP AUDIT TEST SUCCESS"
def test_vtn_vbr_vlanmap_no_vlanid_multi_controller(): print "TEST 6 : VTenant with one VBridge one VLANMAP with vlan_id and logicalport_id" print "then update vlan_id to no_vlan_id with multi-controller" print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 6 :Controller1 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "TEST 6 :Controller2 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerSecond',"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 "VBR1 Create Failed" exit(1) retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "VBR3 Create Failed" exit(1) retval=vtn_vbr_vlanmap.create_vlanmap('VtnOne','VbrOne','VlanmapOne',no_vlan=1) if retval != 0: print "VLANMAP1 Create Failed" exit(1) retval=vtn_vbr_vlanmap.create_vlanmap('VtnOne','VbrThree','VlanmapTwo',no_vlan=1) if retval != 0: print "VLANMAP2 Create Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrOne','VlanmapOne','ControllerFirst',no_vlan_id=1) if retval != 0: print "After Create VLANMAP1 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrThree','VlanmapTwo','ControllerSecond',no_vlan_id=1) if retval != 0: print "After Create VLANMAP2 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.update_vlanmap('VtnOne','VbrOne','VlanmapOne',update_id=2) if retval != 0: print "VLANMAP1 upadte Failed" exit(1) retval=vtn_vbr_vlanmap.update_vlanmap('VtnOne','VbrThree','VlanmapTwo',update_id=2) if retval != 0: print "VLANMAP2 upadte Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_update('VtnOne','VbrOne','VlanmapOne','ControllerFirst',no_vlan_id=1) if retval != 0: print "After update VLANMAP Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_update('VtnOne','VbrThree','VlanmapTwo','ControllerSecond',no_vlan_id=1) if retval != 0: print "After update VLANMAP Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "After Create VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "After Create VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN Validate Failed at controller1" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerSecond') if retval != 0: print "VTN Validate Failed at controller2" exit(1) retval = vtn_vbr_vlanmap.delete_vlanmap('VtnOne','VbrOne','VlanmapOne',no_vlan=1) if retval != 0: print "VLANMAP1 Delete Failed" exit(1) retval = vtn_vbr_vlanmap.delete_vlanmap('VtnOne','VbrThree','VlanmapTwo',no_vlan=1) if retval != 0: print "VLANMAP3 Delete Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrOne','VlanmapOne','ControllerFirst',presence="no",position=0,no_vlan_id=1) if retval != 0: print "After Delete VLANMAP1 Validate Failed" exit(1) retval=vtn_vbr_vlanmap.validate_vlanmap_at_controller('VtnOne','VbrThree','VlanmapTwo','ControllerSecond',presence="no",position=0,no_vlan_id=1) if retval != 0: print "After Delete VLANMAP3 Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR1/VTN Delete Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrThree') if retval != 0: print "VBR3/VTN Delete Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "After Delete VBR1 Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond',presence="no") if retval != 0: print "After Delete VBR3 Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed after VBR Deleted at controller1" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerSecond',presence="no") if retval != 0: print "VTN Validate Failed after VBR Deleted at controller2" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER1 delete failed" exit(1) retval=controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "VTN->VBR->VLANMAP with vlan_id->no_vlan_id with multi-controller TEST SUCCESS"
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"
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"
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"
def test_vtn_vterm_audit_multi_controller_2(): print """TEST 2 : create VTN and VTERM when controller is down change the controller status to up trigger Audit""" print "****CREATE Controller with valid IP****" retval = controller.add_controller_ex("ControllerFirst") if retval != 0: print "Controller1 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerFirst", "up") if retval != 0: print "Controller state check failed" exit(1) retval = controller.add_controller_ex("ControllerSecond") if retval != 0: print "Controller2 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerSecond", "up") if retval != 0: print "Controller state check 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 "controller1 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerFirst", "down") if retval != 0: print "Controller state check failed" exit(1) test_invalid_ipaddr = vtn_testconfig.ReadValues(CONTROLLERDATA, "ControllerSecond")["invalid_ipaddr"] retval = controller.update_controller_ex("ControllerSecond", ipaddr=test_invalid_ipaddr) if retval != 0: print "controller2 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerSecond", "down") if retval != 0: print "Controller state check failed" exit(1) print "****Create VTN****" retval = vtn_vterm.create_vtn("VtnOne") if retval != 0: print "VTN Create Failed" exit(1) print "****Create VTERM****" retval = vtn_vterm.create_vterm("VtnOne", "VTermOne", "ControllerFirst") if retval != 0: print "VTERM1 Create Failed" exit(1) retval = vtn_vterm.create_vterm("VtnOne", "VTermThree", "ControllerSecond") if retval != 0: print "VTERM3 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 "controller1 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerFirst", "up") if retval != 0: print "Controller state check failed" exit(1) test_controller_ipaddr = vtn_testconfig.ReadValues(CONTROLLERDATA, "ControllerSecond")["ipaddr"] retval = controller.update_controller_ex("ControllerSecond", ipaddr=test_controller_ipaddr) if retval != 0: print "controller2 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerSecond", "up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnOne", "ControllerFirst") if retval != 0: print "VTN Validate Failed at controller1" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnOne", "ControllerSecond") if retval != 0: print "VTN Validate Failed at controller2" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnOne", "VTermOne", "ControllerFirst") if retval != 0: print "VTERM1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnOne", "VTermThree", "ControllerSecond") if retval != 0: print "VTERM3 Validate Failed" exit(1) print "****Delete VTERM****" retval = vtn_vterm.delete_vterm("VtnOne", "VTermOne") if retval != 0: print "VTERM1/VTN Delete Failed" exit(1) iretval = vtn_vterm.delete_vterm("VtnOne", "VTermThree") if retval != 0: print "VTERM3/VTN Delete Failed" exit(1) print "****Delete VTN****" retval = vtn_vterm.delete_vtn("VtnOne") if retval != 0: print "VTN Delete Failed in coordinator" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnOne", "VTermOne", "ControllerFirst", presence="no") if retval != 0: print "VTERM1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnOne", "VTermThree", "ControllerSecond", presence="no") if retval != 0: print "VTERM3 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnOne", "ControllerFirst", presence="no") if retval != 0: print "VTN Validate Failed at controller1" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnOne", "ControllerSecond", presence="no") if retval != 0: print "VTN Validate Failed at controller2" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex("ControllerFirst") if retval != 0: print "CONTROLLER1 delete failed" exit(1) retval = controller.delete_controller_ex("ControllerSecond") if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "VTN->VTERM Multi-controller AUDIT TEST SUCCESS"
def test_vtn_multi_vterm_multi_controller(): print "TEST 2 : 1 Tenants with 2 VTerminal each on different controllers" print "CONTROLLER1->VTNONE->VTERMONE->VTERMTWO" print "CONTROLLER2->VTNTWO->VTERMTHREE->VTERMFOUR" print "CREATE ControllerFirst" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller1 Create Failed" exit(1) retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) print "CREATE ControllerSecond" retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "Controller2 Create Failed" exit(1) retval = controller.wait_until_state('ControllerSecond',"up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vtn('VtnTwo') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst') if retval != 0: print "VTERM1 Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne','VTermTwo','ControllerFirst') if retval != 0: print "VTERM2 Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnTwo','VTermThree','ControllerSecond') if retval != 0: print "VTERM3 Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnTwo','VTermFour','ControllerSecond') if retval != 0: print "VTERM4 Create Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnTwo','ControllerSecond') if retval != 0: print "VTN2 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst') if retval != 0: print "VTERM1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne','VTermTwo','ControllerFirst',position=0) if retval != 0: print "VTERM2 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo','VTermThree','ControllerSecond',position=0) if retval != 0: print "VTERM3 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo','VTermFour','ControllerSecond') if retval != 0: print "VTERM4 Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne','VTermOne') if retval != 0: print "VTERM1/VTN1 Delete Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne','VTermTwo') if retval != 0: print "VTERM2/VTN1 Delete Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnTwo','VTermThree') if retval != 0: print "VTERM3/VTN2 Delete Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnTwo','VTermFour') if retval != 0: print "VTERM4/VTN2 Delete Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst',presence="no") if retval != 0: print "VTERM1/VTERM1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne','VTermTwo','ControllerFirst',presence="no") if retval != 0: print "VTERM2/VTN1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo','VTermThree','ControllerSecond',presence="no") if retval != 0: print "VTERM3/VTN2 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo','VTermFour','ControllerSecond',presence="no") if retval != 0: print "VTERM4/VTN2 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne','ControllerFirst', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval=vtn_vterm.validate_vtn_at_controller('VtnTwo','ControllerSecond', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) retval = vtn_vterm.delete_vtn('VtnTwo') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER1" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "DELETE CONTROLLER2" retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER delete failed" exit(1) print "MULTI CONTROLLER MULTI VTERM VTN->VTERM TEST SUCCESS"
def test_multi_vtn_with_vterm_multi_controller_audit_test(): print "TEST 3 : 2 Tenants with one VTerminal each in multi-controller and test AUDIT" print "CONTROLLER1->VTNONE->VTERMONE" print "CONTROLLER1->VTNTWO->VTERMONE" print "CONTROLLER2->VTNTHREE->VTERMONE" print "CONTROLLER2->VTNFOUR->VTERMONE" print "CREATE Controller" retval = controller.add_controller_ex("ControllerFirst") if retval != 0: print "Controller1 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerFirst", "up") if retval != 0: print "Controller state check failed" exit(1) retval = controller.add_controller_ex("ControllerSecond") if retval != 0: print "Controller2 Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerSecond", "up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vterm.create_vtn("VtnOne") if retval != 0: print "VTN1 Create Failed" exit(1) retval = vtn_vterm.create_vtn("VtnTwo") if retval != 0: print "VTN2 Create Failed" exit(1) retval = vtn_vterm.create_vtn("VtnThree") if retval != 0: print "VTN3 Create Failed" exit(1) retval = vtn_vterm.create_vtn("VtnFour") if retval != 0: print "VTN4 Create Failed" exit(1) retval = vtn_vterm.create_vterm("VtnOne", "VTermOne", "ControllerFirst") if retval != 0: print "VTERM1/VTN1 Create Failed" exit(1) retval = vtn_vterm.create_vterm("VtnTwo", "VTermOne", "ControllerFirst") if retval != 0: print "VTERM1/VTN2 Create Failed" exit(1) retval = vtn_vterm.create_vterm("VtnThree", "VTermThree", "ControllerSecond") if retval != 0: print "VTERM3/VTN3 Create Failed" exit(1) retval = vtn_vterm.create_vterm("VtnFour", "VTermThree", "ControllerSecond") if retval != 0: print "VTERM3/VTN4 Create Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnOne", "ControllerFirst", position=0) if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnTwo", "ControllerFirst", position=1) if retval != 0: print "VTN2 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnThree", "ControllerSecond", position=1) if retval != 0: print "VTN3 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnFour", "ControllerSecond", position=0) if retval != 0: print "VTN4 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnOne", "VTermOne", "ControllerFirst") if retval != 0: print "VTERM1/VTN1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnTwo", "VTermOne", "ControllerFirst") if retval != 0: print "VTERM1/VTN2 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnThree", "VTermThree", "ControllerSecond") if retval != 0: print "VTERM3/VTN3 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnFour", "VTermThree", "ControllerSecond") if retval != 0: print "VTERM4/VTN4 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 "controller1 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerFirst", "down") if retval != 0: print "Controller state check failed" exit(1) test_invalid_ipaddr = vtn_testconfig.ReadValues(CONTROLLERDATA, "ControllerSecond")["invalid_ipaddr"] retval = controller.update_controller_ex("ControllerSecond", ipaddr=test_invalid_ipaddr) if retval != 0: print "controller2 invalid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerSecond", "down") if retval != 0: print "Controller state check failed" exit(1) print "****DELETE VTERM****" retval = vtn_vterm.delete_vterm("VtnOne", "VTermOne") if retval != 0: print "VTERM1/VTN1 Delete Failed" exit(1) retval = vtn_vterm.delete_vterm("VtnTwo", "VTermOne") if retval != 0: print "VTERM1/VTN2 Delete Failed" exit(1) retval = vtn_vterm.delete_vterm("VtnThree", "VTermThree") if retval != 0: print "VTERM3/VTN3 Delete Failed" exit(1) retval = vtn_vterm.delete_vterm("VtnFour", "VTermThree") if retval != 0: print "VTERM3/VTN4 Delete 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 "controller1 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerFirst", "up") if retval != 0: print "Controller state check failed" exit(1) test_controller_ipaddr = vtn_testconfig.ReadValues(CONTROLLERDATA, "ControllerSecond")["ipaddr"] retval = controller.update_controller_ex("ControllerSecond", ipaddr=test_controller_ipaddr) if retval != 0: print "controller2 valid_ip update failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state("ControllerSecond", "up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnOne", "VTermOne", "ControllerFirst", presence="no") if retval != 0: print "VTERM1/VTN1 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnOne", "ControllerFirst", presence="no") if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnTwo", "VTermOne", "ControllerFirst", presence="no") if retval != 0: print "VTERM1/VTN2 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnTwo", "ControllerFirst", presence="no") if retval != 0: print "VTN2 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnThree", "VTermThree", "ControllerSecond", presence="no") if retval != 0: print "VTERM3/VTN3 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnThree", "ControllerSecond", presence="no") if retval != 0: print "VTN3 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller("VtnFour", "VTermThree", "ControllerSecond", presence="no") if retval != 0: print "VTERM3/VTN4 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller("VtnFour", "ControllerSecond", presence="no") if retval != 0: print "VTN4 Validate Failed" exit(1) retval = vtn_vterm.delete_vtn("VtnOne") if retval != 0: print "VTN1 Delete Failed in coordinator" exit(1) retval = vtn_vterm.delete_vtn("VtnTwo") if retval != 0: print "VTN2 Delete Failed in coordinator" exit(1) retval = vtn_vterm.delete_vtn("VtnThree") if retval != 0: print "VTN3 Delete Failed in coordinator" exit(1) retval = vtn_vterm.delete_vtn("VtnFour") if retval != 0: print "VTN4 Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex("ControllerFirst") if retval != 0: print "CONTROLLER1 delete failed" exit(1) retval = controller.delete_controller_ex("ControllerSecond") if retval != 0: print "CONTROLLER2 delete failed" exit(1) print "MULTI VTN->VTERM MULTI_CONTROLLER AUDIT TEST SUCCESS"
def test_vtn_vbr_multi_controller(): print "TEST 1 : 1 Tenants with 1 VBridge each on different controllers" print "CONTROLLER1->VTNONE->VBRONE" print "CONTROLLER2->VTNONE->VBRTWO" print "CREATE ControllerFirst" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller Create Failed" exit(1) retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "Controller state check failed" exit(1) print "CREATE ControllerSecond" retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "Controller Create Failed" exit(1) retval = controller.wait_until_state('ControllerSecond',"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 = vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "VBR Create Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',position=0) if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerSecond',position=0) if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBROne Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond') if retval != 0: print "VBRTwo Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrThree') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrThree','ControllerSecond',presence="no") if retval != 0: print "VtnVBRTwo Validate Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VtnVBR Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "VBR Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER1" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "DELETE CONTROLLER2" retval=controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER delete failed" exit(1) print "MULTI CONTROLLER VTN->VBR TEST SUCCESS"
def test_vtn_vterm_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 VTERM when controller is up change the controller status to down delete VTN and VTERM 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_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) print "****Create VTERM****" retval = vtn_vterm.create_vterm('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst') if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM 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) print "****Delete VTERM****" retval = vtn_vterm.delete_vterm('VtnOne', 'VTermOne') if retval != 0: print "VTERM/VTN Delete Failed" exit(1) print "****Delete VTN****" retval = vtn_vterm.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 = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst', presence="no") if retval != 0: print "VTERM Validate Failed" exit(1) retval = vtn_vterm.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->VTERM AUDIT TEST SUCCESS"
def test_multi_vtn_with_vterm_audit_test(): print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller Create Failed" exit(1) retval = controller.wait_until_state('ControllerFirst', "up") if retval != 0: print "controller state change failed" exit(1) print "TEST 6 : 2 Tenants with one VTerminal each and test AUDIT" print "VTNONE->VTERMONE" print "VTNTWO->VTERMONE" retval = vtn_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vtn('VtnTwo') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnTwo', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst', position=0) if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnTwo', 'ControllerFirst', position=1) if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM 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 = vtn_vterm.delete_vterm('VtnOne', 'VTermOne') if retval != 0: print "VTERM/VTN Delete Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnTwo', 'VTermOne') if retval != 0: print "VTERM/VTN Delete 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 = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst', presence="no") if retval != 0: print "VTERM Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo', 'VTermOne', 'ControllerFirst', presence="no") if retval != 0: print "VTERM Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnTwo', 'ControllerFirst', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) retval = vtn_vterm.delete_vtn('VtnTwo') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "MULTI VTN->VTERM AUDIT TEST SUCCESS"
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"
def test_physical_read_1(ctr_child): print "TEST 1" #create mininet topology child = mininet_test.create_mininet_topology('MININETONE', 'ControllerFirst', '2') if child.isalive() == True : print "Topology creation Success!!!" else: print "Topology creation Failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: mininet_test.close_topology(child) stop_controller(ctr_child) print "Controller Create Failed" exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst', "up") if retval != 0: mininet_test.close_topology(child) stop_controller(ctr_child) print "Controller state check failed" exit(1) #stop and start vtn print "stopping vtn" subprocess.Popen("/usr/local/vtn/bin/vtn_stop", stdout=subprocess.PIPE) time.sleep(5) print "starting vtn" subprocess.Popen("/usr/local/vtn/bin/vtn_start", stdout=subprocess.PIPE) time.sleep(5) #Adding controller again, and cheking the physical table print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller Create Failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst', "up") if retval != 0: print "Controller state check failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) insync(60) retval = validate_switch_at_physical('SwitchOne', 'ControllerFirst', 'yes', 0) if retval != 0: print "switch1 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) retval = validate_switch_at_physical('SwitchTwo', 'ControllerFirst', 'yes', 1) if retval != 0: print "switch2 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) retval = validate_switch_at_physical('SwitchThree', 'ControllerFirst', 'yes', 2) if retval != 0: print "switch3 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) verify_switch_port('SwitchOne', 'PortOne', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchOne', 'PortTwo', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchTwo', 'PortThree', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchTwo', 'PortFour', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchThree', 'PortFive', 'ControllerFirst', child, ctr_child, 'yes', 2) verify_switch_port('SwitchThree', 'PortSix', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchThree', 'PortSeven', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchThree', 'PortEight', 'ControllerFirst', child, ctr_child, 'yes', 2) insync(40) verify_logical_port('PortOne', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_logical_port('PortTwo', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_logical_port('PortThree', 'ControllerFirst', child, ctr_child, 'yes', 2) verify_logical_port('PortFour', 'ControllerFirst', child, ctr_child, 'yes', 3) verify_logical_port('PortFive', 'ControllerFirst', child, ctr_child, 'yes', 4) verify_logical_port('PortSix', 'ControllerFirst', child, ctr_child, 'yes', 5) verify_logical_port('PortSeven', 'ControllerFirst', child, ctr_child, 'yes', 6) verify_logical_port('PortEight', 'ControllerFirst', child, ctr_child, 'yes', 7) #close Topology mininet_test.close_topology(child) print "DELETE CONTROLLER" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: stop_controller(ctr_child) print "CONTROLLER delete failed" exit(1) print "test_physical_read_1 SUCESS"
def test_multi_vtn_with_vterm_audit_test(): print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller Create Failed" exit(1) retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "controller state change failed" exit(1) print "TEST 6 : 2 Tenants with one VTerminal each and test AUDIT" print "VTNONE->VTERMONE" print "VTNTWO->VTERMONE" retval = vtn_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vtn('VtnTwo') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnTwo','VTermOne','ControllerFirst') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne','ControllerFirst',position=0) if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnTwo','ControllerFirst',position=1) if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst') if retval != 0: print "VTERM Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo','VTermOne','ControllerFirst') if retval != 0: print "VTERM 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 = vtn_vterm.delete_vterm('VtnOne','VTermOne') if retval != 0: print "VTERM/VTN Delete Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnTwo','VTermOne') if retval != 0: print "VTERM/VTN Delete 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 = vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst',presence="no") if retval != 0: print "VTERM Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo','VTermOne','ControllerFirst',presence="no") if retval != 0: print "VTERM Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnTwo','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) retval = vtn_vterm.delete_vtn('VtnTwo') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "MULTI VTN->VTERM AUDIT TEST SUCCESS"
def test_physical_read_2(ctr_child): print "TEST 2" #create mininet topology child = mininet_test.create_mininet_topology('MININETONE', 'ControllerFirst', '2') if child.isalive() == True : print "Topology creation Success!!!" else: print "Topology creation Failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller Create Failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst', "up") if retval != 0: print "Controller state check failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) insync(60) retval = validate_switch_at_physical('SwitchOne', 'ControllerFirst', 'yes', 0) if retval != 0: print "switch1 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) retval = validate_switch_at_physical('SwitchTwo', 'ControllerFirst', 'yes', 1) if retval != 0: print "switch2 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) retval = validate_switch_at_physical('SwitchThree', 'ControllerFirst', 'yes', 2) if retval != 0: print "switch3 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) verify_switch_port('SwitchOne', 'PortOne', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchOne', 'PortTwo', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchTwo', 'PortThree', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchTwo', 'PortFour', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchTwo', 'PortFive', 'ControllerFirst', child, ctr_child, 'yes', 2) verify_switch_port('SwitchThree', 'PortSix', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchThree', 'PortSeven', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchThree', 'PortEight', 'ControllerFirst', child, ctr_child, 'yes', 2) insync(40) verify_logical_port('PortOne', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_logical_port('PortTwo', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_logical_port('PortThree', 'ControllerFirst', child, ctr_child, 'yes', 2) verify_logical_port('PortFour', 'ControllerFirst', child, ctr_child, 'yes', 3) verify_logical_port('PortFive', 'ControllerFirst', child, ctr_child, 'yes', 4) verify_logical_port('PortSix', 'ControllerFirst', child, ctr_child, 'yes', 5) verify_logical_port('PortSeven', 'ControllerFirst', child, ctr_child, 'yes', 6) verify_logical_port('PortEight', 'ControllerFirst', child, ctr_child, 'yes', 7) #Making the link down of S3 H1 retval = link_down(child, 's3', 'h3') if retval != 0: print "Toggling of link s3 h3 down failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) insync(40) #checking for link down retval = validate_link_down('ControllerFirst', 'SwitchThree', 'PortSix', 'down', 0) if retval != 0: print "s3 h3 is not down" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) #close Topology mininet_test.close_topology(child) print "DELETE CONTROLLER" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" stop_controller(ctr_child) exit(1) print "test_physical_read_2 SUCESS"
def test_vtn_mininet_ping_demo1(): print """TEST 1 : One vtn and one VBridge with Two Interfaces one Portmap each send packets between two configured host(H1,H3)""" print "CREATE Controller" print "VTNONE->VBRONE->VBRIFONE->PORTMAP" print "VTNONE->VBRONE->VBRIFTWO->PORTMAP" child = create_mininet_topology('MININETONE', 'ControllerFirst', '2') if child.isalive() == True : print "Topology creation Success!!!" else: print "Topology creation Failed" close_topology(child) exit(1) retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 1 :Controller Create Failed" close_topology(child) exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "controller state change failed" exit(1) retval = vtn_vbr.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" close_topology(child) exit(1) retval = vtn_vbr.create_vbr('VtnOne', 'VbrOne', 'ControllerFirst') if retval != 0: print "VBR Create Failed" close_topology(child) exit(1) retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrOne', 'VbrIfOne') if retval != 0: print "VBRIFONE Create Failed" close_topology(child) exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrOne', 'VbrIfOne', 'ControllerFirst', position=0) if retval != 0: print "VBRIFONE Validate Failed" close_topology(child) exit(1) retval = vbrif_portmap.create_vbrif('VtnOne', 'VbrOne', 'VbrIfTwo') if retval != 0: print "VBRIFTWO Create Failed" close_topology(child) exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrOne', 'VbrIfTwo', 'ControllerFirst', position=1) if retval != 0: print "VBRIFTWO Validate Failed" close_topology(child) exit(1) retval = vbrif_portmap.create_portmap('VtnOne', 'VbrOne', 'VbrIfOne', vlan_tagged=0); if retval != 0: print "VBRIF1 Portmap Create Failed" close_topology(child) exit(1) retval = vbrif_portmap.create_portmap('VtnOne', 'VbrOne', 'VbrIfTwo', vlan_tagged=0); if retval != 0: print "VBRIF2 Portmap Create Failed" close_topology(child) exit(1) retval = vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne', 'VbrOne', 'VbrIfOne', 'ControllerFirst', presence="yes"); if retval != 0: print "VBRIF1 Portmap Validate Failed" close_topology(child) exit(1) retval = vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne', 'VbrOne', 'VbrIfTwo', 'ControllerFirst', presence="yes"); if retval != 0: print "VBRIF2 Portmap Validate Failed" close_topology(child) exit(1) retval = ping_mininet (child,'h1','h3') if retval != 0: print "MININET PING FAILED" close_topology(child) retval = vtn_vbr.validate_vbr_at_controller('VtnOne', 'VbrOne', 'ControllerFirst') if retval != 0: print "VBR Validate Failed" close_topology(child) exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne', 'ControllerFirst') if retval != 0: print "VTN Validate Failed" close_topology(child) exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne', 'VbrOne', 'VbrIfOne') if retval != 0: print "VTN1->VBR1->VBRIF1 Delete Failed" exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrOne', 'VbrIfOne', 'ControllerFirst', presence="no", position=0) if retval != 0: print "After Delete VBRIFONE Validate Failed" exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne', 'VbrOne', 'VbrIfTwo') if retval != 0: print "VTN1->VBR1->VBRIF1 Delete Failed" exit(1) retval = vbrif_portmap.validate_vbrif_at_controller('VtnOne', 'VbrOne', 'VbrIfTwo', 'ControllerFirst', presence="no", position=1) if retval != 0: print "After Delete VBRIFTWO Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne', 'VbrOne') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval = vtn_vbr.validate_vbr_at_controller('VtnOne', 'VbrOne', 'ControllerFirst', presence="no") if retval != 0: print "After Delete VBR Validate Failed" exit(1) retval = vtn_vbr.validate_vtn_at_controller('VtnOne', 'ControllerFirst', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "MININET PING DEMO 1 TEST SUCCESS"
def test_physical_read_4(ctr_child): print "TEST 4" #create mininet topology child = mininet_test.create_mininet_topology('MININETONE', 'ControllerFirst', '3') if child.isalive() == True : print "Topology creation Success!!!" else: print "Topology creation Failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller Create Failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst', "up") if retval != 0: print "Controller state check failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) insync(60) retval = validate_switch_at_physical('SwitchOne', 'ControllerFirst', 'yes', 0) if retval != 0: print "switch1 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) retval = validate_switch_at_physical('SwitchTwo', 'ControllerFirst', 'yes', 1) if retval != 0: print "switch2 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) retval = validate_switch_at_physical('SwitchThree', 'ControllerFirst', 'yes', 2) if retval != 0: print "switch3 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) retval = validate_switch_at_physical('SwitchFour', 'ControllerFirst', 'yes', 3) if retval != 0: print "switch4 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) retval = validate_switch_at_physical('SwitchFive', 'ControllerFirst', 'yes', 4) if retval != 0: print "switch5 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) retval = validate_switch_at_physical('SwitchSix', 'ControllerFirst', 'yes', 5) if retval != 0: print "switch6 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) retval = validate_switch_at_physical('SwitchSeven', 'ControllerFirst', 'yes', 6) if retval != 0: print "switch7 validate failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) verify_switch_port('SwitchOne', 'PortOne', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchOne', 'PortTwo', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchTwo', 'PortThree', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchTwo', 'PortFour', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchTwo', 'PortFive', 'ControllerFirst', child, ctr_child, 'yes', 2) verify_switch_port('SwitchThree', 'PortSix', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchThree', 'PortSeven', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchThree', 'PortEight', 'ControllerFirst', child, ctr_child, 'yes', 2) verify_switch_port('SwitchFour', 'PortNine', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchFour', 'PortTen', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchFour', 'PortEleven', 'ControllerFirst', child, ctr_child, 'yes', 2) verify_switch_port('SwitchFive', 'PortTwelve', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchFive', 'PortThirteen', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchFive', 'PortFourteen', 'ControllerFirst', child, ctr_child, 'yes', 2) verify_switch_port('SwitchSix', 'PortFifteen', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchSix', 'PortSixteen', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchSix', 'PortSeventeen', 'ControllerFirst', child, ctr_child, 'yes', 2) verify_switch_port('SwitchSeven', 'PortEighteen', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_switch_port('SwitchSeven', 'PortNineteen', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_switch_port('SwitchSeven', 'PortTwenty', 'ControllerFirst', child, ctr_child, 'yes', 2) insync(40) verify_logical_port('PortOne', 'ControllerFirst', child, ctr_child, 'yes', 0) verify_logical_port('PortTwo', 'ControllerFirst', child, ctr_child, 'yes', 1) verify_logical_port('PortThree', 'ControllerFirst', child, ctr_child, 'yes', 2) verify_logical_port('PortFour', 'ControllerFirst', child, ctr_child, 'yes', 3) verify_logical_port('PortFive', 'ControllerFirst', child, ctr_child, 'yes', 4) verify_logical_port('PortSix', 'ControllerFirst', child, ctr_child, 'yes', 5) verify_logical_port('PortSeven', 'ControllerFirst', child, ctr_child, 'yes', 6) verify_logical_port('PortEight', 'ControllerFirst', child, ctr_child, 'yes', 7) verify_logical_port('PortNine', 'ControllerFirst', child, ctr_child, 'yes', 8) verify_logical_port('PortTen', 'ControllerFirst', child, ctr_child, 'yes', 9) verify_logical_port('PortEleven', 'ControllerFirst', child, ctr_child, 'yes', 10) verify_logical_port('PortTwelve', 'ControllerFirst', child, ctr_child, 'yes', 11) verify_logical_port('PortThirteen', 'ControllerFirst', child, ctr_child, 'yes', 12) verify_logical_port('PortFourteen', 'ControllerFirst', child, ctr_child, 'yes', 13) verify_logical_port('PortFifteen', 'ControllerFirst', child, ctr_child, 'yes', 14) verify_logical_port('PortSixteen', 'ControllerFirst', child, ctr_child, 'yes', 15) verify_logical_port('PortSeventeen', 'ControllerFirst', child, ctr_child, 'yes', 16) verify_logical_port('PortEighteen', 'ControllerFirst', child, ctr_child, 'yes', 17) verify_logical_port('PortNineteen', 'ControllerFirst', child, ctr_child, 'yes', 18) verify_logical_port('PortTwenty', 'ControllerFirst', child, ctr_child, 'yes', 19) mininet_test.close_topology(child) #create mininet topology with change in topology tree child = mininet_test.create_mininet_topology('MININETONE', 'ControllerFirst', '2') if child.isalive() == True : print "Topology creation Success!!!" else: print "Topology creation Failed" mininet_test.close_topology(child) stop_controller(ctr_child) exit(1) insync(80) verify_switch_port('SwitchFour', 'PortNine', 'ControllerFirst', child, ctr_child, 'no', 0) verify_switch_port('SwitchFive', 'PortTwelve', 'ControllerFirst', child, ctr_child, 'no', 0) verify_switch_port('SwitchSix', 'PortFifteen', 'ControllerFirst', child, ctr_child, 'no', 0) verify_switch_port('SwitchSeven', 'PortEighteen', 'ControllerFirst', child, ctr_child, 'no', 0) #close Topology mininet_test.close_topology(child) print "DELETE CONTROLLER" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" stop_controller(ctr_child) exit(1) print "test_physical_read_4 SUCESS"
def test_audit_vtn_multi_vterm_vtermif(): print "CREATE Controller" print "VTNONE->VTERMONE->VTERMIFONE/VTERMIFTHREE" print "VTNONE->VTERMTWO->VTERMIFTWO/VTERMIFFOUR" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 3 :Controller Create Failed" exit(1) print "TEST 3 : Audit One vtn and Two VTerminals with Two Interfaces each" # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "controller state change failed" exit(1) retval=vtn_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) retval=vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst') if retval != 0: print "VTERM1 Create Failed" exit(1) retval=vtn_vterm.create_vterm('VtnOne','VTermTwo','ControllerFirst') if retval != 0: print "VTERM2 Create Failed" exit(1) retval=vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne') if retval != 0: print "VTERMIF1 Create Failed" exit(1) retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermOne','VTermIfOne','ControllerFirst',position=0) if retval != 0: print "VTERMIF1 Validate Failed" exit(1) retval=vtermif_portmap.create_vtermif('VtnOne','VTermTwo','VTermIfOne') if retval != 0: print "VTERM2->VTERMIF1 Create Failed" exit(1) retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermTwo','VTermIfOne','ControllerFirst',position=0) if retval != 0: print "VTERM2->VTERMIF2 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 = vtermif_portmap.delete_vtermif('VtnOne','VTermOne','VTermIfOne') if retval != 0: print "VTERM1->VTERMIF1 Delete Failed" exit(1) retval = vtermif_portmap.delete_vtermif('VtnOne','VTermTwo','VTermIfOne') if retval != 0: print "VTERM2->VTERMIF1 Delete Failed" exit(1) retval=vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfThree') if retval != 0: print "VTERMIF3 Create Failed" exit(1) retval=vtermif_portmap.create_vtermif('VtnOne','VTermTwo','VTermIfTwo') if retval != 0: print "VTERM2->VTERMIF2 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=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermOne','VTermIfThree','ControllerFirst',position=0) if retval != 0: print "VTERMIF3 Validate Failed" exit(1) retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermTwo','VTermIfTwo','ControllerFirst',position=0) if retval != 0: print "VTERM2->VTERMIF2 Validate Failed" exit(1) retval=vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst',position=0) if retval != 0: print "VTERMONE Validate Failed" exit(1) retval=vtn_vterm.validate_vterm_at_controller('VtnOne','VTermTwo','ControllerFirst',position=0) if retval != 0: print "VTERMTWO Validate Failed" exit(1) retval=vtn_vterm.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN Validate Failed" exit(1) retval = vtermif_portmap.delete_vtermif('VtnOne','VTermOne','VTermIfThree') if retval != 0: print "VTERM1->VTERMIF3 Delete Failed" exit(1) retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermOne','VTermIfOne','ControllerFirst',presence="no",position=0) if retval != 0: print "VTERM1->VTERMIF1 Validate Failed" exit(1) retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermOne','VTermIfThree','ControllerFirst',presence="no",position=0) if retval != 0: print "VTERM1->VTERMIF3 Validate Failed" exit(1) retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermTwo','VTermIfOne','ControllerFirst',presence="no",position=0) if retval != 0: print "VTERM2->VTERMIF1 Validate Failed" exit(1) retval = vtermif_portmap.delete_vtermif('VtnOne','VTermTwo','VTermIfTwo') if retval != 0: print "VTERM2->VTERMIF2 Delete Failed" exit(1) retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermTwo','VTermIfTwo','ControllerFirst',presence="no",position=0) if retval != 0: print "VTERM2->VTERMIF2 Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne','VTermOne') if retval != 0: print "VTERM1/VTN Delete Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne','VTermTwo') if retval != 0: print "VTERM2/VTN Delete Failed" exit(1) retval=vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst',presence="no",position=0) if retval != 0: print "VTERM1/VTN Validate Failed" exit(1) retval=vtn_vterm.validate_vterm_at_controller('VtnOne','VTermTwo','ControllerFirst',presence="no",position=0) if retval != 0: print "VTERM2/VTN Validate Failed" exit(1) retval=vtn_vterm.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "VTN1->VTERM1->VTERMIF1/VTERMIF3 AND VTN1->VTERM2->VTERMIF1/VTERMIF2 AUDIT TEST SUCCESS"
def test_audit_multi_vbrif(): print "CREATE Controller" print "VTNONE->VBRONE->VBRIFONE" print "VTNONE->VBRONE->VBRIFTWO" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 2 :Controller Create Failed" exit(1) print "TEST 2 : Test audit One vtn and one VBridge with Two Interfaces" # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "controller state change 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) 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=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne') if retval != 0: print "VBRIFONE Create Failed" exit(1) retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfTwo') if retval != 0: print "VBRIFTWO 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=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfTwo','ControllerFirst',position=1) if retval != 0: print "VBRIFTWO Validate Failed" exit(1) retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',position=0) if retval != 0: print "VBRIFONE Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN Validate Failed" exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne','VbrOne','VbrIfOne') if retval != 0: print "VTN1->VBR1->VBRIF1 Delete Failed" exit(1) retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',presence="no",position=0) if retval != 0: print "After Delete VBRIFONE Validate Failed" exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne','VbrOne','VbrIfTwo') if retval != 0: print "VTN1->VBR1->VBRIF1 Delete Failed" exit(1) retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfTwo','ControllerFirst',presence="no",position=1) if retval != 0: print "After Delete VBRIFTWO Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "After Delete VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "VTN->VBR->VBRIF1/VBRIF2 AUDIT TEST SUCCESS"
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"
def test_audit_vtn_vbr_vbrif(): print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 1 :Controller Create Failed" exit(1) print "TEST 1: Test Audit VTenant with one VBridge one VBRIF" # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "controller state change 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=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst') if retval != 0: print "After Create VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN 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=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne') if retval != 0: print "VBRIF 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=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst') if retval != 0: print "After Create VBRIF Validate Failed" exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne','VbrOne','VbrIfOne') if retval != 0: print "VBRIF Delete Failed" exit(1) retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',presence="no",position=0) if retval != 0: print "After Delete VBRIF Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "After Delete VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed after VBR Deleted" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "VTN->VBR->VBRIF AUDIT TEST SUCCESS"
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"
def test_audit_vtn_vbr_multi_vbrif_portmap(): print "CREATE Controller" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "TEST 6 :Controller Create Failed" exit(1) print "TEST 6 : VTenant with one VBridge Two VBRIF1/VBRIF2 and One PORTMAP in VBRIF1" # Delay for AUDIT retval = controller.wait_until_state('ControllerFirst',"up") if retval != 0: print "controller state change 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 "VBR1 Create Failed" exit(1) retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne') if retval != 0: print "VBRIF1 Create Failed" exit(1) retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfTwo') if retval != 0: print "VBRIF2 Create Failed" exit(1) retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',position=0) if retval != 0: print "After Create VBRIF1 Validate Failed" exit(1) retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfTwo','ControllerFirst',position=1) if retval != 0: print "After Create VBRIF2 Validate Failed" exit(1) retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne'); if retval != 0: print "VBRIF1 Portmap Create Failed" exit(1) retval=vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',presence="yes",position=0); if retval != 0: print "VBRIF1 Portmap 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=vbrif_portmap.delete_portmap('VtnOne','VbrOne','VbrIfOne'); if retval != 0: print "Portmap Delete Failed" exit(1) retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfTwo'); if retval != 0: print "VBRIF2 Portmap 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=vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne','VbrOne','VbrIfTwo','ControllerFirst',presence="yes",position=0); if retval != 0: print "VBRIF2 Portmap Validate Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',position=0) if retval != 0: print "After Create VBR1 Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst') if retval != 0: print "VTN Validate Failed" exit(1) retval=vbrif_portmap.delete_portmap('VtnOne','VbrOne','VbrIfTwo'); if retval != 0: print "Portmap Delete Failed" exit(1) retval=vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',presence="no",position=0); if retval != 0: print "After Delete VBRIF1 Portmap Validate Failed" exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne','VbrOne','VbrIfOne') if retval != 0: print "VBRIF1 Delete Failed" exit(1) retval = vbrif_portmap.delete_vbrif('VtnOne','VbrOne','VbrIfTwo') if retval != 0: print "VBRIF2 Delete Failed" exit(1) retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',presence="no",position=0) if retval != 0: print "After Delete VBRIF1 Validate Failed" exit(1) retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfTwo','ControllerFirst',presence="no",position=1) if retval != 0: print "After Delete VBRIF2 Validate Failed" exit(1) retval = vtn_vbr.delete_vbr('VtnOne','VbrOne') if retval != 0: print "VBR/VTN Delete Failed" exit(1) retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no") if retval != 0: print "After Delete VBR Validate Failed" exit(1) retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no") if retval != 0: print "VTN Validate Failed after VBR Deleted" exit(1) retval = vtn_vbr.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER" retval=controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "VTN1->VBR1->VBRIF1->PORTMAP(DELETE) AND VTN1->VBR1->VBRIF2->PORTMAP(CREATE) AUDIT TEST SUCCESS"
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_vtn_multi_vterm_multi_controller(): print "TEST 2 : 1 Tenants with 2 VTerminal each on different controllers" print "CONTROLLER1->VTNONE->VTERMONE->VTERMTWO" print "CONTROLLER2->VTNTWO->VTERMTHREE->VTERMFOUR" print "CREATE ControllerFirst" retval = controller.add_controller_ex('ControllerFirst') if retval != 0: print "Controller1 Create Failed" exit(1) retval = controller.wait_until_state('ControllerFirst', "up") if retval != 0: print "Controller state check failed" exit(1) print "CREATE ControllerSecond" retval = controller.add_controller_ex('ControllerSecond') if retval != 0: print "Controller2 Create Failed" exit(1) retval = controller.wait_until_state('ControllerSecond', "up") if retval != 0: print "Controller state check failed" exit(1) retval = vtn_vterm.create_vtn('VtnOne') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vtn('VtnTwo') if retval != 0: print "VTN Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM1 Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnOne', 'VTermTwo', 'ControllerFirst') if retval != 0: print "VTERM2 Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnTwo', 'VTermThree', 'ControllerSecond') if retval != 0: print "VTERM3 Create Failed" exit(1) retval = vtn_vterm.create_vterm('VtnTwo', 'VTermFour', 'ControllerSecond') if retval != 0: print "VTERM4 Create Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst') if retval != 0: print "VTN1 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnTwo', 'ControllerSecond') if retval != 0: print "VTN2 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst') if retval != 0: print "VTERM1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermTwo', 'ControllerFirst', position=0) if retval != 0: print "VTERM2 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo', 'VTermThree', 'ControllerSecond', position=0) if retval != 0: print "VTERM3 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo', 'VTermFour', 'ControllerSecond') if retval != 0: print "VTERM4 Validate Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne', 'VTermOne') if retval != 0: print "VTERM1/VTN1 Delete Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnOne', 'VTermTwo') if retval != 0: print "VTERM2/VTN1 Delete Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnTwo', 'VTermThree') if retval != 0: print "VTERM3/VTN2 Delete Failed" exit(1) retval = vtn_vterm.delete_vterm('VtnTwo', 'VTermFour') if retval != 0: print "VTERM4/VTN2 Delete Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermOne', 'ControllerFirst', presence="no") if retval != 0: print "VTERM1/VTERM1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnOne', 'VTermTwo', 'ControllerFirst', presence="no") if retval != 0: print "VTERM2/VTN1 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo', 'VTermThree', 'ControllerSecond', presence="no") if retval != 0: print "VTERM3/VTN2 Validate Failed" exit(1) retval = vtn_vterm.validate_vterm_at_controller('VtnTwo', 'VTermFour', 'ControllerSecond', presence="no") if retval != 0: print "VTERM4/VTN2 Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnOne', 'ControllerFirst', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.validate_vtn_at_controller('VtnTwo', 'ControllerSecond', presence="no") if retval != 0: print "VTN Validate Failed" exit(1) retval = vtn_vterm.delete_vtn('VtnOne') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) retval = vtn_vterm.delete_vtn('VtnTwo') if retval != 0: print "VTN Delete Failed in coordinator" exit(1) print "DELETE CONTROLLER1" retval = controller.delete_controller_ex('ControllerFirst') if retval != 0: print "CONTROLLER delete failed" exit(1) print "DELETE CONTROLLER2" retval = controller.delete_controller_ex('ControllerSecond') if retval != 0: print "CONTROLLER delete failed" exit(1) print "MULTI CONTROLLER MULTI VTERM VTN->VTERM TEST SUCCESS"