Test-Scale:
    Adding scale tests and detailed test methods for various test
    scenarios.

Change-Id: I9f826148061c26b7966cfdd981e2b88daacfa56c
diff --git a/src/test/scale/scaleTest.py b/src/test/scale/scaleTest.py
index 1c031a2..2829ea8 100644
--- a/src/test/scale/scaleTest.py
+++ b/src/test/scale/scaleTest.py
@@ -482,6 +482,11 @@
 
     @deferred(10)
     def test_latency_of_cord_for_control_packets_using_icmp_packet(self):
+        """
+	Test-Method:
+	1. Ping from cord-tester to wan interface IP of CiaB setup
+	2. Grep latency of ping packets
+	"""
         df = defer.Deferred()
         def scale_vcpe_instances(df):
             cmd = "ping -c 4 {0} | tail -1| awk '{{print $4}}'".format(self.wan_intf_ip)
@@ -500,6 +505,12 @@
 
     @deferred(20)
     def test_latency_of_cord_for_control_packets_using_increasing_sizes_of_icmp_packet(self):
+        """
+	Test-Method:
+	1. Ping from cord-tester to wan interface IP of CiaB setup
+	2. Grep the latency of ping packet
+	3. Repeat the process for varying sizes of ping packets
+	"""
         df = defer.Deferred()
         def scale_vcpe_instances(df):
             pckt_sizes = [100,500,1000,1500]
@@ -520,6 +531,12 @@
 
     @deferred(10)
     def test_latency_of_cord_with_traceroute(self):
+        """
+	Test-Method:
+	1. Traceroute from cord-tester to wan interface IP of CiaB setup
+	2. Grep the latency of ping packet
+	3. Repeat the process for varying sizes of ping packets
+	"""
         df = defer.Deferred()
         def scale_vcpe_instances(df):
             cmd = "traceroute -q1 {} | tail -1| awk '{{print $4}}'".format(self.wan_intf_ip)
@@ -540,6 +557,13 @@
     #tested with 50 igmp joins on CiaB setup
     @deferred(1000)
     def test_scale_with_igmp_joins_for_500_multicast_groups_and_check_cpu_usage(self, group_count=500):
+        """
+	Test-Method:
+	1. Register 500 igmp groups in onos
+	2. Send  igmp joins for registered groups
+	3. Send multicast traffic to all registered groups
+	4. Verify traffic forwards properly
+	"""
         df = defer.Deferred()
         def scale_igmp_joins(df):
             OnosCtrl(self.igmp_app).activate()
@@ -563,6 +587,15 @@
     #tested with 50 igmp joins on CiaB setup
     @deferred(1000)
     def test_scale_with_igmp_joins_for_1000_multicast_groups_and_igmp_app_toggle(self, group_count=1000):
+	"""
+	Test-Method:
+	1. Register 1000 igmp groups in onos
+	2. Send  igmp joins for registered groups
+	3. Send multicast traffic to all registered groups
+	4. Verify traffic forwards properly
+	5. deactivate and activate igmp app in onos
+	6. Verify multicast traffic do not forward after igmp app deactivated
+	"""
         df = defer.Deferred()
         def scale_igmp_joins(df):
             OnosCtrl(self.igmp_app).activate()
@@ -583,7 +616,7 @@
                     status = scale().verify_igmp_data_traffic(groups[index],intf=self.V_INF1,source=sources[index])
                     assert_equal(status, False)
 		    log_test.info('data received for group %s from source %s - %d'%(groups[index],sources[index],index))
-		OnosCtrl(self.igmp_app).ctivate()
+		OnosCtrl(self.igmp_app).activate()
 	    except Exception as error:
 		log.info('Got unexpected error %s'%error)
 		OnosCtrl(self.igmp_app).activate()
@@ -595,6 +628,13 @@
     #tested with 50 igmp joins on CiaB setup
     @deferred(1800)
     def test_scale_with_igmp_joins_for_2000_multicast_groups_and_check_cpu_usage(self, group_count=2000):
+	"""
+	Test-Method:
+	1. Register 500 igmp groups in onos
+	2. Send  igmp joins for registered groups
+	3. Send multicast traffic to all registered groups
+	4. Verify traffic forwards properly
+	"""
         df = defer.Deferred()
         def scale_igmp_joins(df):
             OnosCtrl(self.igmp_app).activate()
