Add Functional Tests for Flowfilter keytypes 20/18920/1
authorPoornachandrarao <poornachandrarao.b@hcl.com>
Sun, 12 Apr 2015 15:08:44 +0000 (20:38 +0530)
committerPoornachandrarao <poornachandrarao.b@hcl.com>
Sun, 12 Apr 2015 15:08:44 +0000 (20:38 +0530)
Signed-off-by: Poornachandrarao <poornachandrarao.b@hcl.com>
15 files changed:
coordinator/test/vtn_ft/flowfilter.data
coordinator/test/vtn_ft/flowfilter.py
coordinator/test/vtn_ft/vbr_flowfilter.py
coordinator/test/vtn_ft/vbr_flowfilter_audit.py
coordinator/test/vtn_ft/vbrif_flowfilter.py
coordinator/test/vtn_ft/vbrif_flowfilter_audit.py
coordinator/test/vtn_ft/vbrif_portmap.py
coordinator/test/vtn_ft/vbrif_portmap_audit.py
coordinator/test/vtn_ft/vterm_flowfilter.py
coordinator/test/vtn_ft/vterm_flowfilter_audit.py
coordinator/test/vtn_ft/vtermif_portmap.py
coordinator/test/vtn_ft/vtermif_portmap_audit.py
coordinator/test/vtn_ft/vtn_flowfilter.py
coordinator/test/vtn_ft/vtn_vbr_vbrif.data
coordinator/test/vtn_ft/vtn_vterm_vtermif.data

index 8da01ff96c790ad22bc13928229d2e763c4f2c66..113f5eed3fbd7f2aee3489f96d4f1041e6fe102f 100644 (file)
@@ -15,8 +15,19 @@ nmg_name=test1
 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
 
@@ -28,8 +39,7 @@ nmg_name=test1
 priority=7
 dscp=55
 direction=in
-type_in=in
-type_out=out
+type=in
 index=11
 condition=flowlist1
 
@@ -38,15 +48,13 @@ seqnum=10
 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
@@ -55,6 +63,83 @@ output=false
 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
@@ -67,8 +152,7 @@ if_name=vbrifone
 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
@@ -80,9 +164,102 @@ priority= 7
 [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
index 1e8dbb3a1e2e161181091c4f9e820e8c2ed4fe4e..dfe47ef130e25c491b570965cf01b95ca7f21c10 100644 (file)
@@ -63,7 +63,7 @@ def create_flowfilter(blockname, ff_blockname):
     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)
@@ -72,8 +72,9 @@ def create_flowfilter(blockname, ff_blockname):
 
     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:
@@ -84,7 +85,8 @@ def create_flowfilter(blockname, ff_blockname):
 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)
@@ -104,10 +106,14 @@ def validate_flowfilter_at_controller(blockname, controller_blockname, ff_blockn
     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)
