priority=7
dscp=55
direction=in
-type_in=in
-type_out=out
+type=in
+index=10
+condition=flowlist1
+
+[VTNFlowfilterOneOut]
+seqnum=10
+fl_name=flowlist1
+action_type=pass
+nmg_name=test1
+priority=7
+dscp=55
+direction=in
+type=out
index=10
condition=flowlist1
priority=7
dscp=55
direction=in
-type_in=in
-type_out=out
+type=in
index=11
condition=flowlist1
fl_name=flowlist1
action_type=redirect
nmg_name=test1
-priority=7
dscp=55
vnode_name=vbrtwo
if_name=vbriftwo
direction=in
-macdstaddr=0123.4567.89ab
-macsrcaddr=0123.4567.89ab
-type_in=in
-type_out=out
+macdstaddr=f0f1.f2f3.f4f5
+macsrcaddr=f0f1.f2f3.f2f5
+type=in
index=10
condition=flowlist1
bridge=vnode_1
address=f0:f1:f2:f3:f4:f5
priority= 7
+[FlowfilterOnePass]
+seqnum=10
+fl_name=flowlist1
+action_type=pass
+nmg_name=test1
+dscp=55
+direction=in
+type=in
+index=10
+condition=flowlist1
+output=false
+priority= 7
+
+
+[FlowfilterOneDrop]
+seqnum=10
+fl_name=flowlist1
+action_type=drop
+nmg_name=test1
+dscp=55
+direction=in
+type=in
+index=10
+condition=flowlist1
+output=false
+priority=7
+
+[UpdateFlowfilterOnePass]
+seqnum=10
+fl_name=flowlist1
+action_type=drop
+nmg_name=test1
+dscp=54
+direction=in
+type=in
+index=10
+condition=flowlist1
+output=false
+priority= 6
+
+[UpdateFlowfilterOneDrop]
+seqnum=10
+fl_name=flowlist1
+action_type=pass
+nmg_name=test1
+dscp=5
+direction=in
+type=in
+index=10
+condition=flowlist1
+output=false
+priority= 5
+
+
+
+
+[FlowfilterOneOut]
+seqnum=10
+fl_name=flowlist1
+action_type=redirect
+nmg_name=test1
+dscp=55
+vnode_name=vbrtwo
+if_name=vbriftwo
+direction=in
+macsrcaddr=f0f1.f2f3.f4f5
+macdstaddr=f0f1.f2f3.f2f5
+type=out
+index=10
+condition=flowlist1
+bridge=vnode_1
+interface=if_1
+output=false
+address=f0:f1:f2:f3:f4:f5
+priority= 7
+
+
[FlowfilterTwo]
seqnum=11
fl_name=flowlist2
direction=in
macdstaddr=0123.4567.89ab
macsrcaddr=0123.4567.89ab
-type_in=in
-type_out=out
+type=in
index=11
condition=flowlist2
bridge=vnode_2
[UpdateFlowfilter]
vnode_name=vbrthree
if_name=vbrifthree
+macdstaddr=f0f1.f2f3.f4f5
+macsrcaddr=f0f1.f2f3.f2f5
+priority=5
+dscp=5
+type=in
+action_type=redirect
+fl_name=flowlist1
+seqnum=10
+direction=in
+
+[UpdateFlowfilterOne]
+seqnum=10
+fl_name=flowlist1
+action_type=redirect
+nmg_name=test1
+dscp=55
+vnode_name=vbrthree
+if_name=vbrifthree
+direction=in
+macsrcaddr=f0f1.f2f3.f4f5
+macdstaddr=f0f1.f2f3.f2f5
+type=out
+index=10
+condition=flowlist1
+bridge=vnode_1
+interface=if_1
+output=false
+address=f0:f1:f2:f3:f4:f5
+priority= 7
+
+[NegativeFlowfilter]
+dscp =65
+priority=8
+vnode_name=vbrthree
+if_name=vbrifthree
+macdstaddr=f0f1.f2f3.f4f5
+macsrcaddr=f0f1.f2f3.f2f5
+type=in
+action_type=redirect
+fl_name=flowlist1
+seqnum=10
+direction=in
+
+[NegativeFlowfilterOne]
+dscp =65
+priority=8
+vnode_name=vbrthree
+if_name=vbrifthree
+macdstaddr=f0f1.f2f3.f4f5
+macsrcaddr=f0f1.f2f3.f2f5
+type=out
+action_type=redirect
+fl_name=flowlist1
+seqnum=10
+direction=in
+
+
+[UpdateRedirect]
+seqnum=10
+fl_name=flowlist1
+action_type=redirect
+nmg_name=test1
+priority=7
+dscp=55
+direction=in
+vnode_name=vtermone
+if_name=vtermifone
+macdstaddr=f0f1.f2f3.f4f5
+macsrcaddr=f0f1.f2f3.f3f5
+type=in
+index=10
+condition=flowlist1
+bridge=vnode_1
+interface=if_1
+output=false
+address=f0:f1:f2:f3:f3:f5
+priority= 7
+
+
+[NegativeFlowfilter]
+dscp =65
+priority=8
+vnode_name=vbrthree
+if_name=vbrifthree
+
[UpdateVTNFlowfilter]
priority=3
+dscp =33
+
+[NegativeVTNFlowfilter]
+priority=8
+dscp =65
+
+
+
[FlowfilterURL]
url=/flowfilters.json
vtn_bn = blockname.split('|')[0]
vtn_url=vtn_testconfig.ReadValues(VTNVBRDATA, vtn_bn)['vtn_url']
flowfilter_url = vtn_testconfig.ReadValues(FLOWFILTERDATA, 'FlowfilterURL')['url']
- ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type_in']
+ ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type']
url = coordinator_url + vtn_url
url = split_blockname(blockname, url)
print url
flowfilter_add = collections.defaultdict(dict)
+ print ff_type
flowfilter_add['flowfilter']['ff_type'] = ff_type
-
+ print flowfilter_add
r = requests.post(url, data = json.dumps(flowfilter_add), headers = def_header)
print r.status_code
if r.status_code != resp_code.RESP_CREATE_SUCCESS and r.status_code != resp_code.RESP_CREATE_SUCCESS_U14:
def delete_flowfilter(blockname, ff_blockname):
vtn_bn = blockname.split('|')[0]
vtn_url = vtn_testconfig.ReadValues(VTNVBRDATA, vtn_bn)['vtn_url']
- ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type_in']
+ ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type']
+
url = coordinator_url + vtn_url
url = split_blockname(blockname, url)
controller_ipaddr = vtn_testconfig.ReadValues(CONTROLLERDATA, controller_blockname)['ipaddr']
controller_port = vtn_testconfig.ReadValues(CONTROLLERDATA, controller_blockname)['port']
vtn_url = vtn_testconfig.ReadValues(VTNVBRDATA, vtn_bn)['vtn_url']
- ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type_in']
+ ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type']
index = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['index']
condition = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['condition']
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['dscp']
+ direction = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['direction']
+ action_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['action_type']
url = 'http://'+controller_ipaddr+':'+controller_port+controller_url_part+vtn_url
url = split_blockname(blockname, url)
ret = validate_filter_type(flowfilter_content)
if ret != 0:
return 1
- ret = validate_actions(flowfilter_content)
+ ret = validate_actions(flowfilter_content, ff_blockname)
if ret != 0:
return 1
return 0
return 0
return 0
-def validate_actions(flowfilter_content):
+def validate_actions(flowfilter_content, ff_blockname):
print "actions"
- try:
- if flowfilter_content['actions']['dlsrc']['address'] != address:
- return 1
- if flowfilter_content['actions']['vlanpcp']['priority'] != priority:
- return 1
- except (NameError, KeyError):
- print "Action does not contain all the elements"
- return 0
- return 0
+ length = len(flowfilter_content['actions'])
+
+ for index in range(length):
+ print "looping:", index
+ ret = 1
+ element = flowfilter_content['actions'][index]
+ print element
+ if 'dscp' in element:
+ ret = validate_dscp(flowfilter_content['actions'][index], ff_blockname);
+ if 'vlanpcp' in element:
+ ret = validate_priority(flowfilter_content['actions'][index], ff_blockname);
+ if 'dlrsrc' in element:
+ ret = validate_dlsrc(flowfilter_content['actions'][index], ff_blockname);
+ return ret
+
+def validate_dscp(json_array, ff_blockname):
+ print "validate_dscp"
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['dscp']
+ if json_array['dscp']['dscp'] == int(locale.atof(dscp)):
+ print "dscp"
+ return 0
+ else:
+ return 1
+
+def validate_priority(json_array, ff_blockname):
+ print "validate_priority"
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['priority']
+ if json_array['vlanpcp']['priority'] == int(locale.atof(priority)):
+ print "priority"
+ return 0
+ else:
+ return 1
+
+def validate_dlsrc(json_array, ff_blockname):
+ print "validate_dlsrc"
+ dlsrc = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['dlsrc']
+ if json_arrary['dlsrc']['address'] == int(locale.atof(dlsrc)):
+ print "dlsrc"
+ return 0
+ else:
+ return 1
def create_flowfilter_entry(blockname, ff_blockname):
vtn_bn = blockname.split('|')[0]
vtn_url = vtn_testconfig.ReadValues(VTNVBRDATA, vtn_bn)['vtn_url']
flowfilter_entry_url = vtn_testconfig.ReadValues(FLOWFILTERDATA, 'FlowfilterEntryURL')['url']
- ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type_in']
+ ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type']
+
seqnum = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['seqnum']
fl_name = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['fl_name']
action_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['action_type']
direction = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['direction']
macdstaddr = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['macdstaddr']
macsrcaddr = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['macsrcaddr']
+
+
redir = {'vnode_name':vnode_name, 'if_name':if_name, 'direction':direction, 'macdstaddr':macdstaddr, 'macsrcaddr':macsrcaddr}
+
+ flowfilter_entry_add = {'seqnum': seqnum, 'fl_name':fl_name, 'action_type':action_type, 'priority':priority, 'dscp':dscp, 'redirectdst':redir}
flowfilter_entry_add = {'seqnum': seqnum, 'fl_name':fl_name, 'action_type':action_type, 'priority':priority, 'dscp':dscp, 'redirectdst':redir}
J_string = dict({'flowfilterentry':flowfilter_entry_add})
- print J_string
+ print J_string
r = requests.post(url, data=json.dumps(J_string), headers=def_header)
print r.status_code
if r.status_code != resp_code.RESP_CREATE_SUCCESS and r.status_code != resp_code.RESP_CREATE_SUCCESS_U14:
vtn_bn = blockname.split('|')[0]
vtn_url=vtn_testconfig.ReadValues(VTNVBRDATA, vtn_bn)['vtn_url']
flowfilter_entry_url = vtn_testconfig.ReadValues(FLOWFILTERDATA, 'FlowfilterEntryURL')['url']
- ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type_in']
+ ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type']
seqnum = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['seqnum']
fl_name = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['fl_name']
action_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['action_type']
dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['dscp']
priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['priority']
-
if update_ff_bn == 'UpdateVTNFlowfilter':
priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['dscp']
+
+
+ if update_ff_bn == 'NegativeVTNFlowfilter':
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['dscp']
+
+
+ if update_ff_bn == 'UpdateFlowfilter':
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['dscp']
+
+ if update_ff_bn == 'NegativeFlowfilter':
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['dscp']
+
+
+ if update_ff_bn == 'UpdateFlowfilterOne':
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['dscp']
+
+ if update_ff_bn == 'NegativeFlowfilterOne':
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['dscp']
+
+
+ if update_ff_bn == 'UpdateFlowfilterOnePass':
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['dscp']
+ action_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['action_type']
+
+
+ if update_ff_bn == 'UpdateFlowfilterOneDrop':
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['dscp']
+ action_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['action_type']
+
+
+
url= coordinator_url + vtn_url
direction = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['direction']
macdstaddr = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['macdstaddr']
macsrcaddr = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['macsrcaddr']
+
vnode_name = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['vnode_name']
if_name = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['if_name']
+
+ macsrcaddr = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['macsrcaddr']
+ macdstaddr = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['macdstaddr']
+ direction = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['direction']
+
+ seqnum = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['seqnum']
+ fl_name = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['fl_name']
+ action_type = vtn_testconfig.ReadValues(FLOWFILTERDATA,update_ff_bn )['action_type']
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA,update_ff_bn )['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, update_ff_bn)['dscp']
+
+
+
+
redir = {'vnode_name':vnode_name, 'if_name':if_name, 'direction':direction, 'macdstaddr':macdstaddr, 'macsrcaddr':macsrcaddr}
+
flowfilter_entry_add = {'seqnum': seqnum,'fl_name':fl_name, 'action_type':action_type, 'priority':priority, 'dscp':dscp, 'redirectdst':redir}
J_string = dict({'flowfilterentry':flowfilter_entry_add})
print J_string
else:
return 0
+
def delete_flowfilter_entry(blockname, ff_blockname):
vtn_bn = blockname.split('|')[0]
vtn_url=vtn_testconfig.ReadValues(VTNVBRDATA,vtn_bn)['vtn_url']
- ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type_in']
+ ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['type']
+
seqnum = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_blockname)['seqnum']
url= coordinator_url + vtn_url
vtn_bn = blockname.split('|')[0]
ff_bn = ff_blockname.split('|')[0]
vtn_url=vtn_testconfig.ReadValues(VTNVBRDATA, vtn_bn)['vtn_url']
- ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['type_in']
+ ff_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['type']
+
seqnum = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['seqnum']
fl_name = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['fl_name']
action_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['action_type']
macdstaddr = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['macdstaddr']
macsrcaddr = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['macsrcaddr']
+ action_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['action_type']
ff_count = ff_blockname.count('|')
if ff_count > 0 and ff_blockname.find('VTN') != 0:
ff_bn = ff_blockname.split('|')[1]
vnode_name = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['vnode_name']
if_name = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['if_name']
+ priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['dscp']
+
+ action_type = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['action_type']
+
elif ff_count > 0:
ff_bn = ff_blockname.split('|')[1]
priority = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['priority']
+ dscp = vtn_testconfig.ReadValues(FLOWFILTERDATA, ff_bn)['dscp']
url = coordinator_url + vtn_url
if flowfilter_content['action_type'] != action_type:
print "action"
return 1
- #if flowfilter_content['nmg_name'] != nmg_name:
- # return 1
if flowfilter_content['priority'] != priority:
return 1
if flowfilter_content['dscp'] != dscp:
return 1
if flowfilter_content['redirectdst']['macdstaddr'] != macdstaddr:
return 1
+
return 0
+
+
# Main Block
if __name__ == '__main__':
print '*****FLOWFILTER TESTS******'
#
import requests, json, collections, time, controller
-import vtn_testconfig, vtn_vbr, vbrif_portmap, flowfilter, flowlistentry
+import vtn_testconfig, vtn_vbr, vbrif_portmap,vtn_vterm,vtermif_portmap ,flowfilter, flowlistentry
import resp_code
exit(1)
print "VBR->FLOWFILTER TEST SUCCESS"
-def test_vbr_flowfilter_1():
+def update_vbr_flowfilter():
print "CREATE Controller"
retval = controller.add_controller_ex('ControllerFirst')
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 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_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_flowfilter_pass():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print 'TEST 6 : VBR->FLOWFILTER TEST: Create Three VBR and VbrFlowFilterEntry with vbrone update the VbrFlowFilterEntry to vbrthree'
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence = 'yes', position = 1)
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VBRFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VBRFlowFilterEntry Create Failed"
+ exit(1)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOnePass', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOnePass', 'UpdateFlowfilterOnePass')
+ if retval != 0:
+ print "VBRFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst','UpdateFlowfilterOnePass', presence='yes', position=0)
+ if retval != 0:
+ print "VBRFlowFilterEntry Updatation Validate Failed at Co-ordinator"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VBRFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VBRFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrTwo', 'ControllerFirst', 'FlowfilterOnePass', presence='no', position=0)
+ if retval != 0:
+ print "FlowFilter validation Failed after deleting"
+ exit(1)
+
+ retval=vtn_vbr.delete_vtn('VtnOne')
+ if retval != 0:
+ print "DELETE VTN Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VBR->UPDATE FLOWFILTER TEST SUCCESS"
+
+def test_vbr_flowfilter_drop():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 1 : VBR->FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence = 'yes', position = 1)
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry Create Failed"
+ exit(1)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOneDrop', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOneDrop', presence='no', position=0)
+ if retval != 0:
+ print "FlowFilter validation Failed after deleting"
+ exit(1)
+
+ retval=vtn_vbr.delete_vtn('VtnOne')
+ if retval != 0:
+ print "DELETE VTN Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
print "DELETE CONTROLLER"
retval=controller.delete_controller_ex('ControllerFirst')
if retval != 0:
exit(1)
print "VBR->FLOWFILTER 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"
+
+
+
# Main Block
if __name__ == '__main__':
- print '*****VBR FLOWFILTER TESTS******'
+ print '*****VBR FLOWFILTER IN TESTS******'
test_vbr_flowfilter()
- test_vbr_flowfilter_1()
+ print '******UPDATE VBR FLOWFLTER IN TESTS****'
+ update_vbr_flowfilter()
+ print '*****VBR FLOWFILTER ACTION TYPE PASS TESTS******'
+ test_vbr_flowfilter_pass()
+ print '******UPDATE VBR FLOWFLTER ACTION TYPE DROP TESTS****'
+ update_vbr_flowfilter_pass()
+ print '*****VBR FLOWFILTER ACTION TYPE DROP TESTS******'
+ test_vbr_flowfilter_drop()
+ print '******UPDATE VBR FLOWFLTER ACTION TYPE PASS TESTS****'
+ update_vbr_flowfilter_drop()
+ print '*****NEGATIVE VBR FLOWFILTER IN TESTS***'
+ negative_vbr_flowfilter()
+
else:
print 'VBR_FLOWFILTER LOADED AS MODULE'
print "VBR->FLOWFILTER AUDIT_2 SUCCESS"
+def update_vbr_flowfilter_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print 'TEST 3 : VBR->FLOWFILTER AUDIT 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', '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)
+
+
+ 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_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', 'UpdateFlowfilter')
+ if retval != 0:
+ print "VBRFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOne|UpdateFlowfilter', presence='yes', position=0)
+ if retval != 0:
+ print "VBRFlowFilterEntry Updatation Validate Failed at Co-ordinator"
+ 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.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 AUDIT TEST SUCCESS"
+
+def test_vbr_flowfilter_pass_audit():
+ 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 4 : VBR->FLOWFILTER AUDIT TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "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 "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_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)
+ 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_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)
+
+ 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.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 AUDIT TEST SUCCESS"
+
+def update_vbr_flowfilter_pass_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print 'TEST 5 : VBR->FLOWFILTER AUDIT TEST: Create Three VBR and VbrFlowFilterEntry with vbrone update the VbrFlowFilterEntry to vbrthree'
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence = 'yes', position = 1)
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VBRFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VBRFlowFilterEntry Create Failed"
+ exit(1)
+
+ 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.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOnePass', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOnePass', 'UpdateFlowfilterOnePass')
+ if retval != 0:
+ print "VBRFlowFilterEntry Update Failed"
+ exit(1)
+
+
+ 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', 'ControllerFirst','UpdateFlowfilterOnePass', presence='yes', position=0)
+ if retval != 0:
+ print "VBRFlowFilterEntry Updatation Validate Failed at Co-ordinator"
+ exit(1)
+
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VBRFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VBRFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrTwo', 'ControllerFirst', 'FlowfilterOnePass', presence='no', position=0)
+ if retval != 0:
+ print "FlowFilter validation Failed after deleting"
+ exit(1)
+
+ retval=vtn_vbr.delete_vtn('VtnOne')
+ if retval != 0:
+ print "DELETE VTN Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VBR->UPDATE FLOWFILTER AUDIT TEST SUCCESS"
+
+def test_vbr_flowfilter_drop_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 6 : VBR->FLOWFILTER AUDIT TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "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 "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_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)
+
+ 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_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst', presence = 'yes', position = 1)
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst', presence = 'yes', position = 0)
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VbrOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry Create Failed"
+ exit(1)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOneDrop', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VbrOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne', 'ControllerFirst', 'FlowfilterOneDrop', presence='no', position=0)
+ if retval != 0:
+ print "FlowFilter validation Failed after deleting"
+ exit(1)
+
+ retval=vtn_vbr.delete_vtn('VtnOne')
+ if retval != 0:
+ print "DELETE VTN Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VBR->FLOWFILTER AUDIT TEST SUCCESS"
+
+def update_vbr_flowfilter_drop_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print 'TEST 7 : VBR->FLOWFILTER AUDIT 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)
+ 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', '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)
+
+ 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', '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 AUDIT TEST SUCCESS"
+
+
+
# Main Block
if __name__ == '__main__':
print '*****VBR AUDIT FLOWFILTER TESTS******'
test_vbr_flowfilter_audit_1()
test_vbr_flowfilter_audit_2()
+ print '******UPDATE AUDIT VBR FLOWFLTER IN TESTS****'
+ update_vbr_flowfilter_audit()
+ print '*****VBR FLOWFILTER AUDIT ACTION TYPE PASS TESTS******'
+ test_vbr_flowfilter_pass_audit()
+ print '******UPDATE VBR FLOWFLTER AUDIT ACTION TYPE DROP TESTS****'
+ update_vbr_flowfilter_pass_audit()
+ print '*****VBR FLOWFILTER AUDIT ACTION TYPE DROP TESTS******'
+ test_vbr_flowfilter_drop_audit()
+ print '******UPDATE VBR FLOWFLTER AUDIT ACTION TYPE PASS TESTS****'
+ update_vbr_flowfilter_drop_audit()
+
else:
print "VBR FLOWFILTER Audit Loaded as Module"
retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
if retval != 0:
- print "VTN Create Failed"
+ print "VBR Create Failed"
exit(1)
retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
if retval != 0:
- print "VTN Create Failed"
+ print "VBR Create Failed"
exit(1)
retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
exit(1)
print "VBR->FLOWFILTER TEST SUCCESS"
-def test_vbrif_flowfilter_1():
+def update_vbrif_flowfilter():
print "CREATE Controller"
retval = controller.add_controller_ex('ControllerFirst')
if retval != 0:
print "Controller Create Failed"
exit(1)
- print "TEST 1 : VBRIF->FLOWFILTER TEST"
+ print "TEST 1 : VBRIF->Update FLOWFILTER TEST"
# Delay for AUDIT
retval=controller.wait_until_state('ControllerFirst', "up")
if retval != 0:
if retval != 0:
print "CONTROLLER delete failed"
exit(1)
- print "VBR->FLOWFILTER TEST SUCCESS"
+ print "VBR->UPDATE FLOWFILTER TEST SUCCESS"
+
+
+def negative_vbrif_flowfilter():
+ 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 "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=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', 'FlowfilterOne')
+ if retval != 0:
+ print "VBRFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOne')
+ if retval != 0:
+ print "VBRFlowFilterEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', '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|VbrIfOne', '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=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOne', 'NegativeFlowfilter')
+ 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', 'FlowfilterOne|NegativeFlowfilter', 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', 'FlowfilterOne')
+ if retval != 0:
+ print "VBRFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VbrOne|VbrIfOne', '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|VbrOne|VbrIfOne', '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_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->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=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->FLOWFILTER TEST SUCCESS"
+
+def update_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->Update FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "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', 'UpdateFlowfilterOne')
+ if retval != 0:
+ print "VBRFIFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneOut|UpdateFlowfilterOne', 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', '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', '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 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_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 update_vbrif_flowfilter_pass():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 4 : VBRIF->Update 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=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=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->UPDATE FLOWFILTER DROP TEST SUCCESS"
+
+def test_vbrif_flowfilter_drop():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 5 : VBRIF->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 "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', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry Create Failed"
+ exit(1)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst', 'FlowfilterOneDrop', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst', 'FlowfilterOneDrop', presence='no', position=0)
+ if retval != 0:
+ print "FlowFilter validation Failed after deleting"
+ exit(1)
+
+ retval=vtn_vbr.delete_vtn('VtnOne')
+ if retval != 0:
+ print "DELETE VTN Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VBR->FLOWFILTER TEST SUCCESS"
+
+def update_vbrif_flowfilter_drop():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 6 : VBRIF->Update 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 "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=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', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry Create Failed"
+ exit(1)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst', 'FlowfilterOneDrop', 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', 'FlowfilterOneDrop', 'UpdateFlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFIFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst','UpdateFlowfilterOneDrop', 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', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', '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 PASS SUCCESS"
+
+
+
+
+# Main Block
+if __name__ == '__main__':
+ print '*****VBR FLOWFILTER IN TESTS******'
+ test_vbrif_flowfilter()
+ print '****** UPDATE FLOWFILTER IN TESTS**********'
+ update_vbrif_flowfilter()
+ print '*****VBR FLOWFILTER PASS TESTS******'
+ test_vbrif_flowfilter_pass()
+ print '****** UPDATE FLOWFILTER DROP TESTS**********'
+ update_vbrif_flowfilter_pass()
+ print '*****VBR FLOWFILTER DROP TESTS******'
+ test_vbrif_flowfilter_drop()
+ print '****** UPDATE FLOWFILTER PASS TESTS**********'
+ update_vbrif_flowfilter_drop()
+ print '*****VBR FLOWFILTER OUT TESTS******'
+ test_vbrif_flowfilter_out()
+ print '*****UPDATE VBR FLOWFILTER OUT TESTS******'
+ update_vbrif_flowfilter_out()
+ print '*****NEGATIVE VBR FLOWFILTER IN TESTS******'
+ negative_vbrif_flowfilter()
+ print '*****NEGATIVE VBR FLOWFILTER OUT TESTS******'
+ negative_vbrif_flowfilter_out()
+
+
-# Main Block
-if __name__ == '__main__':
- print '*****VBR FLOWFILTER TESTS******'
- test_vbrif_flowfilter()
- test_vbrif_flowfilter_1()
else:
print 'VBR_FLOWFILTER LOADED AS MODULE'
exit(1)
print "VBRIF->FLOWFILTER AUDIT TEST SUCCESS"
+def update_vbrif_flowfilter_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 2 : VBRIF->AUDIT Update FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=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=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', 'FlowfilterOne')
+ if retval != 0:
+ print "VBRFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOne')
+ if retval != 0:
+ print "VBRFlowFilterEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', '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|VbrIfOne', '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=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap 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.update_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOne', 'UpdateFlowfilter')
+ if retval != 0:
+ print "VBRFIFlowFilterEntry Update 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|VbrIfOne', 'FlowfilterOne|UpdateFlowfilter', 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', 'FlowfilterOne')
+ if retval != 0:
+ print "VBRFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VbrOne|VbrIfOne', '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|VbrOne|VbrIfOne', '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 AUDIT TEST SUCCESS"
+
+
+def test_vbrif_flowfilter_out_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 7 : VBRIF->AUDIT FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "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 "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_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)
+
+ 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_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)
+ 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|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)
+
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VBR->AUDIT FLOWFILTER TEST SUCCESS"
+
+def update_vbrif_flowfilter_out_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 8 : VBRIF->AUDIT Update FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "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)
+ 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_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', 'UpdateFlowfilterOne')
+ if retval != 0:
+ print "VBRFIFlowFilterEntry Update 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|VbrIfOne', 'FlowfilterOneOut|UpdateFlowfilterOne', 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', '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', '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->AUDIT UPDATE FLOWFILTER TEST SUCCESS"
+
+
+def test_vbrif_flowfilter_pass_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 3 : VBRIF->AUDIT FLOWFILTER PASS TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "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 "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_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)
+ 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_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->AUDIT FLOWFILTER PASS 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=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)
+
+ 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_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)
+
+ 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_vbrif_flowfilter_drop_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 5 : VBRIF->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 "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', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry Create Failed"
+ exit(1)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst', 'FlowfilterOneDrop', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller 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|VbrOne|VbrIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', '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)
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VBR->AUDIT FLOWFILTER TEST SUCCESS"
+
+def update_vbrif_flowfilter_drop_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 6 : VBRIF->Update AUDIT 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 "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)
+ 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_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)
+
+ 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=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', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry Create Failed"
+ exit(1)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst', 'FlowfilterOneDrop', 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', 'FlowfilterOneDrop', 'UpdateFlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFIFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', 'ControllerFirst','UpdateFlowfilterOneDrop', 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', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VbrOne|VbrIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VBRFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VbrOne|VbrIfOne', '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->AUDIT UPDATE FLOWFILTER TEST PASS SUCCESS"
+
+
+
+
+
# Main Block
if __name__ == '__main__':
print '*****VBR FLOWFILTER TESTS******'
test_vbrif_flowfilter_audit()
+ print '****** UPDATE AUDIT FLOWFILTER IN TESTS**********'
+ update_vbrif_flowfilter_audit()
+ print '*****VBR AUDIT FLOWFILTER PASS TESTS******'
+ test_vbrif_flowfilter_pass_audit()
+ print '****** UPDATE AUDIT FLOWFILTER DROP TESTS**********'
+ update_vbrif_flowfilter_pass_audit()
+ print '*****VBR AUDIT FLOWFILTER DROP TESTS******'
+ test_vbrif_flowfilter_drop_audit()
+ print '****** UPDATE AUDIT FLOWFILTER PASS TESTS**********'
+ update_vbrif_flowfilter_drop_audit()
+ print '*****VBR AUDIT FLOWFILTER OUT TESTS******'
+ test_vbrif_flowfilter_out_audit()
+ print '*****UPDATE VBR FLOWFILTER OUT TESTS******'
+ update_vbrif_flowfilter_out_audit()
+
else:
print 'VBR_FLOWFILTER LOADED AS MODULE'
vbrif_add['interface']['if_name']=vbrif_name
vbrif_add['interface']['description']=description
vbrif_add['interface']['admin_status']=admin_status
+ print vbrif_add
+
r = requests.post(url,data=json.dumps(vbrif_add),headers=def_header)
print r.status_code
if r.status_code != resp_code.RESP_CREATE_SUCCESS and r.status_code != resp_code.RESP_CREATE_SUCCESS_U14:
else:
return 0
+def update_vbrif(vtn_blockname,vbr_blockname,vbrif_blockname):
+ test_vtn_name=vtn_testconfig.ReadValues(VTNVBRDATA,vtn_blockname)['vtn_name']
+ vtn_url=vtn_testconfig.ReadValues(VTNVBRDATA,vtn_blockname)['vtn_url']
+ vbr_url=vtn_testconfig.ReadValues(VTNVBRDATA,vbr_blockname)['vbr_url']
+ vbrif_name=vtn_testconfig.ReadValues(VBRIFDATA,vbrif_blockname)['vbrif_name']
+ vbrif_url=vtn_testconfig.ReadValues(VBRIFDATA,vbrif_blockname)['url']
+ updatedescription=vtn_testconfig.ReadValues(VBRIFDATA,vbrif_blockname)['updatedescription']
+ adminstatus=vtn_testconfig.ReadValues(VBRIFDATA,vbrif_blockname)['adminstatus']
+
+ url= coordinator_url + vtn_url + vbr_url + vbrif_url +vbrif_name + '.json'
+ print url
+
+
+ vbrif_add = collections.defaultdict(dict)
+
+ vbrif_add['interface']['if_name']=vbrif_name
+ vbrif_add['interface']['description']=updatedescription
+ vbrif_add['interface']['adminstatus']=adminstatus
+
+ print vbrif_add
+
+ r = requests.put(url,data=json.dumps(vbrif_add),headers=def_header)
+ print r.status_code
+ if r.status_code != resp_code.RESP_UPDATE_SUCCESS and r.status_code != resp_code.RESP_UPDATE_SUCCESS_U14:
+ return 1
+ else:
+ return 0
+
def delete_vbrif(vtn_blockname,vbr_blockname,vbrif_blockname):
test_vtn_name=vtn_testconfig.ReadValues(VTNVBRDATA,vtn_blockname)['vtn_name']
test_controller_port=vtn_testconfig.ReadValues(CONTROLLERDATA,controller_blockname)['port']
test_vtn_url=vtn_testconfig.ReadValues(VTNVBRDATA,vtn_blockname)['vtn_url']
test_vbr_url=vtn_testconfig.ReadValues(VTNVBRDATA,vbr_blockname)['vbr_url']
- test_vbrif_url=vtn_testconfig.ReadValues(VBRIFDATA,'VBRIFURL')['ctr_url']
+ test_vbrif_ctr_url=vtn_testconfig.ReadValues(VBRIFDATA,'VBRIFURL')['ctr_url']
test_vbrif_name=vtn_testconfig.ReadValues(VBRIFDATA,vbrif_blockname)['vbrif_name']
- test_vbrif_admin_status=vtn_testconfig.ReadValues(VBRIFDATA,vbrif_blockname)['admin_status']
+ test_vbrif_adminstatus=vtn_testconfig.ReadValues(VBRIFDATA,vbrif_blockname)['adminstatus']
print test_vbr_url
- url='http://'+test_controller_ipaddr+':'+test_controller_port+controller_url_part+test_vtn_url+test_vbr_url+test_vbrif_url
+ url='http://'+test_controller_ipaddr+':'+test_controller_port+controller_url_part+test_vtn_url+test_vbr_url+test_vbrif_ctr_url
print url
r = requests.get(url,headers=controller_headers,auth=('admin','admin'))
return 0
else:
return 1
+def validate_updatevbrif_at_controller(vtn_blockname, vbr_blockname, vbrif_blockname,
+ controller_blockname, presence="yes",position=0):
+ test_vtn_name=vtn_testconfig.ReadValues(VTNVBRDATA,vtn_blockname)['vtn_name']
+ test_vbr_name=vtn_testconfig.ReadValues(VTNVBRDATA,vbr_blockname)['vbr_name']
+ test_controller_ipaddr=vtn_testconfig.ReadValues(CONTROLLERDATA,controller_blockname)['ipaddr']
+ test_controller_port=vtn_testconfig.ReadValues(CONTROLLERDATA,controller_blockname)['port']
+ test_vtn_url=vtn_testconfig.ReadValues(VTNVBRDATA,vtn_blockname)['vtn_url']
+ test_vbr_url=vtn_testconfig.ReadValues(VTNVBRDATA,vbr_blockname)['vbr_url']
+ test_vbrif_ctr_url=vtn_testconfig.ReadValues(VBRIFDATA,'VBRIFURL')['ctr_url']
+ test_vbrif_name=vtn_testconfig.ReadValues(VBRIFDATA,vbrif_blockname)['vbrif_name']
+ test_vbrif_adminstatus=vtn_testconfig.ReadValues(VBRIFDATA,vbrif_blockname)['adminstatus']
+ print test_vbr_url
+ url='http://'+test_controller_ipaddr+':'+test_controller_port+controller_url_part+test_vtn_url+test_vbr_url+test_vbrif_ctr_url
+ print url
+ r = requests.get(url,headers=controller_headers,auth=('admin','admin'))
+ print r.status_code
+
+ if presence == "no":
+ if r.status_code == resp_code.RESP_NOT_FOUND:
+ return 0
+
+ if r.status_code != resp_code.RESP_GET_SUCCESS:
+ return 1
+ data=json.loads(r.content)
+ print data
+ if presence == "no":
+ print data['interface']
+ if data['interface'] == []:
+ return 0
+ print position
+ vtn_content=data['interface'][position]
+ print vtn_content
+
+ print "ENABLED Value"
+ print vtn_content['enabled']
+ print "Test Value"
+ print test_vbrif_adminstatus
+ if vtn_content == None:
+ if presence == "yes":
+ return 0
+ else:
+ return 1
+
+ if vtn_content['enabled'] != test_vbrif_adminstatus:
+ if presence == "yes":
+ return 0
+ else:
+ return 1
+ else:
+ if presence == "yes":
+ return 0
+ else:
+ return 1
+
def create_portmap(vtn_blockname,vbr_blockname,vbrif_blockname,vlan_tagged=1):
test_vtn_name=vtn_testconfig.ReadValues(VTNVBRDATA,vtn_blockname)['vtn_name']
vtn_url=vtn_testconfig.ReadValues(VTNVBRDATA,vtn_blockname)['vtn_url']
if retval != 0:
print "VBRIF Create Failed"
exit(1)
+
retval=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','VbrOne','ControllerFirst')
if retval != 0:
print "After Create VBR Validate Failed"
if retval != 0:
print "VBRIFONE Create Failed"
exit(1)
+
+
+
retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',position=0)
if retval != 0:
print "VBRIFONE Validate Failed"
if retval != 0:
print "VBRIFTWO Create Failed"
exit(1)
+
+
retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfTwo','ControllerFirst',position=1)
if retval != 0:
print "VBRIFTWO Validate Failed"
- exit(1)
+ exit (1)
retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
if retval != 0:
if retval != 0:
print "VBRIFONE Create Failed"
exit(1)
+
+
retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
if retval != 0:
print "VBRIFONE Validate Failed"
if retval != 0:
print "VBRIFTWO Validate Failed"
exit(1)
-
retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',position=0)
if retval != 0:
print "VBRONE Validate Failed"
print "VTN1->VBR1->VBRIF1 Validate Failed"
exit(1)
+
+
retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
if retval != 0:
print "VTN1->VBR1 Validate Failed"
if retval != 0:
print "VBRIF1 Validate Failed"
exit(1)
-
retval=create_vbrif('VtnOne','VbrOne','VbrIfThree')
if retval != 0:
print "VBRIF3 Create Failed"
exit(1)
-
retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfThree','ControllerFirst',position=1)
if retval != 0:
print "VBRIF3 Validate Failed"
exit(1)
-
retval=create_vbrif('VtnOne','VbrTwo','VbrIfOne')
if retval != 0:
print "VBR2->VBRIF1 Create Failed"
if retval != 0:
print "VBR2->VBRIF2 Validate Failed"
exit(1)
-
retval=create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
if retval != 0:
print "VBR2->VBRIF2 Create Failed"
if retval != 0:
print "VBR2->VBRIF2 Validate Failed"
exit(1)
-
retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',position=0)
if retval != 0:
print "VBRONE Validate Failed"
exit(1)
print "VTN1->VBR1->VBRIF1/VBRIF3 AND VTN1->VBR2->VBRIF1/VBRIF2 TEST SUCCESS"
-###PORTMAP####
def test_vtn_vbr_vbrif_portmap():
print "CREATE Controller"
if retval != 0:
print "VBRIF Create Failed"
exit(1)
+
retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
if retval != 0:
print "After Create VBRIF Validate Failed"
exit(1)
+
retval=create_portmap('VtnOne','VbrOne','VbrIfOne');
if retval != 0:
print "Portmap Create Failed"
exit(1)
-
+
retval=validate_vbrif_portmap_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',presence="yes");
if retval != 0:
print "Portmap Validate Failed"
if retval != 0:
print "VBRIF2 Create Failed"
exit(1)
+
retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',position=0)
if retval != 0:
if retval != 0:
print "After Create VBRIF2 Validate Failed"
exit(1)
-
retval=create_portmap('VtnOne','VbrOne','VbrIfOne');
if retval != 0:
print "VBRIF1 Portmap Create Failed"
retval=create_vbrif('VtnTwo','VbrTwo','VbrIfTwo')
if retval != 0:
print "VBRIF2 Create Failed"
- exit(1)
+ exit(1)
retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',position=0)
if retval != 0:
if retval != 0:
print "VBRIF4 Create Failed"
exit(1)
-
+
retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',position=0)
if retval != 0:
print "After Create VBRIF1 Validate Failed"
if retval != 0:
print "After Create VBRIF4 Validate Failed"
exit(1)
-
retval=create_portmap('VtnOne','VbrOne','VbrIfOne');
if retval != 0:
print "VBRIF1 Portmap Create Failed"
exit(1)
print "VTN1->VBR1->VBRIF1/VBRIF2->PORTMAP AND VTN2->VBR2->VBRIF3/VBRIF4->PORTMAP TEST SUCCESS"
+
+def test_vbrif_update():
+
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "TEST 12 :Controller Create Failed"
+ exit(1)
+ print "UPDATE TEST : VTenant with one VBridge one VBRIF"
+ print "TEST : VTenant with one VBridge one VBRIF UPDATE SCENARIO"
+ # Delay for AUDIT
+ time.sleep(15)
+ 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=create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=update_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Update Failed"
+ exit(1)
+
+
+ retval=validate_updatevbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After update VBRIF 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_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval = delete_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Delete Failed"
+ exit(1)
+
+ retval=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 Update TEST SUCCESS"
+
+
+def test_vbrif_update_portmap():
+
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "TEST 13 :Controller Create Failed"
+ exit(1)
+
+ print "TEST 13 : VTenant with one VBridge one VBRIF and One UPDATE PORTMAP"
+ # Delay for AUDIT
+ time.sleep(15)
+ 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=create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=validate_vbrif_portmap_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',presence="yes");
+ if retval != 0:
+ print "Portmap Validate Failed"
+ exit(1)
+
+ retval=update_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Update Failed"
+ exit(1)
+
+ retval=validate_updatevbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Update VBRIF 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_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=delete_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Delete Failed"
+ exit(1)
+
+ retval=validate_vbrif_portmap_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',presence="no");
+ if retval != 0:
+ print "After Delete Portmap Validate Failed"
+ exit(1)
+
+ retval = delete_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Delete Failed"
+ exit(1)
+
+ retval=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->Update PORTMAP TEST SUCCESS"
+
+
# Main Block
if __name__ == '__main__':
print '*****VBRIF TESTS******'
test_vtn_multi_vbr_single_vbrif_portmap()
test_multi_vtn_vbr_vbrif_portmap()
test_vtn_vbr_multiple_vbrif_portmap()
-
+ test_vbrif_update()
+ test_vbrif_update_portmap()
+
else:
print "VBRIF_PORTMAP Loaded as Module"
CONTROLLERDATA=vtn_testconfig.CONTROLLERDATA
-#####AUDIT TEST CASE#################
def test_audit_vtn_vbr_vbrif():
exit(1)
print "VTN1->VBR1->VBRIF1->PORTMAP(DELETE) AND VTN1->VBR1->VBRIF2->PORTMAP(CREATE) AUDIT TEST SUCCESS"
+##### AUDIT Test cases ####################
+
+def test_audit_multi_vbr_vbrif():
+
+ print "CREATE Controller"
+ print "VTNONE->VBRONE->VBRIFONE"
+ print "VTNONE->VBRTWO->VBRIFTWO"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "TEST 3 :Controller Create Failed"
+ exit(1)
+
+ print "TEST 7 : One vtn and Two VBridges with One Interfaces each"
+ # 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 "VBRONE Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VBRTWO 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','VbrTwo','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=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',position=0)
+ if retval != 0:
+ print "VBRONE Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst',position=1)
+ if retval != 0:
+ print "VBRTWO 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.delete_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBR1->VBRIFONE Delete Failed"
+ exit(1)
+
+ retval =vbrif_portmap.delete_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBR1->VBRIFTWO Delete 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','VbrTwo')
+ if retval != 0:
+ print "VBR2/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_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no",position=0)
+ if retval != 0:
+ print "VBR1/VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst',presence="no",position=1)
+ if retval != 0:
+ print "VBR2/VTN 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 "VTN1->VBR1->VBRIF1 AND VTN1->VBR2->VBRIF2 TEST SUCCESS"
+
+def test_audit_multi_vtn_vbr_vbrif():
+
+ print "TEST 8 :CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 8 : Two Vtn and Two Vbridges one Interfaces each "
+ # 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 "VTN1 Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnTwo')
+ if retval != 0:
+ print "VTN2 Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN1->VBR1 Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VTN1->VBR1->VBRIF1 Create Failed"
+ exit(1)
+
+
+ retval=vtn_vbr.create_vbr('VtnTwo','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN1->VBR2 Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnTwo','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VTN2->VBR2->VBRIF2 Create Failed"
+ exit(1)
+
+
+
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN1->VBR1 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN2->VBR2 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',position=0)
+ if retval != 0:
+ print "After Create VTN1 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerFirst',position=1)
+ if retval != 0:
+ print "After Create VTN1 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_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VTN1->VBR1->VBRIF1 Delete Failed"
+ exit(1)
+
+ retval = vbrif_portmap.delete_vbrif('VtnTwo','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VTN2->VBR2->VBRIF2 Delete Failed"
+ exit(1)
+
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN1->VBR1 Validate Failed"
+ exit(1)
+
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN2->VBR2 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',position=0)
+ if retval != 0:
+ print "Before VBR1 Delete VTN1 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerFirst',position=1)
+ if retval != 0:
+ print "Before VBR2 Delete VTN2 Validate Failed"
+ exit(1)
+
+ retval = vtn_vbr.delete_vbr('VtnOne','VbrOne')
+ if retval != 0:
+ print "VTN1->VBR1 Delete Failed"
+ exit(1)
+
+ retval = vtn_vbr.delete_vbr('VtnTwo','VbrTwo')
+ if retval != 0:
+ print "VTN2->VBR2 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_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no")
+ if retval != 0:
+ print "VTN1->VBR1 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrTwo','ControllerFirst',presence="no")
+ if retval != 0:
+ print "VTN2->VBR2 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no",position=0)
+ if retval != 0:
+ print "After VBR1 Delete VTN1 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerFirst',presence="no",position=1)
+ if retval != 0:
+ print "After VBR1 Delete VTN1 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)
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VTN1->VBR1->VBRIF1 and VTN2->VBR2->VBRIF2 TEST SUCCESS"
+
+def test_audit_vtn_multi_vbr_single_vbrif_portmap():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "TEST 9 :Controller Create Failed"
+ exit(1)
+
+ print "TEST 9 : VTenant with Two VBridge Two VBRIF and One PORTMAP each"
+ # Delay for AUDIT
+
+ retval = controller.wait_until_state('ControllerFirst',"up")
+ if retval != 0:
+ print "controller state change 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_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','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VBR2 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','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF2 Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "VBRIF1 Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','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','VbrIfOne','ControllerFirst',presence="yes",position=0);
+ if retval != 0:
+ print "VBRIF1 Portmap Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne','VbrTwo','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_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst',position=1)
+ 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','VbrIfOne');
+ 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_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "VbrIfTwo Portmap Delete Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne','VbrTwo','VbrIfTwo','ControllerFirst',presence="no",position=0);
+ if retval != 0:
+ print "After Delete VBRIF2 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','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF2 Delete 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','VbrTwo')
+ if retval != 0:
+ print "VBR/VTN Delete Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no",position=0)
+ if retval != 0:
+ print "After Delete VBR1 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrTwo','ControllerFirst',presence="no",position=1)
+ 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 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 AND VTN1->VBR2->VBRIF2->PORTMAP TEST SUCCESS"
+
+def test_audit_multi_vtn_vbr_vbrif_portmap():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "TEST 10 :Controller Create Failed"
+ exit(1)
+
+ print "TEST 10 : Two VTenant with Two VBridge Two VBRIF and One PORTMAP each"
+ # 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_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','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VBR2 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('VtnTwo','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF2 Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "VBRIF1 Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnTwo','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "VBRIF2 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)
+
+ retval=vbrif_portmap.validate_vbrif_portmap_at_controller('VtnTwo','VbrTwo','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_vbr_at_controller('VtnTwo','VbrTwo','ControllerFirst',position=0)
+ if retval != 0:
+ print "After Create VBR1 Validate 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)
+
+ 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.delete_portmap('VtnTwo','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "VbrIfTwo Portmap Delete 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('VtnTwo','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF2 Delete 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('VtnTwo','VbrTwo')
+ if retval != 0:
+ print "VBR/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_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst',presence="no",position=0)
+ if retval != 0:
+ print "After Delete VBR1 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnTwo','VbrTwo','ControllerFirst',presence="no",position=0)
+ if retval != 0:
+ print "After Delete VBR2 Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst',presence="no",position=0)
+ if retval != 0:
+ print "VTN1 Validate Failed after VBR Deleted"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnTwo','ControllerFirst',presence="no",position=1)
+ if retval != 0:
+ print "VTN2 Validate Failed after VBR Deleted"
+ 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 "CONTROLLER delete failed"
+ exit(1)
+ print "VTN1->VBR1->VBRIF1->PORTMAP AND VTN2->VBR2->VBRIF2->PORTMAP TEST SUCCESS"
+
+def test_audit_vbrif_update():
+
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "TEST 11 :Controller Create Failed"
+ exit(1)
+ print "UPDATE TEST : VTenant with one VBridge one VBRIF"
+ print "TEST : VTenant with one VBridge one VBRIF UPDATE SCENARIO"
+ # 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=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF 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.update_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Update Failed"
+ exit(1)
+
+
+ retval=vbrif_portmap.validate_updatevbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After update VBRIF Validate 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_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)
+
+ retval = vbrif_portmap.delete_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Delete 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 Update TEST SUCCESS"
+
+
+def test_audit_vbrif_update_portmap():
+
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "TEST 13 :Controller Create Failed"
+ exit(1)
+
+ print "TEST 12 : VTenant with one VBridge one VBRIF and One UPDATE PORTMAP"
+ # Delay for AUDIT
+
+ retval = controller.wait_until_state('ControllerFirst',"up")
+ if retval != 0:
+ print "controller state change 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_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=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ 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=vbrif_portmap.update_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Update Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_updatevbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Update VBRIF 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_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.delete_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Delete Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_portmap_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',presence="no");
+ if retval != 0:
+ print "After Delete Portmap Validate Failed"
+ exit(1)
+
+ retval = vbrif_portmap.delete_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Delete 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->Update PORTMAP TEST SUCCESS"
+
+
+
# Main Block
if __name__ == '__main__':
test_audit_vtn_vbr_vbrif_portmap()
test_audit_vtn_multi_vbr_vbrif_portmap()
test_audit_vtn_vbr_multi_vbrif_portmap()
+ test_audit_multi_vbr_vbrif()
+ test_audit_multi_vtn_vbr_vbrif()
+ test_audit_vtn_multi_vbr_single_vbrif_portmap()
+ test_audit_multi_vtn_vbr_vbrif_portmap()
+ test_audit_vbrif_update()
+ test_audit_vbrif_update_portmap()
+
+
+
+
else:
print "VTN VBR Loaded as Module"
exit(1)
print "VTERM->FLOWFILTER TEST SUCCESS"
-def test_vtermif_flowfilter_1():
+def update_vtermif_flowfilter():
print "CREATE Controller"
retval = controller.add_controller_ex('ControllerFirst')
if retval != 0:
print "Controller Create Failed"
exit(1)
- print "TEST 2 : VTERMIF->FLOWFILTER TEST"
+ print "TEST 2 : VTERMIF->UPDATE FLOWFILTER TEST"
# Delay for AUDIT
retval=controller.wait_until_state('ControllerFirst', "up")
if retval != 0:
if retval != 0:
print "CONTROLLER delete failed"
exit(1)
- print "VTERMIF->FLOWFILTER TEST SUCCESS"
+ print "VTERMIF->UPDATE FLOWFILTER TEST SUCCESS"
+
+def negative_vtermif_flowfilter():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 2 : VTERMIF->NEGATIVE UPDATE FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree','VbrIfThree')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
+ if retval != 0:
+ print "VTERM Create Failed"
+ exit(1)
+
+ retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
+ if retval != 0:
+ print "VTERMIF Create Failed"
+ exit(1)
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+
+ retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMFlowFilterEntry Validation at Co-ordinator Failed "
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOne', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne', 'NegativeFlowfilter')
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Negative Update at priority and dscp has Failed"
+ print "Because priority range should be >63 and dscp also >7 so its showing Bad command "
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne|NegativeFlowfilter', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Negative Updatation Validate Failed at Co-ordinator"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOne', presence='no', position=0)
+ if retval != 0:
+ print "FlowFilter validation Failed after deleting"
+ exit(1)
+
+ retval=vtn_vbr.delete_vtn('VtnOne')
+ if retval != 0:
+ print "DELETE VTN Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VTERMIF->UPDATE NEGATIVE FLOWFILTER TEST FAILD"
+
+def test_vtermif_flowfilter_out():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 1 : VTERMIF->FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.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 = 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', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMFlowFilterEntry Validation at Co-ordinator Failed "
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOneOut', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', '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 "VTERM->FLOWFILTER TEST SUCCESS"
+
+def update_vtermif_flowfilter_out():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 2 : VTERMIF->UPDATE FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree','VbrIfThree')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
+ if retval != 0:
+ print "VTERM Create Failed"
+ exit(1)
+
+ retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
+ if retval != 0:
+ print "VTERMIF Create Failed"
+ exit(1)
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+
+ retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMFlowFilterEntry Validation at Co-ordinator Failed "
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOneOut', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut', 'UpdateFlowfilterOne')
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut|UpdateFlowfilterOne', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Updatation Validate Failed at Co-ordinator"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', '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 "VTERMIF->UPDATE FLOWFILTER TEST SUCCESS"
+
+def negative_vtermif_flowfilter_out():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 2 : VTERMIF->NEGATIVE UPDATE FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree','VbrIfThree')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
+ if retval != 0:
+ print "VTERM Create Failed"
+ exit(1)
+
+ retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
+ if retval != 0:
+ print "VTERMIF Create Failed"
+ exit(1)
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+
+ retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMFlowFilterEntry Validation at Co-ordinator Failed "
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOneOut', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut', 'NegativeFlowfilterOne')
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Negative Update at priority and dscp has Failed"
+ print "Because priority range should be >63 and dscp also >7 so its showing Bad command "
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut|NegativeFlowfilterOne', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Negative Updatation Validate Failed at Co-ordinator"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', '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 "VTERMIF->UPDATE NEGATIVE FLOWFILTER TEST FAILD"
+
+
+def test_vtermif_flowfilter_pass():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 1 : VTERMIF->FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.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', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+
+
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', '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 "VTERM->FLOWFILTER TEST SUCCESS"
+
+def update_vtermif_flowfilter_pass():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 2 : VTERMIF->UPDATE FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree','VbrIfThree')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
+ if retval != 0:
+ print "VTERM Create Failed"
+ exit(1)
+
+ retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
+ if retval != 0:
+ print "VTERMIF Create Failed"
+ exit(1)
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+
+ retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+
+ # retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass', presence='yes', position=0)
+ #if retval != 0:
+ # print "VTERMFlowFilterEntry Validation at Co-ordinator Failed "
+ # exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOnePass', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass', 'UpdateFlowfilterOnePass')
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst','UpdateFlowfilterOnePass', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Updatation Validate Failed at Co-ordinator"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', '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 "VTERMIF->UPDATE FLOWFILTER TEST SUCCESS"
+
+
+def test_vtermif_flowfilter_drop():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 1 : VTERMIF->FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.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)
+
+
+
+ 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=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', '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 "VTERM->FLOWFILTER TEST SUCCESS"
+
+def update_vtermif_flowfilter_drop():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 2 : VTERMIF->UPDATE FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree','VbrIfThree')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
+ if retval != 0:
+ print "VTERM Create Failed"
+ exit(1)
+
+ retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
+ if retval != 0:
+ print "VTERMIF Create Failed"
+ exit(1)
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+
+ retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', '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)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOneDrop', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneDrop', 'UpdateFlowfilterOneDrop')
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst','UpdateFlowfilterOneDrop', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Updatation Validate Failed at Co-ordinator"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', '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=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', '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 "VTERMIF->UPDATE FLOWFILTER TEST SUCCESS"
+
+
+
+
+
+
# Main Block
if __name__ == '__main__':
print '*****VTERMIF FLOWFILTER TESTS******'
test_vtermif_flowfilter()
- test_vtermif_flowfilter_1()
+ print '*********UPDATE FLOWFILTER TESTS***'
+ update_vtermif_flowfilter()
+ print '*****VTERMIF FLOWFILTER PASS TESTS******'
+ test_vtermif_flowfilter_pass()
+ print '*********UPDATE FLOWFILTER PASS TESTS***'
+ update_vtermif_flowfilter_pass()
+ print '*****VTERMIF FLOWFILTER DROP TESTS******'
+ test_vtermif_flowfilter_drop()
+ print '*********UPDATE FLOWFILTER DROP TESTS***'
+ update_vtermif_flowfilter_drop()
+ print '*****VTERMIF OUT FLOWFILTER TESTS******'
+ test_vtermif_flowfilter_out()
+ print '*********UPDATE OUT FLOWFILTER TESTS***'
+ update_vtermif_flowfilter_out()
+ print '******NEGATIVE FLOWFILTER TESTS****'
+ negative_vtermif_flowfilter()
+ print '******NEGATIVE OUT FLOWFILTER TESTS****'
+ negative_vtermif_flowfilter_out()
else:
print 'VTERMIF_FLOWFILTER LOADED AS MODULE'
print "CONTROLLER delete failed"
exit(1)
print "VTERM->FLOWFILTER AUDIT TEST SUCCESS"
+def update_vtermif_flowfilter_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 2 : VTERMIF->UPDATE 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.create_vbr('VtnOne','VbrThree','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree','VbrIfThree')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ 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_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
+ if retval != 0:
+ print "VTERM Create Failed"
+ exit(1)
+
+ retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
+ if retval != 0:
+ print "VTERMIF Create Failed"
+ exit(1)
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+
+ retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMFlowFilterEntry Validation at Co-ordinator Failed "
+ exit(1)
+
+ 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|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOne', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne', 'UpdateFlowfilter')
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne|UpdateFlowfilter', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Updatation Validate Failed at Co-ordinator"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOne')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOne', presence='no', position=0)
+ if retval != 0:
+ print "FlowFilter validation Failed after deleting"
+ exit(1)
+
+ retval=vtn_vbr.delete_vtn('VtnOne')
+ if retval != 0:
+ print "DELETE VTN Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst', presence='no')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VTERMIF->AUDIT UPDATE FLOWFILTER TEST SUCCESS"
+
+def test_vtermif_flowfilter_out_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 7 : 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 = 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', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ 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.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMFlowFilterEntry Validation at Co-ordinator 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|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOneOut', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', '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 "VTERM->AUDIT FLOWFILTER TEST SUCCESS"
+
+def update_vtermif_flowfilter_out_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 8 : VTERMIF->AUDIT UPDATE FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "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 "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_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree','VbrIfThree')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+ 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_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
+ if retval != 0:
+ print "VTERM Create Failed"
+ exit(1)
+
+ retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
+ if retval != 0:
+ print "VTERMIF Create Failed"
+ exit(1)
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+
+ retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMFlowFilterEntry Validation at Co-ordinator Failed "
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOneOut', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut', 'UpdateFlowfilterOne')
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut|UpdateFlowfilterOne', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Updatation Validate Failed at Co-ordinator"
+ 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', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneOut')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+# retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', '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)
+
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VTERMIF->AUDIT UPDATE FLOWFILTER TEST SUCCESS"
+
+def test_vtermif_flowfilter_pass_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 3 : VTERMIF->AUDIT FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "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 "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_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)
+ 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_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', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+
+
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', '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 "VTERM->FLOWFILTER TEST SUCCESS"
+
+def update_vtermif_flowfilter_pass_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 4 : VTERMIF->AUDIT UPDATE FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree','VbrIfThree')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
+ if retval != 0:
+ print "VTERM Create Failed"
+ exit(1)
+
+ retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
+ if retval != 0:
+ print "VTERMIF Create Failed"
+ exit(1)
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+
+ retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOnePass', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller 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.update_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass', 'UpdateFlowfilterOnePass')
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Update 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|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst','UpdateFlowfilterOnePass', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Updatation Validate Failed at Co-ordinator"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOnePass')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', '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 "VTERMIF->AUDIT UPDATE FLOWFILTER TEST SUCCESS"
+
+
+def test_vtermif_flowfilter_drop_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 5 : VTERMIF->AUDIT FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrOne','VbrIfOne')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
+ if retval != 0:
+ print "VTERM Create Failed"
+ exit(1)
+
+ retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
+ if retval != 0:
+ print "VTERMIF Create Failed"
+ exit(1)
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+
+ retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VTERMFlowFilter Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VTERMFlowFilterEntry Create Failed"
+ exit(1)
+ print "****UPDATE Controller IP to invalid****"
+ test_invalid_ipaddr= vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerFirst')['invalid_ipaddr']
+ retval = controller.update_controller_ex('ControllerFirst',ipaddr=test_invalid_ipaddr)
+ if retval != 0:
+ print "controller invalid_ip update failed"
+ exit(1)
+ # Delay for AUDIT
+ retval = controller.wait_until_state('ControllerFirst',"down")
+ if retval != 0:
+ print "controller state change failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VTERMFlowFilterEntry deletete Failed"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneDrop')
+ if retval != 0:
+ print "VTERMFlowFilter deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlistentry('FlowlistOne', 'FlowlistentryOne')
+ if retval != 0:
+ print "FlowilistEntry deletete Failed"
+ exit(1)
+
+ retval=flowlistentry.delete_flowlist('FlowlistOne')
+ if retval != 0:
+ print "Flowilist deletete Failed"
+ exit(1)
+
+
+ retval=vtn_vbr.delete_vtn('VtnOne')
+ if retval != 0:
+ print "DELETE VTN Failed"
+ exit(1)
+
+
+ print "DELETE CONTROLLER"
+ retval=controller.delete_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "CONTROLLER delete failed"
+ exit(1)
+ print "VTERM->AUDIT FLOWFILTER TEST SUCCESS"
+
+def update_vtermif_flowfilter_drop_audit():
+ print "CREATE Controller"
+ retval = controller.add_controller_ex('ControllerFirst')
+ if retval != 0:
+ print "Controller Create Failed"
+ exit(1)
+
+ print "TEST 6 : VTERMIF->AUDIT UPDATE FLOWFILTER TEST"
+ # Delay for AUDIT
+ retval=controller.wait_until_state('ControllerFirst', "up")
+ if retval != 0:
+ print "Controller state check Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vtn('VtnOne')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+ 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)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrTwo','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ retval=vtn_vbr.create_vbr('VtnOne','VbrThree','ControllerFirst')
+ if retval != 0:
+ print "VTN Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_vbrif('VtnOne','VbrThree','VbrIfThree')
+ if retval != 0:
+ print "VBRIF Create Failed"
+ exit(1)
+
+ 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_vbr.validate_vtn_at_controller('VtnOne','ControllerFirst')
+ if retval != 0:
+ print "VTN Validate Failed"
+ exit(1)
+
+ retval=vtn_vbr.validate_vbr_at_controller('VtnOne','VbrOne','ControllerFirst')
+ if retval != 0:
+ print "VBR Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst')
+ if retval != 0:
+ print "After Create VBRIF Validate Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrOne','VbrIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrTwo','VbrIfTwo');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=vbrif_portmap.create_portmap('VtnOne','VbrThree','VbrIfThree');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval = vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
+ if retval != 0:
+ print "VTERM Create Failed"
+ exit(1)
+
+ retval = vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
+ if retval != 0:
+ print "VTERMIF Create Failed"
+ exit(1)
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+
+ retval = vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
+ if retval != 0:
+ print "Portmap Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlist('FlowlistOne')
+ if retval != 0:
+ print "FlowList Create Failed"
+ exit(1)
+
+ retval=flowlistentry.create_flowlistentry('FlowlistOne', 'FlowlistentryOne','ControllerFirst')
+ if retval != 0:
+ print "FlowlistEntry Create Failed"
+ exit(1)
+
+ retval=flowfilter.create_flowfilter('VtnOne|VTermOne|VbrIfOne|VTermIfOne', '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)
+
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst', 'FlowfilterOneDrop', presence='yes', position=0)
+ if retval != 0:
+ print "FlowFilter validation at Controller Failed"
+ exit(1)
+
+ retval=flowfilter.update_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'FlowfilterOneDrop', 'UpdateFlowfilterOneDrop')
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Update Failed"
+ exit(1)
+
+ retval=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', 'ControllerFirst','UpdateFlowfilterOneDrop', presence='yes', position=0)
+ if retval != 0:
+ print "VTERMIFFlowFilterEntry Updatation Validate Failed at Co-ordinator"
+ exit(1)
+
+ retval=flowfilter.delete_flowfilter_entry('VtnOne|VTermOne|VbrIfOne|VTermIfOne', '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=flowfilter.validate_flowfilter_at_controller('VtnOne|VTermOne|VbrIfOne|VTermIfOne', '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 "VTERMIF->AUDIT UPDATE FLOWFILTER TEST SUCCESS"
+
+
+
+
+
# Main Block
if __name__ == '__main__':
print '*****VTERM FLOWFILTER TESTS******'
test_vtermif_flowfilter_audit()
+ print '*********UPDATE AUDIT FLOWFILTER TESTS***'
+ update_vtermif_flowfilter_audit()
+ print '*****VTERMIF AUDIT FLOWFILTER PASS TESTS******'
+ test_vtermif_flowfilter_pass_audit()
+ print '*********UPDATE AUDIT FLOWFILTER PASS TESTS***'
+ update_vtermif_flowfilter_pass_audit()
+ print '*****VTERMIF AUDIT FLOWFILTER DROP TESTS******'
+ test_vtermif_flowfilter_drop_audit()
+ print '*********UPDATE AUDIT FLOWFILTER DROP TESTS***'
+ update_vtermif_flowfilter_drop_audit()
+ print '*****VTERMIF AUDIT OUT FLOWFILTER TESTS******'
+ test_vtermif_flowfilter_out_audit()
+ print '*********UPDATE AUDIT OUT FLOWFILTER TESTS***'
+ update_vtermif_flowfilter_out_audit()
+
+
+
else:
print 'VTERM_FLOWFILTER LOADED AS MODULE'
test_vterm_url = vtn_testconfig.ReadValues(VTNVTERMDATA,vterm_blockname)['vterm_url']
test_vtermif_url = vtn_testconfig.ReadValues(VTERMIFDATA,'VTERMIFURL')['ctr_url']
test_vtermif_name = vtn_testconfig.ReadValues(VTERMIFDATA,vtermif_blockname)['vtermif_name']
- test_vtermif_admin_status = vtn_testconfig.ReadValues(VTERMIFDATA,vtermif_blockname)['admin_status']
+ test_vtermif_adminstatus = vtn_testconfig.ReadValues(VTERMIFDATA,vtermif_blockname)['adminstatus']
print test_vterm_url
url = 'http://'+test_controller_ipaddr+':'+test_controller_port+controller_url_part+test_vtn_url+test_vterm_url+test_vtermif_url
print url
return 1
-
def create_portmap(vtn_blockname,vterm_blockname,vtermif_blockname,vlan_tagged = 1):
test_vtn_name = vtn_testconfig.ReadValues(VTNVTERMDATA,vtn_blockname)['vtn_name']
vtn_url = vtn_testconfig.ReadValues(VTNVTERMDATA,vtn_blockname)['vtn_url']
exit(1)
print "VTN1->VTERM1->VTERMIF1 and VTN2->VTERM2->VTERMIF2 TEST SUCCESS"
-###PORTMAP####
def test_vtn_vterm_vtermif_portmap():
print "CREATE Controller"
exit(1)
print "VTN1->VTERM1->VTERMIF1->PORTMAP AND VTN2->VTERM2->VTERMIF2->PORTMAP TEST SUCCESS"
+
# Main Block
if __name__ == '__main__':
print '*****VTERMIF TESTS******'
test_vtn_vterm_vtermif_portmap()
test_vtn_multi_vterm_single_vtermif_portmap()
test_multi_vtn_vterm_vtermif_portmap()
+
+
else:
print "VTERMIF_PORTMAP Loaded as Module"
CONTROLLERDATA=vtn_testconfig.CONTROLLERDATA
-#####AUDIT TEST CASE#################
def test_audit_vtn_vterm_vtermif():
print "CREATE Controller"
retval = controller.add_controller_ex('ControllerFirst')
if retval != 0:
- print "TEST 1 :Controller Create Failed"
- exit(1)
+ print "TEST 1 :Controller Create Failed"
+ exit(1)
print "TEST 1: Test Audit VTenant with one VTerminal one VTERMIF"
# Delay for AUDIT
retval=vtn_vterm.create_vtn('VtnOne')
if retval != 0:
- print "VTN Create Failed"
- exit(1)
+ print "VTN Create Failed"
+ exit(1)
retval=vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
if retval != 0:
- print "VTERM Create Failed"
- exit(1)
+ print "VTERM Create Failed"
+ exit(1)
retval=vtn_vterm.validate_vterm_at_controller('VtnOne','VTermOne','ControllerFirst')
if retval != 0:
- print "After Create VTERM Validate Failed"
- exit(1)
+ 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)
+ 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)
+ print "controller invalid_ip update failed"
+ exit(1)
# Delay for AUDIT
retval = controller.wait_until_state('ControllerFirst',"down")
exit(1)
retval=vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
if retval != 0:
- print "VTERMIF Create Failed"
- exit(1)
+ print "VTERMIF 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)
+ print "controller valid_ip update failed"
+ exit(1)
# Delay for AUDIT
retval = controller.wait_until_state('ControllerFirst',"up")
if retval != 0:
retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermOne','VTermIfOne','ControllerFirst')
if retval != 0:
- print "After Create VTERMIF Validate Failed"
- exit(1)
+ print "After Create VTERMIF Validate Failed"
+ exit(1)
retval = vtermif_portmap.delete_vtermif('VtnOne','VTermOne','VTermIfOne')
if retval != 0:
- print "VTERMIF Delete Failed"
- exit(1)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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 "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 "CONTROLLER delete failed"
+ exit(1)
print "VTN->VTERM->VTERMIF AUDIT TEST SUCCESS"
def test_audit_vtn_multi_vterm_vtermif():
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 :Controller Create Failed"
+ exit(1)
print "TEST 3 : Audit One vtn and Two VTerminals with Two Interfaces each"
# Delay for AUDIT
exit(1)
retval=vtn_vterm.create_vtn('VtnOne')
if retval != 0:
- print "VTN Create Failed"
- exit(1)
+ print "VTN Create Failed"
+ exit(1)
retval=vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
if retval != 0:
- print "VTERM1 Create Failed"
- exit(1)
+ print "VTERM1 Create Failed"
+ exit(1)
retval=vtn_vterm.create_vterm('VtnOne','VTermTwo','ControllerFirst')
if retval != 0:
- print "VTERM2 Create Failed"
- exit(1)
+ print "VTERM2 Create Failed"
+ exit(1)
retval=vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
if retval != 0:
- print "VTERMIF1 Create Failed"
- exit(1)
+ 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)
+ print "VTERMIF1 Validate Failed"
+ exit(1)
retval=vtermif_portmap.create_vtermif('VtnOne','VTermTwo','VTermIfOne')
if retval != 0:
- print "VTERM2->VTERMIF1 Create Failed"
- exit(1)
+ 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 "VTERM2->VTERMIF2 Validate Failed"
+ exit(1)
print "****UPDATE Controller IP to invalid****"
test_invalid_ipaddr=vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerFirst')['invalid_ipaddr']
retval = vtermif_portmap.delete_vtermif('VtnOne','VTermOne','VTermIfOne')
if retval != 0:
- print "VTERM1->VTERMIF1 Delete Failed"
- exit(1)
+ 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)
+ print "VTERM2->VTERMIF1 Delete Failed"
+ exit(1)
retval=vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfThree')
if retval != 0:
- print "VTERMIF3 Create Failed"
- exit(1)
+ 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 "VTERM2->VTERMIF2 Create Failed"
+ exit(1)
print "****UPDATE Controller IP to Valid****"
test_controller_ipaddr=vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerFirst')['ipaddr']
retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermOne','VTermIfThree','ControllerFirst',position=0)
if retval != 0:
- print "VTERMIF3 Validate Failed"
- exit(1)
+ 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)
+ 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)
+ print "VTERMONE Validate Failed"
+ exit(1)
retval=vtn_vterm.validate_vterm_at_controller('VtnOne','VTermTwo','ControllerFirst',position=1)
if retval != 0:
- print "VTERMTWO Validate Failed"
- exit(1)
+ print "VTERMTWO Validate Failed"
+ exit(1)
retval=vtn_vterm.validate_vtn_at_controller('VtnOne','ControllerFirst')
if retval != 0:
- print "VTN Validate Failed"
- exit(1)
+ print "VTN Validate Failed"
+ exit(1)
retval = vtermif_portmap.delete_vtermif('VtnOne','VTermOne','VTermIfThree')
if retval != 0:
- print "VTERM1->VTERMIF3 Delete Failed"
- exit(1)
+ 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)
+ 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)
+ 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)
+ 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)
+ print "VTERM2->VTERMIF2 Delete Failed"
+ exit(1)
retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermTwo','VTermIfTwo','ControllerFirst',presence="no",position=1)
if retval != 0:
- print "VTERM2->VTERMIF2 Validate Failed"
- exit(1)
+ print "VTERM2->VTERMIF2 Validate Failed"
+ exit(1)
retval = vtn_vterm.delete_vterm('VtnOne','VTermOne')
if retval != 0:
- print "VTERM1/VTN Delete Failed"
- exit(1)
+ print "VTERM1/VTN Delete Failed"
+ exit(1)
retval = vtn_vterm.delete_vterm('VtnOne','VTermTwo')
if retval != 0:
- print "VTERM2/VTN Delete Failed"
- exit(1)
+ 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)
+ print "VTERM1/VTN Validate Failed"
+ exit(1)
retval=vtn_vterm.validate_vterm_at_controller('VtnOne','VTermTwo','ControllerFirst',presence="no",position=1)
if retval != 0:
- print "VTERM2/VTN Validate Failed"
- exit(1)
+ 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)
+ print "VTN Validate Failed"
+ exit(1)
retval = vtn_vterm.delete_vtn('VtnOne')
if retval != 0:
- print "VTN Delete Failed in coordinator"
- exit(1)
+ 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 "CONTROLLER delete failed"
+ exit(1)
print "VTN1->VTERM1->VTERMIF1/VTERMIF3 AND VTN1->VTERM2->VTERMIF1/VTERMIF2 AUDIT 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 :Controller Create Failed"
+ exit(1)
print "TEST 4 : Test Audit with VTenant one VTerminal one VTERMIF and One PORTMAP"
# Delay for AUDIT
exit(1)
retval=vtn_vterm.create_vtn('VtnOne')
if retval != 0:
- print "VTN Create Failed"
- exit(1)
+ print "VTN Create Failed"
+ exit(1)
retval=vtn_vterm.create_vterm('VtnOne','VTermOne','ControllerFirst')
if retval != 0:
- print "VTERM Create Failed"
- exit(1)
+ print "VTERM Create Failed"
+ exit(1)
retval=vtermif_portmap.create_vtermif('VtnOne','VTermOne','VTermIfOne')
if retval != 0:
- print "VTERMIF Create Failed"
- exit(1)
+ print "VTERMIF Create Failed"
+ exit(1)
retval=vtermif_portmap.validate_vtermif_at_controller('VtnOne','VTermOne','VTermIfOne','ControllerFirst')
if retval != 0:
- print "After Create VTERMIF Validate Failed"
- exit(1)
+ print "After Create VTERMIF Validate Failed"
+ exit(1)
print "****UPDATE Controller IP to invalid****"
test_invalid_ipaddr=vtn_testconfig.ReadValues(CONTROLLERDATA,'ControllerFirst')['invalid_ipaddr']
retval=vtermif_portmap.create_portmap('VtnOne','VTermOne','VTermIfOne');
if retval != 0:
- print "Portmap Create Failed"
- exit(1)
+ 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)
+ print "controller valid_ip update failed"
+ exit(1)
# Delay for AUDIT
retval = controller.wait_until_state('ControllerFirst',"up")
if retval != 0:
retval=vtermif_portmap.validate_vtermif_portmap_at_controller('VtnOne','VTermOne','VTermIfOne','ControllerFirst',presence="yes");
if retval != 0:
- print "Portmap Validate Failed"
- exit(1)
+ 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)
+ 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)
+ print "VTN Validate Failed"
+ exit(1)
retval=vtermif_portmap.delete_portmap('VtnOne','VTermOne','VTermIfOne');
if retval != 0:
- print "Portmap Delete Failed"
- exit(1)
+ print "Portmap Delete Failed"
+ exit(1)
retval = vtermif_portmap.delete_vtermif('VtnOne','VTermOne','VTermIfOne')
if retval != 0:
- print "VTERMIF Delete Failed"
- exit(1)
+ 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)
+ 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)
+ 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)
+ 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)
+ 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 "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 "CONTROLLER delete failed"
+ exit(1)
print "VTN->VTERM->VTERMIF->PORTMAP AUDIT TEST SUCCESS"
+
+
# Main Block
if __name__ == '__main__':
- print '*****VTERMIF Portmap AUDIT cases ******'
- test_audit_vtn_vterm_vtermif()
- test_audit_vtn_multi_vterm_vtermif()
- test_audit_vtn_vterm_vtermif_portmap()
+ print '*****VTERMIF Portmap AUDIT cases ******'
+ test_audit_vtn_vterm_vtermif()
+ test_audit_vtn_multi_vterm_vtermif()
+ test_audit_vtn_vterm_vtermif_portmap()
+
else:
- print "VTN VTERM Loaded as Module"
+ print "VTN VTERM Loaded as Module"
exit(1)
print "VTN->FLOWFILTER TEST SUCCESS"
-
-def test_vtn_flowfilter_1():
+def update_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 with update"
+ print "TEST 2 : VTN->UPDATE FLOWFILTER TEST "
# Delay for AUDIT
retval=controller.wait_until_state('ControllerFirst', "up")
if retval != 0:
if retval != 0:
print "CONTROLLER delete failed"
exit(1)
- print "VTN->FLOWFILTER_1 TEST SUCCESS"
+ print "VTN->UPDATE FLOWFILTER 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"
+
+
+
# Main Block
if __name__ == '__main__':
print '*****VTN FLOWFILTER TESTS******'
test_vtn_flowfilter()
- test_vtn_flowfilter_1()
+ print '*****UPDATE FLOWFILTER TESTS****'
+ update_vtn_flowfilter()
+ print '*******NEGATIVE FLOWFILTER TESTS****'
+ negative_vtn_flowfilter()
else:
print 'VTN_FLOWFILTER LOADED AS MODULE'
vbrif_url=/interfaces/vbrifone
logical_port_id=PP-00:00:00:00:00:00:00:03-s3-eth1
node_id=00:00:00:00:00:00:00:03
+update_url=/interfaces/vbrifone
+url=/interfaces/
vlan_id=1
tagged=true
+updatedescription=first update vbrif for vbrone
+adminstatus=disable
+
[VbrIfTwo]
vbrif_name=vbriftwo
vlan_id=1
vlan_id=2
tagged=false
+update_url=/interfaces/vbriftwo
+updatedescription=second update vbrif for vbrone
+adminstatus=enable
+
[VbrIfThree]
vbrif_name=vbrifthree
vlan_id=1
vlan_id=3
tagged=false
+update_url=/interfaces/vbrifthree
+updatedescription=Three update vbrif for vbrtwo
+adminstatus=disable
+
[VbrIfFour]
vbrif_name=vbriffour
vlan_id=1
vlan_id=4
tagged=true
+update_url=/interfaces/vbriffour
+updatedescription=second update vbrif for vbrtwo
+adminstatus=enable
+
[MultiCtrVbrIfOne]
vbrif_name=vbrifone
node_id=00:00:00:00:00:00:00:02
vlan_id=1
tagged=true
+update_url=/interfaces/vbrifone
+updatedescription=first update vbrif for vbrone
+adminstatus=disable
+
[MultiCtrVbrIfThree]
vbrif_name=vbrifthree
node_id=00:00:00:00:00:00:00:05
vlan_id=1
tagged=false
+update_url=/interfaces/vbrifthree
+updatedescription=first update vbrif for vbrtwo
+adminstatus=disable
+
[VBRIFURL]
url=/interfaces.json
vlan_id=1
tagged=true
+
+
[VTermIfTwo]
vtermif_name=vtermiftwo
description=second vtermif for vtermone
vlan_id=2
tagged=false
+
[VTermIfThree]
vtermif_name=vtermifthree
description=first vtermif for vtermtwo
vlan_id=3
tagged=false
+
[VTermIfFour]
vtermif_name=vtermiffour
description=second vtermif for vtermtwo
vlan_id=4
tagged=true
+
[MultiCtrVTermIfOne]
vtermif_name=vtermifone
description=first vtermif for vtermone
vlan_id=1
tagged=true
+
[MultiCtrVTermIfThree]
vtermif_name=vtermifthree
description=first vtermif for vtermtwo
vlan_id=1
tagged=false
+
[VTERMIFURL]
url=/interfaces.json
ctr_url=/interfaces