@@ -621,6 +661,13 @@
     #tested with 50 igmp joins on CiaB setup
     @deferred(1000)
     def test_scale_of_igmp_joins_for_2000_multicast_groups_and_check_cpu_usage_after_app_deactivation_and_activation(self,group_count=2000):
+	"""
+	Test-Method:
+	1. Register 2000 igmp groups in onos
+	2. Send  igmp joins for registered groups
+	3. Send multicast traffic to all registered groups
+	4. Verify traffic forwards properly
+	"""
         df = defer.Deferred()
         def scale_igmp_joins(df):
 	    cpu_usage1 = scale().get_system_cpu_usage()
@@ -653,6 +700,12 @@
     #tested with 100 flow entries on CiaB setup
     @deferred(1000)
     def test_scale_adding_1k_flow_entries_in_onos_with_dynamic_tcp_ports(self,count=1000):
+	"""
+	Test-Method:
+	1. Add 1000 flow entries with varying tcp port number in onos
+	2. Send data traffic for added tcp port numbers
+	3. Verify onos forwards data traffic propoerly
+	"""
 	scale().flows_setup()
         df = defer.Deferred()
         def scale_flow_entries(df):
@@ -701,6 +754,12 @@
     #tested with 100 flow entries on CiaB setup
     @deferred(1000)
     def test_scale_adding_5k_ip_flow_entries_in_onos_and_checking_cpu_usage(self,count=5000):
+	"""
+	Test-Method:
+	1. Add 5000 flow entries with varying source and destination IP
+	2. Send data traffic matching flow entries
+	3. Verify onos forwards data traffic propoerly
+	"""
 	scale().flows_setup()
         df = defer.Deferred()
         def scale_flow_entries(df):
@@ -751,6 +810,12 @@
     #tested with 100 flow entries on CiaB setup
     @deferred(1000)
     def test_scale_adding_10k_flow_entries_in_onos_with_dynamic_udp_ports(self,count=10000):
+	"""
+	Test-Method:
+	1. Add 10000 flow entries with varying udp port number in onos
+	2. Send data traffic matching flow entries
+	3. Verify onos forwards data traffic propoerly
+	"""
         scale().flows_setup()
         df = defer.Deferred()
         def scale_flow_entries(df):
@@ -799,6 +864,12 @@
     #tested with 100 flow entries on CiaB setup
     @deferred(1000)
     def test_scale_adding_10k_constant_destination_mac_flow_entries_in_onos_and_check_cpu_usage(self,count=100):
+	"""
+	Test-Method:
+	1. Add 10000 flow entries with varying source mac
+	2. Send data traffic matching flow entries
+	3. Verify onos forwards data traffic propoerly
+	"""
 	scale().flows_setup()
         df = defer.Deferred()
         def scale_flow_entries(df):
@@ -849,86 +920,192 @@
 
     @deferred(1000)
     def test_scale_adding_10k_acl_rules_to_deny_matching_destination_tcp_port_traffic(self,count=10000):
+	"""
+	Test-Method:
+	1. Add 10000 acl deny rules with varying tcp port number
+	2. Send data traffic matching flow entries
+	3. Verify onos drops data traffic propoerly
+	"""
         df = defer.Deferred()