@@ -145,7 +151,7 @@ def validate_flowfilter_at_controller(blockname, controller_blockname, ff_blockn
       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
@@ -164,23 +170,56 @@ def validate_filter_type(flowfilter_content):
       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']
@@ -203,11 +242,15 @@ def create_flowfilter_entry(blockname, ff_blockname):
         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:
@@ -219,7 +262,7 @@ def update_flowfilter_entry(blockname, ff_blockname, update_ff_bn):
     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']
@@ -227,9 +270,47 @@ def update_flowfilter_entry(blockname, ff_blockname, update_ff_bn):
     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
@@ -245,9 +326,25 @@ def update_flowfilter_entry(blockname, ff_blockname, update_ff_bn):
         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
@@ -259,10 +356,12 @@ def update_flowfilter_entry(blockname, ff_blockname, update_ff_bn):
     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
 
@@ -281,7 +380,8 @@ def validate_flowfilter_entry(blockname, ff_blockname, presence='yes', position=
     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']
@@ -296,14 +396,21 @@ def validate_flowfilter_entry(blockname, ff_blockname, presence='yes', position=
         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
@@ -340,8 +447,6 @@ def validate_flowfilter_entry(blockname, ff_blockname, presence='yes', position=
       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:
@@ -358,8 +463,11 @@ def validate_flowfilter_entry(blockname, ff_blockname, presence='yes', position=
              return 1
           if flowfilter_content['redirectdst']['macdstaddr'] != macdstaddr:
              return 1
+
       return 0
 
+
+
 # Main Block
 if __name__ == '__main__':
     print '*****FLOWFILTER TESTS******'
index 7a1c89f10b090f1168502694531c525e1225233f..f6a6e410475e32bb8fb87c1cbf3c2efea83eb33b 100644 (file)
@@ -10,7 +10,7 @@
 #
 
 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
 
 
@@ -150,7 +150,7 @@ def test_vbr_flowfilter():
      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:
@@ -299,6 +299,570 @@ def test_vbr_flowfilter_1():
     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:
@@ -306,10 +870,167 @@ def test_vbr_flowfilter_1():
      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'
index 7b05d69552e74382c710bbdceb954907fd94cc61..154252a7c2615b3a6a47c04373d21f27b21e6a20 100644 (file)
@@ -338,11 +338,866 @@ def test_vbr_flowfilter_audit_2():
     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"
 
index 58fd6b3021a2ab5dbe84b8c6b8ef0c42c601ec2b..61fb696b72ba5fa1f835769f949386fa45eeb939 100644 (file)
@@ -35,7 +35,7 @@ def test_vbrif_flowfilter():
 
   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')
@@ -45,7 +45,7 @@ def test_vbrif_flowfilter():
 
   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')
@@ -160,14 +160,14 @@ def test_vbrif_flowfilter():
      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:
@@ -329,12 +329,1318 @@ def test_vbrif_flowfilter_1():
   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'
index 823fbfc298b14cffc71b8917b9e53d915bda8e08..cb06927000d5d76520f5c3415de376d18aec9d04 100644 (file)
@@ -185,9 +185,1291 @@ def test_vbrif_flowfilter_audit():
      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'
index 31c48da280ebd186231ee869e7d85200608cec0c..414b877f69573f11277c94ca60bc6a9133397bb6 100644 (file)
@@ -42,6 +42,8 @@ def create_vbrif(vtn_blockname,vbr_blockname,vbrif_blockname):
     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:
@@ -49,6 +51,34 @@ def create_vbrif(vtn_blockname,vbr_blockname,vbrif_blockname):
     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']
@@ -76,11 +106,11 @@ def validate_vbrif_at_controller(vtn_blockname, vbr_blockname, vbrif_blockname,
     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'))
 
@@ -120,9 +150,63 @@ def validate_vbrif_at_controller(vtn_blockname, vbr_blockname, vbrif_blockname,
             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']
@@ -249,12 +333,14 @@ def test_vtn_vbr_vbrif():
     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"
@@ -329,6 +415,9 @@ def test_multi_vbrif():
     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"
@@ -338,10 +427,12 @@ def test_multi_vbrif():
     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:
@@ -432,6 +523,8 @@ def test_multi_vbr_vbrif():
     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"
@@ -446,7 +539,6 @@ def test_multi_vbr_vbrif():
     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"
@@ -570,6 +662,8 @@ def test_multi_vtn_vbr_vbrif():
         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"
@@ -714,17 +808,14 @@ def test_vtn_multi_vbr_vbrif():
     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"
@@ -734,7 +825,6 @@ def test_vtn_multi_vbr_vbrif():
     if retval != 0:
         print "VBR2->VBRIF2 Validate Failed"
         exit(1)
-
     retval=create_vbrif('VtnOne','VbrTwo','VbrIfTwo')
     if retval != 0:
         print "VBR2->VBRIF2 Create Failed"
@@ -744,7 +834,6 @@ def test_vtn_multi_vbr_vbrif():
     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"
@@ -836,7 +925,6 @@ def test_vtn_multi_vbr_vbrif():
         exit(1)
     print "VTN1->VBR1->VBRIF1/VBRIF3 AND VTN1->VBR2->VBRIF1/VBRIF2 TEST SUCCESS"
 
-###PORTMAP####
 def test_vtn_vbr_vbrif_portmap():
 
     print "CREATE Controller"
@@ -862,16 +950,18 @@ def test_vtn_vbr_vbrif_portmap():
     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"
@@ -1103,6 +1193,7 @@ def test_vtn_vbr_multi_vbrif_portmap():
     if retval != 0:
         print "VBRIF2 Create Failed"
         exit(1)
+  
 
     retval=validate_vbrif_at_controller('VtnOne','VbrOne','VbrIfOne','ControllerFirst',position=0)
     if retval != 0:
@@ -1113,7 +1204,6 @@ def test_vtn_vbr_multi_vbrif_portmap():
     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"
@@ -1386,7 +1476,7 @@ def test_multi_vtn_vbr_vbrif_portmap():
     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:
@@ -1569,7 +1659,7 @@ def test_vtn_vbr_multiple_vbrif_portmap():
     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"
@@ -1589,7 +1679,6 @@ def test_vtn_vbr_multiple_vbrif_portmap():
     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"
@@ -1762,6 +1851,209 @@ def test_vtn_vbr_multiple_vbrif_portmap():
         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******'
@@ -1776,6 +2068,8 @@ if __name__ == '__main__':
     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"
index a106217adf55ae9415c56fbb15fb55f07dd61881..63944c8e47cb0f0a558a28938a4f6b79776c2a6f 100644 (file)
@@ -14,7 +14,6 @@ import vtn_testconfig, vbrif_portmap
 
 CONTROLLERDATA=vtn_testconfig.CONTROLLERDATA
 
-#####AUDIT TEST CASE#################
 
 def test_audit_vtn_vbr_vbrif():
 
@@ -911,6 +910,930 @@ def test_audit_vtn_vbr_multi_vbrif_portmap():
         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__':
@@ -921,6 +1844,16 @@ 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"
index 6e3e8ac58c367a1d37ec60a45aa6a5f3e856de16..caaa1ff69d9ec041bca814d5061ca027708bb1cb 100644 (file)
@@ -167,14 +167,14 @@ def test_vtermif_flowfilter():
      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:
@@ -342,12 +342,1359 @@ def test_vtermif_flowfilter_1():
   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'
index 969b914ab70005718334e29f498ac90393157449..023f07f3c0812c19722e552587aa083b6ac651d3 100644 (file)
@@ -191,10 +191,1315 @@ def test_vtermif_flowfilter_audit():
      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'
index 26c88f710850f09f79f404a2af219eff9f76caa6..bbe433c31950f1ff8519c146734bf99170420ba4 100644 (file)
@@ -78,7 +78,7 @@ def validate_vtermif_at_controller(vtn_blockname, vterm_blockname, vtermif_block
     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
@@ -122,7 +122,6 @@ def validate_vtermif_at_controller(vtn_blockname, vterm_blockname, vtermif_block
             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']
@@ -580,7 +579,6 @@ def test_multi_vtn_vterm_vtermif():
         exit(1)
     print "VTN1->VTERM1->VTERMIF1 and VTN2->VTERM2->VTERMIF2 TEST SUCCESS"
 
-###PORTMAP####
 def test_vtn_vterm_vtermif_portmap():
 
     print "CREATE Controller"
@@ -987,6 +985,7 @@ def test_multi_vtn_vterm_vtermif_portmap():
         exit(1)
     print "VTN1->VTERM1->VTERMIF1->PORTMAP AND VTN2->VTERM2->VTERMIF2->PORTMAP TEST SUCCESS"
 
+
 # Main Block
 if __name__ == '__main__':
     print '*****VTERMIF TESTS******'
@@ -996,6 +995,8 @@ if __name__ == '__main__':
     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"
index da9b8e79444ff7dbc577ba2bf5675847ed64efa7..28459b32cfb568661dfe25f4700545adb53a1fb4 100644 (file)
@@ -14,15 +14,14 @@ import vtn_testconfig, vtermif_portmap
 
 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
@@ -33,30 +32,30 @@ def test_audit_vtn_vterm_vtermif():
 
     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")
 
@@ -65,16 +64,16 @@ def test_audit_vtn_vterm_vtermif():
       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:
@@ -83,44 +82,44 @@ def test_audit_vtn_vterm_vtermif():
 
     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():
@@ -129,8 +128,8 @@ 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
@@ -140,38 +139,38 @@ def test_audit_vtn_multi_vterm_vtermif():
       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']
@@ -187,23 +186,23 @@ def test_audit_vtn_multi_vterm_vtermif():
 
     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']
@@ -219,94 +218,94 @@ def test_audit_vtn_multi_vterm_vtermif():
 
     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():
@@ -314,8 +313,8 @@ 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
@@ -325,22 +324,22 @@ def test_audit_vtn_vterm_vtermif_portmap():
       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']
@@ -356,15 +355,15 @@ def test_audit_vtn_vterm_vtermif_portmap():
 
     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:
@@ -373,67 +372,70 @@ def test_audit_vtn_vterm_vtermif_portmap():
 
     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"
index 2e4e5c9e3d218c06e61c5356e470072cee58b4b0..e96c476a312fcf0ef8970bc2bec3ad5089d3f279 100644 (file)
@@ -120,15 +120,14 @@ def test_vtn_flowfilter():
      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:
@@ -235,13 +234,137 @@ def test_vtn_flowfilter_1():
   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'
index 0a6faf58961c7db3196742be0d672aab6f5bd07b..e5fa6e9c31c1dd62413060bf038741a2183940ea 100644 (file)
@@ -15,8 +15,13 @@ controller_url=/interfaces/vbrifone
 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
@@ -29,6 +34,10 @@ node_id=00:00:00:00:00:00:00:02
 vlan_id=1
 vlan_id=2
 tagged=false
+update_url=/interfaces/vbriftwo
+updatedescription=second update vbrif for vbrone
+adminstatus=enable
+
 
 [VbrIfThree]
 vbrif_name=vbrifthree
@@ -41,6 +50,10 @@ node_id=00:00:00:00:00:00:00:03
 vlan_id=1
 vlan_id=3
 tagged=false
+update_url=/interfaces/vbrifthree
+updatedescription=Three update vbrif for vbrtwo
+adminstatus=disable
+
 
 [VbrIfFour]
 vbrif_name=vbriffour
@@ -53,6 +66,10 @@ node_id=00:00:00:00:00:00:00:02
 vlan_id=1
 vlan_id=4
 tagged=true
+update_url=/interfaces/vbriffour
+updatedescription=second update vbrif for vbrtwo
+adminstatus=enable
+
 
 [MultiCtrVbrIfOne]
 vbrif_name=vbrifone
@@ -64,6 +81,10 @@ logical_port_id=PP-00:00:00:00:00:00:00:02-s2-eth2
 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
@@ -75,6 +96,10 @@ logical_port_id=PP-00:00:00:00:00:00:00:05-s5-eth2
 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
index d53f5cb5685ded394ed3cd5b5cfced3537c434ce..76cf63faa4c69b661757839bb1d5a8adff493ee6 100644 (file)
@@ -18,6 +18,8 @@ node_id=00:00:00:00:00:00:00:01
 vlan_id=1
 tagged=true
 
+
+
 [VTermIfTwo]
 vtermif_name=vtermiftwo
 description=second vtermif for vtermone
@@ -30,6 +32,7 @@ vlan_id=1
 vlan_id=2
 tagged=false
 
+
 [VTermIfThree]
 vtermif_name=vtermifthree
 description=first vtermif for vtermtwo
@@ -42,6 +45,7 @@ vlan_id=1
 vlan_id=3
 tagged=false
 
+
 [VTermIfFour]
 vtermif_name=vtermiffour
 description=second vtermif for vtermtwo
@@ -54,6 +58,7 @@ vlan_id=1
 vlan_id=4
 tagged=true
 
+
 [MultiCtrVTermIfOne]
 vtermif_name=vtermifone
 description=first vtermif for vtermone
@@ -65,6 +70,7 @@ node_id=00:00:00:00:00:00:00:02
 vlan_id=1
 tagged=true
 
+
 [MultiCtrVTermIfThree]
 vtermif_name=vtermifthree
 description=first vtermif for vtermtwo
@@ -76,6 +82,7 @@ node_id=00:00:00:00:00:00:00:05
 vlan_id=1
 tagged=false
 
+
 [VTERMIFURL]
 url=/interfaces.json
 ctr_url=/interfaces