-        def scale_vcpe_instances(df):
+        def scale_acl_rules(df):
+		    acl_rule = ACLTest()
+		    ingress = self.ingress_iface
+            egress = self.CURRENT_PORT_NUM
+			status, code, host_ip_mac = acl_rule.generate_onos_interface_config(iface_num= self.CURRENT_PORT_NUM, iface_name = 'b1',iface_count = 1, iface_ip = self.HOST_DST_IP)
+            self.CURRENT_PORT_NUM += 1
+            time.sleep(5)
+			assert_equal(status, True)
+			srcMac = '00:00:00:00:00:11'
+            dstMac = host_ip_mac[0][1]
+            scale().acl_hosts_add(dstHostIpMac = host_ip_mac, egress_iface_count = 1,  egress_iface_num = egress )
+			try:
+                for index in range(0,count):
+				    status,code,host_ip_mac = acl_rule.generate_onos_interface_config(iface_num= self.CURRENT_PORT_NUM, iface_name = 'b1',iface_count = 1, iface_ip = self.HOST_DST_IP)
+                    self.CURRENT_PORT_NUM += 1
+                    src_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
+                    dst_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
+                    dst_port = random.randint(1024,65535)
+                    log.info('adding acl rule = %d with src ip = %s, dst ip = %s and dst tcp port = %d'%(index+1, src_ip,dst_ip,dst_port))
+                    status,code = acl_rule.adding_acl_rule('v4', srcIp=src_ip, dstIp = dst_ip, ipProto ='TCP', dstTpPort =dst_port, action = 'deny')
+                    assert_equal(status, True)
+					self.acl_rule_traffic_send_recv(srcMac = srcMac, dstMac = dstMac ,srcIp = src_ip, dstIp = dst_ip,ingress =ingress, egress = egress, ip_proto = 'TCP',positive_test = False)
+					scale().acl_hosts_remove(egress_iface_count = 1,  egress_iface_num = egress)
+		    except Exception as error:
+                log.info('Got unexpected error %s'%error)
+				self.acl_hosts_remove(egress_iface_count = 1,  egress_iface_num = egress)
+                raise
+            df.callback(0)
+        reactor.callLater(0, scale_vsg_vms, df)
+        return df
+
+    @deferred(1000)
+    def test_scale_adding_10k_acl_rules_to_allow_src_and_dst_ip_matching_traffic_check_cpu_usage(self,count=10000):
+	"""
+	Test-Method:
+	1. Grep system usage before starting test case
+	2. Configure 10000 acl rules in onos
+	3. Verify traffic test for all 10000 acl rules configured
+	4. Grep system usage again now
+	"""
+        df = defer.Deferred()
+        def scale_acl_rules(df):
             cpu_usage1 = self.get_system_cpu_usage()
+		    ingress = self.ingress_iface
+            egress = self.CURRENT_PORT_NUM
+			status, code, host_ip_mac = acl_rule.generate_onos_interface_config(iface_num= self.CURRENT_PORT_NUM, iface_name = 'b1',iface_count = 1, iface_ip = self.HOST_DST_IP)
+            self.CURRENT_PORT_NUM += 1
+            time.sleep(5)
+			assert_equal(status, True)
+			srcMac = '00:00:00:00:00:11'
+            dstMac = host_ip_mac[0][1]
+            self.acl_hosts_add(dstHostIpMac = host_ip_mac, egress_iface_count = 1,  egress_iface_num = egress )
             acl_rule = ACLTest()
-            for index in range(0,count):
-                src_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
-                dst_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
-                dst_port = random.randint(1024,65535)
-                log.info('adding acl rule = %d with src ip = %s, dst ip = %s and dst tcp port = %d'%(index+1, src_ip,dst_ip,dst_port))
-                status,code = acl_rule.adding_acl_rule('v4', srcIp=src_ip, dstIp = dst_ip, ipProto ='TCP', dstTpPort =dst_port, action = 'deny')
-                assert_equal(status, True)
-                if index % 100 == 0:
-                    cpu_usage = self.get_system_cpu_usage()
-                    log.info('CPU usage is %s for multicast group entries %s'%(cpu_usage,index+1))
-                    time.sleep(1)
+			try:
+                for index in range(0,count):
+				    status,code,host_ip_mac = acl_rule.generate_onos_interface_config(iface_num= self.CURRENT_PORT_NUM, iface_name = 'b1',iface_count = 1, iface_ip = self.HOST_DST_IP)
+                    self.CURRENT_PORT_NUM += 1
+                    src_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
+                    dst_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
+                    dst_port = random.randint(1024,65535)
+                    log.info('adding acl rule = %d with src ip = %s, dst ip = %s '%(index+1, src_ip,dst_ip))
+                    status,code = acl_rule.adding_acl_rule('v4', srcIp=src_ip, dstIp = dst_ip,action = 'allow')
+                    assert_equal(status, True)
+					self.acl_rule_traffic_send_recv(srcMac = srcMac, dstMac = dstMac ,srcIp =self.ACL_SRC_IP, dstIp = self.ACL_DST_IP,ingress =ingress, egress = egress, ip_proto = 'UDP', dstPortNum = 456)
+                    if index % 100 == 0:
+                        cpu_usage = self.get_system_cpu_usage()
+                        log.info('CPU usage is %s for acl rule number %s'%(cpu_usage,index+1))
+                        time.sleep(1)
+				    self.acl_hosts_remove(egress_iface_count = 1,  egress_iface_num = egress)
+			except Exception as error:
+                log.info('Got unexpected error %s'%error)
+				self.acl_hosts_remove(egress_iface_count = 1,  egress_iface_num = egress)
+                raise
             cpu_usage2 = self.get_system_cpu_usage()
             log.info('system cpu usage before flows added = %f and after %d flows added = %f'%(cpu_usage1,count,cpu_usage2))
             df.callback(0)
-        reactor.callLater(0, scale_vsg_vms, df)
+        reactor.callLater(0, scale_acl_rules, df)
         return df
 
     @deferred(1000)
-    def test_scale_adding_and_deleting_10k_acl_rules_to_allow_src_and_dst_ip_matching_traffic_check_cpu_usage(self,count=10000):
+    def test_scale_adding_and_deleting_10k_acl_rules_to_allow_src_and_dst_ip_matching_traffic(self,count=10000):
+        """
+	Test-Method:
+	1. Add 10000 acl rules to allow source and destinaiton IP matching traffic
+	2. Send acl rules matching traffic
+	3. Delete all the added acl rules
+	"""
         df = defer.Deferred()
-        def scale_vcpe_instances(df):
-            cpu_usage1 = self.get_system_cpu_usage()
+        def scale_acl_rules(df):
+		    ingress = self.ingress_iface
+            egress = self.CURRENT_PORT_NUM
+			status, code, host_ip_mac = acl_rule.generate_onos_interface_config(iface_num= self.CURRENT_PORT_NUM, iface_name = 'b1',iface_count = 1, iface_ip = self.HOST_DST_IP)
+            self.CURRENT_PORT_NUM += 1
+            time.sleep(5)
+			assert_equal(status, True)
+			srcMac = '00:00:00:00:00:11'
+            dstMac = host_ip_mac[0][1]
+            self.acl_hosts_add(dstHostIpMac = host_ip_mac, egress_iface_count = 1,  egress_iface_num = egress )
             acl_rule = ACLTest()
-            for index in range(0,count):
-                src_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
-                dst_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
-                dst_port = random.randint(1024,65535)
-                log.info('adding acl rule = %d with src ip = %s, dst ip = %s '%(index+1, src_ip,dst_ip))
-                status,code = acl_rule.adding_acl_rule('v4', srcIp=src_ip, dstIp = dst_ip,action = 'allow')
-                assert_equal(status, True)
-                if index % 100 == 0:
-                    cpu_usage = self.get_system_cpu_usage()
-                    log.info('CPU usage is %s for acl rule number %s'%(cpu_usage,index+1))
-                    time.sleep(1)
-            cpu_usage2 = self.get_system_cpu_usage()
-            result = acl_rule.get_acl_rules()
-            result = result.json()['aclRules']
-            for acl in result:
-                acl_rule.remove_acl_rule(acl['id'])
-                #log.info('acl is %s'%acl)
-            cpu_usage3 = self.get_system_cpu_usage()
-            log.info('system cpu usage before flows added = %f and after %d flows added = %f, after deleting all acl rules = %f'%(cpu_usage1,count,cpu_usage2,cpu_usage3))
+			try:
+                for index in range(0,count):
+				    status,code,host_ip_mac = acl_rule.generate_onos_interface_config(iface_num= self.CURRENT_PORT_NUM, iface_name = 'b1',iface_count = 1, iface_ip = self.HOST_DST_IP)
+                    self.CURRENT_PORT_NUM += 1
+                    src_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
+                    dst_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
+                    dst_port = random.randint(1024,65535)
+                    log.info('adding acl rule = %d with src ip = %s, dst ip = %s '%(index+1, src_ip,dst_ip))
+                    status,code = acl_rule.adding_acl_rule('v4', srcIp=src_ip, dstIp = dst_ip,action = 'allow')
+                    assert_equal(status, True)
+					self.acl_rule_traffic_send_recv(srcMac = srcMac, dstMac = dstMac ,srcIp =self.ACL_SRC_IP, dstIp = self.ACL_DST_IP,ingress =ingress, egress = egress, ip_proto = 'UDP', dstPortNum = 456)
+                result = acl_rule.get_acl_rules()
+                result = result.json()['aclRules']
+                for acl in result:
+                    acl_rule.remove_acl_rule(acl['id'])
+                    log.info('removed acl with Id --> %s'%acl['id'])
+				self.acl_hosts_remove(egress_iface_count = 1,  egress_iface_num = egress)
+			except Exception as error:
+                log.info('Got unexpected error %s'%error)
+				self.acl_hosts_remove(egress_iface_count = 1,  egress_iface_num = egress)
+                raise
             df.callback(0)
-        reactor.callLater(0, scale_vsg_vms, df)
+        reactor.callLater(0, scale_acl_rules, df)
         return df
 
     @deferred(1000)
-    def test_scale_adding_20k_acl_rules_to_allow_src_and_dst_ip_matching_traffic_and_deactivate_acl_app_checking_cpu_usage(self,count=20000):
+    def test_scale_adding_20k_acl_rules_to_deny_src_and_dst_ip_matching_traffic_with_acl_app_toggle(self,count=20000):
+	"""
+	Test-Method:
+	1. Add 20000 acl rules to allow source and destinaiton IP matching traffic
+	2. Send acl rules matching traffic
+	3. Verify onos drops the traffic as the rule is deny type
+	4. Deactivate the acl app in onos
+	4. Verify now onos forwards the traffic
+	"""
         df = defer.Deferred()
-        def scale_vcpe_instances(df):
-            cpu_usage1 = self.get_system_cpu_usage()
+        def scale_acl_rules(df):
+		    ingress = self.ingress_iface
+            egress = self.CURRENT_PORT_NUM
+			status, code, host_ip_mac = acl_rule.generate_onos_interface_config(iface_num= self.CURRENT_PORT_NUM, iface_name = 'b1',iface_count = 1, iface_ip = self.HOST_DST_IP)
+            self.CURRENT_PORT_NUM += 1
+            time.sleep(5)
+			assert_equal(status, True)
+			srcMac = '00:00:00:00:00:11'
+            dstMac = host_ip_mac[0][1]
+            self.acl_hosts_add(dstHostIpMac = host_ip_mac, egress_iface_count = 1,  egress_iface_num = egress )
             acl_rule = ACLTest()
-            for index in range(0,count):
-                src_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
-                dst_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
-                dst_port = random.randint(1024,65535)
-                log.info('adding acl rule = %d with src ip = %s, dst ip = %s '%(index+1, src_ip,dst_ip))
-                status,code = acl_rule.adding_acl_rule('v4', srcIp=src_ip, dstIp = dst_ip,action = 'allow')
-                assert_equal(status, True)
-                if index % 200 == 0:
-                    cpu_usage = self.get_system_cpu_usage()
-                    log.info('CPU usage is %s for acl rule number %s'%(cpu_usage,index+1))
-                    time.sleep(1)
-            cpu_usage2 = self.get_system_cpu_usage()
-            OnosCtrl(cls.acl_app).deactivate()
-            time.sleep(3)
-            cpu_usage3 = self.get_system_cpu_usage()
-            log.info('system cpu usage before flows added = %f, after %d flows added = %f, and after deactivating acl app = %f'%(cpu_usage1,count,cpu_usage2,cpu_usage3))
+            try:
+                for index in range(0,count):
+				    status,code,host_ip_mac = acl_rule.generate_onos_interface_config(iface_num= self.CURRENT_PORT_NUM, iface_name = 'b1',iface_count = 1, iface_ip = self.HOST_DST_IP)
+                    self.CURRENT_PORT_NUM += 1
+                    src_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
+                    dst_ip =  self.generate_random_unicast_ip_addresses(count=1)[0]+'/32'
+                    dst_port = random.randint(1024,65535)
+                    log.info('adding acl rule = %d with src ip = %s, dst ip = %s '%(index+1, src_ip,dst_ip))
+                    status,code = acl_rule.adding_acl_rule('v4', srcIp=src_ip, dstIp = dst_ip,action = 'deny')
+                    assert_equal(status, True)
+					self.acl_rule_traffic_send_recv(srcMac = srcMac, dstMac = dstMac ,srcIp =self.ACL_SRC_IP, dstIp = self.ACL_DST_IP,ingress =ingress, egress = egress, ip_proto = 'UDP', dstPortNum = 456)
+                OnosCtrl(cls.acl_app).deactivate()
+                time.sleep(3)
+			except Exception as error:
+                log.info('Got unexpected error %s'%error)
+                raise
             df.callback(0)
-        reactor.callLater(0, scale_vsg_vms, df)
+        reactor.callLater(0, scale_acl_rules, df)
         return df
 
     @deferred(1000)
     def test_scale_adding_igmp_and_acl_with_flow_entries_and_check_cpu_usage(self,igmp_groups=1300, flows_count=10000):
+	"""
+	Test-Method:
+	1. Add igmp and flow entries in onos
+	2. Send igmp joins for corresponding igmp entries
+	3. Send multicast data traffic to registered igmp groups
+	3. Verify onos forwards the traffic
+	4. Send traffic matching the flow entries
+	4. Verify onos forwards the traffic
+	"""
         df = defer.Deferred()
-        def scale_vcpe_instances(df):
+        def scale_igmp_acl_flows(df):
             cpu_usage1 = self.get_system_cpu_usage()
             egress = 1
             ingress = 2
@@ -967,13 +1144,24 @@
             cpu_usage2 = self.get_system_cpu_usage()
             log.info('system cpu usage before flows added = %f, after %d flows added = %f'%(cpu_usage1,count,cpu_usage2))
             df.callback(0)
-        reactor.callLater(0, scale_vsg_vms, df)
+        reactor.callLater(0, scale_igmp_acl_flows, df)
         return df
 
     @deferred(1000)
     def test_scale_adding_igmp_acl_and_flow_entries_and_simultaneously_toggling_app_activation(self,igmp_groups=1300, flows_count=10000):
+	"""
+	Test-Method:
+	1. Add igmp, acl and flow entries in onos
+	2. Send igmp joins for corresponding igmp entries
+	3. Send multicast data traffic to registered igmp groups
+	3. Verify onos forwards the traffic
+	4. Send traffic matching the flow entries
+	4. Verify onos forwards the traffic
+	5. Send traffic matching acl rules
+	6. Verify onos forwards the traffic
+	"""
         df = defer.Deferred()
-        def scale_vcpe_instances(df):
+        def scale_igmp_acl_flows(df):
             cpu_usage1 = self.get_system_cpu_usage()
             def adding_igmp_entries():
                 OnosCtrl(self.igmp_app).activate()
@@ -1028,11 +1216,18 @@
             OnosCtrl(self.igmp_app).activate()
             OnosCtrl(self.acl_app).activate()
             df.callback(0)
-        reactor.callLater(0, scale_vsg_vms, df)
+        reactor.callLater(0, scale_igmp_acl_flows, df)
         return df
 
     @deferred(1000)
     def test_scale_for_vrouter_with_10_routes_with_10_peers(self):
+	"""
+	Test-Method:
+	1. Add 10 routes with 10 pairs in quagga
+	2. Verify routes pushed to onos  from quagga
+	3. Send traffic destined  the routes added
+	3. Verify onos forwards the traffic
+	"""
 	scale().vrouter_setup()
 	df = defer.Deferred()
         def scale_vrouter_routes(df):
@@ -1048,7 +1243,14 @@
 
     #tested with 100 routes on CiaB
     @deferred(1000)
-    def test_scale_for_vrouter_with_20000_routes_with_100_peers(self):
+    def test_scale_for_vrouter_with_10000_routes_with_100_peers(self):
+	"""
+	Test-Method:
+	1. Add 100000 routes with 100 pairs in quagga
+	2. Verify routes pushed to onos  from quagga
+	3. Send traffic destined  the routes added
+	3. Verify onos forwards the traffic
+	"""
         scale().vrouter_setup()
         df = defer.Deferred()
         def scale_vrouter_routes(df):
@@ -1064,12 +1266,19 @@
 
     #tested with 100 routes on CiaB
     @deferred(1500)
-    def test_scale_for_vrouter_with_20000_routes_with_100_peers(self):
+    def test_scale_for_vrouter_with_20000_routes_with_200_peers(self):
+	"""
+	Test-Method:
+	1. Add 20000 routes with 200 pairs in quagga
+	2. Verify routes pushed to onos  from quagga
+	3. Send traffic destined  the routes added
+	3. Verify onos forwards the traffic
+	"""
         scale().vrouter_setup()
         df = defer.Deferred()
         def scale_vrouter_routes(df):
 	    try:
-                res = scale().vrouter_network_verify(20000, peers = 100)
+                res = scale().vrouter_network_verify(20000, peers = 200)
                 assert_equal(res, True)
 	    except Exception as error:
 		log.info('Got Unexpected error %s'%error)
@@ -1081,6 +1290,11 @@
     #tested with 100 subscribers on CiaB
     @deferred(1800)
     def test_scale_of_eap_tls_with_5k_sessions_using_diff_mac(self):
+	"""
+	Test-Method:
+	1. Simulate eap authentication requests for 5000 users
+	2. Verify authentication is succes for all 5000 users
+	"""
 	OnosCtrl('org.opencord.aaa').activate()
         df = defer.Deferred()
         def eap_tls_5k_with_diff_mac(df):
@@ -1099,6 +1313,14 @@
     #tested with 100 subscribers on CiaB
     @deferred(1800)
     def test_scale_of_eap_tls_with_5k_sessions_using_diff_mac_with_aaa_deactivate_and_activated(self):
+	"""
+	Test-Method:
+	1. Simulate eap authentication requests for 5000 users
+	2. Verify authentication is succes for all 5000 users
+	3. Deactivate and activate the aaa app in onos
+	4. Simulate eap authentication requests for 5000 users
+	5. Verify authentication is succes for all 5000 users
+	"""
 	OnosCtrl('org.opencord.aaa').activate()
 	df = defer.Deferred()
         def eap_tls_5k_with_diff_mac(df):
@@ -1126,6 +1348,12 @@
     #tested with 10 subscribers on CiaB
     @deferred(1800)
     def test_scale_5k_cord_subscribers_authentication_with_valid_and_invalid_certificates_and_channel_surfing(self):
+	"""
+	Test-Method:
+	1. Simulate 5000 subscribers to get authentication access
+	2. Send igmp joins from all the subcribers
+	3. Verify multicast traffic received to all 5000 subscribers
+	"""
 	scale().subscriber_setup()
         df = defer.Deferred()
         def cordsub_auth_invalid_cert(df):
@@ -1149,6 +1377,12 @@
     #tested with 10 subscribers on CiaB
     @deferred(1800)
     def test_scale_5k_cord_subscribers_igmp_join_jump_1500channel(self):
+	"""
+        Test-Method:
+        1. Simulate 5000 subscribers
+        2. Send igmp joins from all the subcribers
+        3. Verify multicast traffic received to all 5000 subscribers
+        """
         scale().subscriber_setup()
         df = defer.Deferred()
         def cordsub_igmp_join_jump(df):
@@ -1173,6 +1407,12 @@
     #tested with 10 subscribers on CiaB
     @deferred(1800)
     def test_scale_10k_cord_subscribers_authentication_with_valid_and_non_ca_authorized_certificates_and_channel_surfing(self):
+	"""
+        Test-Method:
+        1. Simulate 10000 subscribers to get authentication access
+        2. Send igmp joins from all the subcribers
+        3. Verify multicast traffic received to all 10000 subscribers
+        """
 	scale().subscriber_setup()
         df = defer.Deferred()
         def cordsub_auth_valid_cert(df):
@@ -1193,3 +1433,4 @@
             df.callback(0)
         reactor.callLater(0, cordsub_auth_valid_cert, df)
         return df
+
diff --git a/src/test/utils/Scale.py b/src/test/utils/Scale.py
index 1a53c52..04cb5f5 100644
--- a/src/test/utils/Scale.py
+++ b/src/test/utils/Scale.py
@@ -199,6 +199,21 @@
     IGMP_DST_MAC = "01:00:5e:00:00:16"
     igmp_eth = Ether(dst = IGMP_DST_MAC, type = ETH_P_IP)
     igmp_ip = IP(dst = IP_DST)
+	INGRESS_PORT = 1
+    EGRESS_PORT = 2
+    ingress_iface = 1
+    egress_iface = 2
+    MAX_PORTS = 100
+    CURRENT_PORT_NUM = egress_iface
+    ACL_SRC_IP = '192.168.20.3/32'
+    ACL_DST_IP = '192.168.30.2/32'
+    ACL_SRC_IP_RULE_2 = '192.168.40.3/32'
+    ACL_DST_IP_RULE_2 = '192.168.50.2/32'
+    ACL_SRC_IP_PREFIX_24 = '192.168.20.3/24'
+    ACL_DST_IP_PREFIX_24 = '192.168.30.2/24'
+    HOST_DST_IP = '192.168.30.0/24'
+    HOST_DST_IP_RULE_2 = '192.168.50.0/24'
+
 
 
 
@@ -338,8 +353,75 @@
         self.send_multicast_data_traffic(group,source=source)
         t.join()
         return self.success
+##################### acl utility functions ###############################
 
     @classmethod
+    def acl_hosts_add(cls, dstHostIpMac, egress_iface_count = 1,  egress_iface_num = None):
+        index = 0
+        if egress_iface_num is None:
+            egress_iface_num = cls.egress_iface
+        for ip,_ in dstHostIpMac:
+            egress = cls.port_map[egress_iface_num]
+            log.info('Assigning ip %s to interface %s' %(ip, egress))
+            config_cmds_egress = ( 'ifconfig {} 0'.format(egress),
+                                   'ifconfig {0} up'.format(egress),
+                                   'ifconfig {0} {1}'.format(egress, ip),
+                                   'arping -I {0} {1} -c 2'.format(egress, ip.split('/')[0]),
+                                   'ifconfig {0}'.format(egress),
+                                 )
+            for cmd in config_cmds_egress:
+                os.system(cmd)
+            index += 1
+            if index == egress_iface_count:
+               break
+            egress_iface_count += 1
+            egress_iface_num += 1
+    @classmethod
+    def acl_hosts_remove(cls, egress_iface_count = 1,  egress_iface_num = None):
+        if egress_iface_num is None:
+           egress_iface_num = cls.egress_iface
+        n = 0
+        for n in range(egress_iface_count):
+           egress = cls.port_map[egress_iface_num]
+           config_cmds_egress = ('ifconfig {} 0'.format(egress))
+           os.system(config_cmds_egress)
+           egress_iface_num += 1
+    def acl_rule_traffic_send_recv(self, srcMac, dstMac, srcIp, dstIp, ingress =None, egress=None, ip_proto=None, dstPortNum = None, positive_test = True):
+        if ingress is None:
+           ingress = self.ingress_iface
+        if egress is None:
+           egress = self.egress_iface
+        ingress = self.port_map[ingress]
+        egress = self.port_map[egress]
+        self.success = False if positive_test else True
+        timeout = 10 if positive_test else 1
+        count = 2 if positive_test else 1
+        self.start_sending = True
+        def recv_task():
+            def recv_cb(pkt):
+                log.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
+                self.success = True if positive_test else False
+            sniff(count=count, timeout=timeout,
+                  lfilter = lambda p: IP in p and p[IP].dst == dstIp.split('/')[0] and p[IP].src == srcIp.split('/')[0],
+                  prn = recv_cb, iface = egress)
+            self.start_sending = False
+
+        t = threading.Thread(target = recv_task)
+        t.start()
+        L2 = Ether(src = srcMac, dst = dstMac)
+        L3 = IP(src = srcIp.split('/')[0], dst = dstIp.split('/')[0])
+        pkt = L2/L3
+		        log.info('Sending a packet with dst ip %s, src ip %s , dst mac %s src mac %s on port %s to verify if flows are correct' %
+                 (dstIp.split('/')[0], srcIp.split('/')[0], dstMac, srcMac, ingress))
+        while self.start_sending is True:
+            sendp(pkt, count=50, iface = ingress)
+        t.join()
+        assert_equal(self.success, True)
+
+
+
+############################# vrouter utility functiuons ####################
+    @classmethod
     def vrouter_setup(cls):
         apps = ('org.onosproject.proxyarp', 'org.onosproject.hostprovider', 'org.onosproject.vrouter', 'org.onosproject.fwd')
         for app in apps:
@@ -432,7 +514,6 @@
         bgp_speakers_list.append(speaker_dict)
         cls.peer_list = peer_list
         return (cls.vrouter_device_dict, ports_dict, quagga_dict)
-
     @classmethod
     def generate_conf(cls, networks = 4, peer_address = None, router_address = None):
         num = 0
@@ -727,7 +808,6 @@
           ssm_groups = map(lambda sub: sub.channels, self.subscriber_list)
           ssm_list = reduce(lambda ssm1, ssm2: ssm1+ssm2, ssm_groups)
           igmpChannel.igmp_load_ssm_config(ssm_list)
-
     def subscriber_join_verify( self, num_subscribers = 10, num_channels = 1,
                                   channel_start = 0, cbs = None, port_list = [],
                                   services = None, negative_subscriber_auth = None):
@@ -962,9 +1042,9 @@
         return ':'.join(mac)
 
     def inc_ip(self, ip, i):
+
         ip[i] =str(int(ip[i])+1)
         return '.'.join(ip)
-
     def next_ip(self, ip):
 
         lst = ip.split('.')
@@ -985,4 +1065,3 @@
         lst=ip.split('.')
         lst[0] = '182'
         return '.'.join(lst)
-