Cleanup for using cord-tester logger over scapy logger which was an ugly hack.
Change-Id: I8af565f8eb4f69ddc6605e717a0c83772cc9417f
diff --git a/src/test/cbench/cbenchTest.py b/src/test/cbench/cbenchTest.py
index 869b71a..4948199 100644
--- a/src/test/cbench/cbenchTest.py
+++ b/src/test/cbench/cbenchTest.py
@@ -20,7 +20,8 @@
from nose.twistedtools import reactor, deferred
from twisted.internet import defer
from OnosCtrl import OnosCtrl
-from scapy.all import *
+from CordTestUtils import log_test as log
+
log.setLevel('INFO')
class cbench_exchange(unittest.TestCase):
@@ -74,7 +75,7 @@
log.info('Starting back switch with command: \"%s\"', cmd)
os.system(cmd)
time.sleep(3)
-
+
@deferred(CBENCH_TIMEOUT)
def test_cbench_igmp(self):
df = defer.Deferred()
diff --git a/src/test/cli/clicommon.py b/src/test/cli/clicommon.py
index 66b1845..8b2654a 100644
--- a/src/test/cli/clicommon.py
+++ b/src/test/cli/clicommon.py
@@ -1,12 +1,12 @@
-#
+#
# Copyright 2016-present Ciena Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -15,7 +15,7 @@
#
import os,sys
from utilities import Utilities, utilities
-from scapy.all import *
+from CordTestUtils import log_test as log
#log.setLevel('INFO')
class MAIN(object):
diff --git a/src/test/cluster/clusterTest.py b/src/test/cluster/clusterTest.py
index ab919a0..ed5f84a 100644
--- a/src/test/cluster/clusterTest.py
+++ b/src/test/cluster/clusterTest.py
@@ -17,7 +17,7 @@
from scapy.all import *
from OnosCtrl import OnosCtrl
from OltConfig import OltConfig
-from CordTestUtils import get_mac, get_controller, get_controllers
+from CordTestUtils import get_mac, get_controller, get_controllers, log_test
from OnosFlowCtrl import OnosFlowCtrl
from nose.twistedtools import reactor, deferred
from twisted.internet import defer
@@ -39,7 +39,7 @@
import json
import random
import collections
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class cluster_exchange(CordLogger):
test_path = os.path.dirname(os.path.realpath(__file__))
@@ -96,9 +96,9 @@
result = None
if result is None:
- log.info('Leaders command failure for controller %s' %controller)
+ log_test.info('Leaders command failure for controller %s' %controller)
else:
- log.info('Leaders returned: %s' %result)
+ log_test.info('Leaders returned: %s' %result)
self.cliExit()
return result
@@ -108,7 +108,7 @@
try:
self.cli.shutdown(timeout = 10)
except:
- log.info('Graceful shutdown of ONOS failed for controller: %s' %controller)
+ log_test.info('Graceful shutdown of ONOS failed for controller: %s' %controller)
status = False
self.cliExit()
@@ -142,7 +142,7 @@
while tries <= 10:
cluster_summary = json.loads(self.cli.summary(jsonFormat = True))
if cluster_summary:
- log.info("cluster 'summary' command output is %s"%cluster_summary)
+ log_test.info("cluster 'summary' command output is %s"%cluster_summary)
nodes = cluster_summary['nodes']
if verify:
if nodes == onos_instances:
@@ -175,7 +175,7 @@
while tries <= 10:
cluster_nodes = json.loads(self.cli.nodes(jsonFormat = True))
if cluster_nodes:
- log.info("cluster 'nodes' output is %s"%cluster_nodes)
+ log_test.info("cluster 'nodes' output is %s"%cluster_nodes)
if nodes_filter:
cluster_nodes = nodes_filter(cluster_nodes)
cluster_ips = map(lambda c: c['id'], cluster_nodes)
@@ -222,14 +222,14 @@
cli = self.cliEnter(controller = controller)
while tries <= 10:
roles = json.loads(self.cli.roles(jsonFormat = True))
- log.info("cluster 'roles' command output is %s"%roles)
+ log_test.info("cluster 'roles' command output is %s"%roles)
if roles:
for device in roles:
- log.info('Verifying device info in line %s'%device)
+ log_test.info('Verifying device info in line %s'%device)
if device['id'] == device_id:
master = str(device['master'])
standbys = map(lambda d: str(d), device['standbys'])
- log.info('Master and standbys for device %s are %s and %s'%(device_id, master, standbys))
+ log_test.info('Master and standbys for device %s are %s and %s'%(device_id, master, standbys))
self.cliExit()
return master, standbys
self.cliExit()
@@ -252,13 +252,13 @@
while tries <= 10:
device_dict = {}
roles = json.loads(self.cli.roles(jsonFormat = True))
- log.info("cluster 'roles' command output is %s"%roles)
+ log_test.info("cluster 'roles' command output is %s"%roles)
if roles:
for device in roles:
device_dict[str(device['id'])]= {'master':str(device['master']),'standbys':device['standbys']}
for i in range(len(device_dict[device['id']]['standbys'])):
device_dict[device['id']]['standbys'][i] = str(device_dict[device['id']]['standbys'][i])
- log.info('master and standbys for device %s are %s and %s'%(device['id'],device_dict[device['id']]['master'],device_dict[device['id']]['standbys']))
+ log_test.info('master and standbys for device %s are %s and %s'%(device['id'],device_dict[device['id']]['master'],device_dict[device['id']]['standbys']))
self.cliExit()
return device_dict
else:
@@ -280,10 +280,10 @@
while tries <= 10:
device_list = []
devices = json.loads(self.cli.devices(jsonFormat = True))
- log.info("cluster 'devices' command output is %s"%devices)
+ log_test.info("cluster 'devices' command output is %s"%devices)
if devices:
for device in devices:
- log.info('device id is %s'%device['id'])
+ log_test.info('device id is %s'%device['id'])
device_list.append(str(device['id']))
self.cliExit()
return device_list
@@ -321,7 +321,7 @@
time.sleep(60)
master, standbys = self.get_cluster_current_master_standbys(controller=controller,device_id=device_id)
assert_equal(master,new_master)
- log.info('Cluster master changed to %s successfully'%new_master)
+ log_test.info('Cluster master changed to %s successfully'%new_master)
def withdraw_cluster_current_mastership(self,master_ip=None,device_id=device_id,controller=None):
'''current master looses its mastership and hence new master will be elected'''
@@ -332,15 +332,15 @@
time.sleep(60)
new_master_ip, standbys = self.get_cluster_current_master_standbys(controller=controller,device_id=device_id)
assert_not_equal(new_master_ip,master_ip)
- log.info('Device-role of device %s successfully changed to none for controller %s'%(device_id,master_ip))
- log.info('Cluster new master is %s'%new_master_ip)
+ log_test.info('Device-role of device %s successfully changed to none for controller %s'%(device_id,master_ip))
+ log_test.info('Cluster new master is %s'%new_master_ip)
return True
def cluster_controller_restarts(self, graceful = False):
controllers = get_controllers()
ctlr_len = len(controllers)
if ctlr_len <= 1:
- log.info('ONOS is not running in cluster mode. This test only works for cluster mode')
+ log_test.info('ONOS is not running in cluster mode. This test only works for cluster mode')
assert_greater(ctlr_len, 1)
#this call would verify the cluster for once
@@ -357,15 +357,15 @@
##check the logs for storage exception
_, output = onosLog.get_log(('ERROR', 'Exception',))
if output and output.find('StorageException$Timeout') >= 0:
- log.info('\nStorage Exception Timeout found on node: %s\n' %node)
- log.info('Dumping the ERROR and Exception logs for node: %s\n' %node)
- log.info('\n' + '-' * 50 + '\n')
- log.info('%s' %output)
- log.info('\n' + '-' * 50 + '\n')
+ log_test.info('\nStorage Exception Timeout found on node: %s\n' %node)
+ log_test.info('Dumping the ERROR and Exception logs for node: %s\n' %node)
+ log_test.info('\n' + '-' * 50 + '\n')
+ log_test.info('%s' %output)
+ log_test.info('\n' + '-' * 50 + '\n')
failed = self.verify_leaders(controllers)
if failed:
- log.info('Leaders command failed on nodes: %s' %failed)
- log.error('Test failed on ITERATION %d' %iteration)
+ log_test.info('Leaders command failed on nodes: %s' %failed)
+ log_test.error('Test failed on ITERATION %d' %iteration)
CordLogger.archive_results(self._testMethodName,
controllers = controllers,
iteration = 'FAILED',
@@ -375,21 +375,21 @@
try:
ips = self.get_cluster_current_member_ips(controller = adjacent_controller)
- log.info('ONOS cluster formed with controllers: %s' %ips)
+ log_test.info('ONOS cluster formed with controllers: %s' %ips)
st = True
except:
st = False
failed = self.verify_leaders(controllers)
if failed:
- log.error('Test failed on ITERATION %d' %iteration)
+ log_test.error('Test failed on ITERATION %d' %iteration)
CordLogger.archive_results(self._testMethodName,
controllers = controllers,
iteration = 'FAILED',
archive_partition = self.ARCHIVE_PARTITION)
assert_equal(len(failed), 0)
if st is False:
- log.info('No storage exception and ONOS cluster was not formed successfully')
+ log_test.info('No storage exception and ONOS cluster was not formed successfully')
else:
controller = None
@@ -402,14 +402,14 @@
#index = random.randrange(0, ctlr_len)
controller_name = onos_map[controllers[index]] if next_controller is None else onos_map[next_controller]
controller = onos_map[controller_name]
- log.info('ITERATION: %d. Restarting Controller %s' %(num + 1, controller_name))
+ log_test.info('ITERATION: %d. Restarting Controller %s' %(num + 1, controller_name))
try:
#enable debug log for the other controllers before restarting this controller
adjacent_controllers = list( set(controllers) - set([controller]) )
self.log_set(controllers = adjacent_controllers)
self.log_set(app = 'io.atomix', controllers = adjacent_controllers)
if graceful is True:
- log.info('Gracefully shutting down controller: %s' %controller)
+ log_test.info('Gracefully shutting down controller: %s' %controller)
self.onos_shutdown(controller)
cord_test_onos_restart(node = controller, timeout = 0)
self.log_set(controllers = controller)
@@ -439,7 +439,7 @@
controllers = get_controllers()
ctlr_len = len(controllers)
if ctlr_len <= 1:
- log.info('ONOS is not running in cluster mode. This test only works for cluster mode')
+ log_test.info('ONOS is not running in cluster mode. This test only works for cluster mode')
assert_greater(ctlr_len, 1)
#this call would verify the cluster for once
@@ -455,19 +455,19 @@
##check the logs for storage exception
_, output = onosLog.get_log(('ERROR', 'Exception',))
if output and output.find('StorageException$Timeout') >= 0:
- log.info('\nStorage Exception Timeout found on node: %s\n' %node)
- log.info('Dumping the ERROR and Exception logs for node: %s\n' %node)
- log.info('\n' + '-' * 50 + '\n')
- log.info('%s' %output)
- log.info('\n' + '-' * 50 + '\n')
+ log_test.info('\nStorage Exception Timeout found on node: %s\n' %node)
+ log_test.info('Dumping the ERROR and Exception logs for node: %s\n' %node)
+ log_test.info('\n' + '-' * 50 + '\n')
+ log_test.info('%s' %output)
+ log_test.info('\n' + '-' * 50 + '\n')
storage_exceptions.append(node)
failed = self.verify_leaders(controller_list)
if failed:
- log.info('Leaders command failed on nodes: %s' %failed)
+ log_test.info('Leaders command failed on nodes: %s' %failed)
if storage_exceptions:
- log.info('Storage exception seen on nodes: %s' %storage_exceptions)
- log.error('Test failed on ITERATION %d' %iteration)
+ log_test.info('Storage exception seen on nodes: %s' %storage_exceptions)
+ log_test.error('Test failed on ITERATION %d' %iteration)
CordLogger.archive_results('test_cluster_single_controller_restarts',
controllers = controllers,
iteration = 'FAILED',
@@ -479,11 +479,11 @@
ips = self.get_cluster_current_member_ips(controller = ctlr,
nodes_filter = \
lambda nodes: [ n for n in nodes if n['state'] in [ 'ACTIVE', 'READY'] ])
- log.info('ONOS cluster on node %s formed with controllers: %s' %(ctlr, ips))
+ log_test.info('ONOS cluster on node %s formed with controllers: %s' %(ctlr, ips))
if controller in ips and inclusive is False:
- log.info('Controller %s still ACTIVE on Node %s after it was shutdown' %(controller, ctlr))
+ log_test.info('Controller %s still ACTIVE on Node %s after it was shutdown' %(controller, ctlr))
if controller not in ips and inclusive is True:
- log.info('Controller %s still INACTIVE on Node %s after it was restarted' %(controller, ctlr))
+ log_test.info('Controller %s still INACTIVE on Node %s after it was restarted' %(controller, ctlr))
return controller
@@ -495,7 +495,7 @@
self.log_set(controllers = controllers)
self.log_set(app = 'io.atomix', controllers = controllers)
for num in range(tries):
- log.info('ITERATION: %d. Shutting down Controller %s' %(num + 1, controller_name))
+ log_test.info('ITERATION: %d. Shutting down Controller %s' %(num + 1, controller_name))
try:
cord_test_onos_shutdown(node = controller)
time.sleep(20)
@@ -505,7 +505,7 @@
#check for exceptions on the adjacent nodes
check_exception(num, controller)
#Now restart the controller back
- log.info('Restarting back the controller %s' %controller_name)
+ log_test.info('Restarting back the controller %s' %controller_name)
cord_test_onos_restart(node = controller)
self.log_set(controllers = controller)
self.log_set(app = 'io.atomix', controllers = controller)
@@ -522,7 +522,7 @@
controllers = get_controllers()
ctlr_len = len(controllers)
if ctlr_len <= 1:
- log.info('ONOS is not running in cluster mode. This test only works for cluster mode')
+ log_test.info('ONOS is not running in cluster mode. This test only works for cluster mode')
assert_greater(ctlr_len, 1)
#this call would verify the cluster for once
@@ -536,19 +536,19 @@
##check the logs for storage exception
_, output = onosLog.get_log(('ERROR', 'Exception',))
if output and output.find('StorageException$Timeout') >= 0:
- log.info('\nStorage Exception Timeout found on node: %s\n' %node)
- log.info('Dumping the ERROR and Exception logs for node: %s\n' %node)
- log.info('\n' + '-' * 50 + '\n')
- log.info('%s' %output)
- log.info('\n' + '-' * 50 + '\n')
+ log_test.info('\nStorage Exception Timeout found on node: %s\n' %node)
+ log_test.info('Dumping the ERROR and Exception logs for node: %s\n' %node)
+ log_test.info('\n' + '-' * 50 + '\n')
+ log_test.info('%s' %output)
+ log_test.info('\n' + '-' * 50 + '\n')
storage_exceptions.append(node)
failed = self.verify_leaders(controller_list)
if failed:
- log.info('Leaders command failed on nodes: %s' %failed)
+ log_test.info('Leaders command failed on nodes: %s' %failed)
if storage_exceptions:
- log.info('Storage exception seen on nodes: %s' %storage_exceptions)
- log.error('Test failed on ITERATION %d' %iteration)
+ log_test.info('Storage exception seen on nodes: %s' %storage_exceptions)
+ log_test.error('Test failed on ITERATION %d' %iteration)
CordLogger.archive_results('test_cluster_restarts',
controllers = controllers,
iteration = 'FAILED',
@@ -560,9 +560,9 @@
ips = self.get_cluster_current_member_ips(controller = ctlr,
nodes_filter = \
lambda nodes: [ n for n in nodes if n['state'] in [ 'ACTIVE', 'READY'] ])
- log.info('ONOS cluster on node %s formed with controllers: %s' %(ctlr, ips))
+ log_test.info('ONOS cluster on node %s formed with controllers: %s' %(ctlr, ips))
if len(ips) != len(controllers):
- log.error('Test failed on ITERATION %d' %iteration)
+ log_test.error('Test failed on ITERATION %d' %iteration)
CordLogger.archive_results('test_cluster_restarts',
controllers = controllers,
iteration = 'FAILED',
@@ -571,12 +571,12 @@
tries = self.ITERATIONS
for num in range(tries):
- log.info('ITERATION: %d. Restarting cluster with controllers at %s' %(num+1, controllers))
+ log_test.info('ITERATION: %d. Restarting cluster with controllers at %s' %(num+1, controllers))
try:
cord_test_restart_cluster()
self.log_set(controllers = controllers)
self.log_set(app = 'io.atomix', controllers = controllers)
- log.info('Delaying before verifying cluster status')
+ log_test.info('Delaying before verifying cluster status')
time.sleep(60)
except:
time.sleep(10)
@@ -594,7 +594,7 @@
def test_cluster_formation_and_verification(self,onos_instances = ONOS_INSTANCES):
status = self.verify_cluster_status(onos_instances = onos_instances)
assert_equal(status, True)
- log.info('Cluster exists with %d ONOS instances'%onos_instances)
+ log_test.info('Cluster exists with %d ONOS instances'%onos_instances)
#nottest cluster not coming up properly if member goes down
def test_cluster_adding_members(self, add = 2, onos_instances = ONOS_INSTANCES):
@@ -602,7 +602,7 @@
assert_equal(status, True)
onos_ips = self.get_cluster_current_member_ips()
onos_instances = len(onos_ips)+add
- log.info('Adding %d nodes to the ONOS cluster' %add)
+ log_test.info('Adding %d nodes to the ONOS cluster' %add)
cord_test_onos_add_cluster(count = add)
status = self.verify_cluster_status(onos_instances=onos_instances)
assert_equal(status, True)
@@ -614,7 +614,7 @@
assert_equal(len(standbys),(onos_instances-1))
onos_names_ips = self.get_cluster_container_names_ips()
master_onos_name = onos_names_ips[master]
- log.info('Removing cluster current master %s'%(master))
+ log_test.info('Removing cluster current master %s'%(master))
cord_test_onos_shutdown(node = master)
time.sleep(60)
onos_instances -= 1
@@ -622,7 +622,7 @@
assert_equal(status, True)
new_master, standbys = self.get_cluster_current_master_standbys(controller=standbys[0])
assert_not_equal(master,new_master)
- log.info('Successfully removed clusters master instance')
+ log_test.info('Successfully removed clusters master instance')
def test_cluster_removing_one_member(self, onos_instances = ONOS_INSTANCES):
status = self.verify_cluster_status(onos_instances = onos_instances)
@@ -631,7 +631,7 @@
assert_equal(len(standbys),(onos_instances-1))
onos_names_ips = self.get_cluster_container_names_ips()
member_onos_name = onos_names_ips[standbys[0]]
- log.info('Removing cluster member %s'%standbys[0])
+ log_test.info('Removing cluster member %s'%standbys[0])
cord_test_onos_shutdown(node = standbys[0])
time.sleep(60)
onos_instances -= 1
@@ -646,9 +646,9 @@
onos_names_ips = self.get_cluster_container_names_ips()
member1_onos_name = onos_names_ips[standbys[0]]
member2_onos_name = onos_names_ips[standbys[1]]
- log.info('Removing cluster member %s'%standbys[0])
+ log_test.info('Removing cluster member %s'%standbys[0])
cord_test_onos_shutdown(node = standbys[0])
- log.info('Removing cluster member %s'%standbys[1])
+ log_test.info('Removing cluster member %s'%standbys[1])
cord_test_onos_shutdown(node = standbys[1])
time.sleep(60)
onos_instances = onos_instances - 2
@@ -663,7 +663,7 @@
onos_names_ips = self.get_cluster_container_names_ips()
for i in range(remove):
member_onos_name = onos_names_ips[standbys[i]]
- log.info('Removing onos container with name %s'%standbys[i])
+ log_test.info('Removing onos container with name %s'%standbys[i])
cord_test_onos_shutdown(node = standbys[i])
time.sleep(60)
onos_instances = onos_instances - remove
@@ -676,14 +676,14 @@
assert_equal(status, True)
onos_ips = self.get_cluster_current_member_ips()
onos_instances = len(onos_ips)+add
- log.info('Adding %d ONOS instances to the cluster'%add)
+ log_test.info('Adding %d ONOS instances to the cluster'%add)
cord_test_onos_add_cluster(count = add)
status = self.verify_cluster_status(onos_instances=onos_instances)
assert_equal(status, True)
- log.info('Removing %d ONOS instances from the cluster'%remove)
+ log_test.info('Removing %d ONOS instances from the cluster'%remove)
for i in range(remove):
name = '{}-{}'.format(Onos.NAME, onos_instances - i)
- log.info('Removing onos container with name %s'%name)
+ log_test.info('Removing onos container with name %s'%name)
cord_test_onos_shutdown(node = name)
time.sleep(60)
onos_instances = onos_instances-remove
@@ -696,15 +696,15 @@
assert_equal(status, True)
onos_ips = self.get_cluster_current_member_ips()
onos_instances = onos_instances-remove
- log.info('Removing %d ONOS instances from the cluster'%remove)
+ log_test.info('Removing %d ONOS instances from the cluster'%remove)
for i in range(remove):
name = '{}-{}'.format(Onos.NAME, len(onos_ips)-i)
- log.info('Removing onos container with name %s'%name)
+ log_test.info('Removing onos container with name %s'%name)
cord_test_onos_shutdown(node = name)
time.sleep(60)
status = self.verify_cluster_status(onos_instances=onos_instances)
assert_equal(status, True)
- log.info('Adding %d ONOS instances to the cluster'%add)
+ log_test.info('Adding %d ONOS instances to the cluster'%add)
cord_test_onos_add_cluster(count = add)
onos_instances = onos_instances+add
status = self.verify_cluster_status(onos_instances=onos_instances)
@@ -713,7 +713,7 @@
def test_cluster_restart(self, onos_instances = ONOS_INSTANCES):
status = self.verify_cluster_status(onos_instances = onos_instances)
assert_equal(status, True)
- log.info('Restarting cluster')
+ log_test.info('Restarting cluster')
cord_test_onos_restart()
status = self.verify_cluster_status(onos_instances = onos_instances)
assert_equal(status, True)
@@ -724,11 +724,11 @@
master, standbys = self.get_cluster_current_master_standbys()
onos_names_ips = self.get_cluster_container_names_ips()
master_onos_name = onos_names_ips[master]
- log.info('Restarting cluster master %s'%master)
+ log_test.info('Restarting cluster master %s'%master)
cord_test_onos_restart(node = master)
status = self.verify_cluster_status(onos_instances = onos_instances)
assert_equal(status, True)
- log.info('Cluster came up after master restart as expected')
+ log_test.info('Cluster came up after master restart as expected')
#test fail. master changing after restart. Need to check correct behavior.
def test_cluster_master_ip_after_master_restart(self,onos_instances = ONOS_INSTANCES):
@@ -737,13 +737,13 @@
master1, standbys = self.get_cluster_current_master_standbys()
onos_names_ips = self.get_cluster_container_names_ips()
master_onos_name = onos_names_ips[master1]
- log.info('Restarting cluster master %s'%master1)
+ log_test.info('Restarting cluster master %s'%master1)
cord_test_onos_restart(node = master1)
status = self.verify_cluster_status(onos_instances = onos_instances)
assert_equal(status, True)
master2, standbys = self.get_cluster_current_master_standbys()
assert_equal(master1,master2)
- log.info('Cluster master is same before and after cluster master restart as expected')
+ log_test.info('Cluster master is same before and after cluster master restart as expected')
def test_cluster_one_member_restart(self,onos_instances = ONOS_INSTANCES):
status = self.verify_cluster_status(onos_instances = onos_instances)
@@ -752,11 +752,11 @@
assert_equal(len(standbys),(onos_instances-1))
onos_names_ips = self.get_cluster_container_names_ips()
member_onos_name = onos_names_ips[standbys[0]]
- log.info('Restarting cluster member %s'%standbys[0])
+ log_test.info('Restarting cluster member %s'%standbys[0])
cord_test_onos_restart(node = standbys[0])
status = self.verify_cluster_status(onos_instances = onos_instances)
assert_equal(status, True)
- log.info('Cluster came up as expected after restarting one member')
+ log_test.info('Cluster came up as expected after restarting one member')
def test_cluster_two_members_restart(self,onos_instances = ONOS_INSTANCES):
status = self.verify_cluster_status(onos_instances = onos_instances)
@@ -766,12 +766,12 @@
onos_names_ips = self.get_cluster_container_names_ips()
member1_onos_name = onos_names_ips[standbys[0]]
member2_onos_name = onos_names_ips[standbys[1]]
- log.info('Restarting cluster members %s and %s'%(standbys[0],standbys[1]))
+ log_test.info('Restarting cluster members %s and %s'%(standbys[0],standbys[1]))
cord_test_onos_restart(node = standbys[0])
cord_test_onos_restart(node = standbys[1])
status = self.verify_cluster_status(onos_instances = onos_instances)
assert_equal(status, True)
- log.info('Cluster came up as expected after restarting two members')
+ log_test.info('Cluster came up as expected after restarting two members')
def test_cluster_state_with_N_members_restart(self, members = 2, onos_instances = ONOS_INSTANCES):
status = self.verify_cluster_status(onos_instances = onos_instances)
@@ -781,21 +781,21 @@
onos_names_ips = self.get_cluster_container_names_ips()
for i in range(members):
member_onos_name = onos_names_ips[standbys[i]]
- log.info('Restarting cluster member %s'%standbys[i])
+ log_test.info('Restarting cluster member %s'%standbys[i])
cord_test_onos_restart(node = standbys[i])
status = self.verify_cluster_status(onos_instances = onos_instances)
assert_equal(status, True)
- log.info('Cluster came up as expected after restarting %d members'%members)
+ log_test.info('Cluster came up as expected after restarting %d members'%members)
def test_cluster_state_with_master_change(self,onos_instances = ONOS_INSTANCES):
status = self.verify_cluster_status(onos_instances=onos_instances)
assert_equal(status, True)
master, standbys = self.get_cluster_current_master_standbys()
assert_equal(len(standbys),(onos_instances-1))
- log.info('Cluster current master of devices is %s'%master)
+ log_test.info('Cluster current master of devices is %s'%master)
self.change_master_current_cluster(new_master=standbys[0])
- log.info('Cluster master changed successfully')
+ log_test.info('Cluster master changed successfully')
#tested on single onos setup.
def test_cluster_with_vrouter_routes_in_cluster_members(self,networks = 5,onos_instances = ONOS_INSTANCES):
@@ -822,7 +822,7 @@
time.sleep(1)
assert_equal(flag, True)
except:
- log.info('Exception occured while checking routes in onos instance %s'%onos_ip)
+ log_test.info('Exception occured while checking routes in onos instance %s'%onos_ip)
raise
#tested on single onos setup.
@@ -838,7 +838,7 @@
assert_equal(res,True)
cord_test_onos_shutdown(node = master)
time.sleep(60)
- log.info('Verifying vrouter traffic after cluster master is down')
+ log_test.info('Verifying vrouter traffic after cluster master is down')
self.vrouter.vrouter_traffic_verify()
#tested on single onos setup.
@@ -875,14 +875,14 @@
onos_names_ips = self.get_cluster_container_names_ips()
master_onos_name = onos_names_ips[master]
self.vrouter.setUpClass()
- log.info('Verifying vrouter before master down')
+ log_test.info('Verifying vrouter before master down')
res = self.vrouter.vrouter_network_verify(networks, peers = 1)
assert_equal(res, True)
self.vrouter.vrouter_activate(deactivate=True)
- log.info('Verifying vrouter traffic after app deactivated')
+ log_test.info('Verifying vrouter traffic after app deactivated')
time.sleep(15) ## Expecting vrouter should work properly if master of cluster goes down
self.vrouter.vrouter_traffic_verify(positive_test=False)
- log.info('Verifying vrouter traffic after master down')
+ log_test.info('Verifying vrouter traffic after master down')
cord_test_onos_shutdown(node = master)
time.sleep(60)
self.vrouter.vrouter_traffic_verify(positive_test=False)
@@ -896,10 +896,10 @@
onos_names_ips = self.get_cluster_container_names_ips()
member_onos_name = onos_names_ips[standbys[0]]
self.vrouter.setUpClass()
- log.info('Verifying vrouter before cluster member down')
+ log_test.info('Verifying vrouter before cluster member down')
res = self.vrouter.vrouter_network_verify(networks, peers = 1)
assert_equal(res, True) # Expecting vrouter should work properly
- log.info('Verifying vrouter after cluster member down')
+ log_test.info('Verifying vrouter after cluster member down')
cord_test_onos_shutdown(node = standbys[0])
time.sleep(60)
self.vrouter.vrouter_traffic_verify()# Expecting vrouter should work properly if member of cluster goes down
@@ -912,11 +912,11 @@
onos_names_ips = self.get_cluster_container_names_ips()
member_onos_name = onos_names_ips[standbys[1]]
self.vrouter.setUpClass()
- log.info('Verifying vrouter traffic before cluster member restart')
+ log_test.info('Verifying vrouter traffic before cluster member restart')
res = self.vrouter.vrouter_network_verify(networks, peers = 1)
assert_equal(res, True) # Expecting vrouter should work properly
cord_test_onos_restart(node = standbys[1])
- log.info('Verifying vrouter traffic after cluster member restart')
+ log_test.info('Verifying vrouter traffic after cluster member restart')
self.vrouter.vrouter_traffic_verify()# Expecting vrouter should work properly if member of cluster restarts
#tested on single onos setup.
@@ -924,11 +924,11 @@
status = self.verify_cluster_status(onos_instances = onos_instances)
assert_equal(status, True)
self.vrouter.setUpClass()
- log.info('Verifying vrouter traffic before cluster restart')
+ log_test.info('Verifying vrouter traffic before cluster restart')
res = self.vrouter.vrouter_network_verify(networks, peers = 1)
assert_equal(res, True) # Expecting vrouter should work properly
cord_test_onos_restart()
- log.info('Verifying vrouter traffic after cluster restart')
+ log_test.info('Verifying vrouter traffic after cluster restart')
self.vrouter.vrouter_traffic_verify()# Expecting vrouter should work properly if member of cluster restarts
@@ -957,7 +957,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
+ log_test.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
self.success = True
sniff(timeout=2,
lfilter = lambda p: UDP in p and p[UDP].dport == egress_map['udp_port']
@@ -966,17 +966,17 @@
for i in [0,1]:
if i == 1:
cord_test_onos_shutdown(node = master)
- log.info('Verifying flows traffic after master killed')
+ log_test.info('Verifying flows traffic after master killed')
time.sleep(45)
else:
- log.info('Verifying flows traffic before master killed')
+ log_test.info('Verifying flows traffic before master killed')
t = threading.Thread(target = mac_recv_task)
t.start()
L2 = self.flows_eth #Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])
L4 = UDP(sport = ingress_map['udp_port'], dport = egress_map['udp_port'])
pkt = L2/L3/L4
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.flows.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -1003,7 +1003,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: IP in p and p[IP].dst == egress_map['ip'] and p[IP].src == ingress_map['ip']
@@ -1011,17 +1011,17 @@
iface = self.flows.port_map[egress])
for i in [0,1]:
if i == 1:
- log.info('Changing cluster master to %s'%standbys[0])
+ log_test.info('Changing cluster master to %s'%standbys[0])
self.change_master_current_cluster(new_master=standbys[0])
- log.info('Verifying flow traffic after cluster master chnaged')
+ log_test.info('Verifying flow traffic after cluster master chnaged')
else:
- log.info('Verifying flow traffic before cluster master changed')
+ log_test.info('Verifying flow traffic before cluster master changed')
t = threading.Thread(target = mac_recv_task)
t.start()
L2 = self.flows_eth # Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'], tos = 1)
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.flows.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -1052,24 +1052,24 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s, Extension Header Type %s'%(pkt[IPv6].src, pkt[IPv6].dst, pkt[IPv6].nh))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s, Extension Header Type %s'%(pkt[IPv6].src, pkt[IPv6].dst, pkt[IPv6].nh))
self.success = True
sniff(timeout=2,count=5,
lfilter = lambda p: IPv6 in p and p[IPv6].nh == 0, prn = recv_cb, iface = self.flows.port_map[egress])
for i in [0,1]:
if i == 1:
- log.info('Restart cluster current master %s'%master)
+ log_test.info('Restart cluster current master %s'%master)
Container(master_onos_name,Onos.IMAGE).restart()
time.sleep(45)
- log.info('Verifying flow traffic after master restart')
+ log_test.info('Verifying flow traffic after master restart')
else:
- log.info('Verifying flow traffic before master restart')
+ log_test.info('Verifying flow traffic before master restart')
t = threading.Thread(target = mac_recv_task)
t.start()
L2 = self.flows_eth
L3 = IPv6(src = ingress_map['ipv6'] , dst = egress_map['ipv6'], nh = 0)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.flows.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -1081,14 +1081,14 @@
data = repr(monotonic.monotonic())
sendp(eth/ip/data,count=20, iface = intf)
pkt = (eth/ip/data)
- log.info('multicast traffic packet %s'%pkt.show())
+ log_test.info('multicast traffic packet %s'%pkt.show())
def verify_igmp_data_traffic(self, group, intf='veth0', source='1.2.3.4' ):
- log.info('verifying multicast traffic for group %s from source %s'%(group,source))
+ log_test.info('verifying multicast traffic for group %s from source %s'%(group,source))
self.success = False
def recv_task():
def igmp_recv_cb(pkt):
- log.info('multicast data received for group %s from source %s'%(group,source))
+ log_test.info('multicast data received for group %s from source %s'%(group,source))
self.success = True
sniff(prn = igmp_recv_cb,lfilter = lambda p: IP in p and p[IP].dst == group and p[IP].src == source, count=1,timeout = 2, iface='veth0')
t = threading.Thread(target = recv_task)
@@ -1117,10 +1117,10 @@
assert_equal(status,True)
status = self.verify_igmp_data_traffic(groups[1],intf = self.V_INF1,source= src_list[1])
assert_equal(status,False)
- log.info('restarting cluster master %s'%master)
+ log_test.info('restarting cluster master %s'%master)
Container(master_onos_name,Onos.IMAGE).restart()
time.sleep(60)
- log.info('verifying multicast data traffic after master restart')
+ log_test.info('verifying multicast data traffic after master restart')
status = self.verify_igmp_data_traffic(groups[0],intf=self.V_INF1,source=src_list[0])
assert_equal(status,True)
status = self.verify_igmp_data_traffic(groups[1],intf = self.V_INF1,source= src_list[1])
@@ -1146,12 +1146,12 @@
assert_equal(status,True)
status = self.verify_igmp_data_traffic(groups[1],intf = self.V_INF1,source= src_list[0])
assert_equal(status,False)
- log.info('Killing cluster master %s'%master)
+ log_test.info('Killing cluster master %s'%master)
Container(master_onos_name,Onos.IMAGE).kill()
time.sleep(60)
status = self.verify_cluster_status(onos_instances=onos_instances-1,controller=standbys[0])
assert_equal(status, True)
- log.info('Verifying multicast data traffic after cluster master down')
+ log_test.info('Verifying multicast data traffic after cluster master down')
status = self.verify_igmp_data_traffic(groups[0],intf=self.V_INF1,source=src_list[0])
assert_equal(status,True)
status = self.verify_igmp_data_traffic(groups[1],intf = self.V_INF1,source= src_list[0])
@@ -1172,11 +1172,11 @@
iface = self.V_INF1, delay = 2)
status = self.verify_igmp_data_traffic(groups[0],intf=self.V_INF1,source=src_list[0])
assert_equal(status,True)
- log.info('Killing clusters master %s'%master)
+ log_test.info('Killing clusters master %s'%master)
Container(master_onos_name,Onos.IMAGE).kill()
count = 0
for i in range(60):
- log.info('Verifying multicast data traffic after cluster master down')
+ log_test.info('Verifying multicast data traffic after cluster master down')
status = self.verify_igmp_data_traffic(groups[0],intf=self.V_INF1,source=src_list[0])
if status:
break
@@ -1184,7 +1184,7 @@
count += 1
time.sleep(1)
assert_equal(status, True)
- log.info('Time taken to recover traffic after clusters master down is %d seconds'%count)
+ log_test.info('Time taken to recover traffic after clusters master down is %d seconds'%count)
#pass
@@ -1201,12 +1201,12 @@
iface = self.V_INF1, delay = 2)
status = self.verify_igmp_data_traffic(groups[0],intf=self.V_INF1,source=src_list[0])
assert_equal(status,True)
- log.info('Changing cluster master %s to %s'%(master,standbys[0]))
+ log_test.info('Changing cluster master %s to %s'%(master,standbys[0]))
self.change_cluster_current_master(new_master=standbys[0])
- log.info('Verifying multicast traffic after cluster master change')
+ log_test.info('Verifying multicast traffic after cluster master change')
status = self.verify_igmp_data_traffic(groups[0],intf=self.V_INF1,source=src_list[0])
assert_equal(status,True)
- log.info('Sending igmp TO_EXCLUDE message to leave the group %s'%groups[0])
+ log_test.info('Sending igmp TO_EXCLUDE message to leave the group %s'%groups[0])
self.igmp.send_igmp_join(groups = [groups[0]], src_list = src_list,record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE,
iface = self.V_INF1, delay = 1)
time.sleep(10)
@@ -1223,7 +1223,7 @@
groups = [self.igmp.random_mcast_ip()]
src_list = [self.igmp.randomsourceip()]
self.igmp.onos_ssm_table_load(groups, src_list=src_list,controller=master)
- log.info('Changing cluster master %s to %s'%(master,standbys[0]))
+ log_test.info('Changing cluster master %s to %s'%(master,standbys[0]))
self.change_cluster_current_master(new_master = standbys[0])
self.igmp.send_igmp_join(groups = [groups[0]], src_list = src_list,record_type = IGMP_V3_GR_TYPE_INCLUDE,
iface = self.V_INF1, delay = 2)
@@ -1260,11 +1260,11 @@
df.callback(0)
for i in [0,1]:
if i == 1:
- log.info('Changing cluster master %s to %s'%(master, standbys[0]))
+ log_test.info('Changing cluster master %s to %s'%(master, standbys[0]))
self.change_master_current_cluster(new_master=standbys[0])
- log.info('Verifying tls authentication after cluster master changed to %s'%standbys[0])
+ log_test.info('Verifying tls authentication after cluster master changed to %s'%standbys[0])
else:
- log.info('Verifying tls authentication before cluster master change')
+ log_test.info('Verifying tls authentication before cluster master change')
reactor.callLater(0, eap_tls_verify, df)
return df
@@ -1284,13 +1284,13 @@
df.callback(0)
for i in [0,1]:
if i == 1:
- log.info('Killing cluster current master %s'%master)
+ log_test.info('Killing cluster current master %s'%master)
cord_test_onos_shutdown(node = master)
time.sleep(20)
status = self.verify_cluster_status(controller=standbys[0],onos_instances=onos_instances-1,verify=True)
assert_equal(status, True)
- log.info('Cluster came up with %d instances after killing master'%(onos_instances-1))
- log.info('Verifying tls authentication after killing cluster master')
+ log_test.info('Cluster came up with %d instances after killing master'%(onos_instances-1))
+ log_test.info('Verifying tls authentication after killing cluster master')
reactor.callLater(0, eap_tls_verify, df)
return df
@@ -1306,20 +1306,20 @@
df = defer.Deferred()
def eap_tls_no_cert(df):
def tls_no_cert_cb():
- log.info('TLS authentication failed with no certificate')
+ log_test.info('TLS authentication failed with no certificate')
tls = TLSAuthTest(fail_cb = tls_no_cert_cb, client_cert = '')
tls.runTest()
assert_equal(tls.failTest, True)
df.callback(0)
for i in [0,1]:
if i == 1:
- log.info('Restart cluster member %s'%standbys[0])
+ log_test.info('Restart cluster member %s'%standbys[0])
Container(member_onos_name,Onos.IMAGE).restart()
time.sleep(20)
status = self.verify_cluster_status(onos_instances=onos_instances)
assert_equal(status, True)
- log.info('Cluster came up with %d instances after member restart'%(onos_instances))
- log.info('Verifying tls authentication after member restart')
+ log_test.info('Cluster came up with %d instances after member restart'%(onos_instances))
+ log_test.info('Verifying tls authentication after member restart')
reactor.callLater(0, eap_tls_no_cert, df)
return df
@@ -1335,19 +1335,19 @@
for hostip, hostmac in hosts_config:
self.proxyarp.proxyarp_arpreply_verify(ingress,hostip,hostmac,PositiveTest = True)
time.sleep(1)
- log.info('changing cluster current master from %s to %s'%(master,standbys[0]))
+ log_test.info('changing cluster current master from %s to %s'%(master,standbys[0]))
self.change_cluster_current_master(new_master=standbys[0])
- log.info('verifying proxyarp after master change')
+ log_test.info('verifying proxyarp after master change')
for hostip, hostmac in hosts_config:
self.proxyarp.proxyarp_arpreply_verify(ingress,hostip,hostmac,PositiveTest = True)
time.sleep(1)
- log.info('Deactivating proxyarp app and expecting proxyarp functionality not to work')
+ log_test.info('Deactivating proxyarp app and expecting proxyarp functionality not to work')
self.proxyarp.proxyarp_activate(deactivate = True,controller=standbys[0])
time.sleep(3)
for hostip, hostmac in hosts_config:
self.proxyarp.proxyarp_arpreply_verify(ingress,hostip,hostmac,PositiveTest = False)
time.sleep(1)
- log.info('activating proxyarp app and expecting to get arp reply from ONOS')
+ log_test.info('activating proxyarp app and expecting to get arp reply from ONOS')
self.proxyarp.proxyarp_activate(deactivate = False,controller=standbys[0])
time.sleep(3)
for hostip, hostmac in hosts_config:
@@ -1368,13 +1368,13 @@
for hostip, hostmac in hosts_config:
self.proxyarp.proxyarp_arpreply_verify(ingress,hostip,hostmac,PositiveTest = True)
time.sleep(1)
- log.info('killing cluster member %s'%standbys[1])
+ log_test.info('killing cluster member %s'%standbys[1])
Container(member_onos_name,Onos.IMAGE).kill()
time.sleep(20)
status = self.verify_cluster_status(onos_instances=onos_instances-1,controller=master,verify=True)
assert_equal(status, True)
- log.info('cluster came up with %d instances after member down'%(onos_instances-1))
- log.info('verifying proxy arp functionality after cluster member down')
+ log_test.info('cluster came up with %d instances after member down'%(onos_instances-1))
+ log_test.info('verifying proxy arp functionality after cluster member down')
for hostip, hostmac in hosts_config:
self.proxyarp.proxyarp_arpreply_verify(ingress,hostip,hostmac,PositiveTest = True)
time.sleep(1)
@@ -1400,14 +1400,14 @@
ingress, hostmac, hostip = r[0],r[1],r[2]
def mac_recv_task():
def recv_cb(pkt):
- log.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
+ log_test.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
success_dir[current_thread().name] = True
sniff(count=1, timeout=5,lfilter = lambda p: ARP in p and p[ARP].op == 2 and p[ARP].hwsrc == hostmac,
prn = recv_cb, iface = self.proxyarp.port_map[ingress])
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = (Ether(dst = 'ff:ff:ff:ff:ff:ff')/ARP(op=1,pdst= hostip))
- log.info('Sending arp request for dest ip %s on interface %s' %
+ log_test.info('Sending arp request for dest ip %s on interface %s' %
(hostip,self.proxyarp.port_map[ingress]))
sendp(pkt, count = 10,iface = self.proxyarp.port_map[ingress])
t.join()
@@ -1433,17 +1433,17 @@
acl_rule = ACLTest()
status,code = acl_rule.adding_acl_rule('v4', srcIp=self.acl.ACL_SRC_IP, dstIp =self.acl.ACL_DST_IP, action = 'allow',controller=master)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
result = acl_rule.get_acl_rules(controller=master)
aclRules1 = result.json()['aclRules']
- log.info('Added acl rules is %s'%aclRules1)
+ log_test.info('Added acl rules is %s'%aclRules1)
acl_Id = map(lambda d: d['id'], aclRules1)
- log.info('Changing cluster current master from %s to %s'%(master,standbys[0]))
+ log_test.info('Changing cluster current master from %s to %s'%(master,standbys[0]))
self.change_cluster_current_master(new_master=standbys[0])
status,code = acl_rule.remove_acl_rule(acl_Id[0],controller=standbys[0])
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
#pass
@@ -1458,13 +1458,13 @@
acl_rule = ACLTest()
status,code = acl_rule.adding_acl_rule('v4', srcIp=self.acl.ACL_SRC_IP, dstIp =self.acl.ACL_DST_IP, action = 'allow',controller=master)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
result1 = acl_rule.get_acl_rules(controller=master)
aclRules1 = result1.json()['aclRules']
- log.info('Added acl rules is %s'%aclRules1)
+ log_test.info('Added acl rules is %s'%aclRules1)
acl_Id1 = map(lambda d: d['id'], aclRules1)
- log.info('Killing cluster current master %s'%master)
+ log_test.info('Killing cluster current master %s'%master)
Container(master_onos_name,Onos.IMAGE).kill()
time.sleep(45)
status = self.verify_cluster_status(onos_instances=onos_instances,controller=standbys[0])
@@ -1475,7 +1475,7 @@
result2 = acl_rule.get_acl_rules(controller=new_master)
aclRules2 = result2.json()['aclRules']
acl_Id2 = map(lambda d: d['id'], aclRules2)
- log.info('Acl Ids before and after master down are %s and %s'%(acl_Id1,acl_Id2))
+ log_test.info('Acl Ids before and after master down are %s and %s'%(acl_Id1,acl_Id2))
assert_equal(acl_Id2,acl_Id1)
#acl traffic scenario not working as acl rule is not getting added to onos
@@ -1494,7 +1494,7 @@
self.acl.CURRENT_PORT_NUM += 1
time.sleep(5)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
srcMac = '00:00:00:00:00:11'
dstMac = host_ip_mac[0][1]
@@ -1502,10 +1502,10 @@
status, code = acl_rule.adding_acl_rule('v4', srcIp=self.acl.ACL_SRC_IP, dstIp =self.acl.ACL_DST_IP, action = 'deny',controller=master)
time.sleep(10)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
self.acl.acl_rule_traffic_send_recv(srcMac = srcMac, dstMac = dstMac ,srcIp =self.acl.ACL_SRC_IP, dstIp = self.acl.ACL_DST_IP,ingress =ingress, egress = egress, ip_proto = 'UDP', positive_test = False)
- log.info('killing cluster members %s and %s'%(standbys[0],standbys[1]))
+ log_test.info('killing cluster members %s and %s'%(standbys[0],standbys[1]))
Container(member1_onos_name, Onos.IMAGE).kill()
Container(member2_onos_name, Onos.IMAGE).kill()
time.sleep(40)
@@ -1536,15 +1536,15 @@
controller=master)
self.dhcprelay.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = iface)
cip, sip = self.dhcprelay.send_recv(mac)
- log.info('Changing cluster current master from %s to %s'%(master, standbys[0]))
+ log_test.info('Changing cluster current master from %s to %s'%(master, standbys[0]))
self.change_master_current_cluster(new_master=standbys[0])
- log.info('Releasing ip %s to server %s' %(cip, sip))
+ log_test.info('Releasing ip %s to server %s' %(cip, sip))
assert_equal(self.dhcprelay.dhcp.release(cip), True)
- log.info('Triggering DHCP discover again after release')
+ log_test.info('Triggering DHCP discover again after release')
cip2, sip2 = self.dhcprelay.send_recv(mac)
- log.info('Verifying released IP was given back on rediscover')
+ log_test.info('Verifying released IP was given back on rediscover')
assert_equal(cip, cip2)
- log.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
+ log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
assert_equal(self.dhcprelay.dhcp.release(cip2), True)
self.dhcprelay.tearDownClass(controller=standbys[0])
@@ -1571,15 +1571,15 @@
subnet = subnet,
controller=master)
self.dhcprelay.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
- log.info('Initiating dhcp process from client %s'%mac)
+ log_test.info('Initiating dhcp process from client %s'%mac)
cip, sip = self.dhcprelay.send_recv(mac)
- log.info('Killing cluster current master %s'%master)
+ log_test.info('Killing cluster current master %s'%master)
Container(master_onos_name, Onos.IMAGE).kill()
time.sleep(60)
status = self.verify_cluster_status(onos_instances=onos_instances-1,verify=True,controller=standbys[0])
assert_equal(status, True)
mac = self.dhcprelay.dhcp.get_mac(cip)[0]
- log.info("Verifying dhcp clients gets same IP after cluster master restarts")
+ log_test.info("Verifying dhcp clients gets same IP after cluster master restarts")
new_cip, new_sip = self.dhcprelay.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
self.dhcprelay.tearDownClass(controller=standbys[0])
@@ -1607,17 +1607,17 @@
self.dhcprelay.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
cip1, sip1 = self.dhcprelay.send_recv(macs[0])
assert_not_equal(cip1,None)
- log.info('Got dhcp client IP %s for mac %s when cluster master is %s'%(cip1,macs[0],master))
- log.info('Changing cluster master from %s to %s'%(master, standbys[0]))
+ log_test.info('Got dhcp client IP %s for mac %s when cluster master is %s'%(cip1,macs[0],master))
+ log_test.info('Changing cluster master from %s to %s'%(master, standbys[0]))
self.change_master_current_cluster(new_master=standbys[0])
cip2, sip2 = self.dhcprelay.send_recv(macs[1])
assert_not_equal(cip2,None)
- log.info('Got dhcp client IP %s for mac %s when cluster master is %s'%(cip2,macs[1],standbys[0]))
+ log_test.info('Got dhcp client IP %s for mac %s when cluster master is %s'%(cip2,macs[1],standbys[0]))
self.change_master_current_cluster(new_master=master)
- log.info('Changing cluster master from %s to %s'%(standbys[0],master))
+ log_test.info('Changing cluster master from %s to %s'%(standbys[0],master))
cip3, sip3 = self.dhcprelay.send_recv(macs[2])
assert_not_equal(cip3,None)
- log.info('Got dhcp client IP %s for mac %s when cluster master is %s'%(cip2,macs[2],master))
+ log_test.info('Got dhcp client IP %s for mac %s when cluster master is %s'%(cip2,macs[2],master))
self.dhcprelay.tearDownClass(controller=standbys[0])
def test_cluster_with_cord_subscriber_joining_next_channel_before_and_after_cluster_restart(self,onos_instances=ONOS_INSTANCES):
@@ -1632,9 +1632,9 @@
time.sleep(45)
status = self.verify_cluster_status(onos_instances=onos_instances)
assert_equal(status, True)
- log.info('Verifying cord subscriber functionality after cluster restart')
+ log_test.info('Verifying cord subscriber functionality after cluster restart')
else:
- log.info('Verifying cord subscriber functionality before cluster restart')
+ log_test.info('Verifying cord subscriber functionality before cluster restart')
test_status = self.subscriber.subscriber_join_verify(num_subscribers = self.subscriber.num_subscribers,
num_channels = self.subscriber.num_channels,
cbs = (self.subscriber.tls_verify, self.subscriber.dhcp_next_verify,
@@ -1658,9 +1658,9 @@
status=self.withdraw_cluster_current_mastership(master_ip=master)
asser_equal(status, True)
master,standbys = self.get_cluster_current_master_standbys()
- log.info('verifying cord subscriber functionality after cluster current master withdraw mastership')
+ log_test.info('verifying cord subscriber functionality after cluster current master withdraw mastership')
else:
- log.info('verifying cord subscriber functionality before cluster master withdraw mastership')
+ log_test.info('verifying cord subscriber functionality before cluster master withdraw mastership')
test_status = self.subscriber.subscriber_join_verify(num_subscribers = self.subscriber.num_subscribers,
num_channels = self.subscriber.num_channels,
cbs = (self.subscriber.tls_verify, self.subscriber.dhcp_next_verify,
@@ -1687,9 +1687,9 @@
time.sleep(30)
status = self.verify_cluster_status(onos_instances=onos_instances-1,verify=True,controller=master)
assert_equal(status, True)
- log.info('Verifying cord subscriber functionality after cluster member %s is down'%standbys[0])
+ log_test.info('Verifying cord subscriber functionality after cluster member %s is down'%standbys[0])
else:
- log.info('Verifying cord subscriber functionality before cluster member %s is down'%standbys[0])
+ log_test.info('Verifying cord subscriber functionality before cluster member %s is down'%standbys[0])
test_status = self.subscriber.subscriber_join_verify(num_subscribers = num_subscribers,
num_channels = num_channels,
cbs = (self.subscriber.tls_verify, self.subscriber.dhcp_verify,
@@ -1717,9 +1717,9 @@
time.sleep(60)
status = self.verify_cluster_status(onos_instances=onos_instances-2)
assert_equal(status, True)
- log.info('Verifying cord subscriber funtionality after cluster two members %s and %s down'%(standbys[0],standbys[1]))
+ log_test.info('Verifying cord subscriber funtionality after cluster two members %s and %s down'%(standbys[0],standbys[1]))
else:
- log.info('Verifying cord subscriber funtionality before cluster two members %s and %s down'%(standbys[0],standbys[1]))
+ log_test.info('Verifying cord subscriber funtionality before cluster two members %s and %s down'%(standbys[0],standbys[1]))
test_status = self.subscriber.subscriber_join_verify(num_subscribers = num_subscribers,
num_channels = num_channels,
cbs = (self.subscriber.tls_verify, self.subscriber.dhcp_next_verify,
@@ -1735,9 +1735,9 @@
assert_equal(status, True)
device_dict = self.get_cluster_current_master_standbys_of_connected_devices()
for device in device_dict.keys():
- log.info("Device is %s"%device_dict[device])
+ log_test.info("Device is %s"%device_dict[device])
assert_not_equal(device_dict[device]['master'],'none')
- log.info('Master and standbys for device %s are %s and %s'%(device,device_dict[device]['master'],device_dict[device]['standbys']))
+ log_test.info('Master and standbys for device %s are %s and %s'%(device,device_dict[device]['master'],device_dict[device]['standbys']))
assert_equal(len(device_dict[device]['standbys']), onos_instances-1)
#pass
@@ -1750,9 +1750,9 @@
device_dict= self.get_cluster_current_master_standbys_of_connected_devices(controller = ip)
assert_equal(len(device_dict.keys()),onos_instances)
for device in device_dict.keys():
- log.info("Device is %s"%device_dict[device])
+ log_test.info("Device is %s"%device_dict[device])
assert_not_equal(device_dict[device]['master'],'none')
- log.info('Master and standbys for device %s are %s and %s'%(device,device_dict[device]['master'],device_dict[device]['standbys']))
+ log_test.info('Master and standbys for device %s are %s and %s'%(device,device_dict[device]['master'],device_dict[device]['standbys']))
assert_equal(len(device_dict[device]['standbys']), onos_instances-1)
#pass
@@ -1761,7 +1761,7 @@
assert_equal(status, True)
onos_names_ips = self.get_cluster_container_names_ips()
master_count = self.get_number_of_devices_of_master()
- log.info('Master count information is %s'%master_count)
+ log_test.info('Master count information is %s'%master_count)
total_devices = 0
for master in master_count.keys():
total_devices += master_count[master]['size']
@@ -1769,11 +1769,11 @@
restart_ip = master
assert_equal(total_devices,onos_instances)
member_onos_name = onos_names_ips[restart_ip]
- log.info('Restarting cluster member %s having ip %s'%(member_onos_name,restart_ip))
+ log_test.info('Restarting cluster member %s having ip %s'%(member_onos_name,restart_ip))
Container(member_onos_name, Onos.IMAGE).restart()
time.sleep(40)
master_count = self.get_number_of_devices_of_master()
- log.info('Master count information after restart is %s'%master_count)
+ log_test.info('Master count information after restart is %s'%master_count)
total_devices = 0
for master in master_count.keys():
total_devices += master_count[master]['size']
@@ -1787,7 +1787,7 @@
assert_equal(status, True)
onos_names_ips = self.get_cluster_container_names_ips()
master_count = self.get_number_of_devices_of_master()
- log.info('Master count information is %s'%master_count)
+ log_test.info('Master count information is %s'%master_count)
total_devices = 0
for master in master_count.keys():
total_devices += master_count[master]['size']
@@ -1795,7 +1795,7 @@
restart_ip = master
assert_equal(total_devices,onos_instances)
master_onos_name = onos_names_ips[restart_ip]
- log.info('Shutting down cluster member %s having ip %s'%(master_onos_name,restart_ip))
+ log_test.info('Shutting down cluster member %s having ip %s'%(master_onos_name,restart_ip))
Container(master_onos_name, Onos.IMAGE).kill()
time.sleep(40)
for ip in onos_names_ips.keys():
@@ -1804,7 +1804,7 @@
status = self.verify_cluster_status(onos_instances=onos_instances-1,controller=controller_ip)
assert_equal(status, True)
master_count = self.get_number_of_devices_of_master(controller=controller_ip)
- log.info('Master count information after restart is %s'%master_count)
+ log_test.info('Master count information after restart is %s'%master_count)
total_devices = 0
for master in master_count.keys():
total_devices += master_count[master]['size']
@@ -1817,21 +1817,21 @@
status = self.verify_cluster_status(onos_instances=onos_instances)
assert_equal(status, True)
master_count = self.get_number_of_devices_of_master()
- log.info('Master count information is %s'%master_count)
+ log_test.info('Master count information is %s'%master_count)
total_devices = 0
for master in master_count.keys():
total_devices += int(master_count[master]['size'])
if master_count[master]['size'] != 0:
master_ip = master
- log.info('Devices of master %s are %s'%(master_count[master]['devices'],master))
+ log_test.info('Devices of master %s are %s'%(master_count[master]['devices'],master))
device_id = str(master_count[master]['devices'][0])
device_count = master_count[master]['size']
assert_equal(total_devices,onos_instances)
- log.info('Withdrawing mastership of device %s for controller %s'%(device_id,master_ip))
+ log_test.info('Withdrawing mastership of device %s for controller %s'%(device_id,master_ip))
status=self.withdraw_cluster_current_mastership(master_ip=master_ip,device_id = device_id)
assert_equal(status, True)
master_count = self.get_number_of_devices_of_master()
- log.info('Master count information after cluster mastership withdraw is %s'%master_count)
+ log_test.info('Master count information after cluster mastership withdraw is %s'%master_count)
total_devices = 0
for master in master_count.keys():
total_devices += int(master_count[master]['size'])
@@ -1844,16 +1844,16 @@
status = self.verify_cluster_status(onos_instances=onos_instances)
assert_equal(status, True)
master_count = self.get_number_of_devices_of_master()
- log.info('Master count information is %s'%master_count)
+ log_test.info('Master count information is %s'%master_count)
total_devices = 0
for master in master_count.keys():
total_devices += master_count[master]['size']
assert_equal(total_devices,onos_instances)
- log.info('Restarting cluster')
+ log_test.info('Restarting cluster')
cord_test_onos_restart()
time.sleep(60)
master_count = self.get_number_of_devices_of_master()
- log.info('Master count information after restart is %s'%master_count)
+ log_test.info('Master count information after restart is %s'%master_count)
total_devices = 0
for master in master_count.keys():
total_devices += master_count[master]['size']
diff --git a/src/test/cordSubscriber/cordSubscriberTest.py b/src/test/cordSubscriber/cordSubscriberTest.py
index cce1fdd..6039ebd 100644
--- a/src/test/cordSubscriber/cordSubscriberTest.py
+++ b/src/test/cordSubscriber/cordSubscriberTest.py
@@ -17,7 +17,6 @@
from nose.tools import *
from nose.twistedtools import reactor, deferred
from twisted.internet import defer
-from scapy.all import *
import time, monotonic
import os, sys
import tempfile
@@ -35,9 +34,10 @@
from portmaps import g_subscriber_port_map
from OltConfig import *
from CordTestServer import cord_test_onos_restart, cord_test_shell
+from CordTestUtils import log_test
from CordLogger import CordLogger
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class Subscriber(Channels):
PORT_TX_DEFAULT = 2
@@ -64,7 +64,7 @@
self.tx_intf = self.port_map[self.PORT_TX_DEFAULT]
self.rx_intf = self.port_map[self.PORT_RX_DEFAULT]
- log.info('Subscriber %s, rx interface %s, uplink interface %s' %(name, self.rx_intf, self.tx_intf))
+ log_test.info('Subscriber %s, rx interface %s, uplink interface %s' %(name, self.rx_intf, self.tx_intf))
Channels.__init__(self, num, channel_start = channel_start,
iface = self.rx_intf, iface_mcast = self.tx_intf, mcast_cb = mcast_cb)
self.name = name
@@ -135,20 +135,20 @@
self.join_map[c][stats_type].update(packets = packets, t = t)
def channel_receive(self, chan, cb = None, count = 1, timeout = 5):
- log.info('Subscriber %s on port %s receiving from group %s, channel %d' %
+ log_test.info('Subscriber %s on port %s receiving from group %s, channel %d' %
(self.name, self.rx_intf, self.gaddr(chan), chan))
r = self.recv(chan, cb = cb, count = count, timeout = timeout)
if len(r) == 0:
- log.info('Subscriber %s on port %s timed out' %(self.name, self.rx_intf))
+ log_test.info('Subscriber %s on port %s timed out' %(self.name, self.rx_intf))
else:
- log.info('Subscriber %s on port %s received %d packets' %(self.name, self.rx_intf, len(r)))
+ log_test.info('Subscriber %s on port %s received %d packets' %(self.name, self.rx_intf, len(r)))
if self.recv_timeout:
##Negative test case is disabled for now
assert_equal(len(r), 0)
def recv_channel_cb(self, pkt):
##First verify that we have received the packet for the joined instance
- log.info('Packet received for group %s, subscriber %s, port %s' %
+ log_test.info('Packet received for group %s, subscriber %s, port %s' %
(pkt[IP].dst, self.name, self.rx_intf))
if self.recv_timeout:
return
@@ -159,7 +159,7 @@
delta = recv_time - join_time
self.join_rx_stats.update(packets=1, t = delta, usecs = True)
self.channel_update(chan, self.STATS_RX, 1, t = delta)
- log.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
+ log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
class subscriber_pool:
@@ -174,9 +174,9 @@
if self.test_status is not True:
## This is chaning for other sub status has to check again
self.test_status = True
- log.info('This service is failed and other services will not run for this subscriber')
+ log_test.info('This service is failed and other services will not run for this subscriber')
break
- log.info('This Subscriber is tested for multiple service eligibility ')
+ log_test.info('This Subscriber is tested for multiple service eligibility ')
self.test_status = True
@@ -320,7 +320,7 @@
##Uninstall the existing app if any
OnosCtrl.uninstall_app(cls.table_app)
time.sleep(2)
- log.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file))
+ log_test.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file))
OnosCtrl.install_app(cls.table_app_file)
time.sleep(3)
#onos_ctrl = OnosCtrl(cls.vtn_app)
@@ -331,7 +331,7 @@
##Uninstall the table app on class exit
OnosCtrl.uninstall_app(cls.table_app)
time.sleep(2)
- log.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file))
+ log_test.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file))
OnosCtrl.install_app(cls.app_file)
#onos_ctrl = OnosCtrl(cls.vtn_app)
#onos_ctrl.activate()
@@ -339,7 +339,7 @@
@classmethod
def start_onos(cls, network_cfg = None):
if cls.onos_restartable is False:
- log.info('ONOS restart is disabled. Skipping ONOS restart')
+ log_test.info('ONOS restart is disabled. Skipping ONOS restart')
return
if network_cfg is None:
network_cfg = cls.device_dict
@@ -351,7 +351,7 @@
config = dict(res)
else:
config = network_cfg
- log.info('Restarting ONOS with new network configuration')
+ log_test.info('Restarting ONOS with new network configuration')
return cord_test_onos_restart(config = config)
@classmethod
@@ -410,7 +410,7 @@
def onos_load_config(self, app, config):
status, code = OnosCtrl.config(config)
if status is False:
- log.info('JSON config request for app %s returned status %d' %(app, code))
+ log_test.info('JSON config request for app %s returned status %d' %(app, code))
assert_equal(status, True)
time.sleep(2)
@@ -418,7 +418,7 @@
cip, sip = dhcp.discover(update_seed = update_seed)
assert_not_equal(cip, None)
assert_not_equal(sip, None)
- log.info('Got dhcp client IP %s from server %s for mac %s' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s' %
(cip, sip, dhcp.get_mac(cip)[0]))
return cip,sip
@@ -440,7 +440,7 @@
delta = recv_time - join_time
self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True)
self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta)
- log.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
+ log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
self.test_status = True
def traffic_verify(self, subscriber):
@@ -449,10 +449,10 @@
resp = requests.get(url)
self.test_status = resp.ok
if resp.ok == False:
- log.info('Subscriber %s failed get from url %s with status code %d'
+ log_test.info('Subscriber %s failed get from url %s with status code %d'
%(subscriber.name, url, resp.status_code))
else:
- log.info('GET request from %s succeeded for subscriber %s'
+ log_test.info('GET request from %s succeeded for subscriber %s'
%(url, subscriber.name))
return self.test_status
@@ -460,7 +460,7 @@
if subscriber.has_service('TLS'):
time.sleep(2)
tls = TLSAuthTest(intf = subscriber.rx_intf)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
tls.runTest()
self.test_status = True
return self.test_status
@@ -471,7 +471,7 @@
def dhcp_verify(self, subscriber):
if subscriber.has_service('DHCP'):
cip, sip = self.dhcp_request(subscriber, update_seed = True)
- log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
+ log_test.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
subscriber.src_list = [cip]
self.test_status = True
return self.test_status
@@ -483,7 +483,7 @@
def dhcp_jump_verify(self, subscriber):
if subscriber.has_service('DHCP'):
cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.200.1')
- log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
+ log_test.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
subscriber.src_list = [cip]
self.test_status = True
return self.test_status
@@ -495,7 +495,7 @@
def dhcp_next_verify(self, subscriber):
if subscriber.has_service('DHCP'):
cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.150.1')
- log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
+ log_test.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
subscriber.src_list = [cip]
self.test_status = True
return self.test_status
@@ -514,20 +514,20 @@
self.num_joins += 1
while self.num_joins < self.num_subscribers:
time.sleep(5)
- log.info('All subscribers have joined the channel')
+ log_test.info('All subscribers have joined the channel')
for i in range(10):
subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10)
- log.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name))
+ log_test.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name))
subscriber.channel_leave(chan)
time.sleep(5)
- log.info('Interface %s Join RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name,subscriber.join_rx_stats))
+ log_test.info('Interface %s Join RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name,subscriber.join_rx_stats))
#Should not receive packets for this subscriber
self.recv_timeout = True
subscriber.recv_timeout = True
subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10)
subscriber.recv_timeout = False
self.recv_timeout = False
- log.info('Joining channel %d for subscriber %s' %(chan, subscriber.name))
+ log_test.info('Joining channel %d for subscriber %s' %(chan, subscriber.name))
subscriber.channel_join(chan, delay = 0)
self.test_status = True
return self.test_status
@@ -535,12 +535,12 @@
def igmp_jump_verify(self, subscriber):
if subscriber.has_service('IGMP'):
for i in xrange(subscriber.num):
- log.info('Subscriber %s jumping channel' %subscriber.name)
+ log_test.info('Subscriber %s jumping channel' %subscriber.name)
chan = subscriber.channel_jump(delay=0)
subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1)
- log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
+ log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
time.sleep(3)
- log.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
+ log_test.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
self.test_status = True
return self.test_status
@@ -551,11 +551,11 @@
chan = subscriber.channel_join_next(delay=0)
else:
chan = subscriber.channel_join(i, delay=0)
- log.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name))
+ log_test.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name))
subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1)
- log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
+ log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
time.sleep(3)
- log.info('Interface %s Join Next RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
+ log_test.info('Interface %s Join Next RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
self.test_status = True
return self.test_status
@@ -629,7 +629,7 @@
def tls_invalid_cert(self, subscriber):
if subscriber.has_service('TLS'):
time.sleep(2)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
tls = TLSAuthTest(client_cert = self.CLIENT_CERT_INVALID)
tls.runTest()
if tls.failTest == True:
@@ -642,7 +642,7 @@
def tls_no_cert(self, subscriber):
if subscriber.has_service('TLS'):
time.sleep(2)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
tls = TLSAuthTest(client_cert = '')
tls.runTest()
if tls.failTest == True:
@@ -655,7 +655,7 @@
def tls_self_signed_cert(self, subscriber):
if subscriber.has_service('TLS'):
time.sleep(2)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
tls = TLSAuthTest(client_cert = self.CLIENT_CERT)
tls.runTest()
if tls.failTest == False:
@@ -668,7 +668,7 @@
def tls_non_ca_authrized_cert(self, subscriber):
if subscriber.has_service('TLS'):
time.sleep(2)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
tls = TLSAuthTest(client_cert = self.CLIENT_CERT_NON_CA_AUTHORIZED)
tls.runTest()
if tls.failTest == False:
@@ -678,11 +678,10 @@
self.test_status = True
return self.test_status
-
def tls_Nsubscribers_use_same_valid_cert(self, subscriber):
if subscriber.has_service('TLS'):
time.sleep(2)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
num_users = 3
for i in xrange(num_users):
tls = TLSAuthTest(intf = 'veth{}'.format(i*2))
@@ -697,7 +696,7 @@
def dhcp_discover_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
t1 = self.subscriber_dhcp_1release()
self.test_status = True
return self.test_status
@@ -707,26 +706,25 @@
return self.test_status
def subscriber_dhcp_1release(self, iface = INTF_RX_DEFAULT):
- config = {'startip':'10.10.100.20', 'endip':'10.10.100.21',
- 'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe",
- 'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'}
- self.onos_dhcp_table_load(config)
- self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = iface)
- cip, sip = self.send_recv()
- log.info('Releasing ip %s to server %s' %(cip, sip))
- assert_equal(self.dhcp.release(cip), True)
- log.info('Triggering DHCP discover again after release')
- cip2, sip2 = self.send_recv(update_seed = True)
- log.info('Verifying released IP was given back on rediscover')
- assert_equal(cip, cip2)
- log.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
- assert_equal(self.dhcp.release(cip2), True)
-
+ config = {'startip':'10.10.100.20', 'endip':'10.10.100.21',
+ 'ip':'10.10.100.2', 'mac': "ca:fe:ca:fe:8a:fe",
+ 'subnet': '255.255.255.0', 'broadcast':'10.10.100.255', 'router':'10.10.100.1'}
+ self.onos_dhcp_table_load(config)
+ self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = iface)
+ cip, sip = self.send_recv()
+ log_test.info('Releasing ip %s to server %s' %(cip, sip))
+ assert_equal(self.dhcp.release(cip), True)
+ log_test.info('Triggering DHCP discover again after release')
+ cip2, sip2 = self.send_recv(update_seed = True)
+ log_test.info('Verifying released IP was given back on rediscover')
+ assert_equal(cip, cip2)
+ log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
+ assert_equal(self.dhcp.release(cip2), True)
def dhcp_client_reboot_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_client_request_after_reboot()
self.test_status = True
return self.test_status
@@ -744,39 +742,39 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
else:
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip == None:
- log.info("Got DHCP server NAK.")
+ log_test.info("Got DHCP server NAK.")
os.system('ifconfig '+iface+' down')
- log.info('Client goes down.')
- log.info('Delay for 5 seconds.')
+ log_test.info('Client goes down.')
+ log_test.info('Delay for 5 seconds.')
time.sleep(5)
os.system('ifconfig '+iface+' up')
- log.info('Client is up now.')
+ log_test.info('Client is up now.')
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip == None:
- log.info("Got DHCP server NAK.")
+ log_test.info("Got DHCP server NAK.")
assert_not_equal(new_cip, None)
elif new_cip != None:
- log.info("Got DHCP ACK.")
+ log_test.info("Got DHCP ACK.")
def dhcp_client_renew_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_client_renew_time()
self.test_status = True
return self.test_status
@@ -792,35 +790,35 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac , lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
elif cip and sip and mac:
- log.info("Triggering DHCP Request.")
+ log_test.info("Triggering DHCP Request.")
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True)
if new_cip and new_sip and lval:
- log.info("Client 's Renewal time is :%s",lval)
- log.info("Generating delay till renewal time.")
+ log_test.info("Client 's Renewal time is :%s",lval)
+ log_test.info("Generating delay till renewal time.")
time.sleep(lval)
- log.info("Client Sending Unicast DHCP request.")
+ log_test.info("Client Sending Unicast DHCP request.")
latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac, unicast = True)
if latest_cip and latest_sip:
- log.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." %
+ log_test.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." %
(latest_cip, mac, latest_sip) )
elif latest_cip == None:
- log.info("Got DHCP NAK. Lease not renewed.")
+ log_test.info("Got DHCP NAK. Lease not renewed.")
elif new_cip == None or new_sip == None or lval == None:
- log.info("Got DHCP NAK.")
+ log_test.info("Got DHCP NAK.")
def dhcp_server_reboot_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_server_after_reboot()
self.test_status = True
return self.test_status
@@ -837,51 +835,51 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
else:
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip == None:
- log.info("Got DHCP server NAK.")
+ log_test.info("Got DHCP server NAK.")
assert_not_equal(new_cip, None)
- log.info('Getting DHCP server Down.')
+ log_test.info('Getting DHCP server Down.')
onos_ctrl = OnosCtrl(self.dhcp_app)
onos_ctrl.deactivate()
for i in range(0,4):
- log.info("Sending DHCP Request.")
- log.info('')
+ log_test.info("Sending DHCP Request.")
+ log_test.info('')
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip == None and new_sip == None:
- log.info('')
- log.info("DHCP Request timed out.")
+ log_test.info('')
+ log_test.info("DHCP Request timed out.")
elif new_cip and new_sip:
- log.info("Got Reply from DHCP server.")
+ log_test.info("Got Reply from DHCP server.")
assert_equal(new_cip,None) #Neagtive Test Case
- log.info('Getting DHCP server Up.')
+ log_test.info('Getting DHCP server Up.')
# self.activate_apps(self.dhcp_app)
onos_ctrl = OnosCtrl(self.dhcp_app)
status, _ = onos_ctrl.activate()
assert_equal(status, True)
time.sleep(3)
for i in range(0,4):
- log.info("Sending DHCP Request after DHCP server is up.")
- log.info('')
+ log_test.info("Sending DHCP Request after DHCP server is up.")
+ log_test.info('')
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip == None and new_sip == None:
- log.info('')
- log.info("DHCP Request timed out.")
+ log_test.info('')
+ log_test.info("DHCP Request timed out.")
elif new_cip and new_sip:
- log.info("Got Reply from DHCP server.")
+ log_test.info("Got Reply from DHCP server.")
assert_equal(new_cip,None) #Neagtive Test Case
def dhcp_client_rebind_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_client_rebind_time()
self.test_status = True
return self.test_status
@@ -897,37 +895,37 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
elif cip and sip and mac:
- log.info("Triggering DHCP Request.")
+ log_test.info("Triggering DHCP Request.")
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True)
if new_cip and new_sip and lval:
- log.info("Client 's Rebind time is :%s",lval)
- log.info("Generating delay till rebind time.")
+ log_test.info("Client 's Rebind time is :%s",lval)
+ log_test.info("Generating delay till rebind time.")
time.sleep(lval)
- log.info("Client Sending broadcast DHCP requests for renewing lease or for getting new ip.")
+ log_test.info("Client Sending broadcast DHCP requests for renewing lease or for getting new ip.")
self.dhcp.after_T2 = True
for i in range(0,4):
latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac)
if latest_cip and latest_sip:
- log.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." %
+ log_test.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." %
(latest_cip, mac, latest_sip) )
break
elif latest_cip == None:
- log.info("Got DHCP NAK. Lease not renewed.")
+ log_test.info("Got DHCP NAK. Lease not renewed.")
assert_not_equal(latest_cip, None)
elif new_cip == None or new_sip == None or lval == None:
- log.info("Got DHCP NAK.Lease not Renewed.")
+ log_test.info("Got DHCP NAK.Lease not Renewed.")
def dhcp_starvation_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_starvation()
self.test_status = True
return self.test_status
@@ -943,11 +941,11 @@
'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'}
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = iface)
- log.info('Verifying 1 ')
+ log_test.info('Verifying 1 ')
for x in xrange(50):
mac = RandMAC()._fix()
self.send_recv(mac = mac)
- log.info('Verifying 2 ')
+ log_test.info('Verifying 2 ')
cip, sip = self.send_recv(update_seed = True, validate = False)
assert_equal(cip, None)
assert_equal(sip, None)
@@ -955,7 +953,7 @@
def dhcp_same_client_multi_discovers_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_same_client_multiple_discover()
self.test_status = True
return self.test_status
@@ -972,22 +970,22 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
(cip, sip, mac) )
- log.info('Triggering DHCP discover again.')
+ log_test.info('Triggering DHCP discover again.')
new_cip, new_sip, new_mac , lval = self.dhcp.only_discover()
if cip == new_cip:
- log.info('Got same ip for 2nd DHCP discover for client IP %s from server %s for mac %s. Triggering DHCP Request. '
+ log_test.info('Got same ip for 2nd DHCP discover for client IP %s from server %s for mac %s. Triggering DHCP Request. '
% (new_cip, new_sip, new_mac) )
elif cip != new_cip:
- log.info('Ip after 1st discover %s' %cip)
- log.info('Map after 2nd discover %s' %new_cip)
+ log_test.info('Ip after 1st discover %s' %cip)
+ log_test.info('Map after 2nd discover %s' %new_cip)
assert_equal(cip, new_cip)
def dhcp_same_client_multi_request_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_same_client_multiple_request()
self.test_status = True
return self.test_status
@@ -1003,16 +1001,16 @@
'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
- log.info('Sending DHCP discover and DHCP request.')
+ log_test.info('Sending DHCP discover and DHCP request.')
cip, sip = self.send_recv()
mac = self.dhcp.get_mac(cip)[0]
- log.info("Sending DHCP request again.")
+ log_test.info("Sending DHCP request again.")
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if (new_cip,new_sip) == (cip,sip):
- log.info('Got same ip for 2nd DHCP Request for client IP %s from server %s for mac %s.'
+ log_test.info('Got same ip for 2nd DHCP Request for client IP %s from server %s for mac %s.'
% (new_cip, new_sip, mac) )
elif (new_cip,new_sip):
- log.info('No DHCP ACK')
+ log_test.info('No DHCP ACK')
assert_equal(new_cip, None)
assert_equal(new_sip, None)
else:
@@ -1021,7 +1019,7 @@
def dhcp_client_desired_ip_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_client_desired_address()
self.test_status = True
return self.test_status
@@ -1038,21 +1036,21 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.31', iface = iface)
cip, sip, mac , lval = self.dhcp.only_discover(desired = True)
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
if cip == self.dhcp.seed_ip:
- log.info('Got dhcp client IP %s from server %s for mac %s as desired .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s as desired .' %
(cip, sip, mac) )
elif cip != self.dhcp.seed_ip:
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info('The desired ip was: %s .' % self.dhcp.seed_ip)
+ log_test.info('The desired ip was: %s .' % self.dhcp.seed_ip)
assert_equal(cip, self.dhcp.seed_ip)
def dhcp_client_request_pkt_with_non_offered_ip_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_server_nak_packet()
self.test_status = True
return self.test_status
@@ -1068,22 +1066,22 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
else:
new_cip, new_sip = self.dhcp.only_request('20.20.20.31', mac)
if new_cip == None:
- log.info("Got DHCP server NAK.")
+ log_test.info("Got DHCP server NAK.")
assert_equal(new_cip, None) #Negative Test Case
def dhcp_client_requested_out_pool_ip_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_client_desired_address_out_of_pool()
self.test_status = True
return self.test_status
@@ -1100,26 +1098,26 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.35', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover(desired = True)
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
if cip == self.dhcp.seed_ip:
- log.info('Got dhcp client IP %s from server %s for mac %s as desired .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s as desired .' %
(cip, sip, mac) )
assert_equal(cip, self.dhcp.seed_ip) #Negative Test Case
elif cip != self.dhcp.seed_ip:
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info('The desired ip was: %s .' % self.dhcp.seed_ip)
+ log_test.info('The desired ip was: %s .' % self.dhcp.seed_ip)
assert_not_equal(cip, self.dhcp.seed_ip)
elif cip == None:
- log.info('Got DHCP NAK')
+ log_test.info('Got DHCP NAK')
def dhcp_client_specific_lease_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_specific_lease_packet()
self.test_status = True
return self.test_status
@@ -1135,15 +1133,15 @@
'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
- log.info('Sending DHCP discover with lease time of 700')
+ log_test.info('Sending DHCP discover with lease time of 700')
cip, sip, mac, lval = self.dhcp.only_discover(lease_time = True)
- log.info("Verifying Client 's IP and mac in DHCP Offer packet.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
elif lval != 700:
- log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' %
+ log_test.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' %
(cip, sip, mac, lval) )
assert_not_equal(lval, 700)
diff --git a/src/test/cordvtn/cordvtnTest.py b/src/test/cordvtn/cordvtnTest.py
index edcedc0..8c2f49b 100644
--- a/src/test/cordvtn/cordvtnTest.py
+++ b/src/test/cordvtn/cordvtnTest.py
@@ -25,12 +25,11 @@
from neutronclient.v2_0 import client as neutron_client
import neutronclient.v2_0.client as neutronclient
from nose.tools import assert_equal
-from CordTestUtils import get_mac
+from CordTestUtils import get_mac, log_test
from OnosCtrl import OnosCtrl
from CordLogger import CordLogger
from TestManifest import TestManifest
from OnosFlowCtrl import OnosFlowCtrl
-from scapy.all import *
from credentials import *
from VSGAccess import VSGAccess
from SSHTestAgent import SSHTestAgent
@@ -136,7 +135,7 @@
def onos_load_config(cls, cordvtn_conf_file):
status, code = OnosCtrl.config(cordvtn_conf_file)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
time.sleep(3)
@@ -153,7 +152,7 @@
def get_compute_nodes(cls):
credentials = get_nova_credentials_v2()
novaclient = nova_client.Client('2', **credentials)
- print novaclient.hypervisors.list()
+ print(novaclient.hypervisors.list())
return novaclient.hypervisors.list()
def create_network(i):
@@ -164,10 +163,10 @@
while True:
try:
net = neutron.create_network(body=json)
- print '\nnetwork-' + str(i) + ' created'
+ print('\nnetwork-' + str(i) + ' created')
return net
except Exception as e:
- print e
+ print(e)
continue
def create_tenant(tenant_name):
@@ -183,7 +182,7 @@
user_name = tenant_name + '-user-' + str(j)
user_data.append(create_user(user_name, tenant_id))
- print " Tenant and User Created"
+ print(" Tenant and User Created")
tenant_data = {'tenant_name': tenant_name,
'tenant_id': tenant_id,
@@ -443,7 +442,7 @@
match = True
return match
if match is True:
- print"Network search is successful"
+ print("Network search is successful")
return match
def get_key_value(self, d, key = None, value = None,):
@@ -459,7 +458,7 @@
if type(d[i]) is dict:
match,ret_k,ret_v = self.get_key_value(d[i], key, value)
if match is True:
- print "Network creation is successful"
+ print("Network creation is successful")
break
else:
for k, v in d.items():
@@ -563,7 +562,7 @@
image = nova_obj.images.find(name=image_name)
flavor = nova_obj.flavors.find(name=flavor_id)
network = nova_obj.networks.find(label=net_name)
- print network.id
+ print(network.id)
server = nova_obj.servers.create(name = instance_name,
image = image.id,
@@ -626,7 +625,7 @@
if check_type == "Ping_from_source_tenant":
cmd = "ping -c 3 {0}".format(target_tenants_details.addresses)
ssh_cmd = 'ssh {} {}'.format(source_tenants_details.addresses, cmd)
- print ssh_cmd
+ print(ssh_cmd)
ssh_agent = SSHTestAgent(host = compute_ip)
status, output = ssh_agent.run_cmd(cmd, timeout = 5)
@@ -636,10 +635,10 @@
status, output = ssh_agent.run_cmd(cmd, timeout = 5)
if status == True and output:
- print "Ping is successful"
+ print("Ping is successful")
output = output.strip()
else:
- print "Ping is not successful"
+ print("Ping is not successful")
output = None
return [status, output]
@@ -647,9 +646,9 @@
def nova_instance_deletion(self, nova_obj, server_details):
results_nova_instance_deletion=nova_obj.servers.delete(server_details.id)
if results_nova_instance_deletion == None:
- print"Nova instance is deleted"
+ print("Nova instance is deleted")
else:
- print"Nova instance is not deleted"
+ print("Nova instance is not deleted")
return results_nova_instance_deletion
def test_cordvtn_neutron_network_creation_and_validation_on_head_node_with_neutron_service(self):
@@ -775,12 +774,12 @@
if data['ServiceNetworks'][i]['name'] == 'vtn_test_6_net_management':
sub_net_id = self.get_key_value(d=data['ServiceNetworks'][i], key = 'subnet')
if sub_net_id[2] == " ":
- log.info('Sub network is not successful')
+ log_test.info('Sub network is not successful')
self.neutron_network_deletion('vtn_test_6_net_management')
assert_equal(False, True)
break
elif sub_net_id[2] == cidr:
- log.info('Sub network is successful')
+ log_test.info('Sub network is successful')
self.neutron_network_deletion('vtn_test_6_net_management')
assert_equal(sub_net_id[0], True)
break
@@ -812,11 +811,11 @@
if data['ServiceNetworks'][i]['name'] == test_net_name:
sub_net_id = self.get_key_value(d=data['ServiceNetworks'][i], key = 'subnet')
if sub_net_id[2] == " ":
- log.info('Sub network is not successful')
+ log_test.info('Sub network is not successful')
assert_equal(False, True)
break
elif sub_net_id[2] == test_sub_net_cidr[1]:
- log.info('Sub network is successful')
+ log_test.info('Sub network is successful')
assert_equal(sub_net_id[0], True)
break
@@ -935,11 +934,11 @@
if data['ServiceNetworks'][i]['name'] == test_net_name:
sub_net_id = self.get_key_value(d=data['ServiceNetworks'][i], key = 'subnet')
if sub_net_id[2] == " ":
- log.info('Sub network is not successful')
+ log_test.info('Sub network is not successful')
assert_equal(False, True)
break
elif sub_net_id[2] == test_sub_net_cidr[1]:
- log.info('Sub network is successful')
+ log_test.info('Sub network is successful')
assert_equal(sub_net_id[0], True)
break
@@ -1059,11 +1058,11 @@
if data['ServiceNetworks'][i]['name'] == test_net_name:
sub_net_id = self.get_key_value(d=data['ServiceNetworks'][i], key = 'subnet')
if sub_net_id[2] == " ":
- log.info('Sub network is not successful')
+ log_test.info('Sub network is not successful')
assert_equal(False, True)
break
elif sub_net_id[2] == "192.168.160.0/24":
- log.info('Sub network is successful')
+ log_test.info('Sub network is successful')
assert_equal(sub_net_id[0], True)
break
@@ -1133,7 +1132,7 @@
new_instance_details = self.nova_instance_creation_and_validation(test_net_name,nova,instance_vm_name,image_name,flavor_id)
#assert_equal(new_instance_details.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print new_instance_details.addresses
+ print(new_instance_details.addresses)
status, output = self.nova_instance_tenants_access_check(new_instance_details)
self.neutron_network_deletion(test_net_name)
self.nova_instance_deletion(nova, new_instance_details)
@@ -1169,7 +1168,7 @@
new_instance_details = self.nova_instance_creation_and_validation(test_net_name,nova,instance_vm_name,image_name,flavor_id)
#assert_equal(new_instance_details.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print new_instance_details.addresses
+ print(new_instance_details.addresses)
status, output = self.nova_instance_tenants_access_check(new_instance_details, check_type = "Ping_to_external")
self.neutron_network_deletion(test_net_name)
self.nova_instance_deletion(nova, new_instance_details)
@@ -1210,9 +1209,9 @@
#assert_equal(first_instance_details.status, 'ACTIVE')
#assert_equal(second_instance_details.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print 'New nova instance ip addresses are '
- print first_nova_instance_details.addresses
- print second_nova_instance_details.addresses
+ print('New nova instance ip addresses are ')
+ print(first_nova_instance_details.addresses)
+ print(second_nova_instance_details.addresses)
status, output = self.nova_instance_tenants_access_check(first_nova_instance_details,source_tenants_details = second_nova_instance_details, check_type = "Ping_from_source_tenant")
self.neutron_network_deletion(test_net_name)
self.nova_instance_deletion(nova, first_nova_instance_details)
@@ -1246,9 +1245,9 @@
#assert_equal(nova_instance_details_netA.status, 'ACTIVE')
#assert_equal(nova_instance_details_netB.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print 'New nova instance ip addresses are '
- print nova_instance_details_netA.addresses
- print nova_instance_details_netB.addresses
+ print('New nova instance ip addresses are ')
+ print(nova_instance_details_netA.addresses)
+ print(nova_instance_details_netB.addresses)
status, output = self.nova_instance_tenants_access_check(nova_instance_details_netA, source_tenants_details = nova_instance_details_netB,check_type = "Ping_from_source_tenant")
self.neutron_network_deletion(test_netA_name)
self.nova_instance_deletion(nova_netA, nova_instance_details_netA)
@@ -1287,7 +1286,7 @@
new_instance_details = self.nova_instance_creation_and_validation(test_net_name,nova,instance_vm_name,image_name,flavor_id)
#assert_equal(new_instance_details.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print new_instance_details.addresses
+ print(new_instance_details.addresses)
status, output = self.nova_instance_tenants_access_check(new_instance_details)
self.neutron_network_deletion(test_net_name)
self.nova_instance_deletion(nova, new_instance_details)
@@ -1323,7 +1322,7 @@
new_instance_details = self.nova_instance_creation_and_validation(test_net_name,nova,instance_vm_name,image_name,flavor_id)
#assert_equal(new_instance_details.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print new_instance_details.addresses
+ print(new_instance_details.addresses)
status, output = self.nova_instance_tenants_access_check(new_instance_details, check_type = "Ping_to_external")
self.neutron_network_deletion(test_net_name)
self.nova_instance_deletion(nova, new_instance_details)
@@ -1365,9 +1364,9 @@
#assert_equal(first_instance_details.status, 'ACTIVE')
#assert_equal(second_instance_details.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print 'New nova instance ip addresses are '
- print first_nova_instance_details.addresses
- print second_nova_instance_details.addresses
+ print('New nova instance ip addresses are ')
+ print(first_nova_instance_details.addresses)
+ print(second_nova_instance_details.addresses)
status, output = self.nova_instance_tenants_access_check(first_nova_instance_details,source_tenants_details = second_nova_instance_details, check_type = "Ping_from_source_tenant")
self.neutron_network_deletion(test_net_name)
self.nova_instance_deletion(nova, first_nova_instance_details)
@@ -1401,9 +1400,9 @@
#assert_equal(nova_instance_details_netA.status, 'ACTIVE')
#assert_equal(nova_instance_details_netB.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print 'New nova instance ip addresses are '
- print nova_instance_details_netA.addresses
- print nova_instance_details_netB.addresses
+ print('New nova instance ip addresses are ')
+ print(nova_instance_details_netA.addresses)
+ print(nova_instance_details_netB.addresses)
status, output = self.nova_instance_tenants_access_check(nova_instance_details_netA, source_tenants_details = nova_instance_details_netB,check_type = "Ping_from_source_tenant")
self.neutron_network_deletion(test_netA_name)
self.nova_instance_deletion(nova_netA, nova_instance_details_netA)
@@ -1441,7 +1440,7 @@
new_instance_details = self.nova_instance_creation_and_validation(test_net_name,nova,instance_vm_name,image_name,flavor_id)
#assert_equal(new_instance_details.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print new_instance_details.addresses
+ print(new_instance_details.addresses)
status, output = self.nova_instance_tenants_access_check(new_instance_details)
self.neutron_network_deletion(test_net_name)
self.nova_instance_deletion(nova, new_instance_details)
@@ -1477,7 +1476,7 @@
new_instance_details = self.nova_instance_creation_and_validation(test_net_name,nova,instance_vm_name,image_name,flavor_id)
#assert_equal(new_instance_details.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print new_instance_details.addresses
+ print(new_instance_details.addresses)
status, output = self.nova_instance_tenants_access_check(new_instance_details, check_type = "Ping_to_external")
self.neutron_network_deletion(test_net_name)
self.nova_instance_deletion(nova, new_instance_details)
@@ -1518,9 +1517,9 @@
#assert_equal(first_instance_details.status, 'ACTIVE')
#assert_equal(second_instance_details.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print 'New nova instance ip addresses are '
- print first_nova_instance_details.addresses
- print second_nova_instance_details.addresses
+ print('New nova instance ip addresses are ')
+ print(first_nova_instance_details.addresses)
+ print(second_nova_instance_details.addresses)
status, output = self.nova_instance_tenants_access_check(first_nova_instance_details,source_tenants_details = second_nova_instance_details, check_type = "Ping_from_source_tenant")
self.neutron_network_deletion(test_net_name)
self.nova_instance_deletion(nova, first_nova_instance_details)
@@ -1554,9 +1553,9 @@
#assert_equal(nova_instance_details_netA.status, 'ACTIVE')
#assert_equal(nova_instance_details_netB.status, 'ACTIVE')
compute_details = self.get_compute_nodes()
- print 'New nova instance ip addresses are '
- print nova_instance_details_netA.addresses
- print nova_instance_details_netB.addresses
+ print('New nova instance ip addresses are ')
+ print(nova_instance_details_netA.addresses)
+ print(nova_instance_details_netB.addresses)
status, output = self.nova_instance_tenants_access_check(nova_instance_details_netA, source_tenants_details = nova_instance_details_netB,check_type = "Ping_from_source_tenant")
self.neutron_network_deletion(test_netA_name)
self.nova_instance_deletion(nova_netA, nova_instance_details_netA)
@@ -1679,11 +1678,11 @@
tenant_1= create_tenant("CORD_Subscriber_Test_Tenant_1")
if tenant1 != 0:
- print "Creation of CORD Subscriber Test Tenant 1"
+ print("Creation of CORD Subscriber Test Tenant 1")
tenant_2 = create_tenant("CORD_Subscriber_Test_Tenant_2")
if tenant2 != 0:
- print "Creation of CORD Subscriber Test Tenant 2"
+ print("Creation of CORD Subscriber Test Tenant 2")
create_net(tenant_1,"a1")
create_subnet(tenant_1,"a1","as1","10.0.1.0/24")
@@ -1725,31 +1724,31 @@
ret1 = create_tenant(netA)
if ret1 != 0:
- print "Creation of Tenant netA Failed"
+ print("Creation of Tenant netA Failed")
ret2 = create_tenant(netB)
if ret2 != 0:
- print "Creation of Tenant netB Failed"
+ print("Creation of Tenant netB Failed")
network = {'name': self.network_name, 'admin_state_up': True}
self.neutron.create_network({'network':network})
- log.info("Created network:{0}".format(self.network_name))
+ log_test.info("Created network:{0}".format(self.network_name))
status = validate_vtn_flows()
assert_equal(status, True)
def test_cordvtn_to_create_net_work_with_subnet(self):
ret1 = create_tenant(netA)
if ret1 != 0:
- print "Creation of Tenant netA Failed"
+ print("Creation of Tenant netA Failed")
ret2 = create_tenant(netB)
if ret2 != 0:
- print "Creation of Tenant netB Failed"
+ print("Creation of Tenant netB Failed")
network_name = self.network_name
network = {'name': network_name, 'admin_state_up': True}
network_info = self.neutron.create_network({'network':network})
network_id = network_info['network']['id']
- log.info("Created network:{0}".format(network_id))
+ log_test.info("Created network:{0}".format(network_id))
self.network_ids.append(network_id)
subnet_count = 1
for cidr in self.subnet_cidrs:
@@ -1759,9 +1758,9 @@
"host_routes":[{"destination":"0.0.0.0/0", "nexthop":gateway_ip}]
}
subnet = {"name":"subnet-"+str(subnet_count), "network_id": network_id, "ip_version":4, "cidr":str(cidr), "enable_dhcp":True}
- print subnet
+ print(subnet)
self.neutron.create_subnet({'subnet':subnet})
- log.info("Created subnet:{0}".format(str(cidr)))
+ log_test.info("Created subnet:{0}".format(str(cidr)))
if not self.number_of_subnet - 1:
break
self.number_of_subnet -= 1
@@ -1772,15 +1771,15 @@
def test_cordvtn_subnet_limit(self):
ret1 = create_tenant(netA)
if ret1 != 0:
- print "Creation of Tenant netA Failed"
+ print("Creation of Tenant netA Failed")
ret2 = create_tenant(netB)
if ret2 != 0:
- print "Creation of Tenant netB Failed"
+ print("Creation of Tenant netB Failed")
network_name = uuid.uuid4().get_hex()
network = {'name': network_name, 'admin_state_up': True}
network_info = self.neutron.create_network({'network':network})
- log.info("Created network:{0}".format(network_name))
+ log_test.info("Created network:{0}".format(network_name))
network_id = network_info['network']['id']
self.network_ids.append(network_id)
subnet_cidrs = ['11.2.2.0/29', '11.2.2.8/29']
@@ -1788,13 +1787,13 @@
subnet = {"network_id": network_id, "ip_version":4, "cidr": cidr}
subnet_info = self.neutron.create_subnet({'subnet':subnet})
subnet_id = subnet_info['subnet']['id']
- log.info("Created subnet:{0}".format(cidr))
+ log_test.info("Created subnet:{0}".format(cidr))
while True:
port = {"network_id": network_id, "admin_state_up": True}
port_info = self.neutron.create_port({'port':port})
port_id = port_info['port']['id']
self.port_ids.append(port_id)
- log.info("Created Port:{0}".format(port_info['port']['id']))
+ log_test.info("Created Port:{0}".format(port_info['port']['id']))
if not self.quota_limit:
break
self.quota_limit -= 1
@@ -1802,19 +1801,18 @@
assert_equal(status, True)
def test_cordvtn_floatingip_limit(self):
-
ret1 = create_tenant(netA)
if ret1 != 0:
- print "Creation of Tenant netA Failed"
+ print("Creation of Tenant netA Failed")
ret2 = create_tenant(netB)
if ret2 != 0:
- print "Creation of Tenant netB Failed"
+ print("Creation of Tenant netB Failed")
while True:
floatingip = {"floating_network_id": self.floating_nw_id}
fip_info = self.neutron.create_floatingip({'floatingip':floatingip})
fip_id = fip_info['floatingip']['id']
- log.info("Created Floating IP:{0}".format(fip_id))
+ log_test.info("Created Floating IP:{0}".format(fip_id))
self.fip_ids.append(fip_id)
if not self.quota_limit:
break
@@ -1825,15 +1823,15 @@
def test_cordvtn_for_10_neutron_networks(self):
ret1 = create_tenant(netA)
if ret1 != 0:
- print "Creation of Tenant netA Failed"
+ print("Creation of Tenant netA Failed")
ret2 = create_tenant(netB)
if ret2 != 0:
- print "Creation of Tenant netB Failed"
+ print("Creation of Tenant netB Failed")
pool = Pool(processes=10)
ret = os.system("neutron quote-update --network 15")
if ret1 != 0:
- print "Neutron network install failed"
+ print("Neutron network install failed")
for i in range(1, 11):
pool.apply_async(create_network, (i, ))
@@ -1845,16 +1843,16 @@
def test_cordvtn_for_100_neutron_networks(self):
ret1 = create_tenant(netA)
if ret1 != 0:
- print "Creation of Tenant netA Failed"
+ print("Creation of Tenant netA Failed")
ret2 = create_tenant(netB)
if ret2 != 0:
- print "Creation of Tenant netB Failed"
+ print("Creation of Tenant netB Failed")
pool = Pool(processes=10)
ret = os.system("neutron quote-update --network 105")
if ret1 != 0:
- print "Neutron network install failed"
+ print("Neutron network install failed")
for i in range(1, 101):
pool.apply_async(create_network, (i, ))
diff --git a/src/test/dhcp/dhcpTest.py b/src/test/dhcp/dhcpTest.py
index b81e3cf..c6a3d0d 100644
--- a/src/test/dhcp/dhcpTest.py
+++ b/src/test/dhcp/dhcpTest.py
@@ -17,7 +17,6 @@
from nose.tools import *
from nose.twistedtools import reactor, deferred
from twisted.internet import defer
-from scapy.all import *
import time
import copy
from DHCP import DHCPTest
@@ -26,7 +25,8 @@
from portmaps import g_subscriber_port_map
from CordLogger import CordLogger
from CordTestConfig import setup_module
-log.setLevel('INFO')
+from CordTestUtils import log_test
+log_test.setLevel('INFO')
class dhcp_exchange(CordLogger):
@@ -92,7 +92,7 @@
def onos_load_config(self, config):
status, code = OnosCtrl.config(config)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
time.sleep(3)
@@ -107,12 +107,12 @@
def send_recv(self, mac = None, update_seed = False, validate = True):
cip, sip = self.dhcp.discover(mac = mac, update_seed = update_seed)
- log.info("discover cip %s"%(cip))
- log.info("discover sip %s"%(sip))
+ log_test.info("discover cip %s"%(cip))
+ log_test.info("discover sip %s"%(sip))
if validate:
assert_not_equal(cip, None)
assert_not_equal(sip, None)
- log.info('Got dhcp client IP %s from server %s for mac %s' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s' %
(cip, sip, self.dhcp.get_mac(cip)[0]))
return cip,sip
@@ -133,7 +133,7 @@
while self.diff <= 60:
if only_discover:
cip, sip, mac, _ = self.dhcp.only_discover(multiple = True)
- log.info('Got dhcp client IP %s from server %s for mac %s' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s' %
(cip, sip, mac))
else:
cip, sip = self.send_recv(update_seed = True, validate = False)
@@ -142,7 +142,7 @@
self.ip_count +=1
elif cip == None:
self.failure_count += 1
- log.info('Failed to get ip')
+ log_test.info('Failed to get ip')
if success_rate and self.ip_count > 0:
break
self.diff = round(time.time() - self.start_time, 0)
@@ -168,7 +168,7 @@
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover(mac='ff:ff:ff:ff:ff:ff')
assert_equal(cip,None)
- log.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
+ log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
def test_dhcp_1request_with_invalid_source_mac_multicast(self):
config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
@@ -178,7 +178,7 @@
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover(mac='01:80:c2:91:02:e4')
assert_equal(cip,None)
- log.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
+ log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
def test_dhcp_1request_with_invalid_source_mac_zero(self):
config = {'startip':'10.10.10.20', 'endip':'10.10.10.69',
@@ -188,7 +188,7 @@
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover(mac='00:00:00:00:00:00')
assert_equal(cip,None)
- log.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
+ log_test.info('ONOS dhcp server rejected client discover with invalid source mac as expected')
def test_dhcp_Nrequest(self, requests=10):
config = {'startip':'192.168.1.20', 'endip':'192.168.1.69',
@@ -200,7 +200,7 @@
for i in range(requests):
cip, sip = self.send_recv(update_seed = True)
if ip_map.has_key(cip):
- log.info('IP %s given out multiple times' %cip)
+ log_test.info('IP %s given out multiple times' %cip)
assert_equal(False, ip_map.has_key(cip))
ip_map[cip] = sip
@@ -211,13 +211,13 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = self.iface)
cip, sip = self.send_recv()
- log.info('Releasing ip %s to server %s' %(cip, sip))
+ log_test.info('Releasing ip %s to server %s' %(cip, sip))
assert_equal(self.dhcp.release(cip), True)
- log.info('Triggering DHCP discover again after release')
+ log_test.info('Triggering DHCP discover again after release')
cip2, sip2 = self.send_recv(update_seed = True)
- log.info('Verifying released IP was given back on rediscover')
+ log_test.info('Verifying released IP was given back on rediscover')
assert_equal(cip, cip2)
- log.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
+ log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
assert_equal(self.dhcp.release(cip2), True)
def test_dhcp_Nrelease(self):
@@ -230,24 +230,24 @@
for i in range(10):
cip, sip = self.send_recv(update_seed = True)
if ip_map.has_key(cip):
- log.info('IP %s given out multiple times' %cip)
+ log_test.info('IP %s given out multiple times' %cip)
assert_equal(False, ip_map.has_key(cip))
ip_map[cip] = sip
for ip in ip_map.keys():
- log.info('Releasing IP %s' %ip)
+ log_test.info('Releasing IP %s' %ip)
assert_equal(self.dhcp.release(ip), True)
ip_map2 = {}
- log.info('Triggering DHCP discover again after release')
+ log_test.info('Triggering DHCP discover again after release')
for i in range(len(ip_map.keys())):
cip, sip = self.send_recv(update_seed = True)
ip_map2[cip] = sip
- log.info('Verifying released IPs were given back on rediscover')
+ log_test.info('Verifying released IPs were given back on rediscover')
if ip_map != ip_map2:
- log.info('Map before release %s' %ip_map)
- log.info('Map after release %s' %ip_map2)
+ log_test.info('Map before release %s' %ip_map)
+ log_test.info('Map after release %s' %ip_map2)
assert_equal(ip_map, ip_map2)
@@ -261,7 +261,7 @@
for i in range(10):
cip, sip = self.send_recv(update_seed = True)
if ip_map.has_key(cip):
- log.info('IP %s given out multiple times' %cip)
+ log_test.info('IP %s given out multiple times' %cip)
assert_equal(False, ip_map.has_key(cip))
ip_map[cip] = sip
@@ -272,11 +272,11 @@
'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'}
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = self.iface)
- log.info('Verifying passitive case')
+ log_test.info('Verifying passitive case')
for x in xrange(50):
mac = RandMAC()._fix()
self.send_recv(mac = mac)
- log.info('Verifying negative case')
+ log_test.info('Verifying negative case')
cip, sip = self.send_recv(update_seed = True, validate = False)
assert_equal(cip, None)
assert_equal(sip, None)
@@ -289,13 +289,13 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
(cip, sip, mac) )
assert_not_equal(cip, None)
- log.info('Triggering DHCP discover again.')
+ log_test.info('Triggering DHCP discover again.')
new_cip, new_sip, new_mac, _ = self.dhcp.only_discover()
assert_equal(new_cip, cip)
- log.info('client got same IP as expected when sent 2nd discovery')
+ log_test.info('client got same IP as expected when sent 2nd discovery')
def test_dhcp_same_client_multiple_request(self):
@@ -304,13 +304,13 @@
'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = self.iface)
- log.info('Sending DHCP discover and DHCP request.')
+ log_test.info('Sending DHCP discover and DHCP request.')
cip, sip = self.send_recv()
mac = self.dhcp.get_mac(cip)[0]
- log.info("Sending DHCP request again.")
+ log_test.info("Sending DHCP request again.")
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip,cip)
- log.info('server offered same IP to clain for multiple requests, as expected')
+ log_test.info('server offered same IP to clain for multiple requests, as expected')
def test_dhcp_client_desired_address(self):
config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
@@ -320,10 +320,10 @@
self.dhcp = DHCPTest(seed_ip = '20.20.20.50', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover(desired = True)
assert_not_equal(cip, None)
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac))
assert_equal(cip,self.dhcp.seed_ip)
- log.info('ONOS dhcp server offered client requested IP %s as expected'%self.dhcp.seed_ip)
+ log_test.info('ONOS dhcp server offered client requested IP %s as expected'%self.dhcp.seed_ip)
#test failing, server not returns NAK when requested out of pool IP
def test_dhcp_client_desired_address_out_of_pool(self):
@@ -334,10 +334,10 @@
self.dhcp = DHCPTest(seed_ip = '20.20.20.75', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover(desired = True)
assert_not_equal(cip, None)
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip,self.dhcp.seed_ip)
- log.info('server offered IP from its pool of IPs when requested out of pool IP, as expected')
+ log_test.info('server offered IP from its pool of IPs when requested out of pool IP, as expected')
def test_dhcp_server_nak_packet(self):
@@ -347,12 +347,12 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
new_cip, new_sip = self.dhcp.only_request('20.20.20.31', mac)
assert_equal(new_cip, None) #Negative Test Case
- log.info('dhcp servers sent NAK as expected when requested different IP from same client')
+ log_test.info('dhcp servers sent NAK as expected when requested different IP from same client')
#test_dhcp_lease_packet
@@ -363,10 +363,10 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
self.dhcp.return_option = 'lease'
- log.info('Sending DHCP discover with lease time of 700')
+ log_test.info('Sending DHCP discover with lease time of 700')
cip, sip, mac, lval = self.dhcp.only_discover(lease_time = True, lease_value = lease_time)
assert_equal(lval, 700)
- log.info('dhcp server offered IP address with client requested lease time')
+ log_test.info('dhcp server offered IP address with client requested lease time')
def test_dhcp_client_request_after_reboot(self):
config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
@@ -375,17 +375,17 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip,None)
new_cip, new_sip = self.dhcp.only_request(cip, mac)
- log.info('verifying client IP after reboot')
+ log_test.info('verifying client IP after reboot')
os.system('ifconfig '+self.iface+' down')
time.sleep(5)
os.system('ifconfig '+self.iface+' up')
new_cip, new_sip = self.dhcp.only_request(cip, mac, cl_reboot = True)
assert_equal(new_cip,cip)
- log.info('client got same ip after reboot, as expected')
+ log_test.info('client got same ip after reboot, as expected')
def test_dhcp_server_after_reboot(self):
@@ -395,7 +395,7 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
new_cip, new_sip = self.dhcp.only_request(cip, mac)
@@ -407,7 +407,7 @@
time.sleep(3)
new_cip2, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip2,cip)
- log.info('client got same ip after server reboot, as expected')
+ log_test.info('client got same ip after server reboot, as expected')
def test_dhcp_specific_lease_time_only_in_discover_but_not_in_request_packet(self,lease_time=700):
config = {'startip':'20.20.20.30', 'endip':'20.20.20.69',
@@ -415,15 +415,15 @@
'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
- log.info('Sending DHCP discover with lease time of 700')
+ log_test.info('Sending DHCP discover with lease time of 700')
cip, sip, mac, _ = self.dhcp.only_discover(lease_time = True,lease_value=lease_time)
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, lease_time = True)
assert_equal(new_cip,cip)
assert_not_equal(lval, lease_time) #Negative Test Case
- log.info('client requested lease time only in discover but not in request, not seen in server ACK packet as expected')
+ log_test.info('client requested lease time only in discover but not in request, not seen in server ACK packet as expected')
def test_dhcp_specific_lease_time_only_in_request_but_not_in_discover_packet(self,lease_time=800):
@@ -433,12 +433,12 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, lease_time = True, lease_value=lease_time)
assert_equal(lval, lease_time)
- log.info('client requested lease time in request packet, seen in server ACK packet as expected')
+ log_test.info('client requested lease time in request packet, seen in server ACK packet as expected')
def test_dhcp_client_renew_time(self):
@@ -448,15 +448,15 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True)
- log.info('waiting renew time %d seconds to send next request packet'%lval)
+ log_test.info('waiting renew time %d seconds to send next request packet'%lval)
time.sleep(lval)
latest_cip, latest_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True)
assert_equal(latest_cip,cip)
- log.info('client got same IP after renew time, as expected')
+ log_test.info('client got same IP after renew time, as expected')
def test_dhcp_client_rebind_time(self):
@@ -466,15 +466,15 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True)
- log.info('waiting rebind time %d seconds to send next request packet'%lval)
+ log_test.info('waiting rebind time %d seconds to send next request packet'%lval)
time.sleep(lval)
latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac)
assert_equal(latest_cip,cip)
- log.info('client got same IP after rebind time, as expected')
+ log_test.info('client got same IP after rebind time, as expected')
def test_dhcp_client_expected_subnet_mask(self):
@@ -488,9 +488,9 @@
cip, sip, mac, subnet_mask = self.dhcp.only_discover()
assert_equal(subnet_mask, expected_subnet)
assert_not_equal(cip, None)
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info('seen expected subnet mask %s in dhcp offer packet'%subnet_mask)
+ log_test.info('seen expected subnet mask %s in dhcp offer packet'%subnet_mask)
def test_dhcp_client_sends_dhcp_request_with_wrong_subnet_mask(self):
@@ -501,13 +501,13 @@
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
self.dhcp.send_different_option = 'subnet'
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
- log.info("Got DHCP Ack despite of specifying wrong Subnet Mask in DHCP Request.")
+ log_test.info("Got DHCP Ack despite of specifying wrong Subnet Mask in DHCP Request.")
def test_dhcp_client_expected_router_address(self):
@@ -521,11 +521,11 @@
self.dhcp.return_option = 'router'
cip, sip, mac, router_address_ip = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
assert_equal(expected_router_address, router_address_ip)
- log.info('seen expected rouer address %s ip in dhcp offer packet'%router_address_ip)
+ log_test.info('seen expected rouer address %s ip in dhcp offer packet'%router_address_ip)
def test_dhcp_client_sends_dhcp_request_with_wrong_router_address(self):
@@ -536,13 +536,13 @@
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
self.dhcp.send_different_option = 'router'
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
- log.info("Got DHCP Ack despite of specifying wrong Router Address in DHCP Request.")
+ log_test.info("Got DHCP Ack despite of specifying wrong Router Address in DHCP Request.")
def test_dhcp_client_expected_broadcast_address(self):
@@ -556,11 +556,11 @@
self.dhcp.return_option = 'broadcast_address'
cip, sip, mac, broadcast_address = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
assert_equal(expected_broadcast_address, broadcast_address)
- log.info('seen expected broadcast address %s in dhcp offer packet'%broadcast_address)
+ log_test.info('seen expected broadcast address %s in dhcp offer packet'%broadcast_address)
def test_dhcp_client_sends_dhcp_request_with_wrong_broadcast_address(self):
@@ -571,13 +571,13 @@
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = self.iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
self.dhcp.send_different_option = 'broadcast_address'
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
- log.info("Got DHCP Ack despite of specifying wrong Broadcast Address in DHCP Request.")
+ log_test.info("Got DHCP Ack despite of specifying wrong Broadcast Address in DHCP Request.")
def test_dhcp_client_expected_dns_address(self):
@@ -591,10 +591,10 @@
cip, sip, mac, dns_address = self.dhcp.only_discover()
assert_not_equal(cip, None)
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_equal(expected_dns_address, dns_address)
- log.info('seen expected DNS ip address %s in dhcp offer packet'%dns_address)
+ log_test.info('seen expected DNS ip address %s in dhcp offer packet'%dns_address)
def test_dhcp_client_sends_request_with_wrong_dns_address(self):
@@ -606,96 +606,95 @@
cip, sip, mac, _ = self.dhcp.only_discover()
assert_not_equal(cip, None)
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
self.dhcp.send_different_option = 'dns'
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
- log.info("Got DHCP Ack despite of specifying wrong DNS Address in DHCP Request.")
+ log_test.info("Got DHCP Ack despite of specifying wrong DNS Address in DHCP Request.")
def test_dhcp_server_transactions_per_second(self):
for i in range(1,4):
self.stats()
- log.info("Stats for run %d",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of transactions No. of successes No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.ip_count+self.failure_count, self.ip_count, self.failure_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of transactions per second in run %d:%f" %(i, self.transaction_count))
+ log_test.info("Stats for run %d",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of transactions No. of successes No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.ip_count+self.failure_count, self.ip_count, self.failure_count, self.diff))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of transactions per second in run %d:%f" %(i, self.transaction_count))
- log.info("Final Statistics for total transactions")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of successes Total No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.transactions,
+ log_test.info("Final Statistics for total transactions")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of successes Total No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.transactions,
self.total_success, self.total_failure, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of transactions per second: %d", round(self.transactions/self.running_time,0))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of transactions per second: %d", round(self.transactions/self.running_time,0))
def test_dhcp_server_consecutive_successes_per_second(self):
for i in range(1,4):
self.stats(success_rate = True)
- log.info("Stats for run %d",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of consecutive successful transactions Running Time ")
- log.info(" %d %d " %(self.ip_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of successful transactions per second in run %d:%f" %(i, self.transaction_count))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("Stats for run %d",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of consecutive successful transactions Running Time ")
+ log_test.info(" %d %d " %(self.ip_count, self.diff))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of successful transactions per second in run %d:%f" %(i, self.transaction_count))
+ log_test.info("----------------------------------------------------------------------------------")
- log.info("Final Statistics for total successful transactions")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of consecutive successes Running Time ")
- log.info(" %d %d %d " %(self.transactions,
+ log_test.info("Final Statistics for total successful transactions")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of consecutive successes Running Time ")
+ log_test.info(" %d %d %d " %(self.transactions,
self.total_success, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of consecutive successful transactions per second: %d", round(self.total_success/self.running_time,0))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of consecutive successful transactions per second: %d", round(self.total_success/self.running_time,0))
+ log_test.info("----------------------------------------------------------------------------------")
def test_dhcp_server_client_transactions_per_second(self):
for i in range(1,4):
self.stats(only_discover = True)
- log.info("----------------------------------------------------------------------------------")
- log.info("Stats for run %d of sending only DHCP Discover",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of transactions No. of successes No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.ip_count+self.failure_count, self.ip_count, self.failure_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of clients per second in run %d:%f "
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Stats for run %d of sending only DHCP Discover",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of transactions No. of successes No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.ip_count+self.failure_count, self.ip_count, self.failure_count, self.diff))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of clients per second in run %d:%f "
%(i, self.transaction_count))
- log.info("----------------------------------------------------------------------------------")
- log.info("Final Statistics for total transactions of sending only DHCP Discover")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of successes Total No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.transactions,
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Final Statistics for total transactions of sending only DHCP Discover")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of successes Total No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.transactions,
self.total_success, self.total_failure, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of clients per second: %d ",
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of clients per second: %d ",
round(self.transactions/self.running_time,0))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
def test_dhcp_server_consecutive_successful_clients_per_second(self):
for i in range(1,4):
self.stats(success_rate = True, only_discover = True)
- log.info("----------------------------------------------------------------------------------")
- log.info("Stats for run %d for sending only DHCP Discover",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of consecutive successful transactions Running Time ")
- log.info(" %d %d " %(self.ip_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of consecutive successful clients per second in run %d:%f" %(i, self.transaction_count))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Stats for run %d for sending only DHCP Discover",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of consecutive successful transactions Running Time ")
+ log_test.info(" %d %d " %(self.ip_count, self.diff))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of consecutive successful clients per second in run %d:%f" %(i, self.transaction_count))
+ log_test.info("----------------------------------------------------------------------------------")
- log.info("Final Statistics for total successful transactions")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of consecutive successes Running Time ")
- log.info(" %d %d %d " %(self.transactions,
+ log_test.info("Final Statistics for total successful transactions")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of consecutive successes Running Time ")
+ log_test.info(" %d %d %d " %(self.transactions,
self.total_success, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of consecutive successful clients per second: %d", round(self.total_success/self.running_time,0))
- log.info("----------------------------------------------------------------------------------")
-
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of consecutive successful clients per second: %d", round(self.total_success/self.running_time,0))
+ log_test.info("----------------------------------------------------------------------------------")
diff --git a/src/test/dhcprelay/dhcprelayTest.py b/src/test/dhcprelay/dhcprelayTest.py
index 2cfb4be..20d3097 100644
--- a/src/test/dhcprelay/dhcprelayTest.py
+++ b/src/test/dhcprelay/dhcprelayTest.py
@@ -17,11 +17,10 @@
from nose.tools import *
from nose.twistedtools import reactor, deferred
from twisted.internet import defer
-from scapy.all import *
import time
import os, sys
from DHCP import DHCPTest
-from CordTestUtils import get_mac
+from CordTestUtils import get_mac, log_test
from OnosCtrl import OnosCtrl
from OltConfig import OltConfig
from CordTestServer import cord_test_onos_restart
@@ -29,7 +28,7 @@
from portmaps import g_subscriber_port_map
import threading, random
from threading import current_thread
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class dhcprelay_exchange(CordLogger):
@@ -136,14 +135,14 @@
for config in cls.configs.items():
OnosCtrl.delete(config)
# if cls.onos_restartable is True:
- # log.info('Cleaning up dhcp relay config by restarting ONOS with default network cfg')
+ # log_test.info('Cleaning up dhcp relay config by restarting ONOS with default network cfg')
# return cord_test_onos_restart(config = {})
@classmethod
def onos_load_config(cls, config):
status, code = OnosCtrl.config(config)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
time.sleep(3)
@@ -246,7 +245,7 @@
intf_str = ','.join(intf_list)
dhcpd_cmd = '/usr/sbin/dhcpd -4 --no-pid -cf {0} -lf {1} {2}'.format(conf_file, lease_file, intf_str)
- log.info('Starting DHCPD server with command: %s' %dhcpd_cmd)
+ log_test.info('Starting DHCPD server with command: %s' %dhcpd_cmd)
ret = os.system(dhcpd_cmd)
assert_equal(ret, 0)
time.sleep(3)
@@ -297,7 +296,7 @@
if only_discover:
cip, sip, mac, _ = self.dhcp.only_discover(multiple = True)
- log.info('Got dhcp client IP %s from server %s for mac %s' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s' %
(cip, sip, mac))
else:
cip, sip = self.send_recv(mac=mac, update_seed = True, validate = False)
@@ -306,7 +305,7 @@
self.ip_count +=1
elif cip == None:
self.failure_count += 1
- log.info('Failed to get ip')
+ log_test.info('Failed to get ip')
if success_rate and self.ip_count > 0:
break
@@ -323,7 +322,7 @@
if validate:
assert_not_equal(cip, None)
assert_not_equal(sip, None)
- log.info('Got dhcp client IP %s from server %s for mac %s' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s' %
(cip, sip, self.dhcp.get_mac(cip)[0]))
return cip,sip
@@ -359,7 +358,7 @@
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover(mac='ff:ff:ff:ff:ff:ff')
assert_equal(cip,None)
- log.info('dhcp server rejected client discover with invalid source mac, as expected')
+ log_test.info('dhcp server rejected client discover with invalid source mac, as expected')
def test_dhcpRelay_1request_with_invalid_source_mac_multicast(self, iface = 'veth0'):
mac = self.get_mac(iface)
@@ -377,7 +376,7 @@
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover(mac='01:80:c2:01:98:05')
assert_equal(cip,None)
- log.info('dhcp server rejected client discover with invalid source mac, as expected')
+ log_test.info('dhcp server rejected client discover with invalid source mac, as expected')
def test_dhcpRelay_1request_with_invalid_source_mac_zero(self, iface = 'veth0'):
mac = self.get_mac(iface)
@@ -395,7 +394,7 @@
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover(mac='00:00:00:00:00:00')
assert_equal(cip,None)
- log.info('dhcp server rejected client discover with invalid source mac, as expected')
+ log_test.info('dhcp server rejected client discover with invalid source mac, as expected')
def test_dhcpRelay_Nrequest(self, iface = 'veth0',requests=10):
mac = self.get_mac(iface)
@@ -414,10 +413,10 @@
ip_map = {}
for i in range(requests):
#mac = RandMAC()._fix()
- #log.info('mac is %s'%mac)
+ #log_test.info('mac is %s'%mac)
cip, sip = self.send_recv(update_seed = True)
if ip_map.has_key(cip):
- log.info('IP %s given out multiple times' %cip)
+ log_test.info('IP %s given out multiple times' %cip)
assert_equal(False, ip_map.has_key(cip))
ip_map[cip] = sip
time.sleep(1)
@@ -437,13 +436,13 @@
subnet = subnet)
self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = iface)
cip, sip = self.send_recv(mac=mac)
- log.info('Releasing ip %s to server %s' %(cip, sip))
+ log_test.info('Releasing ip %s to server %s' %(cip, sip))
assert_equal(self.dhcp.release(cip), True)
- log.info('Triggering DHCP discover again after release')
+ log_test.info('Triggering DHCP discover again after release')
cip2, sip2 = self.send_recv(mac=mac)
- log.info('Verifying released IP was given back on rediscover')
+ log_test.info('Verifying released IP was given back on rediscover')
assert_equal(cip, cip2)
- log.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
+ log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
assert_equal(self.dhcp.release(cip2), True)
def test_dhcpRelay_Nrelease(self, iface = 'veth0'):
@@ -464,25 +463,25 @@
for i in range(10):
cip, sip = self.send_recv(mac=mac, update_seed = True)
if ip_map.has_key(cip):
- log.info('IP %s given out multiple times' %cip)
+ log_test.info('IP %s given out multiple times' %cip)
assert_equal(False, ip_map.has_key(cip))
ip_map[cip] = sip
for ip in ip_map.keys():
- log.info('Releasing IP %s' %ip)
+ log_test.info('Releasing IP %s' %ip)
assert_equal(self.dhcp.release(ip), True)
ip_map2 = {}
- log.info('Triggering DHCP discover again after release')
+ log_test.info('Triggering DHCP discover again after release')
self.dhcp = DHCPTest(seed_ip = '192.170.1.10', iface = iface)
for i in range(len(ip_map.keys())):
cip, sip = self.send_recv(mac=mac, update_seed = True)
ip_map2[cip] = sip
- log.info('Verifying released IPs were given back on rediscover')
+ log_test.info('Verifying released IPs were given back on rediscover')
if ip_map != ip_map2:
- log.info('Map before release %s' %ip_map)
- log.info('Map after release %s' %ip_map2)
+ log_test.info('Map before release %s' %ip_map)
+ log_test.info('Map after release %s' %ip_map2)
assert_equal(ip_map, ip_map2)
def test_dhcpRelay_starvation(self, iface = 'veth0'):
@@ -499,7 +498,7 @@
options = options,
subnet = subnet)
self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = iface)
- log.info('Verifying 1 ')
+ log_test.info('Verifying 1 ')
count = 0
while True:
#mac = RandMAC()._fix()
@@ -509,7 +508,7 @@
else:
count += 1
assert_equal(count,91)
- log.info('Verifying 2 ')
+ log_test.info('Verifying 2 ')
cip, sip = self.send_recv(mac=mac, update_seed = True, validate = False)
assert_equal(cip, None)
assert_equal(sip, None)
@@ -529,13 +528,13 @@
subnet = subnet)
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
(cip, sip, mac) )
assert_not_equal(cip, None)
- log.info('Triggering DHCP discover again.')
+ log_test.info('Triggering DHCP discover again.')
new_cip, new_sip, new_mac, _ = self.dhcp.only_discover()
assert_equal(new_cip, cip)
- log.info('got same ip to smae the client when sent discover again, as expected')
+ log_test.info('got same ip to smae the client when sent discover again, as expected')
def test_dhcpRelay_same_client_multiple_request(self, iface = 'veth0'):
mac = self.get_mac(iface)
@@ -551,13 +550,13 @@
options = options,
subnet = subnet)
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
- log.info('Sending DHCP discover and DHCP request.')
+ log_test.info('Sending DHCP discover and DHCP request.')
cip, sip = self.send_recv(mac=mac)
mac = self.dhcp.get_mac(cip)[0]
- log.info("Sending DHCP request again.")
+ log_test.info("Sending DHCP request again.")
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
- log.info('got same ip to smae the client when sent request again, as expected')
+ log_test.info('got same ip to smae the client when sent request again, as expected')
def test_dhcpRelay_client_desired_address(self, iface = 'veth0'):
mac = self.get_mac(iface)
@@ -575,7 +574,7 @@
self.dhcp = DHCPTest(seed_ip = '192.168.1.31', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover(desired = True)
assert_equal(cip,self.dhcp.seed_ip)
- log.info('Got dhcp client desired IP %s from server %s for mac %s as expected' %
+ log_test.info('Got dhcp client desired IP %s from server %s for mac %s as expected' %
(cip, sip, mac) )
def test_dhcpRelay_client_desired_address_out_of_pool(self, iface = 'veth0'):
@@ -596,7 +595,7 @@
cip, sip, mac, _ = self.dhcp.only_discover(desired = True)
assert_not_equal(cip,None)
assert_not_equal(cip,self.dhcp.seed_ip)
- log.info('server offered IP from its pool when requested out of pool IP, as expected')
+ log_test.info('server offered IP from its pool when requested out of pool IP, as expected')
def test_dhcpRelay_nak_packet(self, iface = 'veth0'):
mac = self.get_mac(iface)
@@ -613,12 +612,12 @@
subnet = subnet)
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
new_cip, new_sip = self.dhcp.only_request('20.20.20.31', mac)
assert_equal(new_cip, None)
- log.info('server sent NAK packet when requested other IP than that server offered')
+ log_test.info('server sent NAK packet when requested other IP than that server offered')
def test_dhcpRelay_client_requests_specific_lease_time_in_discover(self, iface = 'veth0',lease_time=700):
@@ -638,7 +637,7 @@
self.dhcp.return_option = 'lease'
cip, sip, mac, lval = self.dhcp.only_discover(lease_time=True,lease_value=lease_time)
assert_equal(lval, lease_time)
- log.info('dhcp server offered IP address with client requested lease time')
+ log_test.info('dhcp server offered IP address with client requested lease time')
def test_dhcpRelay_client_request_after_reboot(self, iface = 'veth0'):
mac = self.get_mac(iface)
@@ -655,17 +654,17 @@
subnet = subnet)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
new_cip, new_sip = self.dhcp.only_request(cip, mac)
- log.info('client rebooting...')
+ log_test.info('client rebooting...')
os.system('ifconfig '+iface+' down')
time.sleep(5)
os.system('ifconfig '+iface+' up')
new_cip2, new_sip = self.dhcp.only_request(cip, mac, cl_reboot = True)
assert_equal(new_cip2, cip)
- log.info('client got same IP after reboot, as expected')
+ log_test.info('client got same IP after reboot, as expected')
def test_dhcpRelay_after_server_reboot(self, iface = 'veth0'):
@@ -683,18 +682,18 @@
subnet = subnet)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip, None)
new_cip, new_sip = self.dhcp.only_request(cip, mac)
- log.info('server rebooting...')
+ log_test.info('server rebooting...')
self.tearDownClass()
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip,None)
self.setUpClass()
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
- log.info('client got same IP after server rebooted, as expected')
+ log_test.info('client got same IP after server rebooted, as expected')
def test_dhcpRelay_specific_lease_time_only_in_discover_but_not_in_request_packet(self, iface = 'veth0',lease_time=700):
@@ -712,13 +711,13 @@
subnet = subnet)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
self.dhcp.return_option = 'lease'
- log.info('Sending DHCP discover with lease time of 700')
+ log_test.info('Sending DHCP discover with lease time of 700')
cip, sip, mac, lval = self.dhcp.only_discover(lease_time = True, lease_value=lease_time)
assert_equal(lval,lease_time)
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, lease_time = True)
assert_equal(new_cip,cip)
assert_not_equal(lval, lease_time) #Negative Test Case
- log.info('client requested lease time in discover packer is not seen in server ACK packet as expected')
+ log_test.info('client requested lease time in discover packer is not seen in server ACK packet as expected')
def test_dhcpRelay_specific_lease_time_only_in_request_but_not_in_discover_packet(self, iface = 'veth0',lease_time=800):
mac = self.get_mac(iface)
@@ -738,7 +737,7 @@
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, lease_time = True,lease_value=lease_time)
assert_equal(new_cip,cip)
assert_equal(lval, lease_time)
- log.info('client requested lease time in request packet seen in servre replied ACK packet as expected')
+ log_test.info('client requested lease time in request packet seen in servre replied ACK packet as expected')
def test_dhcpRelay_client_renew_time(self, iface = 'veth0'):
mac = self.get_mac(iface)
@@ -756,15 +755,15 @@
subnet = subnet)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip,None)
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True)
- log.info('waiting for renew time..')
+ log_test.info('waiting for renew time..')
time.sleep(lval)
latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac, unicast = True)
assert_equal(latest_cip, cip)
- log.info('server renewed client IP when client sends request after renew time, as expected')
+ log_test.info('server renewed client IP when client sends request after renew time, as expected')
def test_dhcpRelay_client_rebind_time(self, iface = 'veth0'):
@@ -783,15 +782,15 @@
subnet = subnet)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip,None)
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True)
- log.info('waiting for rebind time..')
+ log_test.info('waiting for rebind time..')
time.sleep(lval)
latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac)
assert_equal(latest_cip, cip)
- log.info('server renewed client IP when client sends request after rebind time, as expected')
+ log_test.info('server renewed client IP when client sends request after rebind time, as expected')
def test_dhcpRelay_client_expected_subnet_mask(self, iface = 'veth0'):
@@ -812,10 +811,10 @@
self.dhcp.return_option = 'subnet'
cip, sip, mac, subnet_mask = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_equal(subnet_mask,expected_subnet)
- log.info('subnet mask in server offer packet is same as configured subnet mask in dhcp server')
+ log_test.info('subnet mask in server offer packet is same as configured subnet mask in dhcp server')
def test_dhcpRelay_client_sends_dhcp_request_with_wrong_subnet_mask(self, iface = 'veth0'):
@@ -834,13 +833,13 @@
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip,None)
self.dhcp.send_different_option = 'subnet'
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
- log.info("Got DHCP Ack despite of specifying wrong Subnet Mask in DHCP Request.")
+ log_test.info("Got DHCP Ack despite of specifying wrong Subnet Mask in DHCP Request.")
def test_dhcpRelay_client_expected_router_address(self, iface = 'veth0'):
@@ -863,10 +862,10 @@
self.dhcp.return_option = 'router'
cip, sip, mac, router_address_value = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_equal(expected_router_address, router_address_value)
- log.info('router address in server offer packet is same as configured router address in dhcp server')
+ log_test.info('router address in server offer packet is same as configured router address in dhcp server')
def test_dhcpRelay_client_sends_dhcp_request_with_wrong_router_address(self, iface = 'veth0'):
@@ -885,13 +884,13 @@
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip,None)
self.dhcp.send_different_option = 'router'
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
- log.info("Got DHCP Ack despite of specifying wrong Router Address in DHCP Request.")
+ log_test.info("Got DHCP Ack despite of specifying wrong Router Address in DHCP Request.")
def test_dhcpRelay_client_expected_broadcast_address(self, iface = 'veth0'):
@@ -912,10 +911,10 @@
self.dhcp.return_option = 'broadcast_address'
cip, sip, mac, broadcast_address_value = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_equal(expected_broadcast_address, broadcast_address_value)
- log.info('broadcast address in server offer packet is same as configured broadcast address in dhcp server')
+ log_test.info('broadcast address in server offer packet is same as configured broadcast address in dhcp server')
def test_dhcpRelay_client_sends_dhcp_request_with_wrong_broadcast_address(self, iface = 'veth0'):
mac = self.get_mac(iface)
@@ -933,13 +932,13 @@
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip,None)
self.dhcp.send_different_option = 'broadcast_address'
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
- log.info("Got DHCP Ack despite of specifying wrong Broadcast Address in DHCP Request.")
+ log_test.info("Got DHCP Ack despite of specifying wrong Broadcast Address in DHCP Request.")
def test_dhcpRelay_client_expected_dns_address(self, iface = 'veth0'):
@@ -960,10 +959,10 @@
self.dhcp.return_option = 'dns'
cip, sip, mac, dns_address_value = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_equal(expected_dns_address, dns_address_value)
- log.info('dns address in server offer packet is same as configured dns address in dhcp server')
+ log_test.info('dns address in server offer packet is same as configured dns address in dhcp server')
def test_dhcpRelay_client_sends_request_with_wrong_dns_address(self, iface = 'veth0'):
mac = self.get_mac(iface)
@@ -981,100 +980,100 @@
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
assert_not_equal(cip,None)
self.dhcp.send_different_option = 'dns'
new_cip, new_sip = self.dhcp.only_request(cip, mac)
assert_equal(new_cip, cip)
- log.info("Got DHCP Ack despite of specifying wrong DNS Address in DHCP Request.")
+ log_test.info("Got DHCP Ack despite of specifying wrong DNS Address in DHCP Request.")
def test_dhcpRelay_transactions_per_second(self, iface = 'veth0'):
for i in range(1,4):
self.stats()
- log.info("Statistics for run %d",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of transactions No. of successes No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.ip_count+self.failure_count, self.ip_count, self.failure_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of transactions per second in run %d:%f" %(i, self.transaction_count))
+ log_test.info("Statistics for run %d",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of transactions No. of successes No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.ip_count+self.failure_count, self.ip_count, self.failure_count, self.diff))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of transactions per second in run %d:%f" %(i, self.transaction_count))
- log.info("Final Statistics for total transactions")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of successes Total No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.transactions,
+ log_test.info("Final Statistics for total transactions")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of successes Total No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.transactions,
self.total_success, self.total_failure, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of transactions per second: %d", round(self.transactions/self.running_time,0))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of transactions per second: %d", round(self.transactions/self.running_time,0))
def test_dhcpRelay_consecutive_successes_per_second(self, iface = 'veth0'):
for i in range(1,4):
self.stats(success_rate = True)
- log.info("Statistics for run %d",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of consecutive successful transactions Running Time ")
- log.info(" %d %d " %(self.ip_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of successful transactions per second in run %d:%f" %(i, self.transaction_count))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("Statistics for run %d",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of consecutive successful transactions Running Time ")
+ log_test.info(" %d %d " %(self.ip_count, self.diff))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of successful transactions per second in run %d:%f" %(i, self.transaction_count))
+ log_test.info("----------------------------------------------------------------------------------")
- log.info("Final Statistics for total successful transactions")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of consecutive successes Running Time ")
- log.info(" %d %d %d " %(self.transactions,
+ log_test.info("Final Statistics for total successful transactions")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of consecutive successes Running Time ")
+ log_test.info(" %d %d %d " %(self.transactions,
self.total_success, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of consecutive successful transactions per second: %d", round(self.total_success/self.running_time,0))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of consecutive successful transactions per second: %d", round(self.total_success/self.running_time,0))
+ log_test.info("----------------------------------------------------------------------------------")
def test_dhcpRelay_clients_per_second(self, iface = 'veth0'):
for i in range(1,4):
self.stats(only_discover = True)
- log.info("----------------------------------------------------------------------------------")
- log.info("Statistics for run %d of sending only DHCP Discover",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of transactions No. of successes No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.ip_count+self.failure_count, self.ip_count, self.failure_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of clients per second in run %d:%f "
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Statistics for run %d of sending only DHCP Discover",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of transactions No. of successes No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.ip_count+self.failure_count, self.ip_count, self.failure_count, self.diff))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of clients per second in run %d:%f "
%(i, self.transaction_count))
- log.info("----------------------------------------------------------------------------------")
- log.info("Final Statistics for total transactions of sending only DHCP Discover")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of successes Total No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.transactions,
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Final Statistics for total transactions of sending only DHCP Discover")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of successes Total No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.transactions,
self.total_success, self.total_failure, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of clients per second: %d ",
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of clients per second: %d ",
round(self.transactions/self.running_time,0))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
def test_dhcpRelay_consecutive_successful_clients_per_second(self, iface = 'veth0'):
for i in range(1,4):
self.stats(success_rate = True, only_discover = True)
- log.info("----------------------------------------------------------------------------------")
- log.info("Statistics for run %d for sending only DHCP Discover",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of consecutive successful transactions Running Time ")
- log.info(" %d %d " %(self.ip_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of consecutive successful clients per second in run %d:%f" %(i, self.transaction_count))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Statistics for run %d for sending only DHCP Discover",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of consecutive successful transactions Running Time ")
+ log_test.info(" %d %d " %(self.ip_count, self.diff))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of consecutive successful clients per second in run %d:%f" %(i, self.transaction_count))
+ log_test.info("----------------------------------------------------------------------------------")
- log.info("Final Statistics for total successful transactions")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of consecutive successes Running Time ")
- log.info(" %d %d %d " %(self.transactions,
+ log_test.info("Final Statistics for total successful transactions")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of consecutive successes Running Time ")
+ log_test.info(" %d %d %d " %(self.transactions,
self.total_success, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of consecutive successful clients per second: %d", round(self.total_success/self.running_time,0))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of consecutive successful clients per second: %d", round(self.total_success/self.running_time,0))
+ log_test.info("----------------------------------------------------------------------------------")
def test_dhcpRelay_concurrent_transactions_per_second(self, iface = 'veth0'):
@@ -1099,7 +1098,7 @@
def thread_fun(i):
mac = self.get_mac('veth{}'.format(i))
cip, sip = DHCPTest(iface = 'veth{}'.format(i)).discover(mac = mac)
- log.info('Got dhcp client IP %s from server %s for mac %s'%(cip, sip, mac))
+ log_test.info('Got dhcp client IP %s from server %s for mac %s'%(cip, sip, mac))
self.lock.acquire()
if cip:
@@ -1151,26 +1150,26 @@
self.total_failure += self.failure_count
- log.info("----------------------------------------------------------------------------------")
- log.info("Statistics for run %d",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of transactions No. of successes No. of failures Running Time ")
- log.info(" %d %d %d %d"
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Statistics for run %d",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of transactions No. of successes No. of failures Running Time ")
+ log_test.info(" %d %d %d %d"
%(self.ip_count+self.failure_count,self.ip_count, self.failure_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of transactions per second in run %d:%f" %(i, self.transaction_count))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of transactions per second in run %d:%f" %(i, self.transaction_count))
+ log_test.info("----------------------------------------------------------------------------------")
- log.info("----------------------------------------------------------------------------------")
- log.info("Final Statistics for total transactions")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of successes Total No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.transactions,
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Final Statistics for total transactions")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of successes Total No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.transactions,
self.total_success, self.total_failure, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of transactions per second: %d", round(self.transactions/self.running_time,0))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of transactions per second: %d", round(self.transactions/self.running_time,0))
+ log_test.info("----------------------------------------------------------------------------------")
def test_dhcpRelay_concurrent_consecutive_successes_per_second(self, iface = 'veth0'):
@@ -1194,13 +1193,13 @@
self.host_load(g_subscriber_port_map[key])
def thread_fun(i, j):
-# log.info("Thread Name:%s",current_thread().name)
+# log_test.info("Thread Name:%s",current_thread().name)
# failure_dir[current_thread().name] = True
while failure_dir.has_key(current_thread().name) is False:
mac = RandMAC()._fix()
cip, sip = DHCPTest(iface = 'veth{}'.format(i)).discover(mac = mac)
i += 2
- log.info('Got dhcp client IP %s from server %s for mac %s'%(cip, sip, mac))
+ log_test.info('Got dhcp client IP %s from server %s for mac %s'%(cip, sip, mac))
self.lock.acquire()
if cip:
@@ -1256,22 +1255,22 @@
self.total_failure += self.failure_count
- log.info("Statistics for run %d",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of consecutive successful transactions Running Time ")
- log.info(" %d %d " %(self.ip_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of successful transactions per second in run %d:%f" %(i, self.transaction_count))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("Statistics for run %d",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of consecutive successful transactions Running Time ")
+ log_test.info(" %d %d " %(self.ip_count, self.diff))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of successful transactions per second in run %d:%f" %(i, self.transaction_count))
+ log_test.info("----------------------------------------------------------------------------------")
- log.info("Final Statistics for total successful transactions")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of consecutive successes Running Time ")
- log.info(" %d %d %d " %(self.transactions,
+ log_test.info("Final Statistics for total successful transactions")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of consecutive successes Running Time ")
+ log_test.info(" %d %d %d " %(self.transactions,
self.total_success, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of consecutive successful transactions per second: %d", round(self.total_success/self.running_time,2))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of consecutive successful transactions per second: %d", round(self.total_success/self.running_time,2))
+ log_test.info("----------------------------------------------------------------------------------")
def test_dhcpRelay_concurrent_clients_per_second(self, iface = 'veth0'):
@@ -1296,7 +1295,7 @@
def thread_fun(i):
# mac = self.get_mac('veth{}'.format(i))
cip, sip, mac, _ = DHCPTest(iface = 'veth{}'.format(i)).only_discover(mac = RandMAC()._fix())
- log.info('Got dhcp client IP %s from server %s for mac %s'%(cip, sip, mac))
+ log_test.info('Got dhcp client IP %s from server %s for mac %s'%(cip, sip, mac))
self.lock.acquire()
if cip:
@@ -1344,25 +1343,25 @@
self.total_success += self.ip_count
self.total_failure += self.failure_count
- log.info("----------------------------------------------------------------------------------")
- log.info("Statistics for run %d of sending only DHCP Discover",i)
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of transactions No. of successes No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.ip_count+self.failure_count, self.ip_count, self.failure_count, self.diff))
- log.info("----------------------------------------------------------------------------------")
- log.info("No. of clients per second in run %d:%f "
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Statistics for run %d of sending only DHCP Discover",i)
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of transactions No. of successes No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.ip_count+self.failure_count, self.ip_count, self.failure_count, self.diff))
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("No. of clients per second in run %d:%f "
%(i, self.transaction_count))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
- log.info("Final Statistics for total transactions of sending only DHCP Discover")
- log.info("----------------------------------------------------------------------------------")
- log.info("Total transactions Total No. of successes Total No. of failures Running Time ")
- log.info(" %d %d %d %d" %(self.transactions,
+ log_test.info("Final Statistics for total transactions of sending only DHCP Discover")
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Total transactions Total No. of successes Total No. of failures Running Time ")
+ log_test.info(" %d %d %d %d" %(self.transactions,
self.total_success, self.total_failure, self.running_time))
- log.info("----------------------------------------------------------------------------------")
- log.info("Average no. of clients per second: %d ",
+ log_test.info("----------------------------------------------------------------------------------")
+ log_test.info("Average no. of clients per second: %d ",
round(self.transactions/self.running_time,0))
- log.info("----------------------------------------------------------------------------------")
+ log_test.info("----------------------------------------------------------------------------------")
def test_dhcpRelay_client_conflict(self, iface = 'veth0'):
@@ -1370,20 +1369,20 @@
self.host_load(iface)
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
cip, sip, mac, _ = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s.' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s.' %
(cip, sip, mac) )
self.dhcp1 = DHCPTest(seed_ip = cip, iface = iface)
new_cip, new_sip, new_mac, _ = self.dhcp1.only_discover(desired = True)
new_cip, new_sip = self.dhcp1.only_request(new_cip, new_mac)
- log.info('Got dhcp client IP %s from server %s for mac %s.' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s.' %
(new_cip, new_sip, new_mac) )
- log.info("IP %s alredy consumed by mac %s." % (new_cip, new_mac))
- log.info("Now sending DHCP Request for old DHCP discover.")
+ log_test.info("IP %s alredy consumed by mac %s." % (new_cip, new_mac))
+ log_test.info("Now sending DHCP Request for old DHCP discover.")
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip is None:
- log.info('Got dhcp client IP %s from server %s for mac %s.Which is expected behavior.'
+ log_test.info('Got dhcp client IP %s from server %s for mac %s.Which is expected behavior.'
%(new_cip, new_sip, new_mac) )
elif new_cip:
- log.info('Got dhcp client IP %s from server %s for mac %s.Which is not expected behavior as IP %s is already consumed.'
+ log_test.info('Got dhcp client IP %s from server %s for mac %s.Which is not expected behavior as IP %s is already consumed.'
%(new_cip, new_sip, new_mac, new_cip) )
assert_equal(new_cip, None)
diff --git a/src/test/fabric/fabricTest.py b/src/test/fabric/fabricTest.py
index ec17e49..9cfe586 100644
--- a/src/test/fabric/fabricTest.py
+++ b/src/test/fabric/fabricTest.py
@@ -1,12 +1,12 @@
-#
+#
# Copyright 2016-present Ciena Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,7 +19,7 @@
from twisted.internet import defer
from TestManifest import TestManifest
from Fabric import FabricMAAS, Fabric
-from scapy.all import *
+from CordTestUtils import log_test as log
import os
log.setLevel('INFO')
diff --git a/src/test/flows/flowsTest.py b/src/test/flows/flowsTest.py
index dc8bf79..d754415 100644
--- a/src/test/flows/flowsTest.py
+++ b/src/test/flows/flowsTest.py
@@ -26,10 +26,11 @@
from OnosFlowCtrl import OnosFlowCtrl
from OltConfig import OltConfig
from CordLogger import CordLogger
+from CordTestUtils import log_test
import random
from threading import current_thread
import collections
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class flows_exchange(CordLogger):
@@ -128,7 +129,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
self.success = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == ingress_mac,
prn = recv_cb, iface = self.port_map[egress])
@@ -136,7 +137,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = ingress_mac, dst = egress_mac)/IP()
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -161,7 +162,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: IP in p and p[IP].dst == egress_map['ip'] and p[IP].src == ingress_map['ip'],
@@ -172,7 +173,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -196,7 +197,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress TCP port %s, egress TCP port %s' %(pkt[TCP].sport, pkt[TCP].dport))
+ log_test.info('Pkt seen with ingress TCP port %s, egress TCP port %s' %(pkt[TCP].sport, pkt[TCP].dport))
self.success = True
sniff(count=2, timeout=5, lfilter = lambda p: TCP in p and p[TCP].dport == egress_map['tcp_port']
and p[TCP].sport == ingress_map['tcp_port'], prn = recv_cb, iface = self.port_map[egress])
@@ -207,7 +208,7 @@
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])
L4 = TCP(sport = ingress_map['tcp_port'], dport = egress_map['tcp_port'])
pkt = L2/L3/L4
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -230,7 +231,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
+ log_test.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: UDP in p and p[UDP].dport == egress_map['udp_port']
@@ -242,7 +243,7 @@
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])
L4 = UDP(sport = ingress_map['udp_port'], dport = egress_map['udp_port'])
pkt = L2/L3/L4
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -266,8 +267,8 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
- log.info('Pkt:%s', pkt.show())
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt:%s', pkt.show())
self.success = True
sniff(count=2, timeout=5, lfilter = lambda p:p.src == ingress_mac,
prn = recv_cb, iface = self.port_map[egress])
@@ -275,8 +276,8 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = ingress_mac, dst = egress_mac)/Dot1Q(vlan = 0x10)/IP()
- log.info("Sending Packet:%s",pkt.show())
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info("Sending Packet:%s",pkt.show())
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -301,7 +302,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IPv6].src, pkt[IPv6].dst))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IPv6].src, pkt[IPv6].dst))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: IPv6 in p and p[IPv6].dst == egress_map['ipv6'] and p[IPv6].src == ingress_map['ipv6'],
@@ -312,7 +313,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'] , dst = egress_map['ipv6'])
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -335,7 +336,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s with flow label %s' %(pkt[IPv6].src, pkt[IPv6].dst, pkt[IPv6].fl))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s with flow label %s' %(pkt[IPv6].src, pkt[IPv6].dst, pkt[IPv6].fl))
self.success = True
sniff(count=2, timeout=5, lfilter = lambda p: IPv6 in p and p[IPv6].dst == egress_map['ipv6']
and p[IPv6].src == ingress_map['ipv6'] and p[IPv6].fl == 25, prn = recv_cb, iface = self.port_map[egress])
@@ -345,7 +346,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'] , dst = egress_map['ipv6'], fl = 25)
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -368,7 +369,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s, Extension Header Type %s' %(pkt[IPv6].src, pkt[IPv6].dst, pkt[IPv6].nh))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s, Extension Header Type %s' %(pkt[IPv6].src, pkt[IPv6].dst, pkt[IPv6].nh))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: IPv6 in p and p[IPv6].nh == 0, prn = recv_cb, iface = self.port_map[egress])
@@ -378,7 +379,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'] , dst = egress_map['ipv6'], nh = 0)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -401,7 +402,7 @@
time.sleep(1)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s, Extension Header Type %s' %(pkt[IPv6].src, pkt[IPv6].dst, pkt[IPv6].nh))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s, Extension Header Type %s' %(pkt[IPv6].src, pkt[IPv6].dst, pkt[IPv6].nh))
self.success = True
sniff(count=2, timeout=5, lfilter = lambda p: IPv6 in p and p[IPv6].nh == i,
prn = recv_cb, iface = self.port_map[egress])
@@ -413,7 +414,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'] , dst = egress_map['ipv6'], nh = i)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -436,7 +437,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: IP in p and p[IP].dst == egress_map['ip'] and p[IP].src == ingress_map['ip']
@@ -447,7 +448,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'], tos = 32)
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -471,7 +472,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: IP in p and p[IP].dst == egress_map['ip'] and p[IP].src == ingress_map['ip']
@@ -484,7 +485,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'], tos = i)
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -506,7 +507,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: IP in p and p[IP].dst == egress_map['ip'] and p[IP].src == ingress_map['ip']
@@ -518,7 +519,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'], tos = 1)
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -541,7 +542,7 @@
time.sleep(1)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: IP in p and p[IP].dst == egress_map['ip'] and p[IP].src == ingress_map['ip']
@@ -555,7 +556,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'], tos = i)
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -581,7 +582,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s and Type of Service %s' %(pkt[IP].src, pkt[IP].dst, pkt[IP].tos))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: IP in p and p[IP].tos == int(bin(i).split('b')[1]+ bin(j).split('b')[1],2)
@@ -596,7 +597,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'], tos = int(bin(i).split('b')[1]+ bin(j).split('b')[1],2))
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -620,7 +621,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMP type %s, ICMP code %s' %(pkt[ICMP].type, pkt[ICMP].code))
+ log_test.info('Pkt seen with ICMP type %s, ICMP code %s' %(pkt[ICMP].type, pkt[ICMP].code))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMP in p and p[ICMP].type == 3 and p[ICMP].code == 8,
@@ -631,7 +632,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])/ICMP(type = 3, code = 8)
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -671,7 +672,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMP type %s, ICMP code %s' %(pkt[ICMP].type, pkt[ICMP].code))
+ log_test.info('Pkt seen with ICMP type %s, ICMP code %s' %(pkt[ICMP].type, pkt[ICMP].code))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMP in p and p[ICMP].type == 3 and p[ICMP].code == 8,
@@ -682,7 +683,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])/ICMP(type = 3, code = 8)
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -705,7 +706,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6EchoRequest].type, pkt[ICMPv6EchoRequest].code))
+ log_test.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6EchoRequest].type, pkt[ICMPv6EchoRequest].code))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMPv6EchoRequest in p and p[ICMPv6EchoRequest].type == 128 and p[ICMPv6EchoRequest].code == 0,
@@ -716,7 +717,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'], dst = egress_map['ipv6'])/ICMPv6EchoRequest()
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -739,7 +740,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6EchoReply].type, pkt[ICMPv6EchoReply].code))
+ log_test.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6EchoReply].type, pkt[ICMPv6EchoReply].code))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMPv6EchoReply in p and p[ICMPv6EchoReply].type == 129 and p[ICMPv6EchoReply].code == 0,
@@ -750,7 +751,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'], dst = egress_map['ipv6'])/ICMPv6EchoReply()
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -776,7 +777,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6DestUnreach].type, pkt[ICMPv6DestUnreach].code))
+ log_test.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6DestUnreach].type, pkt[ICMPv6DestUnreach].code))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMPv6DestUnreach in p and p[ICMPv6DestUnreach].type == 1 and p[ICMPv6DestUnreach].code == i,
@@ -787,7 +788,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'], dst = egress_map['ipv6'])/ICMPv6DestUnreach(code = i)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -810,7 +811,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6PacketTooBig].type, pkt[ICMPv6PacketTooBig].code))
+ log_test.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6PacketTooBig].type, pkt[ICMPv6PacketTooBig].code))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMPv6PacketTooBig in p and p[ICMPv6PacketTooBig].type == 2 and p[ICMPv6PacketTooBig].code == 0,
@@ -821,7 +822,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'], dst = egress_map['ipv6'])/ICMPv6PacketTooBig()
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -846,7 +847,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6TimeExceeded].type, pkt[ICMPv6TimeExceeded].code))
+ log_test.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6TimeExceeded].type, pkt[ICMPv6TimeExceeded].code))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMPv6TimeExceeded in p and p[ICMPv6TimeExceeded].type == 3 and p[ICMPv6TimeExceeded].code == i,
@@ -857,7 +858,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'], dst = egress_map['ipv6'])/ICMPv6TimeExceeded(code = i)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -882,7 +883,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6ParamProblem].type, pkt[ICMPv6ParamProblem].code))
+ log_test.info('Pkt seen with ICMPv6 type %s, ICMPv6 code %s' %(pkt[ICMPv6ParamProblem].type, pkt[ICMPv6ParamProblem].code))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMPv6ParamProblem in p and p[ICMPv6ParamProblem].type == 4 and p[ICMPv6ParamProblem].code == i,
@@ -893,7 +894,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'], dst = egress_map['ipv6'])/ICMPv6ParamProblem(code = i)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -913,7 +914,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMPv6 Neighbor Discovery type %s, target address %s' %(pkt[ICMPv6ND_NS].type, pkt[ICMPv6ND_NS].tgt))
+ log_test.info('Pkt seen with ICMPv6 Neighbor Discovery type %s, target address %s' %(pkt[ICMPv6ND_NS].type, pkt[ICMPv6ND_NS].tgt))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMPv6ND_NS in p and p[ICMPv6ND_NS].tgt == '2001:db8:a0b:12f0:1010:1010:1010:1001',
@@ -924,7 +925,7 @@
L2 = Ether(src = ingress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'])/ICMPv6ND_NS(tgt = '2001:db8:a0b:12f0:1010:1010:1010:1001')
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -945,7 +946,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMPv6 Neighbor Discovery type %s, Source Link Layer address %s' %(pkt[ICMPv6ND_NS].type, pkt[ICMPv6NDOptSrcLLAddr].lladdr))
+ log_test.info('Pkt seen with ICMPv6 Neighbor Discovery type %s, Source Link Layer address %s' %(pkt[ICMPv6ND_NS].type, pkt[ICMPv6NDOptSrcLLAddr].lladdr))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMPv6NDOptSrcLLAddr in p and p[ICMPv6NDOptSrcLLAddr].lladdr == ingress_map['ether'],
@@ -956,7 +957,7 @@
L2 = Ether(src = ingress_map['ether'])#, dst = ingress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'], dst = egress_map['ipv6'])/ICMPv6ND_NS(tgt = egress_map['ipv6'])/ICMPv6NDOptSrcLLAddr(lladdr = ingress_map['ether'])
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -977,7 +978,7 @@
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ICMPv6 Neighbor Advertisement type %s, Target Link Layer address %s' %(pkt[ICMPv6ND_NA].type, pkt[ICMPv6NDOptDstLLAddr].lladdr))
+ log_test.info('Pkt seen with ICMPv6 Neighbor Advertisement type %s, Target Link Layer address %s' %(pkt[ICMPv6ND_NA].type, pkt[ICMPv6NDOptDstLLAddr].lladdr))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: ICMPv6NDOptDstLLAddr in p and p[ICMPv6NDOptDstLLAddr].lladdr == ingress_map['ether'],
@@ -988,7 +989,7 @@
L2 = Ether(src = ingress_map['ether'])#, dst = ingress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'], dst = egress_map['ipv6'])/ICMPv6ND_NA(tgt = ingress_map['ipv6'])/ICMPv6NDOptDstLLAddr(lladdr = ingress_map['ether'])
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -1016,7 +1017,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IPv6].src, pkt[IPv6].dst))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IPv6].src, pkt[IPv6].dst))
self.success = True
sniff(count=2, timeout=5,
lfilter = lambda p: IPv6 in p and p[IPv6].dst == egress_map['ipv6'] and p[IPv6].src == ingress_map['ipv6']
@@ -1027,7 +1028,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IPv6(src = ingress_map['ipv6'] , dst = egress_map['ipv6'])/ICMPv6EchoRequest()
pkt = L2/L3
- log.info('Sending a packet to verify if flows are correct')
+ log_test.info('Sending a packet to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -1051,12 +1052,12 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
self.success = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == '00:00:00:00:00:02',
prn = recv_cb, iface = self.port_map[egress])
@@ -1064,7 +1065,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = '00:00:00:00:00:02', dst = egress_mac)/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -1089,14 +1090,14 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
random_src = ''.join(r)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == random_src,
prn = recv_cb, iface = self.port_map[egress])
@@ -1104,7 +1105,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = random_src, dst = egress_mac)/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -1150,14 +1151,14 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
random_src = ''.join(r)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == random_src,
prn = recv_cb, iface = self.port_map[egress])
@@ -1165,7 +1166,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = random_src, dst = egress_mac)/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -1227,14 +1228,14 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
random_src = ''.join(r)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == random_src,
prn = recv_cb, iface = self.port_map[egress])
@@ -1242,7 +1243,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = random_src, dst = egress_mac)/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -1310,14 +1311,14 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
random_src = ''.join(r)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == random_src,
prn = recv_cb, iface = self.port_map[egress])
@@ -1325,7 +1326,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = random_src, dst = egress_mac)/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -1394,14 +1395,14 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
random_src = ''.join(r)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == random_src,
prn = recv_cb, iface = self.port_map[egress])
@@ -1409,7 +1410,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = random_src, dst = egress_mac)/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -1475,12 +1476,12 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = False
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
self.success = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == '00:00:00:00:00:01' and p.dst == '00:00:00:00:01:02',
prn = recv_cb, iface = self.port_map[egress])
@@ -1488,7 +1489,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = ingress_mac, dst = '00:00:00:00:01:02')/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
assert_equal(self.success, True)
@@ -1513,14 +1514,14 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
random_src = ''.join(r)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == random_src,
prn = recv_cb, iface = self.port_map[egress])
@@ -1528,7 +1529,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = random_src, dst = self.to_egress_mac(random_src))/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -1572,13 +1573,13 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
random_src = ''.join(r)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == random_src,
prn = recv_cb, iface = self.port_map[egress])
@@ -1586,7 +1587,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = random_src, dst = self.to_egress_mac(random_src))/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -1648,13 +1649,13 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
random_src = ''.join(r)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == random_src,
prn = recv_cb, iface = self.port_map[egress])
@@ -1662,7 +1663,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = random_src, dst = self.to_egress_mac(random_src))/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -1730,14 +1731,14 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
random_src = ''.join(r)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == random_src,
prn = recv_cb, iface = self.port_map[egress])
@@ -1745,7 +1746,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = random_src, dst = self.to_egress_mac(random_src))/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -1813,14 +1814,14 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
random_src = ''.join(r)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: p.src == random_src,
prn = recv_cb, iface = self.port_map[egress])
@@ -1828,7 +1829,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = Ether(src = random_src, dst = egress_mac)/IP()
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -1901,24 +1902,24 @@
flows_added += 1
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",j+1)
+ log_test.info("%d flow added.",j+1)
end_time = time.time()
stats_dir['run '+str(i)] = round((end_time - start_time),2)
for t in stats_dir.items():
- log.info("----------------------------------------------")
- log.info("Statics for %s",t[0])
- log.info("----------------------------------------------")
- log.info("No. of flows added Running Time ")
- log.info(" %d %s " %(100, t[1]))
+ log_test.info("----------------------------------------------")
+ log_test.info("Statics for %s",t[0])
+ log_test.info("----------------------------------------------")
+ log_test.info("No. of flows added Running Time ")
+ log_test.info(" %d %s " %(100, t[1]))
running_time += float(t[1])
- log.info("-------------------------------------------------------------------------------------------------------")
- log.info("Final Statics")
- log.info("-------------------------------------------------------------------------------------------------------")
- log.info("Total No. of flows added Total Running Time Average no. of flows per second ")
- log.info(" %d %s second %d "
+ log_test.info("-------------------------------------------------------------------------------------------------------")
+ log_test.info("Final Statics")
+ log_test.info("-------------------------------------------------------------------------------------------------------")
+ log_test.info("Total No. of flows added Total Running Time Average no. of flows per second ")
+ log_test.info(" %d %s second %d "
%(flows_added, running_time, round(flows_added/running_time,0)))
- log.info("-------------------------------------------------------------------------------------------------------")
+ log_test.info("-------------------------------------------------------------------------------------------------------")
@@ -1948,24 +1949,24 @@
flows_added += 1
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",j+1)
+ log_test.info("%d flow added.",j+1)
end_time = time.time()
stats_dir['run '+str(i)] = round((end_time - start_time),2)
for t in stats_dir.items():
- log.info("----------------------------------------------")
- log.info("Statics for %s",t[0])
- log.info("----------------------------------------------")
- log.info("No. of flows added Running Time ")
- log.info(" %d %s " %(500, t[1]))
+ log_test.info("----------------------------------------------")
+ log_test.info("Statics for %s",t[0])
+ log_test.info("----------------------------------------------")
+ log_test.info("No. of flows added Running Time ")
+ log_test.info(" %d %s " %(500, t[1]))
running_time += float(t[1])
- log.info("-------------------------------------------------------------------------------------------------------")
- log.info("Final Statics")
- log.info("-------------------------------------------------------------------------------------------------------")
- log.info("Total No. of flows added Total Running Time Average no. of flows per second ")
- log.info(" %d %s second %d "
+ log_test.info("-------------------------------------------------------------------------------------------------------")
+ log_test.info("Final Statics")
+ log_test.info("-------------------------------------------------------------------------------------------------------")
+ log_test.info("Total No. of flows added Total Running Time Average no. of flows per second ")
+ log_test.info(" %d %s second %d "
%(flows_added, running_time, round(flows_added/running_time,0)))
- log.info("-------------------------------------------------------------------------------------------------------")
+ log_test.info("-------------------------------------------------------------------------------------------------------")
def test_rate_1k_flow_mac(self):
egress = 1
@@ -1993,24 +1994,24 @@
flows_added += 1
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",j+1)
+ log_test.info("%d flow added.",j+1)
end_time = time.time()
stats_dir['run '+str(i)] = round((end_time - start_time),2)
for t in stats_dir.items():
- log.info("----------------------------------------------")
- log.info("Statics for %s",t[0])
- log.info("----------------------------------------------")
- log.info("No. of flows added Running Time ")
- log.info(" %d %s " %(1000, t[1]))
+ log_test.info("----------------------------------------------")
+ log_test.info("Statics for %s",t[0])
+ log_test.info("----------------------------------------------")
+ log_test.info("No. of flows added Running Time ")
+ log_test.info(" %d %s " %(1000, t[1]))
running_time += float(t[1])
- log.info("-------------------------------------------------------------------------------------------------------")
- log.info("Final Statics")
- log.info("-------------------------------------------------------------------------------------------------------")
- log.info("Total No. of flows added Total Running Time Average no. of flows per second ")
- log.info(" %d %s second %d "
+ log_test.info("-------------------------------------------------------------------------------------------------------")
+ log_test.info("Final Statics")
+ log_test.info("-------------------------------------------------------------------------------------------------------")
+ log_test.info("Total No. of flows added Total Running Time Average no. of flows per second ")
+ log_test.info(" %d %s second %d "
%(flows_added, running_time, round(flows_added/running_time,0)))
- log.info("-------------------------------------------------------------------------------------------------------")
+ log_test.info("-------------------------------------------------------------------------------------------------------")
def test_500_flow_ip(self):
@@ -2036,7 +2037,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
@@ -2045,7 +2046,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: IP in p and p[IP].dst == random_dst and p[IP].src == random_src
@@ -2056,7 +2057,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = random_src, dst = random_dst)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -2106,7 +2107,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
@@ -2115,7 +2116,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: IP in p and p[IP].dst == random_dst and p[IP].src == random_src
@@ -2126,7 +2127,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = random_src, dst = random_dst)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -2192,7 +2193,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
@@ -2201,7 +2202,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: IP in p and p[IP].dst == random_dst and p[IP].src == random_src
,prn = recv_cb, iface = self.port_map[egress])
@@ -2211,7 +2212,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = random_src, dst = random_dst)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -2278,7 +2279,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
@@ -2286,7 +2287,7 @@
random_dst = self.to_egress_ip(random_src)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: IP in p and p[IP].dst == random_dst and p[IP].src == random_src
,prn = recv_cb, iface = self.port_map[egress])
@@ -2296,7 +2297,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = random_src, dst = random_dst)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -2364,7 +2365,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
def verify_flow(*r):
@@ -2372,7 +2373,7 @@
random_dst = self.to_egress_ip(random_src)
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5, lfilter = lambda p: IP in p and p[IP].dst == random_dst and p[IP].src == random_src
@@ -2383,7 +2384,7 @@
L2 = Ether(src = ingress_map['ether'], dst = egress_map['ether'])
L3 = IP(src = random_src, dst = random_dst)
pkt = L2/L3
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -2449,7 +2450,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d Flow added",i+1)
+ log_test.info("%d Flow added",i+1)
self.success = True
def verify_flow(*r):
@@ -2457,7 +2458,7 @@
random_dport = random_sport + 2000
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress TCP port %s, egress TCP port %s' %(pkt[TCP].sport, pkt[TCP].dport))
+ log_test.info('Pkt seen with ingress TCP port %s, egress TCP port %s' %(pkt[TCP].sport, pkt[TCP].dport))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5,
lfilter = lambda p: TCP in p and p[TCP].dport == random_dport and p[TCP].sport == random_sport ,prn = recv_cb, iface = self.port_map[egress])
@@ -2468,7 +2469,7 @@
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])
L4 = TCP(sport = random_sport, dport = random_dport)
pkt = L2/L3/L4
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
t1 = threading.Thread(target = verify_flow, args = str(1101))
@@ -2516,7 +2517,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
@@ -2526,7 +2527,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress TCP port %s, egress TCP port %s' %(pkt[TCP].sport, pkt[TCP].dport))
+ log_test.info('Pkt seen with ingress TCP port %s, egress TCP port %s' %(pkt[TCP].sport, pkt[TCP].dport))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5,
lfilter = lambda p: TCP in p and p[TCP].dport == random_dport and p[TCP].sport == random_sport ,prn = recv_cb, iface = self.port_map[egress])
@@ -2537,7 +2538,7 @@
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])
L4 = TCP(sport = random_sport, dport = random_dport)
pkt = L2/L3/L4
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -2603,7 +2604,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
@@ -2613,7 +2614,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress TCP port %s, egress TCP port %s' %(pkt[TCP].sport, pkt[TCP].dport))
+ log_test.info('Pkt seen with ingress TCP port %s, egress TCP port %s' %(pkt[TCP].sport, pkt[TCP].dport))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5,
lfilter = lambda p: TCP in p and p[TCP].dport == random_dport
@@ -2625,7 +2626,7 @@
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])
L4 = TCP(sport = random_sport, dport = random_dport)
pkt = L2/L3/L4
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -2690,7 +2691,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
@@ -2700,7 +2701,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
+ log_test.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5,
lfilter = lambda p: UDP in p and p[UDP].dport == random_dport and p[UDP].sport == random_sport ,prn = recv_cb, iface = self.port_map[egress])
@@ -2711,7 +2712,7 @@
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])
L4 = UDP(sport = random_sport, dport = random_dport)
pkt = L2/L3/L4
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -2761,7 +2762,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
@@ -2771,7 +2772,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
+ log_test.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5,
lfilter = lambda p: UDP in p and p[UDP].dport == random_dport and p[UDP].sport == random_sport ,prn = recv_cb, iface = self.port_map[egress])
@@ -2782,7 +2783,7 @@
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])
L4 = UDP(sport = random_sport, dport = random_dport)
pkt = L2/L3/L4
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
@@ -2847,7 +2848,7 @@
assert_equal(result, True)
##wait for flows to be added to ONOS
time.sleep(1)
- log.info("%d flow added.",i+1)
+ log_test.info("%d flow added.",i+1)
self.success = True
@@ -2858,7 +2859,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
+ log_test.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
success_dir[current_thread().name] = True
sniff(count=2, timeout=5,
lfilter = lambda p: UDP in p and p[UDP].dport == random_dport and p[UDP].sport == random_sport ,prn = recv_cb, iface = self.port_map[egress])
@@ -2869,7 +2870,7 @@
L3 = IP(src = ingress_map['ip'], dst = egress_map['ip'])
L4 = UDP(sport = random_sport, dport = random_dport)
pkt = L2/L3/L4
- log.info('Sending packets to verify if flows are correct')
+ log_test.info('Sending packets to verify if flows are correct')
sendp(pkt, count=50, iface = self.port_map[ingress])
t.join()
diff --git a/src/test/igmp/igmpTest.py b/src/test/igmp/igmpTest.py
index 84fbbac..8b2cc11 100644
--- a/src/test/igmp/igmpTest.py
+++ b/src/test/igmp/igmpTest.py
@@ -29,8 +29,9 @@
from Channels import IgmpChannel
from CordLogger import CordLogger
from CordTestConfig import setup_module
+from CordTestUtils import log_test
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class IGMPTestState:
@@ -102,10 +103,10 @@
super(igmp_exchange, self).tearDown()
def onos_load_config(self, config):
- log.info('onos load config is %s'%config)
+ log_test.info('onos load config is %s'%config)
status, code = OnosCtrl.config(config)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
time.sleep(2)
@@ -213,9 +214,9 @@
rx_stats = recvState.group_map[g][1]
rx = rx_stats.count
assert_greater(rx, 0)
- log.info('Receive stats %s for group %s' %(rx_stats, g))
+ log_test.info('Receive stats %s for group %s' %(rx_stats, g))
- log.info('IGMP test verification success')
+ log_test.info('IGMP test verification success')
def igmp_verify_leave(self, igmpStateList, leave_groups):
sendState, recvState = igmpStateList[0], igmpStateList[1]
@@ -227,12 +228,12 @@
rx = rx_stats.count
assert_greater(tx, 0)
if g not in leave_groups:
- log.info('Received %d packets for group %s' %(rx, g))
+ log_test.info('Received %d packets for group %s' %(rx, g))
for g in leave_groups:
rx = recvState.group_map[g][1].count
assert_equal(rx, 0)
- log.info('IGMP test verification success')
+ log_test.info('IGMP test verification success')
def mcast_traffic_timer(self):
self.mcastTraffic.stopReceives()
@@ -249,9 +250,9 @@
send_time = float(p.payload.load)
recv_time = monotonic.monotonic()
except:
- log.info('Unexpected Payload received: %s' %p.payload.load)
+ log_test.info('Unexpected Payload received: %s' %p.payload.load)
return 0
- #log.info( 'Recv in %.6f secs' %(recv_time - send_time))
+ #log_test.info( 'Recv in %.6f secs' %(recv_time - send_time))
igmpState.update(p.dst, rx = 1, t = recv_time - send_time)
return 0
@@ -287,19 +288,19 @@
pkt = ip_pkt/igmp
IGMPv3.fixup(pkt)
if rec_queryCount == None:
- log.info('Sending IGMP join for group %s and waiting for one query packet and printing the packet' %groups)
+ log_test.info('Sending IGMP join for group %s and waiting for one query packet and printing the packet' %groups)
resp = srp1(pkt, iface=iface)
else:
- log.info('Sending IGMP join for group %s and waiting for periodic query packets and printing one packet' %groups)
+ log_test.info('Sending IGMP join for group %s and waiting for periodic query packets and printing one packet' %groups)
resp = srp1(pkt, iface=iface)
# resp = srp1(pkt, iface=iface) if rec_queryCount else srp3(pkt, iface=iface)
resp[0].summary()
- log.info('Sent IGMP join for group %s and received a query packet and printing packet' %groups)
+ log_test.info('Sent IGMP join for group %s and received a query packet and printing packet' %groups)
if delay != 0:
time.sleep(delay)
def send_igmp_leave(self, groups, src_list = ['1.2.3.4'], ip_pkt = None, iface = 'veth0', delay = 2):
- log.info('entering into igmp leave function')
+ log_test.info('entering into igmp leave function')
igmp = IGMPv3(type = IGMP_TYPE_V3_MEMBERSHIP_REPORT, max_resp_code=30,
gaddr=self.IP_DST)
for g in groups:
@@ -325,10 +326,10 @@
ip_pkt = self.igmp_eth/self.igmp_ip
pkt = ip_pkt/igmp
IGMPv3.fixup(pkt)
- log.info('Sending IGMP leave for group %s and waiting for one group specific query packet and printing the packet' %groups)
+ log_test.info('Sending IGMP leave for group %s and waiting for one group specific query packet and printing the packet' %groups)
resp = srp1(pkt, iface=iface)
resp[0].summary()
- log.info('Sent IGMP leave for group %s and received a group specific query packet and printing packet' %groups)
+ log_test.info('Sent IGMP leave for group %s and received a group specific query packet and printing packet' %groups)
if delay != 0:
time.sleep(delay)
@@ -381,7 +382,7 @@
self.send_igmp_leave(leave_groups, delay = 3)
join_state = IGMPTestState(groups = leave_groups)
status = self.igmp_not_recv_task(self.V_INF1,leave_groups, join_state)
- log.info('verified status for igmp recv task %s'%status)
+ log_test.info('verified status for igmp recv task %s'%status)
assert status == 1 , 'EXPECTED RESULT'
self.df.callback(0)
return df
@@ -434,7 +435,7 @@
pkt = self.igmp_eth/self.igmp_ip/igmp
IGMPv3.fixup(pkt)
sendp(pkt, iface=intf)
- log.debug('Returning from join task')
+ log_test.debug('Returning from join task')
def igmp_recv_task(self, intf, groups, join_state):
recv_socket = L3PacketSocket(iface = intf, type = ETH_P_IP)
@@ -442,7 +443,7 @@
for g in groups:
group_map[g] = [0,0]
- log.info('Verifying join interface should receive multicast data')
+ log_test.info('Verifying join interface should receive multicast data')
while True:
p = recv_socket.recv()
if p.dst in groups and group_map[p.dst][0] == 0:
@@ -457,23 +458,23 @@
join_start = join_state.group_map[g][0].start
recv_time = group_map[g][1] * 1000000
delta = (recv_time - join_start)
- log.info('Join for group %s received in %.3f usecs' %
+ log_test.info('Join for group %s received in %.3f usecs' %
(g, delta))
recv_socket.close()
- log.debug('Returning from recv task')
+ log_test.debug('Returning from recv task')
def igmp_not_recv_task(self, intf, groups, join_state):
- log.info('Entering igmp not recv task loop')
+ log_test.info('Entering igmp not recv task loop')
recv_socket = L2Socket(iface = intf, type = ETH_P_IP)
group_map = {}
for g in groups:
group_map[g] = [0,0]
- log.info('Verifying join interface, should not receive any multicast data')
+ log_test.info('Verifying join interface, should not receive any multicast data')
self.NEGATIVE_TRAFFIC_STATUS = 1
def igmp_recv_cb(pkt):
- log.info('Multicast packet %s received for left groups %s' %(pkt[IP].dst, groups))
+ log_test.info('Multicast packet %s received for left groups %s' %(pkt[IP].dst, groups))
self.NEGATIVE_TRAFFIC_STATUS = 2
sniff(prn = igmp_recv_cb, count = 1, lfilter = lambda p: IP in p and p[IP].dst in groups,
timeout = 3, opened_socket = recv_socket)
@@ -548,7 +549,7 @@
self.complete = False
def igmp_join_timer():
self.timeout += self.ROVER_JOIN_TIMEOUT
- log.info('IGMP joins sent: %d' %self.count)
+ log_test.info('IGMP joins sent: %d' %self.count)
if self.timeout >= self.ROVER_TIMEOUT:
self.complete = True
reactor.callLater(self.ROVER_JOIN_TIMEOUT, igmp_join_timer)
@@ -568,7 +569,7 @@
self.send_igmp_join([ip], delay = 0, ssm_load = False, iface = iface)
self.count += 1
if self.complete == True:
- log.info('%d IGMP joins sent in %d seconds over %s' %(self.count, self.timeout, iface))
+ log_test.info('%d IGMP joins sent in %d seconds over %s' %(self.count, self.timeout, iface))
self.df.callback(0)
else:
reactor.callLater(0, igmp_join_rover, self)
@@ -585,8 +586,8 @@
def igmp_query_timeout():
def igmp_query_cb(pkt):
- log.info('received igmp query packet is %s'%pkt.show())
- log.info('Got IGMP query packet from %s for %s' %(pkt[IP].src, pkt[IP].dst))
+ log_test.info('received igmp query packet is %s'%pkt.show())
+ log_test.info('Got IGMP query packet from %s for %s' %(pkt[IP].src, pkt[IP].dst))
assert_equal(pkt[IP].dst, '224.0.0.1')
sniff(prn = igmp_query_cb, count=1, lfilter = lambda p: IP in p and p[IP].dst in groups,
opened_socket = self.recv_socket)
@@ -604,13 +605,13 @@
sourcelist2 = sources[1]
eth = Ether(dst = self.IGMP_DST_MAC,type = ETH_P_IP)
ip = IP(dst = self.IP_DST)
- log.info('Sending join message for the group %s' %g1)
+ log_test.info('Sending join message for the group %s' %g1)
self.send_igmp_join((g1,), src_list = sourcelist1, ip_pkt = eth/ip, iface = intf, delay = 2)
eth = Ether(dst = self.MMACGROUP2, src = self.IGMP_SRC_MAC, type = ETH_P_IP)
ip = IP(dst = g2)
- log.info('Sending join message for group %s' %g2)
+ log_test.info('Sending join message for group %s' %g2)
self.send_igmp_join((g2,), src_list = sourcelist2, ip_pkt = eth/ip, iface = intf, delay = 2)
- log.info('Done with igmp_send_joins_different_groups_srclist')
+ log_test.info('Done with igmp_send_joins_different_groups_srclist')
def igmp_send_joins_different_groups_srclist_wait_query_packets(self, groups, sources, intf = V_INF1, delay = 2, ip_src = None, query_group1 = None, query_group2 = None):
g1 = groups[0]
@@ -621,18 +622,18 @@
src_ip = ip_src or self.IP_SRC
ip = IP(dst = g1, src = src_ip)
if query_group1 is 'group1':
- log.info('Sending join message for the group %s and waiting for a query packet on join interface' %g1)
+ log_test.info('Sending join message for the group %s and waiting for a query packet on join interface' %g1)
self.send_igmp_join_recvQuery((g1,), None, src_list = sourcelist1, ip_pkt = eth/ip, iface = intf, delay = 2)
else:
- log.info('Sending join message for the group %s' %g1)
+ log_test.info('Sending join message for the group %s' %g1)
self.send_igmp_join((g1,), src_list = sourcelist1, ip_pkt = eth/ip, iface = intf, delay = 2)
eth = Ether(dst = self.MMACGROUP2, src = self.IGMP_SRC_MAC, type = ETH_P_IP)
ip = IP(dst = g2, src = src_ip)
if query_group2 is 'group2':
- log.info('Sending join message for the group %s and waiting for a query packet on join interface' %g2)
+ log_test.info('Sending join message for the group %s and waiting for a query packet on join interface' %g2)
self.send_igmp_join_recvQuery((g2,), None, src_list = sourcelist2, ip_pkt = eth/ip, iface = intf, delay = 2)
else:
- log.info('Sending join message for group %s' %g2)
+ log_test.info('Sending join message for group %s' %g2)
self.send_igmp_join((g2,), src_list = sourcelist2, ip_pkt = eth/ip, iface = intf, delay = 2)
def igmp_joins_leave(self,groups,src_list,again_join = False, df = None):
@@ -665,10 +666,10 @@
join_state1 = IGMPTestState(groups = groups1)
join_state2 = IGMPTestState(groups = groups2)
self.igmp_recv_task(self.V_INF1, groups1, join_state1)
- log.info('Interface is receiving multicast groups %s' %groups1)
+ log_test.info('Interface is receiving multicast groups %s' %groups1)
self.igmp_recv_task(self.V_INF1, groups2, join_state2)
- log.info('Interface is receiving multicast groups %s' %groups2)
- log.info('Interface is sending leave message for groups %s now' %groups2)
+ log_test.info('Interface is receiving multicast groups %s' %groups2)
+ log_test.info('Interface is sending leave message for groups %s now' %groups2)
self.send_igmp_leave(groups = groups2, src_list = src2, iface = self.V_INF1, delay = 2)
self.igmp_recv_task(self.V_INF1, groups1, join_state1)
target4 = self.igmp_not_recv_task(self.V_INF1, groups2, join_state2)
@@ -678,14 +679,14 @@
ip_dst = '239.2.2.3'
eth = Ether(dst = dst_mac, type = ETH_P_IP)
ip = IP(dst = ip_dst)
- log.info('Interface sending join message again for the groups %s' %groups2)
+ log_test.info('Interface sending join message again for the groups %s' %groups2)
self.send_igmp_join(groups2, src_list = [src_ip], ip_pkt = eth/ip, iface = self.V_INF1, delay = 2)
self.igmp_recv_task(self.V_INF1, groups2, join_state2)
- log.info('Interface is receiving multicast groups %s again' %groups2)
+ log_test.info('Interface is receiving multicast groups %s again' %groups2)
self.igmp_recv_task(self.V_INF1, groups1, join_state1)
- log.info('Interface is still receiving from multicast groups %s' %groups1)
+ log_test.info('Interface is still receiving from multicast groups %s' %groups1)
else:
- log.info('Ended test case')
+ log_test.info('Ended test case')
mcastTraffic1.stop()
mcastTraffic2.stop()
@@ -731,10 +732,10 @@
src_ip = src_ip, cb = self.send_mcast_cb, arg = igmpState1)
mcastTraffic1.start()
join_state1 = IGMPTestState(groups = groups1)
- log.info('Interface should not receive from multicast groups %s from an interface, which is expected' %groups1)
+ log_test.info('Interface should not receive from multicast groups %s from an interface, which is expected' %groups1)
target1 = self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 2, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s, working as expected' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s, working as expected' %groups1)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+20)
@@ -767,7 +768,7 @@
self.send_igmp_leave(groups = groups1, src_list = ['2.2.2.2'], iface = self.V_INF1, delay =2)
target2 = self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target2 == 2, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s after sending CHANGE_TO_EXCLUDE' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s after sending CHANGE_TO_EXCLUDE' %groups1)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+10)
@@ -834,7 +835,7 @@
mcastTraffic2.start()
target1 = self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is still receiving traffic from old multicast group %s even after we send block for source list' %groups1)
+ log_test.info('Interface is still receiving traffic from old multicast group %s even after we send block for source list' %groups1)
mcastTraffic2.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+30)
@@ -863,7 +864,7 @@
join_state1 = IGMPTestState(groups = groups1)
target1= self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
mcastTraffic1.stop()
self.send_igmp_join(groups = groups1, src_list = src_list,record_type = IGMP_V3_GR_TYPE_INCLUDE,
iface = self.V_INF1)
@@ -902,13 +903,13 @@
join_state1 = IGMPTestState(groups = groups1)
target1= self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
self.igmp_send_joins_different_groups_srclist(groups1 + groups2,
(['6.6.6.6', '7.7.7.7', '8.8.8.8'], ['6.6.6.6', '5.5.5.5']),
intf = self.V_INF1, delay = 2)
target1= self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+10)
@@ -939,12 +940,12 @@
join_state1 = IGMPTestState(groups = groups1)
target1= self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
self.send_igmp_leave(groups = groups1, src_list = ['2.2.2.2', '3.3.3.3', '4.4.4.4', '5.5.5.5', '7.7.7.7'],
iface = self.V_INF1, delay = 2)
target1= self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+10)
@@ -976,12 +977,12 @@
join_state1 = IGMPTestState(groups = groups1)
target1 = self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
self.igmp_send_joins_different_groups_srclist(groups1 + groups2,
(['2.2.2.2', '6.6.6.6', '3.3.3.3', '4.4.4.4'], ['2.2.2.2', '5.5.5.5']),
intf = self.V_INF1, delay = 2)
self.igmp_recv_task(self.V_INF1, groups1, join_state1)
- log.info('Interface is receiving traffic from multicast groups %s after sending join with new source list' %groups1)
+ log_test.info('Interface is receiving traffic from multicast groups %s after sending join with new source list' %groups1)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+10)
@@ -1012,13 +1013,13 @@
mcastTraffic1.start()
join_state1 = IGMPTestState(groups = groups2)
self.igmp_recv_task(self.V_INF1, groups2, join_state1)
- log.info('Interface is receiving traffic from multicast groups %s' %groups2)
+ log_test.info('Interface is receiving traffic from multicast groups %s' %groups2)
self.igmp_send_joins_different_groups_srclist(groups,
(['6.6.6.6', '3.3.3.3', '4.4.4.4'], ['2.2.2.2', '7.7.7.7']),
intf = self.V_INF1, delay = 2)
target2 = self.igmp_not_recv_task(self.V_INF1, groups2, join_state1)
assert target2 == 2, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s after sending join with block old source list' %groups2)
+ log_test.info('Interface is not receiving traffic from multicast groups %s after sending join with block old source list' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+20)
@@ -1049,7 +1050,7 @@
join_state1 = IGMPTestState(groups = groups2)
target1 = self.igmp_not_recv_task(self.V_INF1, groups2, join_state1)
assert target1==1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s when we sent join with source list is empty' %groups2)
+ log_test.info('Interface is not receiving traffic from multicast groups %s when we sent join with source list is empty' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+20)
@@ -1076,7 +1077,7 @@
mcastTraffic1.start()
join_state1 = IGMPTestState(groups = groups2)
self.igmp_recv_task(self.V_INF1, groups2, join_state1)
- log.info('Interface is receiving multicast groups %s' %groups2)
+ log_test.info('Interface is receiving multicast groups %s' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+20)
@@ -1108,7 +1109,7 @@
mcastTraffic1.start()
join_state1 = IGMPTestState(groups = groups2)
self.igmp_recv_task(self.V_INF1, groups2, join_state1)
- log.info('Interface is receiving traffic from multicast groups %s when we sent join with source IP is 0.0.0.0' %groups2)
+ log_test.info('Interface is receiving traffic from multicast groups %s when we sent join with source IP is 0.0.0.0' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+20)
@@ -1141,7 +1142,7 @@
join_state1 = IGMPTestState(groups = groups2)
target1 = self.igmp_not_recv_task(self.V_INF1, groups2, join_state1)
assert target1==1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s when we sent invalid join packet ' %groups2)
+ log_test.info('Interface is not receiving traffic from multicast groups %s when we sent invalid join packet ' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+20)
@@ -1173,16 +1174,16 @@
mcastTraffic1.start()
join_state1 = IGMPTestState(groups = groups2)
self.igmp_recv_task(self.V_INF1, groups2, join_state1)
- log.info('Interface is receiving traffic from multicast groups, before bring down the self.V_INF1=%s ' %self.V_INF1)
+ log_test.info('Interface is receiving traffic from multicast groups, before bring down the self.V_INF1=%s ' %self.V_INF1)
os.system('ifconfig '+self.V_INF1+' down')
- log.info(' the self.V_INF1 %s is down now ' %self.V_INF1)
+ log_test.info(' the self.V_INF1 %s is down now ' %self.V_INF1)
os.system('ifconfig '+self.V_INF1)
time.sleep(10)
os.system('ifconfig '+self.V_INF1+' up')
os.system('ifconfig '+self.V_INF1)
- log.info(' the self.V_INF1 %s is up now ' %self.V_INF1)
+ log_test.info(' the self.V_INF1 %s is up now ' %self.V_INF1)
self.igmp_recv_task(self.V_INF1, groups2, join_state1)
- log.info('Interface is receiving traffic from multicast groups %s when we nterface up after down ' %groups2)
+ log_test.info('Interface is receiving traffic from multicast groups %s when we nterface up after down ' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+20)
@@ -1271,7 +1272,7 @@
join_state1 = IGMPTestState(groups = groups2)
target1 = self.igmp_not_recv_task(self.V_INF1, groups2, join_state1)
assert target1==1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s when we sent invalid join packet ' %groups2)
+ log_test.info('Interface is not receiving traffic from multicast groups %s when we sent invalid join packet ' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+20)
@@ -1304,7 +1305,7 @@
join_state1 = IGMPTestState(groups = groups2)
target1 = self.igmp_not_recv_task(self.V_INF1, groups2, join_state1)
assert target1==1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s when we sent invalid join packet ' %groups2)
+ log_test.info('Interface is not receiving traffic from multicast groups %s when we sent invalid join packet ' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+20)
@@ -1335,26 +1336,26 @@
src_ip = src_ip, cb = self.send_mcast_cb, arg = igmpState1)
mcastTraffic1.start()
join_state1 = IGMPTestState(groups = groups2)
- log.info('Started delay to verify multicast data taraffic for group %s is received or not for 180 sec ' %groups2)
+ log_test.info('Started delay to verify multicast data taraffic for group %s is received or not for 180 sec ' %groups2)
time.sleep(100)
self.igmp_recv_task(self.V_INF1, groups2, join_state1)
- log.info('Verified that multicast data for group %s is received after 100 sec ' %groups2)
+ log_test.info('Verified that multicast data for group %s is received after 100 sec ' %groups2)
time.sleep(50)
self.igmp_recv_task(self.V_INF1, groups2, join_state1)
- log.info('Verified that multicast data for group %s is received after 150 sec ' %groups2)
+ log_test.info('Verified that multicast data for group %s is received after 150 sec ' %groups2)
time.sleep(30)
self.igmp_recv_task(self.V_INF1, groups2, join_state1)
- log.info('Verified that multicast data for group %s is received after 180 sec ' %groups2)
+ log_test.info('Verified that multicast data for group %s is received after 180 sec ' %groups2)
time.sleep(10)
self.igmp_recv_task(self.V_INF1, groups2, join_state1)
- log.info('Verified that multicast data for group %s is received after 190 sec ' %groups2)
+ log_test.info('Verified that multicast data for group %s is received after 190 sec ' %groups2)
target3 = mcastTraffic1.isRecvStopped()
assert target3==False, 'EXPECTED FAILURE'
- log.info('Verified that multicast data for a group %s is still transmitting from a data interface' %groups2)
- log.info('Now checking join interface is receiving a multicast data for group %s after 190 sec' %groups2)
+ log_test.info('Verified that multicast data for a group %s is still transmitting from a data interface' %groups2)
+ log_test.info('Now checking join interface is receiving a multicast data for group %s after 190 sec' %groups2)
target1 = self.igmp_not_recv_task(self.V_INF1, groups2, join_state1)
assert target1==1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving multicast data for group %s' %groups2)
+ log_test.info('Interface is not receiving multicast data for group %s' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+250)
@@ -1391,9 +1392,9 @@
self.igmp_verify_leave(stateList, leave_groups)
self.df.callback(0)
- log.info('Sending join packet and expect to receive on general query packet after 60 sec for multicast %s ' %groups)
+ log_test.info('Sending join packet and expect to receive on general query packet after 60 sec for multicast %s ' %groups)
self.send_igmp_join_recvQuery(groups)
- log.info('Received a general query packet for multicast %s group on joing interface and sending traffic' %groups)
+ log_test.info('Received a general query packet for multicast %s group on joing interface and sending traffic' %groups)
mcastTraffic.start()
self.test_timer = reactor.callLater(self.MCAST_TRAFFIC_TIMEOUT, self.mcast_traffic_timer)
reactor.callLater(0, igmp_srp_task, igmpStateList)
@@ -1451,7 +1452,7 @@
self.df.callback(0)
self.send_igmp_join_recvQuery(groups,3)
- log.info('Received periodic general query packets for multicast %s, now checking entry is deleted from tabel by sending traffic for that group' %groups)
+ log_test.info('Received periodic general query packets for multicast %s, now checking entry is deleted from tabel by sending traffic for that group' %groups)
mcastTraffic.start()
self.test_timer = reactor.callLater(self.MCAST_TRAFFIC_TIMEOUT, self.mcast_traffic_timer)
reactor.callLater(0, igmp_srp_task, igmpStateList)
@@ -1483,7 +1484,7 @@
self.df.callback(0)
self.send_igmp_join_recvQuery(groups,3)
- log.info('Received periodic general query packets for multicast %s, now sending join packet again and verifying traffic for that group is received or not on joining interface' %groups)
+ log_test.info('Received periodic general query packets for multicast %s, now sending join packet again and verifying traffic for that group is received or not on joining interface' %groups)
self.send_igmp_join(groups)
mcastTraffic.start()
self.test_timer = reactor.callLater(self.MCAST_TRAFFIC_TIMEOUT, self.mcast_traffic_timer)
@@ -1538,7 +1539,7 @@
time.sleep(10)
target2 = self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target2 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s after sending CHANGE_TO_EXCLUDE' %groups2)
+ log_test.info('Interface is not receiving traffic from multicast groups %s after sending CHANGE_TO_EXCLUDE' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+60)
@@ -1567,13 +1568,13 @@
join_state1 = IGMPTestState(groups = groups1)
target1= self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
self.igmp_send_joins_different_groups_srclist_wait_query_packets(groups1 + groups2,
(['2.2.2.2', '3.3.3.3', '4.4.4.4'], ['6.6.6.6', '5.5.5.5']),
intf = self.V_INF1, delay = 2,query_group1 = 'group1', query_group2 = None)
time.sleep(10)
self.igmp_recv_task(self.V_INF1, groups1, join_state1)
- log.info('Interface is receiving traffic from multicast groups %s after send Change to include message' %groups1)
+ log_test.info('Interface is receiving traffic from multicast groups %s after send Change to include message' %groups1)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+80)
@@ -1602,11 +1603,11 @@
mcastTraffic1.start()
join_state1 = IGMPTestState(groups = groups1)
self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
self.igmp_send_joins_different_groups_srclist_wait_query_packets(groups1 + groups2, (['2.2.2.2', '6.6.6.6', '3.3.3.3', '4.4.4.4'], ['2.2.2.2', '5.5.5.5']),
intf = self.V_INF1, delay = 2, query_group1 = 'group1', query_group2 = None)
self.igmp_recv_task(self.V_INF1, groups1, join_state1)
- log.info('Interface is receiving traffic from multicast groups %s after sending join with new source list' %groups1)
+ log_test.info('Interface is receiving traffic from multicast groups %s after sending join with new source list' %groups1)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+80)
@@ -1636,13 +1637,13 @@
mcastTraffic1.start()
join_state1 = IGMPTestState(groups = groups2)
self.igmp_recv_task(self.V_INF1, groups2, join_state1)
- log.info('Interface is receiving traffic from multicast groups %s' %groups2)
+ log_test.info('Interface is receiving traffic from multicast groups %s' %groups2)
self.igmp_send_joins_different_groups_srclist_wait_query_packets(groups,
(['6.6.6.6', '3.3.3.3', '4.4.4.4'], ['2.2.2.2', '7.7.7.7']),
intf = self.V_INF1, delay = 2, query_group1 = 'group1', query_group2 = None)
target2 = self.igmp_not_recv_task(self.V_INF1, groups2, join_state1)
assert target2 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s after sending join with block old source list' %groups2)
+ log_test.info('Interface is not receiving traffic from multicast groups %s after sending join with block old source list' %groups2)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+90)
@@ -1733,12 +1734,12 @@
join_state1 = IGMPTestState(groups = groups1)
target1= self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
self.igmp_send_joins_different_groups_srclist_wait_query_packets(groups1 + groups2,
(['6.6.6.6', '7.7.7.7', '8.8.8.8'], ['6.6.6.6', '5.5.5.5']), intf = self.V_INF1, delay = 2, query_group1 = 'group1', query_group2 = None)
target1= self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+90)
@@ -1767,13 +1768,13 @@
join_state1 = IGMPTestState(groups = groups1)
target1= self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
self.send_igmp_leave_listening_group_specific_query(groups = groups1,
src_list = ['2.2.2.2', '3.3.3.3', '4.4.4.4', '5.5.5.5', '7.7.7.7'],
iface = self.V_INF1, delay = 2)
target1= self.igmp_not_recv_task(self.V_INF1, groups1, join_state1)
assert target1 == 1, 'EXPECTED FAILURE'
- log.info('Interface is not receiving traffic from multicast groups %s' %groups1)
+ log_test.info('Interface is not receiving traffic from multicast groups %s' %groups1)
mcastTraffic1.stop()
@deferred(timeout=MCAST_TRAFFIC_TIMEOUT+40)
@@ -1802,12 +1803,12 @@
sendp(eth/ip/data,count=20, iface = intf)
def verify_igmp_data_traffic(self, group, intf='veth0', source='1.2.3.4' ):
- log.info('verifying multicast traffic for group %s from source %s'%(group,source))
+ log_test.info('verifying multicast traffic for group %s from source %s'%(group,source))
self.success = False
def recv_task():
def igmp_recv_cb(pkt):
- #log.info('received multicast data packet is %s'%pkt.show())
- log.info('multicast data received for group %s from source %s'%(group,source))
+ #log_test.info('received multicast data packet is %s'%pkt.show())
+ log_test.info('multicast data received for group %s from source %s'%(group,source))
self.success = True
sniff(prn = igmp_recv_cb,lfilter = lambda p: IP in p and p[IP].dst == group and p[IP].src == source, count=1,timeout = 2, iface='veth0')
t = threading.Thread(target = recv_task)
@@ -1940,7 +1941,7 @@
if group in groups:
pass
else:
- log.info('group and source are %s and %s'%(group,source))
+ log_test.info('group and source are %s and %s'%(group,source))
groups.append(group)
sources.append(source)
count += 1
@@ -1950,7 +1951,7 @@
iface = self.V_INF1)
status = self.verify_igmp_data_traffic(groups[i],intf=self.V_INF1,source=sources[i])
assert_equal(status, True)
- log.info('data received for group %s from source %s'%(groups[i],sources[i]))
+ log_test.info('data received for group %s from source %s'%(groups[i],sources[i]))
def test_igmp_multiple_joins_with_data_verification_and_leaving_100_groups(self):
groups = []
@@ -1964,7 +1965,7 @@
if group in groups:
pass
else:
- log.info('group and source are %s and %s'%(group,source))
+ log_test.info('group and source are %s and %s'%(group,source))
groups.append(group)
sources.append(source)
count += 1
@@ -1974,12 +1975,12 @@
iface = self.V_INF1)
status = self.verify_igmp_data_traffic(groups[i],intf=self.V_INF1,source=sources[i])
assert_equal(status, True)
- log.info('data received for group %s from source %s'%(groups[i],sources[i]))
+ log_test.info('data received for group %s from source %s'%(groups[i],sources[i]))
self.send_igmp_join(groups = [groups[i]], src_list = [sources[i]],record_type = IGMP_V3_GR_TYPE_CHANGE_TO_EXCLUDE,
iface = self.V_INF1, delay = 1)
status = self.verify_igmp_data_traffic(groups[i],intf=self.V_INF1,source=sources[i])
assert_equal(status, False)
- log.info("data not received for group %s from source %s after changing group mode to 'TO-EXCLUDE' mode"%(groups[i],sources[i]))
+ log_test.info("data not received for group %s from source %s after changing group mode to 'TO-EXCLUDE' mode"%(groups[i],sources[i]))
def test_igmp_group_source_for_only_config_with_1000_entries(self):
groups = []
@@ -1993,7 +1994,7 @@
if group in groups:
pass
else:
- log.info('group and source are %s and %s'%(group,source))
+ log_test.info('group and source are %s and %s'%(group,source))
groups.append(group)
sources.append(source)
count += 1
@@ -2011,7 +2012,7 @@
if group in groups:
pass
else:
- log.info('group and source are %s and %s'%(group,source))
+ log_test.info('group and source are %s and %s'%(group,source))
groups.append(group)
sources.append(source)
count += 1
@@ -2021,12 +2022,12 @@
iface = self.V_INF1)
status = self.verify_igmp_data_traffic(groups[i],intf=self.V_INF1,source=sources[i])
assert_equal(status, False)
- log.info('data not received for group %s from source %s as expected'%(groups[i],sources[i]))
+ log_test.info('data not received for group %s from source %s as expected'%(groups[i],sources[i]))
self.send_igmp_join(groups = [groups[i]], src_list = [sources[i]],record_type = IGMP_V3_GR_TYPE_INCLUDE,
iface = self.V_INF1)
status = self.verify_igmp_data_traffic(groups[i],intf=self.V_INF1,source=sources[i])
assert_equal(status, True)
- log.info("data received for group %s from source %s after changing group mode to 'TO-INCLUDE' mode"%(groups[i],sources[i]))
+ log_test.info("data received for group %s from source %s after changing group mode to 'TO-INCLUDE' mode"%(groups[i],sources[i]))
def test_igmp_with_multiple_joins_and_data_verify_with_1000_groups(self):
groups = []
@@ -2040,7 +2041,7 @@
if group in groups:
pass
else:
- log.info('group and source are %s and %s'%(group,source))
+ log_test.info('group and source are %s and %s'%(group,source))
groups.append(group)
sources.append(source)
count += 1
@@ -2050,7 +2051,7 @@
iface = self.V_INF1)
status = self.verify_igmp_data_traffic(groups[i],intf=self.V_INF1,source=sources[i])
assert_equal(status, True)
- log.info('data received for group %s from source %s - %d'%(groups[i],sources[i],i))
+ log_test.info('data received for group %s from source %s - %d'%(groups[i],sources[i],i))
def test_igmp_with_multiple_joins_and_data_verify_with_5000_groups(self):
groups = []
@@ -2064,7 +2065,7 @@
if group in groups:
pass
else:
- log.info('group and source are %s and %s'%(group,source))
+ log_test.info('group and source are %s and %s'%(group,source))
groups.append(group)
sources.append(source)
count += 1
@@ -2074,7 +2075,7 @@
iface = self.V_INF1)
status = self.verify_igmp_data_traffic(groups[i],intf=self.V_INF1,source=sources[i])
assert_equal(status, True)
- log.info('data received for group %s from source %s - %d'%(groups[i],sources[i],i))
+ log_test.info('data received for group %s from source %s - %d'%(groups[i],sources[i],i))
"""def test_igmp_join_from_multiple_infts(self):
groups = ['229.9.3.6','234.20.56.2']
@@ -2114,15 +2115,15 @@
iface = self.V_INF1)
status = self.verify_igmp_data_traffic(group[0],intf=self.V_INF1,source=src[0])
assert_equal(status,True) # expecting igmp data traffic from source src_list[0]
- log.info('Multicast traffic received for group %s from source %s before the app is deactivated'%(group[0],src[0]))
+ log_test.info('Multicast traffic received for group %s from source %s before the app is deactivated'%(group[0],src[0]))
self.onos_ctrl.deactivate()
status = self.verify_igmp_data_traffic(group[0],intf=self.V_INF1,source=src[0])
assert_equal(status,False) #not expecting igmp data traffic from source src_list[0]
- log.info('Multicast traffic not received for group %s from source %s after the app is deactivated'%(group[0],src[0]))
+ log_test.info('Multicast traffic not received for group %s from source %s after the app is deactivated'%(group[0],src[0]))
self.onos_ctrl.activate()
status = self.verify_igmp_data_traffic(group[0],intf=self.V_INF1,source=src[0])
assert_equal(status,True) # expecting igmp data traffic from source src_list[0]
- log.info('Multicast traffic received for group %s from source %s the app is re-activated'%(group[0],src[0]))
+ log_test.info('Multicast traffic received for group %s from source %s the app is re-activated'%(group[0],src[0]))
def test_igmp_with_mismatch_for_dst_ip_and_mac_in_data_packets(self):
group = ['228.18.19.29']
@@ -2135,12 +2136,12 @@
ip = IP(dst=group[0],src=source[0])
data = repr(monotonic.monotonic())
pkt = (eth/ip/data)
- log.info('Multicast traffic packet %s'%pkt.show())
+ log_test.info('Multicast traffic packet %s'%pkt.show())
self.success = False
def recv_task():
def igmp_recv_cb(pkt):
- #log.info('received multicast data packet is %s'%pkt.show())
- log.info('multicast data received for group %s from source %s'%(group[0],source[0]))
+ #log_test.info('received multicast data packet is %s'%pkt.show())
+ log_test.info('multicast data received for group %s from source %s'%(group[0],source[0]))
self.success = True
sniff(prn = igmp_recv_cb,lfilter = lambda p: IP in p and p[IP].dst == group[0] and p[IP].src == source[0], count=1,timeout = 2, iface='veth0')
t = threading.Thread(target = recv_task)
@@ -2161,7 +2162,7 @@
d['source'] = s or '0.0.0.0'
d['group'] = g
ssm_xlate_list.append(d)
- log.info('onos load config is %s'%ssm_dict)
+ log_test.info('onos load config is %s'%ssm_dict)
status, code = OnosCtrl.config(ssm_dict)
self.send_igmp_join(groups, src_list = source, record_type = IGMP_V3_GR_TYPE_INCLUDE,
iface = self.V_INF1, delay = 1)
@@ -2179,6 +2180,6 @@
d['source'] = s or '0.0.0.0'
d['group'] = g
ssm_xlate_list.append(d)
- log.info('onos load config is %s'%ssm_dict)
+ log_test.info('onos load config is %s'%ssm_dict)
status, code = OnosCtrl.config(ssm_dict)
assert_equal(status,False)
diff --git a/src/test/iperf/iperfTest.py b/src/test/iperf/iperfTest.py
index a90f048..d6bc737 100644
--- a/src/test/iperf/iperfTest.py
+++ b/src/test/iperf/iperfTest.py
@@ -23,7 +23,8 @@
from nose.twistedtools import reactor, deferred
from twisted.internet import defer
from OnosCtrl import OnosCtrl
-from scapy.all import *
+from CordTestUtils import log_test as log
+
log.setLevel('INFO')
class iperf_exchange(unittest.TestCase):
@@ -200,4 +201,3 @@
df.callback(0)
reactor.callLater(0, iperf_network_test, df)
return df
-
diff --git a/src/test/ipv6vrouter/ipv6vrouterTest.py b/src/test/ipv6vrouter/ipv6vrouterTest.py
index 00a7944..d0b1a79 100644
--- a/src/test/ipv6vrouter/ipv6vrouterTest.py
+++ b/src/test/ipv6vrouter/ipv6vrouterTest.py
@@ -16,7 +16,7 @@
import unittest
from nose.tools import *
from scapy.all import *
-from CordTestUtils import get_mac
+from CordTestUtils import get_mac, log_test
from OnosCtrl import OnosCtrl
from OltConfig import OltConfig
from OnosFlowCtrl import OnosFlowCtrl
@@ -40,7 +40,7 @@
#from cli import system
#from generic import *
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class ipv6vrouter_exchange(CordLogger):
@@ -130,7 +130,7 @@
def onos_load_config(cls, config):
status, code = OnosCtrl.config(config)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
@classmethod
@@ -145,7 +145,7 @@
for host in host_config:
status, code = OnosCtrl.host_config(host)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
@classmethod
@@ -171,7 +171,7 @@
for host,_ in peer_info:
iface = cls.port_map[index]
index += 1
- log.info('Assigning ip %s to interface %s' %(host, iface))
+ log_test.info('Assigning ip %s to interface %s' %(host, iface))
config_cmds = ( 'ifconfig {} 0'.format(iface),
'ifconfig {0} inet6 add {1}/64'.format(iface, host),
'arping -I {0} {1} -c 2'.format(iface, host),
@@ -200,7 +200,7 @@
config = dict(res)
else:
config = network_cfg
- log.info('Restarting ONOS with new network configuration %s'%config)
+ log_test.info('Restarting ONOS with new network configuration %s'%config)
return cord_test_onos_restart(config = config)
@classmethod
@@ -214,8 +214,8 @@
@classmethod
def start_quagga(cls, networks = 4, peer_address = None, router_address = None):
- log.info('Peer address in quagga start is %s'%peer_address)
- log.info('Restarting Quagga container with configuration for %d networks' %(networks))
+ log_test.info('Peer address in quagga start is %s'%peer_address)
+ log_test.info('Restarting Quagga container with configuration for %d networks' %(networks))
config = cls.generate_conf(networks = networks, peer_address = peer_address, router_address = router_address)
if networks <= 10000:
boot_delay = 25
@@ -259,7 +259,7 @@
peer_nt = peer_ip + '/112'
mac = RandMAC()._fix()
peer_list.append((peer_ip, mac))
- log.info('peer ip is %s and and peer network is %s'%(peer_ip,peer_nt))
+ log_test.info('peer ip is %s and and peer network is %s'%(peer_ip,peer_nt))
if num < cls.MAX_PORTS - 1:
interface_dict = { 'name' : 'b1-{}'.format(port), 'ips': [peer_nt], 'mac' : mac }
interfaces.append(interface_dict)
@@ -351,7 +351,7 @@
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))
+ log_test.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 == dst_ip and p[IP].src == src_ip,
@@ -363,7 +363,7 @@
L2 = Ether(src = src_mac, dst = dst_mac)
L3 = IPv6(src=src_ip,dst = dst_ip)
pkt = L2/L3
- log.info('Sending a packet with dst ip %s, dst mac %s on port %s to verify if flows are correct' %
+ log_test.info('Sending a packet with dst ip %s, dst mac %s on port %s to verify if flows are correct' %
(dst_ip, dst_mac, self.port_map[egress]))
while self.start_sending is True:
sendp(pkt, count=50, iface = self.port_map[egress])
@@ -413,7 +413,7 @@
if self.network_list > 50:
wait = len(self.network_list)/20
time.sleep(wait)
- log.info('waiting for %d seconds to verify routes in ONOS'%wait)
+ log_test.info('waiting for %d seconds to verify routes in ONOS'%wait)
else:
time.sleep(5)
self.cliEnter()
@@ -430,16 +430,16 @@
self.vrouter_traffic_verify(positive_test = False)
self.network_list = network_list_backup
if deactivate_activate_vrouter is True:
- log.info('Deactivating vrouter app in ONOS controller for negative scenario')
+ log_test.info('Deactivating vrouter app in ONOS controller for negative scenario')
self.vrouter_activate(deactivate = True)
#routes = json.loads(self.cli.routes(jsonFormat = False, cmd_exist = False))
#assert_equal(len(routes['routes4']), 'Command not found')
- log.info('Activating vrouter app again in ONOS controller for negative scenario')
+ log_test.info('Activating vrouter app again in ONOS controller for negative scenario')
self.vrouter_activate(deactivate = False)
if self.network_list > 50:
wait = len(self.network_list)/20
time.sleep(wait)
- log.info('waiting for %d seconds to verify routes in ONOS'%wait)
+ log_test.info('waiting for %d seconds to verify routes in ONOS'%wait)
else:
time.sleep(5)
routes = json.loads(self.cli.routes(jsonFormat = True))
@@ -450,13 +450,13 @@
def __vrouter_network_verify_negative(self, networks, peers = 1):
##Stop quagga. Test traffic again to see if flows were removed
- log.info('Stopping Quagga container')
+ log_test.info('Stopping Quagga container')
cord_test_quagga_stop()
self.vrouter_traffic_verify(positive_test = False)
- log.info('OVS flows have been removed successfully after Quagga was stopped')
+ log_test.info('OVS flows have been removed successfully after Quagga was stopped')
self.start_quagga(networks = networks)
self.vrouter_traffic_verify()
- log.info('OVS flows have been successfully reinstalled after Quagga was restarted')
+ log_test.info('OVS flows have been successfully reinstalled after Quagga was restarted')
def quagga_shell(self, cmd):
shell_cmds = ('vtysh', '"conf t"', '"{}"'.format(cmd))
@@ -470,14 +470,14 @@
def test_vrouter_ipv6_with_5_routes_quagga_restart_without_config(self):
res = self.__vrouter_network_verify(5, peers = 1)
assert_equal(res, True)
- log.info('Restart Quagga container without config retain')
+ log_test.info('Restart Quagga container without config retain')
cord_test_quagga_restart()
self.vrouter_traffic_verify(positive_test = False)
def test_vrouter_ipv6_with_5_routes_quagga_restart_with_config(self):
res = self.__vrouter_network_verify(5, peers = 1)
assert_equal(res, True)
- log.info('verifying vrouter traffic after Quagga restart with config retain')
+ log_test.info('verifying vrouter traffic after Quagga restart with config retain')
#cord_test_quagga_restart()
self.start_quagga(networks=5)
self.vrouter_traffic_verify(positive_test = True)
@@ -485,14 +485,14 @@
def test_vrouter_ipv6_with_5_routes_quagga_stop(self):
res = self.__vrouter_network_verify(5, peers = 1)
assert_equal(res, True)
- log.info('verifying vrouter traffic after Quagga stop')
+ log_test.info('verifying vrouter traffic after Quagga stop')
cord_test_quagga_stop()
self.vrouter_traffic_verify(positive_test = False)
def test_vrouter_ipv6_with_5_routes_quagga_stop_and_start(self):
res = self.__vrouter_network_verify(5, peers = 1)
assert_equal(res, True)
- log.info('verifying vrouter traffic after Quagga stop and start again')
+ log_test.info('verifying vrouter traffic after Quagga stop and start again')
cord_test_quagga_stop()
self.vrouter_traffic_verify(positive_test = False)
self.start_quagga(networks=5)
@@ -501,14 +501,14 @@
def test_vrouter_ipv6_with_5_routes_onos_restart_without_config(self):
res = self.__vrouter_network_verify(5, peers = 1)
assert_equal(res, True)
- log.info('verifying vrouter traffic after ONOS restart without config retain')
+ log_test.info('verifying vrouter traffic after ONOS restart without config retain')
cord_test_onos_restart()
self.vrouter_traffic_verify(positive_test = False)
def test_vrouter_ipv6_with_5_routes_onos_restart_with_config(self):
res = self.__vrouter_network_verify(5, peers = 1)
assert_equal(res, True)
- log.info('verifying vrouter traffic after ONOS restart with config retain')
+ log_test.info('verifying vrouter traffic after ONOS restart with config retain')
vrouter_configs = self.vrouter_config_get(networks = 5, peers = 1,
peer_address = None, route_update = None)
self.start_onos(network_cfg=vrouter_configs)
@@ -521,7 +521,7 @@
def test_vrouter_ipv6_with_5_routes_restart_quagga_and_onos_with_config(self):
res = self.__vrouter_network_verify(5, peers = 1)
assert_equal(res, True)
- log.info('verifying vrouter traffic after Quagga and ONOS restart with config retain')
+ log_test.info('verifying vrouter traffic after Quagga and ONOS restart with config retain')
#cord_test_quagga_restart()
self.start_quagga(networks=5)
vrouter_configs = self.vrouter_config_get(networks = 5, peers = 1,
@@ -660,7 +660,7 @@
self.network_list = [ '4001:0:0:0:0:0:677:0' ]
self.network_mask = 64
self.vrouter_traffic_verify()
- log.info('verifying vrouter traffic for added routes after Quagga restart with old config only retain')
+ log_test.info('verifying vrouter traffic for added routes after Quagga restart with old config only retain')
#cord_test_quagga_restart()
self.start_quagga(networks=5)
self.vrouter_traffic_verify(positive_test = False)
diff --git a/src/test/mini/miniTest.py b/src/test/mini/miniTest.py
index 5caadc7..0540a72 100644
--- a/src/test/mini/miniTest.py
+++ b/src/test/mini/miniTest.py
@@ -16,7 +16,6 @@
from nose.tools import *
from nose.twistedtools import reactor, deferred
from twisted.internet import defer
-from scapy.all import *
from OnosCtrl import OnosCtrl
from OnosFlowCtrl import OnosFlowCtrl
from OltConfig import OltConfig
@@ -30,6 +29,7 @@
from CordContainer import Onos
from OnosLog import OnosLog
from CordLogger import CordLogger
+from CordTestUtils import log_test as log
import os
import json
import random
@@ -731,4 +731,3 @@
Cleanup.cleanup()
raise
Cleanup.cleanup()
-
diff --git a/src/test/monitoring/monitoringTest.py b/src/test/monitoring/monitoringTest.py
index 6a24da8..c18aec7 100644
--- a/src/test/monitoring/monitoringTest.py
+++ b/src/test/monitoring/monitoringTest.py
@@ -20,7 +20,7 @@
from nose.twistedtools import reactor, deferred
from twisted.internet import defer
from OnosCtrl import OnosCtrl
-from scapy.all import *
+from CordTestUtils import log_test as log
from CordContainer import *
from docker import Client
import json
diff --git a/src/test/netCondition/netConditionTest.py b/src/test/netCondition/netConditionTest.py
index 28800e9..6992860 100644
--- a/src/test/netCondition/netConditionTest.py
+++ b/src/test/netCondition/netConditionTest.py
@@ -45,6 +45,7 @@
from CordTestBase import CordTester
from CordContainer import *
from CordLogger import CordLogger
+from CordTestUtils import log_test
import re
from random import randint
from time import sleep
@@ -53,7 +54,7 @@
from OltConfig import OltConfig
from threading import current_thread
import collections
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class IGMPTestState:
@@ -149,7 +150,7 @@
def onos_load_tls_config(self, config):
status, code = OnosCtrl.config(config)
if status is False:
- log.info('Configure request for AAA returned status %d' %code)
+ log_test.info('Configure request for AAA returned status %d' %code)
assert_equal(status, True)
time.sleep(3)
@@ -185,10 +186,10 @@
onos_ctrl.deactivate()
def onos_load_igmp_config(self, config):
- log.info('onos load config is %s'%config)
+ log_test.info('onos load config is %s'%config)
status, code = OnosCtrl.config(config)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
time.sleep(2)
@@ -296,9 +297,9 @@
rx_stats = recvState.group_map[g][1]
rx = rx_stats.count
assert_greater(rx, 0)
- log.info('Receive stats %s for group %s' %(rx_stats, g))
+ log_test.info('Receive stats %s for group %s' %(rx_stats, g))
- log.info('IGMP test verification success')
+ log_test.info('IGMP test verification success')
def igmp_verify_leave(self, igmpStateList, leave_groups):
sendState, recvState = igmpStateList[0], igmpStateList[1]
@@ -310,12 +311,12 @@
rx = rx_stats.count
assert_greater(tx, 0)
if g not in leave_groups:
- log.info('Received %d packets for group %s' %(rx, g))
+ log_test.info('Received %d packets for group %s' %(rx, g))
for g in leave_groups:
rx = recvState.group_map[g][1].count
assert_equal(rx, 0)
- log.info('IGMP test verification success')
+ log_test.info('IGMP test verification success')
def mcast_traffic_timer(self):
self.mcastTraffic.stopReceives()
@@ -332,9 +333,9 @@
send_time = float(p.payload.load)
recv_time = monotonic.monotonic()
except:
- log.info('Unexpected Payload received: %s' %p.payload.load)
+ log_test.info('Unexpected Payload received: %s' %p.payload.load)
return 0
- #log.info( 'Recv in %.6f secs' %(recv_time - send_time))
+ #log_test.info( 'Recv in %.6f secs' %(recv_time - send_time))
igmpState.update(p.dst, rx = 1, t = recv_time - send_time)
return 0
@@ -408,18 +409,18 @@
pkt = ip_pkt/igmp
IGMPv3.fixup(pkt)
if rec_queryCount == None:
- log.info('Sending IGMP join for group %s and waiting for one query packet and printing the packet' %groups)
+ log_test.info('Sending IGMP join for group %s and waiting for one query packet and printing the packet' %groups)
resp = srp1(pkt, iface=iface)
else:
- log.info('Sending IGMP join for group %s and waiting for periodic query packets and printing one packet' %groups)
+ log_test.info('Sending IGMP join for group %s and waiting for periodic query packets and printing one packet' %groups)
resp = srp1(pkt, iface=iface)
resp[0].summary()
- log.info('Sent IGMP join for group %s and received a query packet and printing packet' %groups)
+ log_test.info('Sent IGMP join for group %s and received a query packet and printing packet' %groups)
if delay != 0:
time.sleep(delay)
def send_igmp_leave(self, groups, src_list = ['1.2.3.4'], ip_pkt = None, iface = 'veth0', delay = 2):
- log.info('entering into igmp leave function')
+ log_test.info('entering into igmp leave function')
igmp = IGMPv3(type = IGMP_TYPE_V3_MEMBERSHIP_REPORT, max_resp_code=30,
gaddr=self.IP_DST)
for g in groups:
@@ -445,10 +446,10 @@
ip_pkt = self.igmp_eth/self.igmp_ip
pkt = ip_pkt/igmp
IGMPv3.fixup(pkt)
- log.info('Sending IGMP leave for group %s and waiting for one group specific query packet and printing the packet' %groups)
+ log_test.info('Sending IGMP leave for group %s and waiting for one group specific query packet and printing the packet' %groups)
resp = srp1(pkt, iface=iface)
resp[0].summary()
- log.info('Sent IGMP leave for group %s and received a group specific query packet and printing packet' %groups)
+ log_test.info('Sent IGMP leave for group %s and received a group specific query packet and printing packet' %groups)
if delay != 0:
time.sleep(delay)
@@ -482,7 +483,7 @@
self.df.callback(0)
self.send_igmp_join(groups)
- log.info('Holding multicast data for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding multicast data for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, mcast_traffic_delay_start)
t.start()
@@ -506,7 +507,7 @@
self.recv_socket = L3PacketSocket(iface = 'veth0', type = ETH_P_IP)
def mcast_join_delay_start():
- log.info('Holding channel join for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding channel join for a period of random delay = {} secs'.format(randomDelay))
self.send_igmp_join(groups)
def igmp_srp_task(stateList):
@@ -550,28 +551,28 @@
self.send_igmp_leave(leave_groups, delay = 3)
join_state = IGMPTestState(groups = leave_groups)
status = self.igmp_not_recv_task(self.V_INF1,leave_groups, join_state)
- log.info('Verified status for igmp recv task %s'%status)
+ log_test.info('Verified status for igmp recv task %s'%status)
assert status == 1 , 'EXPECTED RESULT'
self.df.callback(0)
mcastTraffic.start()
self.send_igmp_join(groups)
- log.info('Holding multicast leave packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding multicast leave packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay+10, mcast_leave_delay_start)
t.start()
return df
def igmp_not_recv_task(self, intf, groups, join_state):
- log.info('Entering igmp not recv task loop')
+ log_test.info('Entering igmp not recv task loop')
recv_socket = L2Socket(iface = intf, type = ETH_P_IP)
group_map = {}
for g in groups:
group_map[g] = [0,0]
- log.info('Verifying join interface should not receive any multicast data')
+ log_test.info('Verifying join interface should not receive any multicast data')
self.NEGATIVE_TRAFFIC_STATUS = 1
def igmp_recv_cb(pkt):
- log.info('Multicast packet %s received for left groups %s' %(pkt[IP].dst, groups))
+ log_test.info('Multicast packet %s received for left groups %s' %(pkt[IP].dst, groups))
self.NEGATIVE_TRAFFIC_STATUS = 2
sniff(prn = igmp_recv_cb, count = 1, lfilter = lambda p: IP in p and p[IP].dst in groups,
timeout = 3, opened_socket = recv_socket)
@@ -598,7 +599,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -611,7 +612,7 @@
df = defer.Deferred()
tls = TLSAuthTest()
def eap_tls_eapTlsHelloReq_pkt_delay():
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
tls._eapTlsHelloReq()
tls._eapTlsCertReq()
tls._eapTlsChangeCipherSpec()
@@ -636,7 +637,7 @@
df = defer.Deferred()
tls = TLSAuthTest()
def eap_tls_eapTlsCertReq_pkt_delay():
- log.info('Holding eapTlsCertReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding eapTlsCertReq packet for a period of random delay = {} secs'.format(randomDelay))
tls._eapTlsCertReq_delay()
tls._eapTlsChangeCipherSpec()
tls._eapTlsFinished()
@@ -668,7 +669,7 @@
df = defer.Deferred()
tls = TLSAuthTest()
def eap_tls_TlsChangeCipherSpec_pkt_delay():
- log.info('Holding TlsChangeCipherSpec packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding TlsChangeCipherSpec packet for a period of random delay = {} secs'.format(randomDelay))
tls._eapTlsChangeCipherSpec()
tls._eapTlsFinished()
df.callback(0)
@@ -692,10 +693,10 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_no_cert_cb():
- log.info('TLS authentication failed with no certificate')
+ log_test.info('TLS authentication failed with no certificate')
tls = TLSAuthTest(fail_cb = tls_no_cert_cb, client_cert = '')
def eap_tls_eapTlsHelloReq_pkt_delay():
- log.info('Holding HelloReq packet with no cert for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding HelloReq packet with no cert for a period of random delay = {} secs'.format(randomDelay))
tls._eapTlsHelloReq()
tls._eapTlsCertReq()
assert_equal(tls.failTest, True)
@@ -720,10 +721,10 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_no_cert_cb():
- log.info('TLS authentication failed with no certificate')
+ log_test.info('TLS authentication failed with no certificate')
tls = TLSAuthTest(fail_cb = tls_no_cert_cb, client_cert = '')
def eap_tls_eapTlsHelloReq_pkt_delay():
- log.info('Holding eapTlsCertReq packet with no cert for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding eapTlsCertReq packet with no cert for a period of random delay = {} secs'.format(randomDelay))
tls._eapTlsCertReq_delay()
assert_equal(tls.failTest, True)
tls._eapTlsChangeCipherSpec()
@@ -757,7 +758,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_no_cert_cb():
- log.info('TLS authentication failed with no certificate')
+ log_test.info('TLS authentication failed with no certificate')
tls = TLSAuthTest(fail_cb = tls_no_cert_cb, client_cert = '')
def eap_tls_TlsChangeCipherSpec_pkt_delay():
tls._eapTlsChangeCipherSpec()
@@ -772,7 +773,7 @@
tls.tlsEventTable.EVT_EAP_ID_REQ
tls._eapTlsHelloReq()
tls._eapTlsCertReq()
- log.info('Holding TlsChangeCipherSpec packet with no cert for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding TlsChangeCipherSpec packet with no cert for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_TlsChangeCipherSpec_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_no_cert, df)
@@ -784,7 +785,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_invalid_cert_cb():
- log.info('TLS authentication failed with invalid certificate')
+ log_test.info('TLS authentication failed with invalid certificate')
tls = TLSAuthTest(fail_cb = tls_invalid_cert_cb, client_cert = self.CLIENT_CERT_INVALID)
def eap_tls_eapTlsHelloReq_pkt_delay():
tls._eapTlsHelloReq()
@@ -800,7 +801,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding HelloReq packet with invalid cert for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding HelloReq packet with invalid cert for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_invalid_cert, df)
@@ -812,10 +813,10 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_invalid_cert_cb():
- log.info('TLS authentication failed with invalid certificate')
+ log_test.info('TLS authentication failed with invalid certificate')
tls = TLSAuthTest(fail_cb = tls_invalid_cert_cb, client_cert = self.CLIENT_CERT_INVALID)
def eap_tls_eapTlsHelloReq_pkt_delay():
- log.info('Holding eapTlsCertReq packet with invalid cert for a period of random delay = {} sec, delay'.format(randomDelay))
+ log_test.info('Holding eapTlsCertReq packet with invalid cert for a period of random delay = {} sec, delay'.format(randomDelay))
tls._eapTlsCertReq_delay()
tls._eapTlsChangeCipherSpec()
assert_equal(tls.failTest, True)
@@ -837,7 +838,7 @@
if len(r) == 0:
tls.tlsFail()
- log.info('Holding eapTlsCertReq packet with invalid cert for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding eapTlsCertReq packet with invalid cert for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_invalid_cert, df)
@@ -850,7 +851,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_invalid_cert_cb():
- log.info('TLS authentication failed with invalid certificate')
+ log_test.info('TLS authentication failed with invalid certificate')
tls = TLSAuthTest(fail_cb = tls_invalid_cert_cb, client_cert = self.CLIENT_CERT_INVALID)
def eap_tls_TlsChangeCipherSpec_pkt_delay():
tls._eapTlsChangeCipherSpec()
@@ -866,7 +867,7 @@
tls.tlsEventTable.EVT_EAP_ID_REQ
tls._eapTlsHelloReq()
tls._eapTlsCertReq()
- log.info('Holding TlsChangeCipherSpec packet with invalid cert for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding TlsChangeCipherSpec packet with invalid cert for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_TlsChangeCipherSpec_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_invalid_cert, df)
@@ -888,13 +889,13 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
time.sleep(randomDelay)
tls._eapTlsHelloReq()
tls._eapTlsCertReq()
tls._eapTlsChangeCipherSpec()
tls._eapTlsFinished()
- log.info('Authentication successful for user %d'%i)
+ log_test.info('Authentication successful for user %d'%i)
# Sending multiple tls clients and making random delay in between client and server packets.
for i in xrange(clients):
thread = threading.Thread(target = multiple_tls_random_delay)
@@ -927,7 +928,7 @@
tls._eapTlsCertReq()
tls._eapTlsChangeCipherSpec()
tls._eapTlsFinished()
- log.info('Authentication successful for user %d'%i)
+ log_test.info('Authentication successful for user %d'%i)
# Client authendicating multiple times one after other and making random delay in between authendication.
for i in xrange(clients):
multiple_tls_random_delay()
@@ -966,7 +967,7 @@
for x in xrange(clients):
tls[x]._eapTlsFinished()
for x in xrange(clients):
- log.info('Authentication successful for user %d'%i)
+ log_test.info('Authentication successful for user %d'%i)
# Client authendicating multiple times one after other and making random delay in between authendication.
for i in xrange(2):
multiple_tls_random_delay()
@@ -988,7 +989,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
+ log_test.info('Pkt seen with ingress mac %s, egress mac %s' %(pkt.src, pkt.dst))
self.success = True
sniff(count=2, timeout=randomDelay+50, lfilter = lambda p: p.src == ingress_mac,
prn = recv_cb, iface = self.port_map[egress])
@@ -1013,7 +1014,7 @@
##wait for flows to be added to ONOS
time.sleep(1)
thread.start()
- log.info('Holding a packet to verify if flows are active after {} secs'.format(randomDelay))
+ log_test.info('Holding a packet to verify if flows are active after {} secs'.format(randomDelay))
t = Timer(randomDelay, send_flow_pkt_delay)
t.start()
reactor.callLater(0, creating_mac_flow, df)
@@ -1034,7 +1035,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
+ log_test.info('Pkt seen with ingress ip %s, egress ip %s' %(pkt[IP].src, pkt[IP].dst))
self.success = True
sniff(count=2, timeout= randomDelay + 30,
lfilter = lambda p: IP in p and p[IP].dst == egress_map['ip'] and p[IP].src == ingress_map['ip'],
@@ -1064,7 +1065,7 @@
##wait for flows to be added to ONOS
time.sleep(1)
thread.start()
- log.info('Holding a packet to verify if flows are active after {} secs'.format(randomDelay))
+ log_test.info('Holding a packet to verify if flows are active after {} secs'.format(randomDelay))
t = Timer(randomDelay, send_flow_ip_pkt_delay)
t.start()
reactor.callLater(0, creating_ip_flow, df)
@@ -1084,7 +1085,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress TCP port %s, egress TCP port %s' %(pkt[TCP].sport, pkt[TCP].dport))
+ log_test.info('Pkt seen with ingress TCP port %s, egress TCP port %s' %(pkt[TCP].sport, pkt[TCP].dport))
self.success = True
sniff(count=2, timeout= randomDelay+30, lfilter = lambda p: TCP in p and p[TCP].dport == egress_map['tcp_port']
and p[TCP].sport == ingress_map['tcp_port'], prn = recv_cb, iface = self.port_map[egress])
@@ -1109,7 +1110,7 @@
time.sleep(1)
self.success = False
thread.start()
- log.info('Holding a packet to verify if flows are active after {} sec, delay'.format(randomDelay))
+ log_test.info('Holding a packet to verify if flows are active after {} sec, delay'.format(randomDelay))
t = Timer(randomDelay, send_flow_tcp_pkt_delay)
t.start()
df.callback(0)
@@ -1131,7 +1132,7 @@
def mac_recv_task():
def recv_cb(pkt):
- log.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
+ log_test.info('Pkt seen with ingress UDP port %s, egress UDP port %s' %(pkt[UDP].sport, pkt[UDP].dport))
self.success = True
sniff(count=2, timeout=randomDelay + 30,
lfilter = lambda p: UDP in p and p[UDP].dport == egress_map['udp_port']
@@ -1158,7 +1159,7 @@
time.sleep(1)
self.success = False
thread.start()
- log.info('Holding a packet to verify if flows are active after {} secs'.format(randomDelay))
+ log_test.info('Holding a packet to verify if flows are active after {} secs'.format(randomDelay))
t = Timer(randomDelay, send_flow_udp_pkt_delay)
t.start()
@@ -1189,7 +1190,7 @@
if group in groups:
pass
else:
- log.info('group = %s source list = %s and subscriber source ip in join = %s'%(group,source, subscriber_sourceip))
+ log_test.info('group = %s source list = %s and subscriber source ip in join = %s'%(group,source, subscriber_sourceip))
groups.append(group)
sources.append(source)
subscribers_src_ip.append(subscriber_sourceip)
@@ -1200,11 +1201,11 @@
self.send_igmp_join(groups = [group], src_list = [source],record_type = IGMP_V3_GR_TYPE_INCLUDE,
iface = self.V_INF1, ip_src = [subscriber_src_ip])
randomDelay_in_thread = randint(10,30)
- log.info('This is running in a thread, with igmp join sent and delay {}'.format(randomDelay_in_thread))
+ log_test.info('This is running in a thread, with igmp join sent and delay {}'.format(randomDelay_in_thread))
time.sleep(randomDelay_in_thread)
- log.info('This is running in a thread, with igmp join sent and delay {}'.format(randomDelay_in_thread))
+ log_test.info('This is running in a thread, with igmp join sent and delay {}'.format(randomDelay_in_thread))
status = self.verify_igmp_data_traffic_in_thread(group,intf=self.V_INF1,source=source, data_pkt = data_pkt)
- log.info('Data received for group %s from source %s and status is %s '%(group,source,status))
+ log_test.info('Data received for group %s from source %s and status is %s '%(group,source,status))
self.igmp_threads_result.append(status)
for i in range(subscriber):
@@ -1217,12 +1218,12 @@
thread.join()
def verify_igmp_data_traffic_in_thread(self, group, intf='veth0', source='1.2.3.4', data_pkt =50, negative = None):
- log.info('Verifying multicast traffic for group %s from source %s'%(group,source))
+ log_test.info('Verifying multicast traffic for group %s from source %s'%(group,source))
self.success = False
def recv_task():
def igmp_recv_cb(pkt):
- #log.info('received multicast data packet is %s'%pkt.show())
- log.info('Multicast data received for group %s from source %s'%(group,source))
+ #log_test.info('received multicast data packet is %s'%pkt.show())
+ log_test.info('Multicast data received for group %s from source %s'%(group,source))
self.success = True
sniff(prn = igmp_recv_cb,lfilter = lambda p: IP in p and p[IP].dst == group and p[IP].src == source, count=1,timeout = 2, iface='veth0')
t = threading.Thread(target = recv_task)
@@ -1232,10 +1233,10 @@
if (negative is None) and self.success is True:
return self.success
elif (negative is not None) and self.success is True:
- log.info('Multicast traffic should not received because this is negative scenario, but it is received')
+ log_test.info('Multicast traffic should not received because this is negative scenario, but it is received')
self.success = False
elif (negative is not None) and self.success is False:
- log.info('Multicast traffic should is not received because this is negative scenario, hence status is True')
+ log_test.info('Multicast traffic should is not received because this is negative scenario, hence status is True')
self.success = True
return self.success
@@ -1244,10 +1245,10 @@
eth = Ether(dst= dst_mac)
ip = IP(dst=group,src=source)
data = repr(monotonic.monotonic())
- log.info('Sending %s number of multicast packet to the multicast group %s'%(data_pkt, group))
+ log_test.info('Sending %s number of multicast packet to the multicast group %s'%(data_pkt, group))
sendp(eth/ip/data,count=data_pkt, iface = intf)
pkt = (eth/ip/data)
- #log.info('multicast traffic packet %s'%pkt.show())
+ #log_test.info('multicast traffic packet %s'%pkt.show())
def iptomac_convert(self, mcast_ip):
mcast_mac = '01:00:5e:'
@@ -1262,7 +1263,7 @@
def test_netCondition_with_delay_between_multiple_igmp_joins_and_data_for_multiple_subscribers(self):
self.setUp_tls()
df = defer.Deferred()
- log.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
+ log_test.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
def netCondition_multiple_igmp_joins_and_data(df):
### Start ips of multicast, source list and subscriber source ip are '229.0.0.1', '10.10.0.1' and '20.20.0.1' respectively
no_users = 10
@@ -1271,9 +1272,9 @@
subscriber_src_end_ip = '20.20.20.254'
self.netCondition_with_delay_between_multiple_igmp_joins_and_data(users = no_users, group_end_ip = group_end_ip,
source_list_end_ip = source_list_end_ip, user_src_end_ip = subscriber_src_end_ip )
- log.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
+ log_test.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
for i in xrange(no_users):
- log.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
+ log_test.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
if assert_equal(self.igmp_threads_result[i], True) is True:
df.callback(0)
df.callback(0)
@@ -1284,7 +1285,7 @@
def test_netCondition_with_delay_between_multiple_igmp_joins_and_data_from_multiple_subscribers_with_low_multicast_data_rate(self):
self.setUp_tls()
df = defer.Deferred()
- log.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
+ log_test.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
def netCondition_multiple_igmp_joins_and_data(df):
### Start ips of multicast, source list and subscriber source ip are '229.0.0.1', '10.10.0.1' and '20.20.0.1' respectively
no_users = 10
@@ -1293,9 +1294,9 @@
subscriber_src_end_ip = '20.20.20.254'
self.netCondition_with_delay_between_multiple_igmp_joins_and_data(users = no_users, group_end_ip = group_end_ip,
source_list_end_ip = source_list_end_ip, user_src_end_ip = subscriber_src_end_ip, data_pkt = 20)
- log.info('IGMP Thread status after running igmp thread %s '%(self.igmp_threads_result))
+ log_test.info('IGMP Thread status after running igmp thread %s '%(self.igmp_threads_result))
for i in xrange(no_users):
- log.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
+ log_test.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
if assert_equal(self.igmp_threads_result[i], True) is True:
df.callback(0)
df.callback(0)
@@ -1306,7 +1307,7 @@
def test_netCondition_with_delay_between_multiple_igmp_joins_and_data_for_same_subscriber(self):
self.setUp_tls()
df = defer.Deferred()
- log.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
+ log_test.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
def netCondition_multiple_igmp_joins_and_data(df):
### Start ips of multicast, source list and subscriber source ip are '229.0.0.1', '10.10.0.1' and '20.20.0.1' respectively
no_users = 5
@@ -1315,9 +1316,9 @@
subscriber_src_end_ip = '20.20.0.1'
self.netCondition_with_delay_between_multiple_igmp_joins_and_data(users = no_users, group_end_ip = group_end_ip,
source_list_end_ip = source_list_end_ip, user_src_end_ip = subscriber_src_end_ip )
- log.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
+ log_test.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
for i in xrange(no_users):
- log.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
+ log_test.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
if assert_equal(self.igmp_threads_result[i], True) is True:
df.callback(0)
df.callback(0)
@@ -1329,7 +1330,7 @@
def test_netCondition_with_delay_between_same_igmp_joins_and_data_from_multiple_subscriber(self):
self.setUp_tls()
df = defer.Deferred()
- log.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
+ log_test.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
def netCondition_multiple_igmp_joins_and_data(df):
### Start ips of multicast, source list and subscriber source ip are '229.0.0.1', '10.10.0.1' and '20.20.0.1' respectively
no_users = 100
@@ -1338,9 +1339,9 @@
subscriber_src_end_ip = '20.20.20.254'
self.netCondition_with_delay_between_multiple_igmp_joins_and_data(users = no_users, group_end_ip = group_end_ip,
source_list_end_ip = source_list_end_ip, user_src_end_ip = subscriber_src_end_ip )
- log.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
+ log_test.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
for i in xrange(no_users):
- log.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
+ log_test.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
if assert_equal(self.igmp_threads_result[i], True) is True:
df.callback(0)
df.callback(0)
@@ -1351,7 +1352,7 @@
def test_netCondition_with_delay_between_multiple_igmp_joins_and_data_from_same_sourcelist_for_multiple_subscriber(self):
self.setUp_tls()
df = defer.Deferred()
- log.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
+ log_test.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
def netCondition_multiple_igmp_joins_and_data(df):
### Start ips of multicast, source list and subscriber source ip are '229.0.0.1', '10.10.0.1' and '20.20.0.1' respectively
no_users = 20
@@ -1360,9 +1361,9 @@
subscriber_src_end_ip = '20.20.20.254'
self.netCondition_with_delay_between_multiple_igmp_joins_and_data(users = no_users, group_end_ip = group_end_ip,
source_list_end_ip = source_list_end_ip, user_src_end_ip = subscriber_src_end_ip )
- log.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
+ log_test.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
for i in xrange(no_users):
- log.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
+ log_test.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
if assert_equal(self.igmp_threads_result[i], True) is True:
df.callback(0)
df.callback(0)
@@ -1395,7 +1396,7 @@
if group in groups:
pass
else:
- log.info('group = %s source list = %s and subscriber source ip in join = %s'%(group,source, subscriber_sourceip))
+ log_test.info('group = %s source list = %s and subscriber source ip in join = %s'%(group,source, subscriber_sourceip))
groups.append(group)
sources.append(source)
subscribers_src_ip.append(subscriber_sourceip)
@@ -1410,17 +1411,17 @@
self.send_igmp_join_negative(groups = [group], src_list = [source],record_type = IGMP_V3_GR_TYPE_INCLUDE,
iface = self.V_INF1, ip_src = [subscriber_src_ip], invalid_igmp_join = invalid_igmp_join)
randomDelay_in_thread = randint(10,30)
- log.info('This is running in thread with igmp join sent and delay {}'.format(randomDelay_in_thread))
+ log_test.info('This is running in thread with igmp join sent and delay {}'.format(randomDelay_in_thread))
time.sleep(randomDelay_in_thread)
- log.info('This is running in thread with igmp join sent and delay {}'.format(randomDelay_in_thread))
+ log_test.info('This is running in thread with igmp join sent and delay {}'.format(randomDelay_in_thread))
status = self.verify_igmp_data_traffic_in_thread(group,intf=self.V_INF1,source=source, data_pkt = data_pkt,negative=negative_traffic)
- log.info('data received for group %s from source %s and status is %s '%(group,source,status))
+ log_test.info('data received for group %s from source %s and status is %s '%(group,source,status))
self.igmp_threads_result.append(status)
for i in range(subscriber):
thread = threading.Thread(target = multiple_joins_send_in_threads, args = (groups[i], sources[i], subscribers_src_ip[i], invalid_joins))
if bunch_traffic == 'yes':
if j == 10:
- log.info('Here we are throttle traffic for 100 sec of delay and agian creating igmp threads')
+ log_test.info('Here we are throttle traffic for 100 sec of delay and agian creating igmp threads')
time.sleep(randint(100,110))
j = 1
else:
@@ -1435,7 +1436,7 @@
def test_netCondition_with_throttle_between_multiple_igmp_joins_and_data_from_multiple_subscribers(self):
self.setUp_tls()
df = defer.Deferred()
- log.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
+ log_test.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
def netCondition_multiple_igmp_joins_and_data(df):
### Start ips of multicast, source list and subscriber source ip are '229.0.0.1', '10.10.0.1' and '20.20.0.1' respectively
batch_traffic_run = 'yes'
@@ -1444,9 +1445,9 @@
source_list_end_ip = '10.10.30.254'
subscriber_src_end_ip = '20.20.20.254'
self.netCondition_with_multiple_scenarios_igmp_joins_and_data(users = no_users, group_end_ip = group_end_ip, source_list_end_ip = source_list_end_ip, user_src_end_ip = subscriber_src_end_ip, bunch_traffic = batch_traffic_run, data_pkt = 50 )
- log.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
+ log_test.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
for i in xrange(no_users):
- log.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
+ log_test.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
if assert_equal(self.igmp_threads_result[i], True) is True:
df.callback(0)
df.callback(0)
@@ -1457,7 +1458,7 @@
def test_netCondition_with_invalid_igmp_type_multiple_igmp_joins_and_data_from_multiple_subscribers(self):
self.setUp_tls()
df = defer.Deferred()
- log.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
+ log_test.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
def netCondition_multiple_igmp_joins_and_data(df):
### Start ips of multicast, source list and subscriber source ip are '229.0.0.1', '10.10.0.1' and '20.20.0.1' respectively
batch_traffic_run = 'no'
@@ -1467,9 +1468,9 @@
source_list_end_ip = '10.10.30.254'
subscriber_src_end_ip = '20.20.20.254'
self.netCondition_with_multiple_scenarios_igmp_joins_and_data(users = no_users, group_end_ip = group_end_ip, source_list_end_ip = source_list_end_ip, user_src_end_ip = subscriber_src_end_ip, bunch_traffic = batch_traffic_run, data_pkt = 50, invalid_joins = invalid_igmp_join )
- log.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
+ log_test.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
for i in xrange(no_users):
- log.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
+ log_test.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
if assert_equal(self.igmp_threads_result[i], True) is True:
df.callback(0)
df.callback(0)
@@ -1480,7 +1481,7 @@
def test_netCondition_with_invalid_record_type_multiple_igmp_joins_and_data_from_multiple_subscribers(self):
self.setUp_tls()
df = defer.Deferred()
- log.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
+ log_test.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
def netCondition_multiple_igmp_joins_and_data(df):
### Start ips of multicast, source list and subscriber source ip are '229.0.0.1', '10.10.0.1' and '20.20.0.1' respectively
batch_traffic_run = 'no'
@@ -1490,9 +1491,9 @@
source_list_end_ip = '10.10.30.254'
subscriber_src_end_ip = '20.20.20.254'
self.netCondition_with_multiple_scenarios_igmp_joins_and_data(users = no_users, group_end_ip = group_end_ip, source_list_end_ip = source_list_end_ip, user_src_end_ip = subscriber_src_end_ip, bunch_traffic = batch_traffic_run, data_pkt = 50, invalid_joins = invalid_igmp_join )
- log.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
+ log_test.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
for i in xrange(no_users):
- log.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
+ log_test.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
if assert_equal(self.igmp_threads_result[i], True) is True:
df.callback(0)
df.callback(0)
@@ -1504,7 +1505,7 @@
def test_netCondition_with_invalid_ttl_and_multiple_igmp_joins_and_data_from_multiple_subscribers(self):
self.setUp_tls()
df = defer.Deferred()
- log.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
+ log_test.info('IGMP Thread status before running igmp thread %s '%(self.igmp_threads_result))
def netCondition_multiple_igmp_joins_and_data(df):
### Start ips of multicast, source list and subscriber source ip are '229.0.0.1', '10.10.0.1' and '20.20.0.1' respectively
batch_traffic_run = 'no'
@@ -1514,9 +1515,9 @@
source_list_end_ip = '10.10.30.254'
subscriber_src_end_ip = '20.20.20.254'
self.netCondition_with_multiple_scenarios_igmp_joins_and_data(users = no_users, group_end_ip = group_end_ip, source_list_end_ip = source_list_end_ip, user_src_end_ip = subscriber_src_end_ip, bunch_traffic = batch_traffic_run, data_pkt = 10, invalid_joins = invalid_igmp_join )
- log.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
+ log_test.info('IGMP Thread status after running igmp thread %s '%(self. igmp_threads_result))
for i in xrange(no_users):
- log.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
+ log_test.info('IGMP Thread %s status is %s after running igmp thread '%(i,self.igmp_threads_result[i]))
if assert_equal(self.igmp_threads_result[i], True) is True:
df.callback(0)
df.callback(0)
@@ -1548,7 +1549,7 @@
assert_equal(tls.failTest, True)
tls._eapTlsFinished()
assert_equal(tls.failTest, True)
- log.info('Authentication successful for user %d'%i)
+ log_test.info('Authentication successful for user %d'%i)
# Sending multiple tls clients and making random delay in between client and server packets.
for i in xrange(clients):
thread = threading.Thread(target = multiple_tls_random_delay)
@@ -1587,7 +1588,7 @@
assert_equal(tls.failTest, True)
tls._eapTlsFinished()
assert_equal(tls.failTest, True)
- log.info('Authentication successful for user %d'%i)
+ log_test.info('Authentication successful for user %d'%i)
# Sending multiple tls clients and making random delay in between client and server packets.
for i in xrange(clients):
thread = threading.Thread(target = multiple_tls_random_delay)
@@ -1626,7 +1627,7 @@
assert_equal(tls.failTest, True)
tls._eapTlsFinished()
assert_equal(tls.failTest, True)
- log.info('Authentication successful for user %d'%i)
+ log_test.info('Authentication successful for user %d'%i)
# Sending multiple tls clients and making random delay in between client and server packets.
for i in xrange(clients):
thread = threading.Thread(target = multiple_tls_random_delay)
@@ -1659,7 +1660,7 @@
tls._eapTlsChangeCipherSpec()
assert_equal(tls.failTest, True)
tls._eapTlsFinished()
- log.info('Authentication successful for user %d'%i)
+ log_test.info('Authentication successful for user %d'%i)
# Sending multiple tls clients and making random delay in between client and server packets.
for i in xrange(clients):
thread = threading.Thread(target = multiple_tls_random_delay)
@@ -1692,7 +1693,7 @@
#tls._eapTlsChangeCipherSpec()
assert_equal(tls.failTest, True)
tls._eapTlsFinished()
- log.info('Authentication successful for user %d'%i)
+ log_test.info('Authentication successful for user %d'%i)
# Sending multiple tls clients and making random delay in between client and server packets.
for i in xrange(clients):
thread = threading.Thread(target = multiple_tls_random_delay)
@@ -1725,7 +1726,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -1752,7 +1753,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -1779,7 +1780,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -1806,7 +1807,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -1818,7 +1819,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_invalid_content_type_cb():
- log.info('TLS authentication failed with invalid content type in TLSContentType packet')
+ log_test.info('TLS authentication failed with invalid content type in TLSContentType packet')
tls = TLSAuthTest(fail_cb = tls_invalid_content_type_cb, invalid_content_type = 44)
def eap_tls_eapTlsHelloReq_pkt_delay():
tls._eapTlsHelloReq()
@@ -1833,7 +1834,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -1845,7 +1846,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_invalid_eap_tls_version_in_client_auth_packet():
- log.info('TLS authentication failed with invalid tls version field in the packet')
+ log_test.info('TLS authentication failed with invalid tls version field in the packet')
tls = TLSAuthTest(fail_cb = tls_invalid_eap_tls_version_in_client_auth_packet, version = 'TLS_2_1')
def eap_tls_eapTlsHelloReq_pkt_delay():
tls._eapTlsHelloReq()
@@ -1860,7 +1861,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -1872,7 +1873,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_with_invalid_tls_cipher_suite_field_in_client_auth_packet_cb():
- log.info('TLS authentication failed with invalid tls cipher suite field in the packet')
+ log_test.info('TLS authentication failed with invalid tls cipher suite field in the packet')
tls = TLSAuthTest(fail_cb = tls_with_invalid_tls_cipher_suite_field_in_client_auth_packet_cb, cipher_suite = 'RSA_WITH_AES_512_CBC_SHA')
def eap_tls_eapTlsHelloReq_pkt_delay():
tls._eapTlsHelloReq()
@@ -1887,7 +1888,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -1899,7 +1900,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_with_invalid_id_in_identifier_response_packet_cb():
- log.info('TLS authentication failed with invalid id in identifier packet')
+ log_test.info('TLS authentication failed with invalid id in identifier packet')
tls = TLSAuthTest(fail_cb = tls_with_invalid_id_in_identifier_response_packet_cb,
id_mismatch_in_identifier_response_packet = True)
def eap_tls_eapTlsHelloReq_pkt_delay():
@@ -1915,7 +1916,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -1927,7 +1928,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_with_invalid_id_in_client_hello_packet_cb():
- log.info('TLS authentication failed with invalid id in client hello packet')
+ log_test.info('TLS authentication failed with invalid id in client hello packet')
tls = TLSAuthTest(fail_cb = tls_with_invalid_id_in_client_hello_packet_cb,
id_mismatch_in_client_hello_packet = True)
@@ -1944,7 +1945,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -1956,7 +1957,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_incorrect_handshake_type_client_hello_cb():
- log.info('TLS authentication failed with incorrect handshake type in client hello packet')
+ log_test.info('TLS authentication failed with incorrect handshake type in client hello packet')
tls = TLSAuthTest(fail_cb = tls_incorrect_handshake_type_client_hello_cb, invalid_client_hello_handshake_type=True)
def eap_tls_eapTlsHelloReq_pkt_delay():
tls._eapTlsHelloReq()
@@ -1971,7 +1972,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -1983,7 +1984,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_incorrect_handshake_type_certificate_request_cb():
- log.info('TLS authentication failed with incorrect handshake type in client certificate request packet')
+ log_test.info('TLS authentication failed with incorrect handshake type in client certificate request packet')
tls = TLSAuthTest(fail_cb = tls_incorrect_handshake_type_certificate_request_cb, invalid_cert_req_handshake = True)
def eap_tls_eapTlsHelloReq_pkt_delay():
tls._eapTlsHelloReq()
@@ -1998,7 +1999,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -2010,7 +2011,7 @@
randomDelay = randint(10,300)
df = defer.Deferred()
def tls_clientkeyex_replace_with_serverkeyex_cb():
- log.info('TLS authentication failed with client key exchange replaced with server key exchange')
+ log_test.info('TLS authentication failed with client key exchange replaced with server key exchange')
tls = TLSAuthTest(fail_cb = tls_clientkeyex_replace_with_serverkeyex_cb,clientkeyex_replace_with_serverkeyex=True)
def eap_tls_eapTlsHelloReq_pkt_delay():
tls._eapTlsHelloReq()
@@ -2025,7 +2026,7 @@
tls.tlsEventTable.EVT_EAP_START
tls._eapIdReq()
tls.tlsEventTable.EVT_EAP_ID_REQ
- log.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
+ log_test.info('Holding tlsHelloReq packet for a period of random delay = {} secs'.format(randomDelay))
t = Timer(randomDelay, eap_tls_eapTlsHelloReq_pkt_delay)
t.start()
reactor.callLater(0, eap_tls_verify, df)
@@ -2039,11 +2040,11 @@
pcap_file_path = "/root/test/src/test/netCondition/tls_auth_exhange_packets_Radius_server_packets_only.pcap"
elif error_pkt:
pcap_file_path = "/root/test/src/test/netCondition/error_tls_auth_exhange_packets_Radius_server_packets_only.pcap"
- log.info('Started replaying pcap file packets on docker0 interface using tcprelay linux command')
+ log_test.info('Started replaying pcap file packets on docker0 interface using tcprelay linux command')
time.sleep(0.4)
sendp(rdpcap(pcap_file_path), iface="eth0", loop=0, inter=1)
time.sleep(5)
- log.info('Replayed pcap file packets on docker0 interface')
+ log_test.info('Replayed pcap file packets on docker0 interface')
def tcpreplay_radius_server_error_packets_from_pcap_file(self, pcap_file_path =None, error_pkt = None):
#default radius server packets in path in test/netCondition/xxx.pcap file
@@ -2051,7 +2052,7 @@
pcap_file_path = pcap_file_path
else:
pcap_file_path = "/root/test/src/test/netCondition/error_tls_auth_exhange_packets_Radius_server_packets_only.pcap"
- log.info('Started replaying pcap file error packets on docker0 interface using tcprelay linux command')
+ log_test.info('Started replaying pcap file error packets on docker0 interface using tcprelay linux command')
time.sleep(0.4)
sendp(rdpcap(pcap_file_path), iface="eth0", loop=0, inter=1)
time.sleep(5)
@@ -2064,7 +2065,7 @@
pcap_file_path = pcap_file_path
else:
pcap_file_path = "/root/test/src/test/netCondition/tls_auth_exhange_packets_Radius_server_packets_only.pcap"
- log.info('Started corrupting tls server packet no = {}'.format(pkt_no))
+ log_test.info('Started corrupting tls server packet no = {}'.format(pkt_no))
radius_server_pkts = rdpcap(pcap_file_path)
error_server_pkt = radius_server_pkts[pkt_no]
if pkt_no == 0:
@@ -2152,7 +2153,7 @@
wrpcap("/root/test/src/test/netCondition/error_tls_auth_exhange_packets_Radius_server_packets_only.pcap", radius_server_pkts)
pcap_file_path = "/root/test/src/test/netCondition/error_tls_auth_exhange_packets_Radius_server_packets_only.pcap"
- log.info('Done corrupting tls server packet no = {} send back filepath along with file name'.format(pkt_no))
+ log_test.info('Done corrupting tls server packet no = {} send back filepath along with file name'.format(pkt_no))
return pcap_file_path
@deferred(TEST_TIMEOUT_DELAY-50)
@@ -2181,10 +2182,10 @@
tls._eapTlsChangeCipherSpec()
tls._eapTlsFinished()
if tls.failTest == False:
- log.info('Authentication successful for user')
+ log_test.info('Authentication successful for user')
return 'success'
else:
- log.info('Authentication not successful for user')
+ log_test.info('Authentication not successful for user')
return 'failed'
thread_client = threading.Thread(target=lambda q, arg1: q.put(tls_client_packets(arg1)), args=(que, 'start'))
thread_radius = threading.Thread(target = Container.pause_container, args = (radius_image,delay))
@@ -2215,7 +2216,7 @@
time.sleep(0.2)
randomDelay = randint(10,300)
def tls_invalid_server_packets_scenario_cb():
- log.info('TLS authentication failed with {}'.format(msg))
+ log_test.info('TLS authentication failed with {}'.format(msg))
tls = TLSAuthTest(fail_cb = tls_invalid_server_packets_scenario_cb, src_mac = 'random')
tls._eapSetup()
tls.tlsEventTable.EVT_EAP_SETUP
@@ -2228,10 +2229,10 @@
tls._eapTlsChangeCipherSpec()
tls._eapTlsFinished()
if tls.failTest == True:
- log.info('Authentication not successful for user')
+ log_test.info('Authentication not successful for user')
return 'failed'
else:
- log.info('Authentication successful for user')
+ log_test.info('Authentication successful for user')
return 'success'
def tcpreplay_radius_server_error_packets_from_pcap_file(pcap_file_path =None, error_pkt = None):
#default radius server packets in path in test/netCondition/xxx.pcap file
@@ -2240,7 +2241,7 @@
else:
pcap_file_path = "/root/test/src/test/netCondition/error_tls_auth_exhange_packets_Radius_server_packets_only.pcap"
- log.info('Started replaying pcap file error packets on docker0 interface using tcprelay linux command')
+ log_test.info('Started replaying pcap file error packets on docker0 interface using tcprelay linux command')
time.sleep(0.4)
sendp(rdpcap(pcap_file_path), iface="eth0", loop=0, inter=1)
time.sleep(5)
diff --git a/src/test/onosCli/onosCliTest.py b/src/test/onosCli/onosCliTest.py
index 731cf32..4fa20f7 100644
--- a/src/test/onosCli/onosCliTest.py
+++ b/src/test/onosCli/onosCliTest.py
@@ -1,12 +1,12 @@
-#
+#
# Copyright 2016-present Ciena Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -20,7 +20,7 @@
from nose.tools import *
from onosclidriver import OnosCliDriver
from OnosCtrl import OnosCtrl
-from scapy.all import *
+from CordTestUtils import log_test as log
log.setLevel('INFO')
diff --git a/src/test/proxyarp/proxyarpTest.py b/src/test/proxyarp/proxyarpTest.py
index 836cb3b..9df4a0e 100644
--- a/src/test/proxyarp/proxyarpTest.py
+++ b/src/test/proxyarp/proxyarpTest.py
@@ -16,7 +16,7 @@
import unittest
from nose.tools import *
from scapy.all import *
-from CordTestUtils import get_mac
+from CordTestUtils import get_mac, log_test
from OnosCtrl import OnosCtrl
from OltConfig import OltConfig
from OnosFlowCtrl import OnosFlowCtrl
@@ -29,7 +29,7 @@
import time
import os
import json
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class proxyarp_exchange(unittest.TestCase):
@@ -99,7 +99,7 @@
index += 1
config_cmds = ('ifconfig {} 0'.format(iface), )
for cmd in config_cmds:
- log.info('host unload command %s' % cmd)
+ log_test.info('host unload command %s' % cmd)
os.system(cmd)
@classmethod
@@ -124,7 +124,7 @@
for host in host_config:
status, code = OnosCtrl.host_config(host)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
@classmethod
@@ -191,18 +191,18 @@
return proxyarp_configs
def proxyarp_arpreply_verify(self, ingress, hostip, hostmac, PositiveTest=True):
- log.info('verifying arp reply for host ip %s host mac %s on interface %s'%(hostip ,hostmac ,self.port_map[ingress]))
+ log_test.info('verifying arp reply for host ip %s host mac %s on interface %s'%(hostip ,hostmac ,self.port_map[ingress]))
self.success = False
def recv_task():
def recv_cb(pkt):
- log.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
+ log_test.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
self.success = True if PositiveTest == True else False
sniff(count=1, timeout=2, lfilter = lambda p: ARP in p and p[ARP].op == 2 and p[ARP].hwsrc == hostmac,
prn = recv_cb, iface = self.port_map[ingress])
t = threading.Thread(target = recv_task)
t.start()
pkt = (Ether(dst = 'ff:ff:ff:ff:ff:ff')/ARP(op=1,pdst=hostip))
- log.info('sending arp request for dest ip %s on interface %s' %
+ log_test.info('sending arp request for dest ip %s on interface %s' %
(hostip, self.port_map[ingress]))
sendp( pkt, count = 10, iface = self.port_map[ingress])
t.join()
@@ -213,10 +213,10 @@
def __proxyarp_hosts_verify(self, hosts = 1,PositiveTest = True):
_,_,hosts_config = self.proxyarp_config(hosts = hosts)
- log.info('\nhosts_config %s and its type %s'%(hosts_config,type(hosts_config)))
+ log_test.info('\nhosts_config %s and its type %s'%(hosts_config,type(hosts_config)))
self.cliEnter()
connected_hosts = json.loads(self.cli.hosts(jsonFormat = True))
- log.info('Discovered hosts: %s' %connected_hosts)
+ log_test.info('Discovered hosts: %s' %connected_hosts)
#We read from cli if we expect less number of routes to avoid cli timeouts
if hosts <= 10000:
assert_equal(len(connected_hosts), hosts)
@@ -243,12 +243,12 @@
for hostip, hostmac in hosts_config:
self.proxyarp_arpreply_verify(ingress,hostip,hostmac,PositiveTest = True)
time.sleep(1)
- log.info('Deactivating proxyarp app and expecting not to get arp reply from ONOS')
+ log_test.info('Deactivating proxyarp app and expecting not to get arp reply from ONOS')
self.proxyarp_activate(deactivate = True)
for hostip, hostmac in hosts_config:
self.proxyarp_arpreply_verify(ingress,hostip,hostmac,PositiveTest = False)
time.sleep(1)
- log.info('activating proxyarp app and expecting to get arp reply from ONOS')
+ log_test.info('activating proxyarp app and expecting to get arp reply from ONOS')
self.proxyarp_activate(deactivate = False)
for hostip, hostmac in hosts_config:
self.proxyarp_arpreply_verify(ingress,hostip,hostmac,PositiveTest = True)
@@ -263,10 +263,10 @@
new_host[2] = str(int(new_host[2])+1)
new_host = '.'.join(new_host)
new_mac = RandMAC()._fix()
- log.info('verifying arp reply for host ip %s on interface %s'%(new_host,self.port_map[ingress]))
+ log_test.info('verifying arp reply for host ip %s on interface %s'%(new_host,self.port_map[ingress]))
res=srp1(Ether(dst='ff:ff:ff:ff:ff:ff')/ARP(op=1,pdst=new_host),timeout=2,iface=self.port_map[ingress])
assert_equal(res, None)
- log.info('arp reply not seen for host ip %s on interface %s as expected'%(new_host,self.port_map[ingress]))
+ log_test.info('arp reply not seen for host ip %s on interface %s as expected'%(new_host,self.port_map[ingress]))
hosts = hosts + 1
_,_,hosts_config = self.proxyarp_config(hosts = hosts)
for host in hosts_config:
@@ -281,7 +281,7 @@
self.proxyarp_arpreply_verify(ingress,hostip,hostmac,PositiveTest = True)
time.sleep(1)
host_mac = hosts_config[0][1]
- log.info('removing host entry %s' % host_mac)
+ log_test.info('removing host entry %s' % host_mac)
self.cliEnter()
hostentries = json.loads(self.cli.hosts(jsonFormat = True))
for host in hostentries:
@@ -316,14 +316,14 @@
ingress,hostmac,hostip = r[0],r[1],r[2]
def mac_recv_task():
def recv_cb(pkt):
- log.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
+ log_test.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
success_dir[current_thread().name] = True
sniff(count=1, timeout=5,lfilter = lambda p: ARP in p and p[ARP].op == 2 and p[ARP].hwsrc == hostmac,
prn = recv_cb, iface = self.port_map[ingress])
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = (Ether(dst = 'ff:ff:ff:ff:ff:ff')/ARP(op=1,pdst= hostip))
- log.info('sending arp request for dest ip %s on interface %s' %
+ log_test.info('sending arp request for dest ip %s on interface %s' %
(hostip,self.port_map[ingress]))
sendp(pkt, count = 10,iface = self.port_map[ingress])
t.join()
@@ -354,14 +354,14 @@
ingress,hostmac,hostip = r[0],r[1],r[2]
def mac_recv_task():
def recv_cb(pkt):
- log.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
+ log_test.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
success_dir[current_thread().name] = True
sniff(count=1, timeout=5,lfilter = lambda p: ARP in p and p[ARP].op == 2 and p[ARP].hwsrc == hostmac,
prn = recv_cb, iface = self.port_map[ingress])
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = (Ether(dst = 'ff:ff:ff:ff:ff:ff')/ARP(op=1,pdst= hostip))
- log.info('sending arp request for dest ip %s on interface %s' %
+ log_test.info('sending arp request for dest ip %s on interface %s' %
(hostip,self.port_map[ingress]))
sendp(pkt, count = 10,iface = self.port_map[ingress])
t.join()
@@ -426,7 +426,7 @@
ingress,hostmac,hostip = r[0],r[1],r[2]
def mac_recv_task():
def recv_cb(pkt):
- log.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
+ log_test.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
success_dir[current_thread().name] = True
replied_hosts.append(hostip)
sniff(count=1, timeout=5,lfilter = lambda p: ARP in p and p[ARP].op == 2 and p[ARP].psrc == hostip,
@@ -434,7 +434,7 @@
t = threading.Thread(target = mac_recv_task)
t.start()
pkt = (Ether(dst = 'ff:ff:ff:ff:ff:ff')/ARP(op=1,pdst= hostip))
- log.info('sending arp request for dest ip %s on interface %s' %
+ log_test.info('sending arp request for dest ip %s on interface %s' %
(hostip,self.port_map[ingress]))
sendp(pkt, count = 10,iface = self.port_map[ingress])
t.join()
diff --git a/src/test/subscriber/subscriberTest.py b/src/test/subscriber/subscriberTest.py
index a79a3a4..c1545e4 100644
--- a/src/test/subscriber/subscriberTest.py
+++ b/src/test/subscriber/subscriberTest.py
@@ -17,7 +17,6 @@
from nose.tools import *
from nose.twistedtools import reactor, deferred
from twisted.internet import defer
-from scapy.all import *
import time, monotonic
import os, sys
import tempfile
@@ -35,6 +34,7 @@
from CordContainer import *
from CordTestServer import cord_test_radius_restart
from CordLogger import CordLogger
+from CordTestUtils import log_test as log
import copy
log.setLevel('INFO')
DEFAULT_NO_CHANNELS = 1
diff --git a/src/test/tls/tlsTest.py b/src/test/tls/tlsTest.py
index f659f0f..6ac5e6b 100644
--- a/src/test/tls/tlsTest.py
+++ b/src/test/tls/tlsTest.py
@@ -22,10 +22,11 @@
from EapTLS import TLSAuthTest
from OnosCtrl import OnosCtrl
from CordLogger import CordLogger
+from CordTestUtils import log_test
from scapy.all import *
from scapy_ssl_tls.ssl_tls import *
from scapy_ssl_tls.ssl_tls_crypto import *
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class eap_auth_exchange(CordLogger):
@@ -90,7 +91,7 @@
def onos_load_config(self, config):
status, code = OnosCtrl.config(config)
if status is False:
- log.info('Configure request for AAA returned status %d' %code)
+ log_test.info('Configure request for AAA returned status %d' %code)
assert_equal(status, True)
time.sleep(3)
@@ -109,7 +110,7 @@
df = defer.Deferred()
def eap_tls_no_cert(df):
def tls_no_cert_cb():
- log.info('TLS authentication failed with no certificate')
+ log_test.info('TLS authentication failed with no certificate')
tls = TLSAuthTest(fail_cb = tls_no_cert_cb, client_cert = '')
tls.runTest()
assert_equal(tls.failTest, True)
@@ -122,7 +123,7 @@
df = defer.Deferred()
def eap_tls_invalid_cert(df):
def tls_invalid_cert_cb():
- log.info('TLS authentication failed with invalid certificate')
+ log_test.info('TLS authentication failed with invalid certificate')
tls = TLSAuthTest(fail_cb = tls_invalid_cert_cb,
client_cert = self.CLIENT_CERT_INVALID)
@@ -149,7 +150,7 @@
df = defer.Deferred()
def eap_tls_invalid_session_id(df):
def tls_invalid_session_id_cb():
- log.info('TLS authentication failed with invalid session id')
+ log_test.info('TLS authentication failed with invalid session id')
tls = TLSAuthTest(fail_cb = tls_invalid_session_id_cb,session_id = 12345, session_id_length = 1)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -162,9 +163,9 @@
df = defer.Deferred()
def eap_tls_invalid_gmt_unix_time(df):
def eap_tls_invalid_gmt_unix_time_cb():
- log.info('TLS authentication failed with invalid gmt_unix_time in Client Hello Packet')
+ log_test.info('TLS authentication failed with invalid gmt_unix_time in Client Hello Packet')
for i in [0,7265,98758,23627238]:
- log.info("\nExecuting test case with gmt_unix_time value is set to %d"%i)
+ log_test.info("\nExecuting test case with gmt_unix_time value is set to %d"%i)
tls = TLSAuthTest(fail_cb = eap_tls_invalid_gmt_unix_time_cb, gmt_unix_time = i)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -177,7 +178,7 @@
df = defer.Deferred()
def eap_tls_invalid_content_type(df):
def tls_invalid_content_type_cb():
- log.info('TLS authentication failed with invalid content type in TLSContentType packet')
+ log_test.info('TLS authentication failed with invalid content type in TLSContentType packet')
tls = TLSAuthTest(fail_cb = tls_invalid_content_type_cb, invalid_content_type = 24)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -190,7 +191,7 @@
df = defer.Deferred()
def eap_tls_invalid_record_fragment_length(df):
def eap_tls_invalid_record_fragment_length_cb():
- log.info('TLS authentication failed with invalid fragment length field in TLSRecord packet')
+ log_test.info('TLS authentication failed with invalid fragment length field in TLSRecord packet')
tls = TLSAuthTest(fail_cb = eap_tls_invalid_record_fragment_length_cb, record_fragment_length = 17384)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -204,7 +205,7 @@
df = defer.Deferred()
def eap_tls_with_invalid_id_in_identifier_response_packet(df):
def tls_with_invalid_id_in_identifier_response_packet_cb():
- log.info('TLS authentication failed with invalid id in identifier packet')
+ log_test.info('TLS authentication failed with invalid id in identifier packet')
tls = TLSAuthTest(fail_cb = tls_with_invalid_id_in_identifier_response_packet_cb,
id_mismatch_in_identifier_response_packet = True)
tls.runTest()
@@ -219,7 +220,7 @@
df = defer.Deferred()
def eap_tls_with_invalid_id_in_client_hello_packet(df):
def tls_with_invalid_id_in_client_hello_packet_cb():
- log.info('TLS authentication failed with invalid id in client hello packet')
+ log_test.info('TLS authentication failed with invalid id in client hello packet')
tls = TLSAuthTest(fail_cb = tls_with_invalid_id_in_client_hello_packet_cb,
id_mismatch_in_client_hello_packet = True)
tls.runTest()
@@ -233,7 +234,7 @@
df = defer.Deferred()
def eap_tls_without_sending_client_hello(df):
def tls_without_sending_client_hello_cb():
- log.info('TLS authentication failed with not sending client hello')
+ log_test.info('TLS authentication failed with not sending client hello')
tls = TLSAuthTest(fail_cb = tls_without_sending_client_hello_cb,
dont_send_client_hello = True)
tls.runTest()
@@ -247,7 +248,7 @@
df = defer.Deferred()
def eap_tls_aaa_app_deactivate(df):
def tls_aaa_app_deactivate_cb():
- log.info('TLS authentication failed with aaa app deactivated in ONOS')
+ log_test.info('TLS authentication failed with aaa app deactivated in ONOS')
tls = TLSAuthTest(fail_cb = tls_aaa_app_deactivate_cb)
self.onos_ctrl.deactivate()
tls.runTest()
@@ -263,7 +264,7 @@
df = defer.Deferred()
def eap_tls_incorrect_cipher_suite_length_field(df):
def tls_incorrect_cipher_suite_length_field_cb():
- log.info('TLS authentication failed with incorrect cipher suite length field in client hello packet')
+ log_test.info('TLS authentication failed with incorrect cipher suite length field in client hello packet')
tls = TLSAuthTest(fail_cb = tls_incorrect_cipher_suite_length_field_cb, cipher_suites_length = 0)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -277,7 +278,7 @@
df = defer.Deferred()
def eap_tls_incorrect_compression_methods_length_field(df):
def tls_incorrect_compression_methods_length_field_cb():
- log.info('TLS authentication failed with incorrect compression methods length field in client hello packet')
+ log_test.info('TLS authentication failed with incorrect compression methods length field in client hello packet')
tls = TLSAuthTest(fail_cb = tls_incorrect_compression_methods_length_field_cb, compression_methods_length=1,compression_methods=TLSCompressionMethod.LZS)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -291,7 +292,7 @@
df = defer.Deferred()
def eap_tls_invalid_source_mac_broadcast(df):
def tls_invalid_source_mac_broadcast_cb():
- log.info('TLS authentication failed with invalid source mac as broadcast in EAPOL packet')
+ log_test.info('TLS authentication failed with invalid source mac as broadcast in EAPOL packet')
tls = TLSAuthTest(fail_cb = tls_invalid_source_mac_broadcast_cb, src_mac='bcast')
tls.runTest()
assert_equal(tls.failTest, True)
@@ -305,7 +306,7 @@
df = defer.Deferred()
def eap_tls_invalid_source_mac_multicast(df):
def tls_invalid_source_mac_multicast_cb():
- log.info('TLS authentication failed with invalid source mac as multicast in EAPOL packet')
+ log_test.info('TLS authentication failed with invalid source mac as multicast in EAPOL packet')
tls = TLSAuthTest(fail_cb = tls_invalid_source_mac_multicast_cb, src_mac='mcast')
tls.runTest()
assert_equal(tls.failTest, True)
@@ -319,7 +320,7 @@
df = defer.Deferred()
def eap_tls_invalid_source_mac_zero(df):
def tls_invalid_source_mac_zero_cb():
- log.info('TLS authentication failed with invalid source mac as zero in EAPOL packet')
+ log_test.info('TLS authentication failed with invalid source mac as zero in EAPOL packet')
tls = TLSAuthTest(fail_cb = tls_invalid_source_mac_zero_cb, src_mac='zeros')
tls.runTest()
assert_equal(tls.failTest, True)
@@ -333,7 +334,7 @@
df = defer.Deferred()
def eap_tls_restart_radius_server(df):
def tls_restart_radius_server_cb():
- log.info('TLS authentication failed with radius server down in middle of authentication process')
+ log_test.info('TLS authentication failed with radius server down in middle of authentication process')
tls = TLSAuthTest(fail_cb = tls_restart_radius_server_cb, restart_radius=True)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -346,7 +347,7 @@
df = defer.Deferred()
def eap_tls_incorrect_handshake_type_client_hello(df):
def tls_incorrect_handshake_type_client_hello_cb():
- log.info('TLS authentication failed with incorrect handshake type in client hello packet')
+ log_test.info('TLS authentication failed with incorrect handshake type in client hello packet')
tls = TLSAuthTest(fail_cb = tls_incorrect_handshake_type_client_hello_cb, invalid_client_hello_handshake_type=True)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -360,7 +361,7 @@
df = defer.Deferred()
def eap_tls_incorrect_handshake_type_certificate_request(df):
def tls_incorrect_handshake_type_certificate_request_cb():
- log.info('TLS authentication failed with incorrect handshake type in client certificate request packet')
+ log_test.info('TLS authentication failed with incorrect handshake type in client certificate request packet')
tls = TLSAuthTest(fail_cb = tls_incorrect_handshake_type_certificate_request_cb, invalid_cert_req_handshake=True)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -374,7 +375,7 @@
df = defer.Deferred()
def eap_tls_incorrect_tlsrecord_certificate_request(df):
def tls_incorrect_tlsrecord_certificate_request_cb():
- log.info('TLS authentication failed with incorrect tlsrecord type in certificate request packet')
+ log_test.info('TLS authentication failed with incorrect tlsrecord type in certificate request packet')
tls = TLSAuthTest(fail_cb = tls_incorrect_tlsrecord_certificate_request_cb, incorrect_tlsrecord_type_cert_req=True)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -388,7 +389,7 @@
df = defer.Deferred()
def eap_tls_invalid_handshake_length_client_hello(df):
def tls_invalid_handshake_length_client_hello_cb():
- log.info('TLS authentication failed with invalid handshake length in client hello packet')
+ log_test.info('TLS authentication failed with invalid handshake length in client hello packet')
tls = TLSAuthTest(fail_cb = tls_invalid_handshake_length_client_hello_cb, invalid_client_hello_handshake_length=True)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -401,7 +402,7 @@
df = defer.Deferred()
def eap_tls_clientkeyex_replace_with_serverkeyex(df):
def tls_clientkeyex_replace_with_serverkeyex_cb():
- log.info('TLS authentication failed with client key exchange replaced with server key exchange')
+ log_test.info('TLS authentication failed with client key exchange replaced with server key exchange')
tls = TLSAuthTest(fail_cb = tls_clientkeyex_replace_with_serverkeyex_cb,clientkeyex_replace_with_serverkeyex=True)
tls.runTest()
assert_equal(tls.failTest, True)
@@ -417,7 +418,7 @@
for i in xrange(1000):
tls = TLSAuthTest(src_mac = 'random')
tls.runTest()
- log.info('Authentication successfull for user %d'%i)
+ log_test.info('Authentication successfull for user %d'%i)
df.callback(0)
reactor.callLater(0, eap_tls_1k_with_diff_mac, df)
return df
@@ -430,7 +431,7 @@
for i in xrange(5000):
tls = TLSAuthTest(src_mac = 'random')
tls.runTest()
- log.info('Authentication successfull for user %d'%i)
+ log_test.info('Authentication successfull for user %d'%i)
df.callback(0)
reactor.callLater(0, eap_tls_5k_with_diff_mac, df)
return df
diff --git a/src/test/utils/ACL.py b/src/test/utils/ACL.py
index ecb159e..d54692f 100644
--- a/src/test/utils/ACL.py
+++ b/src/test/utils/ACL.py
@@ -19,10 +19,10 @@
import logging
logging.getLogger('scapy.runtime').setLevel(logging.ERROR)
from scapy.all import *
-from CordTestUtils import get_mac, get_controller
+from CordTestUtils import get_mac, get_controller, log_test
from OnosCtrl import OnosCtrl
from OnosFlowCtrl import OnosFlowCtrl
-log.setLevel('INFO')
+log_test.setLevel('INFO')
conf.verb = 0 # Disable Scapy verbosity
conf.checkIPaddr = 0 # Don't check response packets for matching destination IPs
@@ -71,7 +71,7 @@
resp = requests.post(self.add_acl_rule_url, auth = self.auth, data = json_data)
else:
add_acl_rule_url = 'http://%s:8181/onos/v1/acl/rules' %(controller)
- log.info('add_acl_rule_acl url is %s'%add_acl_rule_url)
+ log_test.info('add_acl_rule_acl url is %s'%add_acl_rule_url)
resp = requests.post(add_acl_rule_url, auth = self.auth, data = json_data)
return resp.ok, resp.status_code
@@ -81,7 +81,7 @@
resp = requests.get(self.add_acl_rule_url, auth = self.auth)
else:
add_acl_rule_url = 'http://%s:8181/onos/v1/acl/rules' %(controller)
- log.info('get_acl_rule_url is %s'%add_acl_rule_url)
+ log_test.info('get_acl_rule_url is %s'%add_acl_rule_url)
resp = requests.get(add_acl_rule_url, auth = self.auth)
return resp
@@ -98,7 +98,7 @@
remove_acl_rule_url = 'http://%s:8181/onos/v1/acl/rules/%s' %(cls.controller, id)
else:
remove_acl_rule_url = 'http://%s:8181/onos/v1/acl/rules/%s' %(controller, id)
- log.info('remove_acl_rule_url is %s'%remove_acl_rule_url)
+ log_test.info('remove_acl_rule_url is %s'%remove_acl_rule_url)
resp = requests.delete(remove_acl_rule_url, auth = cls.auth)
return resp.ok, resp.status_code
diff --git a/src/test/utils/Channels.py b/src/test/utils/Channels.py
index 8266c7e..84d4921 100644
--- a/src/test/utils/Channels.py
+++ b/src/test/utils/Channels.py
@@ -25,8 +25,9 @@
from McastTraffic import *
from IGMP import *
from OnosCtrl import OnosCtrl
+from CordTestUtils import log_test
from nose.tools import *
-log.setLevel('DEBUG')
+log_test.setLevel('DEBUG')
conf.verb = 0
@@ -85,7 +86,7 @@
def onos_load_config(self, config):
status, code = OnosCtrl.config(config,controller=self.controller)
if status is False:
- log.info('JSON config request returned status %d' %code)
+ log_test.info('JSON config request returned status %d' %code)
time.sleep(2)
def ssm_table_load(self, groups):
@@ -144,7 +145,7 @@
for i in range(start, end):
if i&255:
g = '%s.%s.%s.%s' %((i>>24) &0xff, (i>>16)&0xff, (i>>8)&0xff, i&0xff)
- log.debug('Adding group %s' %g)
+ log_test.debug('Adding group %s' %g)
group_addrs.append(g)
count += 1
start = end
@@ -235,10 +236,10 @@
def recv_cb(self, pkt):
'''Default channel receive callback'''
- log.debug('Received packet from source %s, destination %s' %(pkt[IP].src, pkt[IP].dst))
+ log_test.debug('Received packet from source %s, destination %s' %(pkt[IP].src, pkt[IP].dst))
send_time = float(pkt[IP].payload.load)
recv_time = monotonic.monotonic()
- log.debug('Packet received in %.3f usecs' %(recv_time - send_time))
+ log_test.debug('Packet received in %.3f usecs' %(recv_time - send_time))
def recv(self, chan, cb = None, count = 1, timeout = 5):
if chan is None:
diff --git a/src/test/utils/Cluster.py b/src/test/utils/Cluster.py
index 31b6bbb..5e248ec 100644
--- a/src/test/utils/Cluster.py
+++ b/src/test/utils/Cluster.py
@@ -7,7 +7,7 @@
from Channels import Channels, IgmpChannel
from subscriberDb import SubscriberDB
import time, monotonic
-from CordTestUtils import get_mac
+from CordTestUtils import get_mac, log_test
from OltConfig import OltConfig
from OnosCtrl import OnosCtrl
from OnosFlowCtrl import OnosFlowCtrl
@@ -35,7 +35,7 @@
import random
import collections
import requests
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class cluster_igmp(object):
V_INF1 = 'veth0'
V_INF2 = 'veth1'
@@ -84,10 +84,10 @@
def tearDown(self): pass
def onos_load_config(self, config,controller=None):
- log.info('onos load config is %s'%config)
+ log_test.info('onos load config is %s'%config)
status, code = OnosCtrl(self.app).config(config,controller=controller)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
time.sleep(2)
@@ -203,9 +203,9 @@
rx_stats = recvState.group_map[g][1]
rx = rx_stats.count
assert_greater(rx, 0)
- log.info('Receive stats %s for group %s' %(rx_stats, g))
+ log_test.info('Receive stats %s for group %s' %(rx_stats, g))
- log.info('IGMP test verification success')
+ log_test.info('IGMP test verification success')
def igmp_verify_leave(self, igmpStateList, leave_groups):
sendState, recvState = igmpStateList[0], igmpStateList[1]
@@ -217,12 +217,12 @@
rx = rx_stats.count
assert_greater(tx, 0)
if g not in leave_groups:
- log.info('Received %d packets for group %s' %(rx, g))
+ log_test.info('Received %d packets for group %s' %(rx, g))
for g in leave_groups:
rx = recvState.group_map[g][1].count
assert_equal(rx, 0)
- log.info('IGMP test verification success')
+ log_test.info('IGMP test verification success')
def mcast_traffic_timer(self):
self.mcastTraffic.stopReceives()
@@ -239,9 +239,9 @@
send_time = float(p.payload.load)
recv_time = monotonic.monotonic()
except:
- log.info('Unexpected Payload received: %s' %p.payload.load)
+ log_test.info('Unexpected Payload received: %s' %p.payload.load)
return 0
- #log.info( 'Recv in %.6f secs' %(recv_time - send_time))
+ #log_test.info( 'Recv in %.6f secs' %(recv_time - send_time))
igmpState.update(p.dst, rx = 1, t = recv_time - send_time)
return 0
@@ -260,7 +260,7 @@
pkt = ip_pkt/igmp
IGMPv3.fixup(pkt)
sendp(pkt, iface=iface)
- log.info('igmp join packet is %s'%pkt.show())
+ log_test.info('igmp join packet is %s'%pkt.show())
if delay != 0:
time.sleep(delay)
@@ -301,7 +301,7 @@
self.onos_aaa_config(controller=controller)
def onos_aaa_config(self,controller=None):
- log.info('controller in onos_aaa_config is %s'%controller)
+ log_test.info('controller in onos_aaa_config is %s'%controller)
aaa_dict = {'apps' : { 'org.opencord.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password',
'radiusIp': '172.17.0.2' } } } }
radius_ip = os.getenv('ONOS_AAA_IP') or '172.17.0.2'
@@ -311,11 +311,11 @@
self.onos_load_config(aaa_dict,controller=controller)
def onos_load_config(self, config,controller=None):
- log.info('controller in onos_load_config is %s'%controller)
- log.info('onos load config is %s'%config)
+ log_test.info('controller in onos_load_config is %s'%controller)
+ log_test.info('onos load config is %s'%config)
status, code = OnosCtrl(self.eap_app).config(config,controller=controller)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
time.sleep(2)
@@ -503,7 +503,7 @@
for host in host_config:
status, code = OnosCtrl(cls.app).host_config(host,onos_ip=controller)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
@classmethod
@@ -570,18 +570,18 @@
return proxyarp_configs
def proxyarp_arpreply_verify(self, ingress, hostip, hostmac, PositiveTest=True):
- #log.info('verifying arp reply for host ip %s host mac %s on interface %s'%(hostip ,hostmac ,self.port_map[ingress]))
+ #log_test.info('verifying arp reply for host ip %s host mac %s on interface %s'%(hostip ,hostmac ,self.port_map[ingress]))
self.success = False
def recv_task():
def recv_cb(pkt):
- log.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
+ log_test.info('Arp Reply seen with source Mac is %s' %(pkt[ARP].hwsrc))
self.success = True if PositiveTest == True else False
sniff(count=1, timeout=2, lfilter = lambda p: ARP in p and p[ARP].op == 2 and p[ARP].hwsrc == hostmac,
prn = recv_cb, iface = self.port_map[ingress])
t = threading.Thread(target = recv_task)
t.start()
pkt = (Ether(dst = 'ff:ff:ff:ff:ff:ff')/ARP(op=1,pdst=hostip))
- log.info('sending arp request for dest ip %s on interface %s' %
+ log_test.info('sending arp request for dest ip %s on interface %s' %
(hostip, self.port_map[ingress]))
sendp( pkt, count = 10, iface = self.port_map[ingress])
t.join()
@@ -591,12 +591,12 @@
assert_equal(self.success, False)
def proxyarp_hosts_verify(self, hosts = 1,PositiveTest = True):
- log.info('verifying arp reply for host ip host mac on interface %s'%(self.port_map[2]))
+ log_test.info('verifying arp reply for host ip host mac on interface %s'%(self.port_map[2]))
_,_,hosts_config = self.proxyarp_config(hosts = hosts)
- log.info('\nhosts_config %s and its type %s'%(hosts_config,type(hosts_config)))
+ log_test.info('\nhosts_config %s and its type %s'%(hosts_config,type(hosts_config)))
self.cliEnter()
connected_hosts = json.loads(self.cli.hosts(jsonFormat = True))
- log.info('Discovered hosts: %s' %connected_hosts)
+ log_test.info('Discovered hosts: %s' %connected_hosts)
#We read from cli if we expect less number of routes to avoid cli timeouts
if hosts <= 10000:
assert_equal(len(connected_hosts), hosts)
@@ -694,7 +694,7 @@
def onos_load_config(cls, config,controller=None):
status, code = OnosCtrl.config(config,controller=controller)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
@classmethod
@@ -713,13 +713,13 @@
#iface = cls.port_map[index]
mac = RandMAC()._fix()
#port = num + 1 if num < cls.MAX_PORTS - 1 else cls.MAX_PORTS - 1
- log.info('creating host with ip %s and mac %s'%(host,mac))
+ log_test.info('creating host with ip %s and mac %s'%(host,mac))
hosts_dict[host] = {'mac':mac, 'vlan':'none', 'ipAddresses':[host], 'location':{ 'elementId' : '{}'.format(cls.device_id), 'port': index}}
index += 1
for host in hosts_dict.values():
status, code = OnosCtrl.host_config(host,onos_ip=controller)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
return False
return True
@@ -732,7 +732,7 @@
for host,_ in peer_info:
iface = cls.port_map[index]
index += 1
- log.info('Assigning ip %s to interface %s' %(host, iface))
+ log_test.info('Assigning ip %s to interface %s' %(host, iface))
config_cmds = ( 'ifconfig {} 0'.format(iface),
'ifconfig {0} {1}'.format(iface, host),
'arping -I {0} {1} -c 2'.format(iface, host),
@@ -762,7 +762,7 @@
else:
config = network_cfg
cfg = json.dumps(config)
- log.info('Restarting ONOS with new network configuration %s'%config)
+ log_test.info('Restarting ONOS with new network configuration %s'%config)
#return cord_test_onos_restart(config = config)
with open('{}/network-cfg.json'.format(cls.onos_config_path), 'w') as f:
f.write(cfg)
@@ -770,7 +770,7 @@
@classmethod
def start_quagga(cls, networks = 4, peer_address = None, router_address = None):
- log.info('Restarting Quagga container with configuration for %d networks' %(networks))
+ log_test.info('Restarting Quagga container with configuration for %d networks' %(networks))
config = cls.generate_conf(networks = networks, peer_address = peer_address, router_address = router_address)
if networks <= 10000:
boot_delay = 25
@@ -864,7 +864,7 @@
cls.network_list = network_list
cls.network_mask = network_mask
zebra_routes = '\n'.join(net_list)
- #log.info('Zebra routes: \n:%s\n' %cls.zebra_conf + zebra_routes)
+ #log_test.info('Zebra routes: \n:%s\n' %cls.zebra_conf + zebra_routes)
return cls.zebra_conf + zebra_routes
@classmethod
@@ -897,7 +897,7 @@
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))
+ log_test.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 == dst_ip and p[IP].src == src_ip,
@@ -909,7 +909,7 @@
L2 = Ether(src = src_mac, dst = dst_mac)
L3 = IP(src = src_ip, dst = dst_ip)
pkt = L2/L3
- log.info('Sending a packet with dst ip %s, dst mac %s on port %s to verify if flows are correct' %
+ log_test.info('Sending a packet with dst ip %s, dst mac %s on port %s to verify if flows are correct' %
(dst_ip, dst_mac, self.port_map[egress]))
while self.start_sending is True:
sendp(pkt, count=50, iface = self.port_map[egress])
@@ -959,11 +959,11 @@
self.cliEnter(controller=controller)
##Now verify
hosts = json.loads(self.cli.hosts(jsonFormat = True))
- log.info('Discovered hosts: %s' %hosts)
+ log_test.info('Discovered hosts: %s' %hosts)
##We read from cli if we expect less number of routes to avoid cli timeouts
if networks <= 10000:
routes = json.loads(self.cli.routes(jsonFormat = True))
- #log.info('Routes: %s' %routes)
+ #log_test.info('Routes: %s' %routes)
if start_network is not None:
if start_network.split('/')[1] is 24:
assert_equal(len(routes['routes4']), networks)
@@ -975,7 +975,7 @@
assert_equal(len(routes['routes4']), 0)
flows = json.loads(self.cli.flows(jsonFormat = True))
flows = filter(lambda f: f['flows'], flows)
- #log.info('Flows: %s' %flows)
+ #log_test.info('Flows: %s' %flows)
assert_not_equal(len(flows), 0)
if invalid_peers is None:
self.vrouter_traffic_verify()
@@ -990,11 +990,11 @@
self.vrouter_traffic_verify(positive_test = False)
self.network_list = network_list_backup
if deactivate_activate_vrouter is True:
- log.info('Deactivating vrouter app in ONOS controller for negative scenario')
+ log_test.info('Deactivating vrouter app in ONOS controller for negative scenario')
self.vrouter_activate(deactivate = True)
#routes = json.loads(self.cli.routes(jsonFormat = False, cmd_exist = False))
#assert_equal(len(routes['routes4']), 'Command not found')
- log.info('Activating vrouter app again in ONOS controller for negative scenario')
+ log_test.info('Activating vrouter app again in ONOS controller for negative scenario')
self.vrouter_activate(deactivate = False)
routes = json.loads(self.cli.routes(jsonFormat = True))
assert_equal(len(routes['routes4']), networks)
@@ -1004,7 +1004,7 @@
def vrouter_network_verify_negative(self, networks, peers = 1):
##Stop quagga. Test traffic again to see if flows were removed
- log.info('Stopping Quagga container')
+ log_test.info('Stopping Quagga container')
cord_test_quagga_stop()
if networks <= 10000:
routes = json.loads(self.cli.routes(jsonFormat = True))
@@ -1012,14 +1012,14 @@
if routes and routes.has_key('routes4'):
assert_equal(len(routes['routes4']), 0)
self.vrouter_traffic_verify(positive_test = False)
- log.info('OVS flows have been removed successfully after Quagga was stopped')
+ log_test.info('OVS flows have been removed successfully after Quagga was stopped')
self.start_quagga(networks = networks)
##Verify the flows again after restarting quagga back
if networks <= 10000:
routes = json.loads(self.cli.routes(jsonFormat = True))
assert_equal(len(routes['routes4']), networks)
self.vrouter_traffic_verify()
- log.info('OVS flows have been successfully reinstalled after Quagga was restarted')
+ log_test.info('OVS flows have been successfully reinstalled after Quagga was restarted')
def quagga_shell(self, cmd):
shell_cmds = ('vtysh', '"conf t"', '"{}"'.format(cmd))
@@ -1055,7 +1055,7 @@
if not cls.port_map:
cls.port_map = g_subscriber_port_map
time.sleep(3)
- log.info('port_map = %s'%cls.port_map[1] )
+ log_test.info('port_map = %s'%cls.port_map[1] )
@classmethod
def tearDownClass(cls):
@@ -1069,12 +1069,12 @@
assert_equal(status, True)
time.sleep(1)
#status, _ = ACLTest.remove_acl_rule()
- #log.info('Start setup')
+ #log_test.info('Start setup')
#assert_equal(status, True)
def tearDown(self):
'''Deactivate the acl app'''
- log.info('Tear down setup')
+ log_test.info('Tear down setup')
self.CURRENT_PORT_NUM = 4
def cliEnter(self):
@@ -1098,7 +1098,7 @@
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))
+ log_test.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),
@@ -1140,7 +1140,7 @@
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))
+ log_test.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],
@@ -1152,7 +1152,7 @@
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' %
+ log_test.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)
@@ -1163,7 +1163,7 @@
def onos_load_config(cls, config,controller=None):
status, code = OnosCtrl.config(config,controller=controller)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
class cluster_dhcprelay(object):
@@ -1205,7 +1205,7 @@
@classmethod
def setUpClass(cls,controller=None):
- log.info('controller ip in dhcp setup def is %s'%controller)
+ log_test.info('controller ip in dhcp setup def is %s'%controller)
''' Activate the dhcprelay app'''
OnosCtrl(cls.app_dhcp,controller=controller).deactivate()
time.sleep(3)
@@ -1268,15 +1268,15 @@
def dhcp_relay_cleanup(cls):
##reset the ONOS port configuration back to default
if cls.onos_restartable is True:
- log.info('Cleaning up dhcp relay config by restarting ONOS with default network cfg')
+ log_test.info('Cleaning up dhcp relay config by restarting ONOS with default network cfg')
return cord_test_onos_restart(config = {})
@classmethod
def onos_load_config(cls, config,controller=None):
- log.info('loading onos config in controller %s'%controller)
+ log_test.info('loading onos config in controller %s'%controller)
status, code = OnosCtrl.config(config,controller=controller)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
time.sleep(2)
@@ -1377,7 +1377,7 @@
intf_str = ','.join(intf_list)
dhcpd_cmd = '/usr/sbin/dhcpd -4 --no-pid -cf {0} -lf {1} {2}'.format(conf_file, lease_file, intf_str)
- log.info('Starting DHCPD server with command: %s' %dhcpd_cmd)
+ log_test.info('Starting DHCPD server with command: %s' %dhcpd_cmd)
ret = os.system(dhcpd_cmd)
assert_equal(ret, 0)
time.sleep(3)
@@ -1428,7 +1428,7 @@
if only_discover:
cip, sip, mac, _ = self.dhcp.only_discover(multiple = True)
- log.info('Got dhcp client IP %s from server %s for mac %s' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s' %
(cip, sip, mac))
else:
cip, sip = self.send_recv(mac, update_seed = True, validate = False)
@@ -1437,7 +1437,7 @@
self.ip_count +=1
elif cip == None:
self.failure_count += 1
- log.info('Failed to get ip')
+ log_test.info('Failed to get ip')
if success_rate and self.ip_count > 0:
break
@@ -1454,7 +1454,7 @@
if validate:
assert_not_equal(cip, None)
assert_not_equal(sip, None)
- log.info('Got dhcp client IP %s from server %s for mac %s' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s' %
(cip, sip, self.dhcp.get_mac(cip)[0]))
return cip,sip
@@ -1482,7 +1482,7 @@
except:
self.tx_intf = self.port_map[self.PORT_TX_DEFAULT]
self.rx_intf = self.port_map[self.PORT_RX_DEFAULT]
- log.info('Subscriber %s, rx interface %s, uplink interface %s' %(name, self.rx_intf, self.tx_intf))
+ log_test.info('Subscriber %s, rx interface %s, uplink interface %s' %(name, self.rx_intf, self.tx_intf))
Channels.__init__(self, num, channel_start = channel_start,
iface = self.rx_intf, iface_mcast = self.tx_intf, mcast_cb = mcast_cb)
self.name = name
@@ -1551,20 +1551,20 @@
if self.join_map.has_key(c):
self.join_map[c][stats_type].update(packets = packets, t = t)
def channel_receive(self, chan, cb = None, count = 1, timeout = 5):
- log.info('Subscriber %s on port %s receiving from group %s, channel %d' %
+ log_test.info('Subscriber %s on port %s receiving from group %s, channel %d' %
(self.name, self.rx_intf, self.gaddr(chan), chan))
r = self.recv(chan, cb = cb, count = count, timeout = timeout)
if len(r) == 0:
- log.info('Subscriber %s on port %s timed out' %(self.name, self.rx_intf))
+ log_test.info('Subscriber %s on port %s timed out' %(self.name, self.rx_intf))
else:
- log.info('Subscriber %s on port %s received %d packets' %(self.name, self.rx_intf, len(r)))
+ log_test.info('Subscriber %s on port %s received %d packets' %(self.name, self.rx_intf, len(r)))
if self.recv_timeout:
##Negative test case is disabled for now
assert_equal(len(r), 0)
def recv_channel_cb(self, pkt):
##First verify that we have received the packet for the joined instance
- log.info('Packet received for group %s, subscriber %s, port %s' %
+ log_test.info('Packet received for group %s, subscriber %s, port %s' %
(pkt[IP].dst, self.name, self.rx_intf))
if self.recv_timeout:
return
@@ -1575,7 +1575,7 @@
delta = recv_time - join_time
self.join_rx_stats.update(packets=1, t = delta, usecs = True)
self.channel_update(chan, self.STATS_RX, 1, t = delta)
- log.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
+ log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
class subscriber_pool:
@@ -1590,9 +1590,9 @@
if self.test_status is not True:
## This is chaning for other sub status has to check again
self.test_status = True
- log.info('This service is failed and other services will not run for this subscriber')
+ log_test.info('This service is failed and other services will not run for this subscriber')
break
- log.info('This Subscriber is tested for multiple service eligibility ')
+ log_test.info('This Subscriber is tested for multiple service eligibility ')
self.test_status = True
class cluster_subscriber(object):
@@ -1690,7 +1690,7 @@
@classmethod
def setUpClass(cls,controller=None):
- log.info('controller ip in cluster.py setupclass is %s'%controller)
+ log_test.info('controller ip in cluster.py setupclass is %s'%controller)
'''Load the OLT config and activate relevant apps'''
did = cls.load_device_id()
network_cfg = { "devices" : {
@@ -1706,7 +1706,7 @@
cls.start_onos(network_cfg = network_cfg)
#status, code = OnosCtrl.config(network_cfg)
#if status is False:
- # log.info('JSON config request for app %s returned status %d' %(app, code))
+ # log_test.info('JSON config request for app %s returned status %d' %(app, code))
#assert_equal(status, True)
#time.sleep(2)
cls.install_app_table(controller=controller)
@@ -1737,7 +1737,7 @@
##Uninstall the existing app if any
OnosCtrl.uninstall_app(cls.table_app,onos_ip=controller)
time.sleep(2)
- log.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file))
+ log_test.info('Installing the multi table app %s for subscriber test' %(cls.table_app_file))
OnosCtrl.install_app(cls.table_app_file,onos_ip=controller)
time.sleep(3)
#onos_ctrl = OnosCtrl(cls.vtn_app)
@@ -1748,7 +1748,7 @@
##Uninstall the table app on class exit
OnosCtrl.uninstall_app(cls.table_app,onos_ip=controller)
time.sleep(2)
- log.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file))
+ log_test.info('Installing back the cord igmp app %s for subscriber test on exit' %(cls.app_file))
OnosCtrl.install_app(cls.app_file,onos_ip=controller)
#onos_ctrl = OnosCtrl(cls.vtn_app)
#onos_ctrl.activate()
@@ -1756,7 +1756,7 @@
@classmethod
def start_onos(cls, network_cfg = None):
if cls.onos_restartable is False:
- log.info('ONOS restart is disabled. Skipping ONOS restart')
+ log_test.info('ONOS restart is disabled. Skipping ONOS restart')
return
if network_cfg is None:
network_cfg = cls.device_dict
@@ -1768,7 +1768,7 @@
config = dict(res)
else:
config = network_cfg
- log.info('Restarting ONOS with new network configuration')
+ log_test.info('Restarting ONOS with new network configuration')
#return cord_test_onos_restart(config = config)
@classmethod
@@ -1805,7 +1805,7 @@
except: pass
def onos_aaa_load(self,controller=None):
- log.info('controller ip in cluster.py onos_aaa_load is %s'%controller)
+ log_test.info('controller ip in cluster.py onos_aaa_load is %s'%controller)
if self.aaa_loaded:
return
aaa_dict = {'apps' : { 'org.opencord.aaa' : { 'AAA' : { 'radiusSecret': 'radius_password',
@@ -1816,7 +1816,7 @@
self.aaa_loaded = True
def onos_dhcp_table_load(self, config = None,controller=None):
- log.info('controller ip in cluster.py onos_dhcp_table_load is %s'%controller)
+ log_test.info('controller ip in cluster.py onos_dhcp_table_load is %s'%controller)
dhcp_dict = {'apps' : { 'org.onosproject.dhcp' : { 'dhcp' : copy.copy(self.dhcp_server_config) } } }
dhcp_config = dhcp_dict['apps']['org.onosproject.dhcp']['dhcp']
if config:
@@ -1826,17 +1826,17 @@
self.onos_load_config('org.onosproject.dhcp', dhcp_dict,controller=controller)
def onos_load_config(self, app, config,controller=None):
- log.info('controller ip in cluster.py onos_load_config is %s'%controller)
+ log_test.info('controller ip in cluster.py onos_load_config is %s'%controller)
status, code = OnosCtrl(controller=controller).config(config)
if status is False:
- log.info('JSON config request for app %s returned status %d' %(app, code))
+ log_test.info('JSON config request for app %s returned status %d' %(app, code))
assert_equal(status, True)
time.sleep(2)
def dhcp_sndrcv(self, dhcp, update_seed = False):
cip, sip = dhcp.discover(update_seed = update_seed)
assert_not_equal(cip, None)
assert_not_equal(sip, None)
- log.info('Got dhcp client IP %s from server %s for mac %s' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s' %
(cip, sip, dhcp.get_mac(cip)[0]))
return cip,sip
@@ -1858,7 +1858,7 @@
delta = recv_time - join_time
self.subscriber.join_rx_stats.update(packets=1, t = delta, usecs = True)
self.subscriber.channel_update(chan, self.subscriber.STATS_RX, 1, t = delta)
- log.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
+ log_test.debug('Packet received in %.3f usecs for group %s after join' %(delta, pkt[IP].dst))
self.test_status = True
def traffic_verify(self, subscriber):
@@ -1867,10 +1867,10 @@
resp = requests.get(url)
self.test_status = resp.ok
if resp.ok == False:
- log.info('Subscriber %s failed get from url %s with status code %d'
+ log_test.info('Subscriber %s failed get from url %s with status code %d'
%(subscriber.name, url, resp.status_code))
else:
- log.info('GET request from %s succeeded for subscriber %s'
+ log_test.info('GET request from %s succeeded for subscriber %s'
%(url, subscriber.name))
return self.test_status
@@ -1878,7 +1878,7 @@
if subscriber.has_service('TLS'):
time.sleep(2)
tls = TLSAuthTest(intf = subscriber.rx_intf)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
tls.runTest()
self.test_status = True
return self.test_status
@@ -1888,7 +1888,7 @@
def dhcp_verify(self, subscriber):
if subscriber.has_service('DHCP'):
cip, sip = self.dhcp_request(subscriber, update_seed = True)
- log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
+ log_test.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
subscriber.src_list = [cip]
self.test_status = True
return self.test_status
@@ -1900,7 +1900,7 @@
def dhcp_jump_verify(self, subscriber):
if subscriber.has_service('DHCP'):
cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.200.1')
- log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
+ log_test.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
subscriber.src_list = [cip]
self.test_status = True
return self.test_status
@@ -1912,7 +1912,7 @@
def dhcp_next_verify(self, subscriber):
if subscriber.has_service('DHCP'):
cip, sip = self.dhcp_request(subscriber, seed_ip = '10.10.150.1')
- log.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
+ log_test.info('Subscriber %s got client ip %s from server %s' %(subscriber.name, cip, sip))
subscriber.src_list = [cip]
self.test_status = True
return self.test_status
@@ -1930,20 +1930,20 @@
self.num_joins += 1
while self.num_joins < self.num_subscribers:
time.sleep(5)
- log.info('All subscribers have joined the channel')
+ log_test.info('All subscribers have joined the channel')
for i in range(10):
subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10)
- log.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name))
+ log_test.info('Leaving channel %d for subscriber %s' %(chan, subscriber.name))
subscriber.channel_leave(chan)
time.sleep(5)
- log.info('Interface %s Join RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name,subscriber.join_rx_stats))
+ log_test.info('Interface %s Join RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name,subscriber.join_rx_stats))
#Should not receive packets for this subscriber
self.recv_timeout = True
subscriber.recv_timeout = True
subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 10)
subscriber.recv_timeout = False
self.recv_timeout = False
- log.info('Joining channel %d for subscriber %s' %(chan, subscriber.name))
+ log_test.info('Joining channel %d for subscriber %s' %(chan, subscriber.name))
subscriber.channel_join(chan, delay = 0)
self.test_status = True
return self.test_status
@@ -1951,12 +1951,12 @@
def igmp_jump_verify(self, subscriber):
if subscriber.has_service('IGMP'):
for i in xrange(subscriber.num):
- log.info('Subscriber %s jumping channel' %subscriber.name)
+ log_test.info('Subscriber %s jumping channel' %subscriber.name)
chan = subscriber.channel_jump(delay=0)
subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count = 1)
- log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
+ log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
time.sleep(3)
- log.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
+ log_test.info('Interface %s Jump RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
self.test_status = True
return self.test_status
def igmp_next_verify(self, subscriber):
@@ -1966,11 +1966,11 @@
chan = subscriber.channel_join_next(delay=0)
else:
chan = subscriber.channel_join(i, delay=0)
- log.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name))
+ log_test.info('Joined next channel %d for subscriber %s' %(chan, subscriber.name))
subscriber.channel_receive(chan, cb = subscriber.recv_channel_cb, count=1)
- log.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
+ log_test.info('Verified receive for channel %d, subscriber %s' %(chan, subscriber.name))
time.sleep(3)
- log.info('Interface %s Join Next RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
+ log_test.info('Interface %s Join Next RX stats for subscriber %s, %s' %(subscriber.iface, subscriber.name, subscriber.join_rx_stats))
self.test_status = True
return self.test_status
@@ -2007,7 +2007,7 @@
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 = [], negative_subscriber_auth = None,controller=None):
- log.info('controller ip in cluster.py subscriber_join_verify is %s'%controller)
+ log_test.info('controller ip in cluster.py subscriber_join_verify is %s'%controller)
self.test_status = False
self.ovs_cleanup()
subscribers_count = num_subscribers
@@ -2043,7 +2043,7 @@
def tls_invalid_cert(self, subscriber):
if subscriber.has_service('TLS'):
time.sleep(2)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
tls = TLSAuthTest(client_cert = self.CLIENT_CERT_INVALID)
tls.runTest()
if tls.failTest == True:
@@ -2056,7 +2056,7 @@
def tls_no_cert(self, subscriber):
if subscriber.has_service('TLS'):
time.sleep(2)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
tls = TLSAuthTest(client_cert = '')
tls.runTest()
if tls.failTest == True:
@@ -2069,7 +2069,7 @@
def tls_self_signed_cert(self, subscriber):
if subscriber.has_service('TLS'):
time.sleep(2)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
tls = TLSAuthTest(client_cert = self.CLIENT_CERT)
tls.runTest()
if tls.failTest == False:
@@ -2082,7 +2082,7 @@
def tls_non_ca_authrized_cert(self, subscriber):
if subscriber.has_service('TLS'):
time.sleep(2)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
tls = TLSAuthTest(client_cert = self.CLIENT_CERT_NON_CA_AUTHORIZED)
tls.runTest()
if tls.failTest == False:
@@ -2094,7 +2094,7 @@
def tls_Nsubscribers_use_same_valid_cert(self, subscriber):
if subscriber.has_service('TLS'):
time.sleep(2)
- log.info('Running subscriber %s tls auth test' %subscriber.name)
+ log_test.info('Running subscriber %s tls auth test' %subscriber.name)
num_users = 3
for i in xrange(num_users):
tls = TLSAuthTest(intf = 'veth{}'.format(i*2))
@@ -2109,7 +2109,7 @@
def dhcp_discover_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
t1 = self.subscriber_dhcp_1release()
self.test_status = True
return self.test_status
@@ -2125,18 +2125,18 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '10.10.100.10', iface = iface)
cip, sip = self.send_recv()
- log.info('Releasing ip %s to server %s' %(cip, sip))
+ log_test.info('Releasing ip %s to server %s' %(cip, sip))
assert_equal(self.dhcp.release(cip), True)
- log.info('Triggering DHCP discover again after release')
+ log_test.info('Triggering DHCP discover again after release')
cip2, sip2 = self.send_recv(update_seed = True)
- log.info('Verifying released IP was given back on rediscover')
+ log_test.info('Verifying released IP was given back on rediscover')
assert_equal(cip, cip2)
- log.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
+ log_test.info('Test done. Releasing ip %s to server %s' %(cip2, sip2))
assert_equal(self.dhcp.release(cip2), True)
def dhcp_client_reboot_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_client_request_after_reboot()
self.test_status = True
return self.test_status
@@ -2154,38 +2154,38 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
else:
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip == None:
- log.info("Got DHCP server NAK.")
+ log_test.info("Got DHCP server NAK.")
os.system('ifconfig '+iface+' down')
- log.info('Client goes down.')
- log.info('Delay for 5 seconds.')
+ log_test.info('Client goes down.')
+ log_test.info('Delay for 5 seconds.')
time.sleep(5)
os.system('ifconfig '+iface+' up')
- log.info('Client is up now.')
+ log_test.info('Client is up now.')
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip == None:
- log.info("Got DHCP server NAK.")
+ log_test.info("Got DHCP server NAK.")
assert_not_equal(new_cip, None)
elif new_cip != None:
- log.info("Got DHCP ACK.")
+ log_test.info("Got DHCP ACK.")
def dhcp_client_renew_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_client_renew_time()
self.test_status = True
return self.test_status
@@ -2201,34 +2201,34 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac , lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
elif cip and sip and mac:
- log.info("Triggering DHCP Request.")
+ log_test.info("Triggering DHCP Request.")
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, renew_time = True)
if new_cip and new_sip and lval:
- log.info("Client 's Renewal time is :%s",lval)
- log.info("Generating delay till renewal time.")
+ log_test.info("Client 's Renewal time is :%s",lval)
+ log_test.info("Generating delay till renewal time.")
time.sleep(lval)
- log.info("Client Sending Unicast DHCP request.")
+ log_test.info("Client Sending Unicast DHCP request.")
latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac, unicast = True)
if latest_cip and latest_sip:
- log.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." %
+ log_test.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." %
(latest_cip, mac, latest_sip) )
elif latest_cip == None:
- log.info("Got DHCP NAK. Lease not renewed.")
+ log_test.info("Got DHCP NAK. Lease not renewed.")
elif new_cip == None or new_sip == None or lval == None:
- log.info("Got DHCP NAK.")
+ log_test.info("Got DHCP NAK.")
def dhcp_server_reboot_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_server_after_reboot()
self.test_status = True
return self.test_status
@@ -2244,50 +2244,50 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
else:
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip == None:
- log.info("Got DHCP server NAK.")
+ log_test.info("Got DHCP server NAK.")
assert_not_equal(new_cip, None)
- log.info('Getting DHCP server Down.')
+ log_test.info('Getting DHCP server Down.')
onos_ctrl = OnosCtrl(self.dhcp_app)
onos_ctrl.deactivate()
for i in range(0,4):
- log.info("Sending DHCP Request.")
- log.info('')
+ log_test.info("Sending DHCP Request.")
+ log_test.info('')
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip == None and new_sip == None:
- log.info('')
- log.info("DHCP Request timed out.")
+ log_test.info('')
+ log_test.info("DHCP Request timed out.")
elif new_cip and new_sip:
- log.info("Got Reply from DHCP server.")
+ log_test.info("Got Reply from DHCP server.")
assert_equal(new_cip,None) #Neagtive Test Case
- log.info('Getting DHCP server Up.')
+ log_test.info('Getting DHCP server Up.')
# self.activate_apps(self.dhcp_app)
onos_ctrl = OnosCtrl(self.dhcp_app)
status, _ = onos_ctrl.activate()
assert_equal(status, True)
time.sleep(3)
for i in range(0,4):
- log.info("Sending DHCP Request after DHCP server is up.")
- log.info('')
+ log_test.info("Sending DHCP Request after DHCP server is up.")
+ log_test.info('')
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if new_cip == None and new_sip == None:
- log.info('')
- log.info("DHCP Request timed out.")
+ log_test.info('')
+ log_test.info("DHCP Request timed out.")
elif new_cip and new_sip:
- log.info("Got Reply from DHCP server.")
+ log_test.info("Got Reply from DHCP server.")
assert_equal(new_cip,None) #Neagtive Test Case
def dhcp_client_rebind_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_client_rebind_time()
self.test_status = True
return self.test_status
@@ -2303,36 +2303,36 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
elif cip and sip and mac:
- log.info("Triggering DHCP Request.")
+ log_test.info("Triggering DHCP Request.")
new_cip, new_sip, lval = self.dhcp.only_request(cip, mac, rebind_time = True)
if new_cip and new_sip and lval:
- log.info("Client 's Rebind time is :%s",lval)
- log.info("Generating delay till rebind time.")
+ log_test.info("Client 's Rebind time is :%s",lval)
+ log_test.info("Generating delay till rebind time.")
time.sleep(lval)
- log.info("Client Sending broadcast DHCP requests for renewing lease or for getting new ip.")
+ log_test.info("Client Sending broadcast DHCP requests for renewing lease or for getting new ip.")
self.dhcp.after_T2 = True
for i in range(0,4):
latest_cip, latest_sip = self.dhcp.only_request(new_cip, mac)
if latest_cip and latest_sip:
- log.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." %
+ log_test.info("Got DHCP Ack. Lease Renewed for ip %s and mac %s from server %s." %
(latest_cip, mac, latest_sip) )
break
elif latest_cip == None:
- log.info("Got DHCP NAK. Lease not renewed.")
+ log_test.info("Got DHCP NAK. Lease not renewed.")
assert_not_equal(latest_cip, None)
elif new_cip == None or new_sip == None or lval == None:
- log.info("Got DHCP NAK.Lease not Renewed.")
+ log_test.info("Got DHCP NAK.Lease not Renewed.")
def dhcp_starvation_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_starvation()
self.test_status = True
return self.test_status
@@ -2348,11 +2348,11 @@
'subnet': '255.255.255.0', 'broadcast':'182.17.0.255', 'router':'182.17.0.1'}
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '182.17.0.1', iface = iface)
- log.info('Verifying 1 ')
+ log_test.info('Verifying 1 ')
for x in xrange(50):
mac = RandMAC()._fix()
self.send_recv(mac = mac)
- log.info('Verifying 2 ')
+ log_test.info('Verifying 2 ')
cip, sip = self.send_recv(update_seed = True, validate = False)
assert_equal(cip, None)
assert_equal(sip, None)
@@ -2360,7 +2360,7 @@
def dhcp_same_client_multi_discovers_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_same_client_multiple_discover()
self.test_status = True
return self.test_status
@@ -2376,22 +2376,22 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s . Not going to send DHCPREQUEST.' %
(cip, sip, mac) )
- log.info('Triggering DHCP discover again.')
+ log_test.info('Triggering DHCP discover again.')
new_cip, new_sip, new_mac , lval = self.dhcp.only_discover()
if cip == new_cip:
- log.info('Got same ip for 2nd DHCP discover for client IP %s from server %s for mac %s. Triggering DHCP Request. '
+ log_test.info('Got same ip for 2nd DHCP discover for client IP %s from server %s for mac %s. Triggering DHCP Request. '
% (new_cip, new_sip, new_mac) )
elif cip != new_cip:
- log.info('Ip after 1st discover %s' %cip)
- log.info('Map after 2nd discover %s' %new_cip)
+ log_test.info('Ip after 1st discover %s' %cip)
+ log_test.info('Map after 2nd discover %s' %new_cip)
assert_equal(cip, new_cip)
def dhcp_same_client_multi_request_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_same_client_multiple_request()
self.test_status = True
return self.test_status
@@ -2406,16 +2406,16 @@
'subnet': '255.255.255.0', 'broadcast':'10.10.10.255', 'router':'10.10.10.1'}
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '10.10.10.1', iface = iface)
- log.info('Sending DHCP discover and DHCP request.')
+ log_test.info('Sending DHCP discover and DHCP request.')
cip, sip = self.send_recv()
mac = self.dhcp.get_mac(cip)[0]
- log.info("Sending DHCP request again.")
+ log_test.info("Sending DHCP request again.")
new_cip, new_sip = self.dhcp.only_request(cip, mac)
if (new_cip,new_sip) == (cip,sip):
- log.info('Got same ip for 2nd DHCP Request for client IP %s from server %s for mac %s.'
+ log_test.info('Got same ip for 2nd DHCP Request for client IP %s from server %s for mac %s.'
% (new_cip, new_sip, mac) )
elif (new_cip,new_sip):
- log.info('No DHCP ACK')
+ log_test.info('No DHCP ACK')
assert_equal(new_cip, None)
assert_equal(new_sip, None)
else:
@@ -2424,7 +2424,7 @@
def dhcp_client_desired_ip_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_client_desired_address()
self.test_status = True
return self.test_status
@@ -2441,20 +2441,20 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.31', iface = iface)
cip, sip, mac , lval = self.dhcp.only_discover(desired = True)
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
if cip == self.dhcp.seed_ip:
- log.info('Got dhcp client IP %s from server %s for mac %s as desired .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s as desired .' %
(cip, sip, mac) )
elif cip != self.dhcp.seed_ip:
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info('The desired ip was: %s .' % self.dhcp.seed_ip)
+ log_test.info('The desired ip was: %s .' % self.dhcp.seed_ip)
assert_equal(cip, self.dhcp.seed_ip)
def dhcp_client_request_pkt_with_non_offered_ip_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_server_nak_packet()
self.test_status = True
return self.test_status
@@ -2470,22 +2470,22 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover()
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet. Those should not be none, which is expected.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
else:
new_cip, new_sip = self.dhcp.only_request('20.20.20.31', mac)
if new_cip == None:
- log.info("Got DHCP server NAK.")
+ log_test.info("Got DHCP server NAK.")
assert_equal(new_cip, None) #Negative Test Case
def dhcp_client_requested_out_pool_ip_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_client_desired_address_out_of_pool()
self.test_status = True
return self.test_status
@@ -2501,26 +2501,26 @@
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.35', iface = iface)
cip, sip, mac, lval = self.dhcp.only_discover(desired = True)
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
if cip == self.dhcp.seed_ip:
- log.info('Got dhcp client IP %s from server %s for mac %s as desired .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s as desired .' %
(cip, sip, mac) )
assert_equal(cip, self.dhcp.seed_ip) #Negative Test Case
elif cip != self.dhcp.seed_ip:
- log.info('Got dhcp client IP %s from server %s for mac %s .' %
+ log_test.info('Got dhcp client IP %s from server %s for mac %s .' %
(cip, sip, mac) )
- log.info('The desired ip was: %s .' % self.dhcp.seed_ip)
+ log_test.info('The desired ip was: %s .' % self.dhcp.seed_ip)
assert_not_equal(cip, self.dhcp.seed_ip)
elif cip == None:
- log.info('Got DHCP NAK')
+ log_test.info('Got DHCP NAK')
def dhcp_client_specific_lease_scenario(self, subscriber):
if subscriber.has_service('DHCP'):
time.sleep(2)
- log.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
+ log_test.info('Running subscriber %s DHCP rediscover scenario test' %subscriber.name)
tl = self.subscriber_dhcp_specific_lease_packet()
self.test_status = True
return self.test_status
@@ -2535,14 +2535,14 @@
'subnet': '255.255.255.0', 'broadcast':'20.20.20.255', 'router':'20.20.20.1'}
self.onos_dhcp_table_load(config)
self.dhcp = DHCPTest(seed_ip = '20.20.20.45', iface = iface)
- log.info('Sending DHCP discover with lease time of 700')
+ log_test.info('Sending DHCP discover with lease time of 700')
cip, sip, mac, lval = self.dhcp.only_discover(lease_time = True)
- log.info("Verifying Client 's IP and mac in DHCP Offer packet.")
+ log_test.info("Verifying Client 's IP and mac in DHCP Offer packet.")
if (cip == None and mac != None):
- log.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
+ log_test.info("Verified that Client 's IP and mac in DHCP Offer packet are none, which is not expected behavior.")
assert_not_equal(cip, None)
elif lval != 700:
- log.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' %
+ log_test.info('Getting dhcp client IP %s from server %s for mac %s with lease time %s. That is not 700.' %
(cip, sip, mac, lval) )
assert_not_equal(lval, 700)
diff --git a/src/test/utils/CordLogger.py b/src/test/utils/CordLogger.py
index cbebee5..18517b4 100644
--- a/src/test/utils/CordLogger.py
+++ b/src/test/utils/CordLogger.py
@@ -1,7 +1,7 @@
from OnosLog import OnosLog
import logging
logging.getLogger('scapy.runtime').setLevel(logging.ERROR)
-from scapy.all import log
+from CordTestUtils import log_test as log
from onosclidriver import OnosCliDriver
from OnosCtrl import OnosCtrl
from docker import Client
diff --git a/src/test/utils/CordTestBase.py b/src/test/utils/CordTestBase.py
index 1402ffc..0170662 100644
--- a/src/test/utils/CordTestBase.py
+++ b/src/test/utils/CordTestBase.py
@@ -28,8 +28,8 @@
def runTest(self):
while self.currentState != self.stopState and self.currentEvent != None:
if self.stateTable and self.eventTable:
- print 'Current state: %s, Current event: %s' %(self.stateTable.toStr(self.currentState),
- self.eventTable.toStr(self.currentEvent))
+ print('Current state: %s, Current event: %s' %(self.stateTable.toStr(self.currentState),
+ self.eventTable.toStr(self.currentEvent)))
key = (self.currentState, self.currentEvent)
(actions, nextState) = self.fsmTable[key]
if actions:
diff --git a/src/test/utils/DHCP.py b/src/test/utils/DHCP.py
index 1ca73bb..eaad0d4 100644
--- a/src/test/utils/DHCP.py
+++ b/src/test/utils/DHCP.py
@@ -14,6 +14,7 @@
# limitations under the License.
#
from scapy.all import *
+from CordTestUtils import log_test
conf.verb = 0 # Disable Scapy verbosity
conf.checkIPaddr = 0 # Don't check response packets for matching destination IPs
@@ -50,7 +51,7 @@
mac = self.seed_mac
chmac = self.macToChaddr(mac)
- #log.info('mac and chmac are %s %s'%(mac, chmac))
+ #log_test.info('mac and chmac are %s %s'%(mac, chmac))
self.bootpmac = chmac
L2 = Ether(dst="ff:ff:ff:ff:ff:ff", src=mac)
L3 = IP(src="0.0.0.0", dst="255.255.255.255")
@@ -58,14 +59,14 @@
L5 = BOOTP(chaddr=chmac)
L6 = DHCP(options=[("message-type","discover"),"end"])
resp = srp1(L2/L3/L4/L5/L6, filter="udp and port 68", timeout=10, iface=self.iface)
- #log.info('dhcp discover packet is %s'%(L2/L3/L4/L5/L6).show())
+ #log_test.info('dhcp discover packet is %s'%(L2/L3/L4/L5/L6).show())
self.dhcpresp = resp
- #log.info('discover response is %s'%resp.show())
+ #log_test.info('discover response is %s'%resp.show())
try:
srcIP = resp.yiaddr
serverIP = resp.siaddr
except AttributeError:
- log.info("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
+ log_test.info("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
return (None, None)
subnet_mask = "0.0.0.0"
@@ -82,7 +83,7 @@
L6 = DHCP(options=[("message-type","request"), ("server_id",server_id),
("subnet_mask",subnet_mask), ("requested_addr",srcIP), "end"])
resp2 = srp1(L2/L3/L4/L5/L6, filter="udp and port 68", timeout=10, iface=self.iface)
- #log.info('request response is %s'%resp2.show())
+ #log_test.info('request response is %s'%resp2.show())
self.mac_map[mac] = (srcIP, serverIP)
self.mac_inverse_map[srcIP] = (mac, serverIP)
return (srcIP, serverIP)
@@ -111,13 +112,13 @@
else:
L6 = DHCP(options=[("message-type","discover"),"end"])
- #log.info('only discover packet is %s'%(L2/L3/L4/L5/L6).show())
+ #log_test.info('only discover packet is %s'%(L2/L3/L4/L5/L6).show())
resp = srp1(L2/L3/L4/L5/L6, filter="udp and port 68", timeout=10, iface=self.iface)
- #log.info('discovery packet is %s'%(L2/L3/L4/L5/L6).show())
+ #log_test.info('discovery packet is %s'%(L2/L3/L4/L5/L6).show())
if resp == None:
return (None, None, mac, None)
- #log.info('only discover response is %s'%resp.show())
+ #log_test.info('only discover response is %s'%resp.show())
self.dhcpresp = resp
for x in resp.lastlayer().options:
@@ -132,8 +133,8 @@
srcIP = resp.yiaddr
serverIP = resp.siaddr
except AttributeError:
- log.info("In Attribute error.")
- log.info("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
+ log_test.info("In Attribute error.")
+ log_test.info("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
return (None, None, None, None)
if self.return_option:
@@ -221,8 +222,8 @@
("subnet_mask",subnet_mask), ("requested_addr",cip), "end"])
resp=srp1(L2/L3/L4/L5/L6, filter="udp and port 68", timeout=10, iface=self.iface)
- #log.info('request packet is %s'%(L2/L3/L4/L5/L6).show())
- #log.info('response packet is %s'%resp.show())
+ #log_test.info('request packet is %s'%(L2/L3/L4/L5/L6).show())
+ #log_test.info('response packet is %s'%resp.show())
if resp == None:
return (None, None)
@@ -242,8 +243,8 @@
self.mac_map[mac] = (srcIP, serverIP)
self.mac_inverse_map[srcIP] = (mac, serverIP)
except AttributeError:
- log.info("In Attribute error.")
- log.info("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
+ log_test.info("In Attribute error.")
+ log_test.info("Failed to acquire IP via DHCP for %s on interface %s" %(mac, self.iface))
return (None, None)
if lease_time or renew_time or rebind_time or self.specific_lease:
@@ -276,7 +277,7 @@
return (srcIP, serverIP)
elif(val == 6):
- log.info("Got DHCP NAK.")
+ log_test.info("Got DHCP NAK.")
return (None, None)
@@ -299,7 +300,7 @@
L5 = BOOTP(chaddr=chmac, ciaddr = ip)
L6 = DHCP(options=[("message-type","release"), ("server_id", server_ip), "end"])
sendp(L2/L3/L4/L5/L6, iface = self.iface, count=2)
- #log.info('release response is %s'%resp)
+ #log_test.info('release response is %s'%resp)
del self.mac_map[mac]
del self.mac_inverse_map[ip]
return True
@@ -350,4 +351,3 @@
n -= 1
return self.incIP(".".join(o), n)
-
diff --git a/src/test/utils/EapMD5.py b/src/test/utils/EapMD5.py
index be71b18..8467a78 100644
--- a/src/test/utils/EapMD5.py
+++ b/src/test/utils/EapMD5.py
@@ -1,12 +1,12 @@
-#
+#
# Copyright 2016-present Ciena Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -54,58 +54,56 @@
self.nextEvent = None
def _eapSetup(self):
- print 'Inside EAP Setup'
+ print('Inside EAP Setup')
self.setup()
self.nextEvent = self.md5EventTable.EVT_EAP_START
-
+
def _eapStart(self):
- print 'Inside EAP Start'
+ print('Inside EAP Start')
self.eapol_start()
self.nextEvent = self.md5EventTable.EVT_EAP_ID_REQ
def _eapIdReq(self):
- print 'Inside EAP ID Req'
+ print('Inside EAP ID Req')
p = self.eapol_recv()
code, pkt_id, eaplen = unpack("!BBH", p[0:4])
- print "Code %d, id %d, len %d" %(code, pkt_id, eaplen)
+ print("Code %d, id %d, len %d" %(code, pkt_id, eaplen))
assert_equal(code, EAP_REQUEST)
reqtype = unpack("!B", p[4:5])[0]
reqdata = p[5:4+eaplen]
assert_equal(reqtype, EAP_TYPE_ID)
- print "<====== Send EAP Response with identity = %s ================>" % USER
+ print("<====== Send EAP Response with identity = %s ================>" % USER)
self.eapol_id_req(pkt_id, USER)
self.nextEvent = self.md5EventTable.EVT_EAP_MD5_CHALLENGE
def _eapMd5Challenge(self):
- print 'Inside EAP MD5 Challenge Exchange'
+ print('Inside EAP MD5 Challenge Exchange')
challenge,pkt_id =self.eap_md5_challenge_recv(self.passwd)
resp=md5(challenge).digest()
resp=chr(len(resp))+resp
length= 5+len(resp)
- print "Generated MD5 challenge is %s Length : %d" % (resp,length)
- print "--> Send EAP response with MD5 challenge"
+ print("Generated MD5 challenge is %s Length : %d" % (resp,length))
+ print("--> Send EAP response with MD5 challenge")
eap_payload = self.eap(EAP_RESPONSE, pkt_id, EAP_TYPE_MD5, str(resp))
self.eapol_send(EAPOL_EAPPACKET, eap_payload)
self.nextEvent = self.md5EventTable.EVT_EAP_STATUS
def _eapStatus(self):
- print 'Inside EAP Status -- Sucess/Failure'
+ print('Inside EAP Status -- Sucess/Failure')
if self.req_status == "EAP_SUCCESS":
status=self.eap_Status()
- print "<============EAP code received is = %d ====================>" % status
+ print("<============EAP code received is = %d ====================>" % status)
assert_equal(status, EAP_SUCCESS)
- print"Received EAP SUCCESS"
+ print("Received EAP SUCCESS")
else:
- print 'Inside EAP Status -- Sucess/Failure ===> SUCCESS should not be received , Since Negative Testcase'
+ print('Inside EAP Status -- Sucess/Failure ===> SUCCESS should not be received , Since Negative Testcase')
self.s.settimeout(10)
assert_equal(self.s.gettimeout(), 10)
- print "Check if the socket timed out ====> Since negative testcase socket should timeout because ONOS is not sending the EAP FAILURE Message"
+ print("Check if the socket timed out ====> Since negative testcase socket should timeout because ONOS is not sending the EAP FAILURE Message")
assert_raises(socket.error, self.s.recv, 1024)
self.nextEvent = self.md5EventTable.EVT_EAP_MD5_DONE
def _wrong_password(self):
- print 'Start Testcase for EAP-MD5 Wrong Password'
+ print('Start Testcase for EAP-MD5 Wrong Password')
#self._eap_md5_states()
self.__init__(intf = 'veth0', password = "wrong_password", required_status = "EAP_FAILURE")
-
-
diff --git a/src/test/utils/EapPAP.py b/src/test/utils/EapPAP.py
index a342132..accb660 100644
--- a/src/test/utils/EapPAP.py
+++ b/src/test/utils/EapPAP.py
@@ -1,12 +1,12 @@
-#
+#
# Copyright 2016-present Ciena Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,9 +22,10 @@
from scapy.all import *
from nose.tools import *
from CordTestBase import CordTester
+from CordTestUtils import log_test
PAP_USER = "raduser"
PAP_PASSWD = "radpass"
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class PAPAuthTest(EapolPacket, CordTester):
@@ -58,18 +59,18 @@
print 'Inside EAP PAP Setup'
self.setup()
self.nextEvent = self.PAPEventTable.EVT_EAP_START
-
+
def _eapStart(self):
print 'Inside EAP PAP Start'
self.eapol_start()
self.nextEvent = self.PAPEventTable.EVT_EAP_ID_REQ
def _eapIdReq(self):
- log.info( 'Inside EAP ID Req' )
+ log_test.info( 'Inside EAP ID Req' )
def eapol_cb(pkt):
- log.info('Got EAPOL packet with type id and code request')
- log.info('Packet code: %d, type: %d, id: %s', pkt[EAP].code, pkt[EAP].type, pkt[EAP].id)
- log.info("<====== Send EAP Response with identity = %s ================>" % PAP_USER)
+ log_test.info('Got EAPOL packet with type id and code request')
+ log_test.info('Packet code: %d, type: %d, id: %s', pkt[EAP].code, pkt[EAP].type, pkt[EAP].id)
+ log_test.info("<====== Send EAP Response with identity = %s ================>" % PAP_USER)
self.eapol_id_req(pkt[EAP].id, PAP_USER)
self.eapol_scapy_recv(cb = eapol_cb,
@@ -77,11 +78,11 @@
self.nextEvent = self.PAPEventTable.EVT_EAP_PAP_USER_REQ
def _eapPAPUserReq(self):
- log.info('UserReq Inside Challenge')
+ log_test.info('UserReq Inside Challenge')
def eapol_cb(pkt):
- log.info('Got EAPOL packet with type id and code request')
- log.info('Packet code: %d, id: %s', pkt[EAP].code, pkt[EAP].id)
- log.info('Send EAP Response for id %s with Password = %s' %(pkt[EAP].id, PAP_PASSWD) )
+ log_test.info('Got EAPOL packet with type id and code request')
+ log_test.info('Packet code: %d, id: %s', pkt[EAP].code, pkt[EAP].id)
+ log_test.info('Send EAP Response for id %s with Password = %s' %(pkt[EAP].id, PAP_PASSWD) )
self.eapol_id_req(pkt[EAP].id, PAP_PASSWD)
self.eapol_scapy_recv(cb = eapol_cb,
@@ -90,12 +91,11 @@
self.nextEvent = None
def _eapPAPPassReq(self):
- log.info('PassReq Inside Challenge')
+ log_test.info('PassReq Inside Challenge')
def eapol_cb(pkt):
- log.info('Got EAPOL packet with type id and code request')
- log.info('Packet code: %d, type: %d', pkt[EAP].code, pkt[EAP].type)
+ log_test.info('Got EAPOL packet with type id and code request')
+ log_test.info('Packet code: %d, type: %d', pkt[EAP].code, pkt[EAP].type)
self.eapol_scapy_recv(cb = eapol_cb,
lfilter = lambda pkt: pkt[EAP].code == EAP.SUCCESS)
self.nextEvent = self.PAPEventTable.EVT_EAP_PAP_DONE
-
diff --git a/src/test/utils/EapTLS.py b/src/test/utils/EapTLS.py
index c92721a..6a68209 100644
--- a/src/test/utils/EapTLS.py
+++ b/src/test/utils/EapTLS.py
@@ -27,10 +27,11 @@
from nose.tools import *
from CordTestBase import CordTester
from CordContainer import *
+from CordTestUtils import log_test
import re
import time
-log.setLevel('INFO')
+log_test.setLevel('INFO')
def bytes_to_num(data):
try:
@@ -130,7 +131,7 @@
def handle_server_hello_done(self, server_hello_done):
if server_hello_done[-4:] == self.server_hello_done_signature:
- log.info('server hello received')
+ log_test.info('server hello received')
self.server_hello_done_received = True
def __init__(self, intf = 'veth0', client_cert = None, client_priv_key = None,
@@ -215,8 +216,8 @@
self.pkt_map[pkt_type][self.DATA_IDX] += data
if reassembled is True:
self.pkt_map[pkt_type][self.CB_IDX](self.pkt_map[pkt_type][self.DATA_IDX])
- log.info('Appending packet type %02x to packet history of len %d'
- %(ord(pkt_type), len(self.pkt_map[pkt_type][self.DATA_IDX])))
+ log_test.info('Appending packet type %02x to packet history of len %d'
+ %(ord(pkt_type), len(self.pkt_map[pkt_type][self.DATA_IDX])))
self.pkt_history.append(self.pkt_map[pkt_type][self.DATA_IDX])
data = ''.join(self.pkt_map[pkt_type][:self.DATA_IDX+1])
self.load_tls_record(data, pkt_type = pkt_type)
@@ -225,7 +226,7 @@
def tlsFail(self):
##Force a failure
- log.info('entering into testFail function')
+ log_test.info('entering into testFail function')
self.nextEvent = self.tlsEventTable.EVT_EAP_TLS_FINISHED
self.nextState = self.tlsStateTable.ST_EAP_TLS_FINISHED
self.failTest = True
@@ -272,7 +273,7 @@
reassembled = False)
self.pending_bytes -= len(tls_data) - 5 - type_hdrlen
self.pkt_last = pkt_type
- log.info('Pending bytes left %d' %(self.pending_bytes))
+ log_test.info('Pending bytes left %d' %(self.pending_bytes))
assert self.pending_bytes > 0
elif tls_data[0] == self.SERVER_HELLO_DONE:
self.server_hello_done_eap_id = pkt[EAP].id
@@ -295,23 +296,23 @@
#if self.src_mac == 'mcast': self.setup(src_mac='mcast')
#if self.src_mac == 'zeros': self.setup(src_mac='zeros')
#if self.src_mac == 'default': self.setup(src_mac='default')
- log.info('source mac is %s'%self.src_mac)
+ log_test.info('source mac is %s'%self.src_mac)
self.setup(src_mac=self.src_mac)
self.nextEvent = self.tlsEventTable.EVT_EAP_START
def _eapStart(self):
- log.info('_eapStart method started')
+ log_test.info('_eapStart method started')
self.eapol_start()
self.nextEvent = self.tlsEventTable.EVT_EAP_ID_REQ
def _eapIdReq(self):
- log.info( 'Inside EAP ID Req' )
+ log_test.info( 'Inside EAP ID Req' )
def eapol_cb(pkt):
- log.info('Got EAPOL packet with type id and code request')
- log.info('Packet code: %d, type: %d, id: %d', pkt[EAP].code, pkt[EAP].type, pkt[EAP].id)
- log.info("<====== Send EAP Response with identity = %s ================>" % USER)
+ log_test.info('Got EAPOL packet with type id and code request')
+ log_test.info('Packet code: %d, type: %d, id: %d', pkt[EAP].code, pkt[EAP].type, pkt[EAP].id)
+ log_test.info("<====== Send EAP Response with identity = %s ================>" % USER)
if self.id_mismatch_in_identifier_response_packet:
- log.info('\nSending invalid id field in EAP Identity Response packet')
+ log_test.info('\nSending invalid id field in EAP Identity Response packet')
self.eapol_id_req(pkt[EAP].id+10, USER)
else:
self.eapol_id_req(pkt[EAP].id, USER)
@@ -328,7 +329,7 @@
def _eapTlsHelloReq(self):
def eapol_cb(pkt):
- log.info('Got hello request for id %d', pkt[EAP].id)
+ log_test.info('Got hello request for id %d', pkt[EAP].id)
self.client_hello = TLSClientHello(version= self.version,
gmt_unix_time=self.gmt_unix_time,
random_bytes= '\xAB' * 28,
@@ -340,10 +341,10 @@
cipher_suites=[self.cipher_suite]
)
if self.invalid_client_hello_handshake_type:
- log.info('sending server_hello instead of client_hello handshape type in client hello packet')
+ log_test.info('sending server_hello instead of client_hello handshape type in client hello packet')
client_hello_data = TLSHandshake(type='server_hello')/self.client_hello
elif self.invalid_client_hello_handshake_length:
- log.info('sending TLS Handshake message with zero length field in client hello packet')
+ log_test.info('sending TLS Handshake message with zero length field in client hello packet')
client_hello_data = TLSHandshake(length=0)/self.client_hello
else:
client_hello_data = TLSHandshake()/self.client_hello
@@ -354,14 +355,14 @@
else:
reqdata = TLSRecord()/client_hello_data
self.load_tls_record(str(reqdata))
- log.info("Sending Client Hello TLS payload of len %d, id %d" %(len(reqdata),pkt[EAP].id))
+ log_test.info("Sending Client Hello TLS payload of len %d, id %d" %(len(reqdata),pkt[EAP].id))
if self.id_mismatch_in_client_hello_packet:
- log.info('\nsending invalid id field in client hello packet')
+ log_test.info('\nsending invalid id field in client hello packet')
eap_payload = self.eapTLS(EAP_RESPONSE, pkt[EAP].id+10, TLS_LENGTH_INCLUDED, str(reqdata))
else:
eap_payload = self.eapTLS(EAP_RESPONSE, pkt[EAP].id, TLS_LENGTH_INCLUDED, str(reqdata))
if self.dont_send_client_hello:
- log.info('\nskipping client hello packet sending part')
+ log_test.info('\nskipping client hello packet sending part')
pass
else:
self.eapol_send(EAPOL_EAPPACKET, eap_payload)
@@ -405,7 +406,7 @@
return to_raw(TLSPlaintext(data = 'GET / HTTP/1.1\r\nHOST: localhost\r\n\r\n'), self.tls_ctx)
def _eapTlsCertReq(self):
- log.info('Receiving server certificates')
+ log_test.info('Receiving server certificates')
while self.server_hello_done_received == False:
r = self.eapol_scapy_recv(cb = self.eapol_server_hello_cb,
lfilter =
@@ -414,7 +415,7 @@
if len(r) == 0:
self.tlsFail()
return r
- log.info('Sending client certificate request')
+ log_test.info('Sending client certificate request')
rex_pem = re.compile(r'\-+BEGIN[^\-]+\-+(.*?)\-+END[^\-]+\-+', re.DOTALL)
if self.client_cert:
der_cert = rex_pem.findall(self.client_cert)[0].decode("base64")
@@ -433,17 +434,17 @@
self.pkt_history.append(str(client_key_ex_data))
verify_signature = self.get_verify_signature(self.client_priv_key)
if self.invalid_cert_req_handshake:
- log.info("sending 'certificate-request' type of handshake message instead of 'certificate-verify' type")
+ log_test.info("sending 'certificate-request' type of handshake message instead of 'certificate-verify' type")
client_cert_verify = TLSHandshake(type=TLSHandshakeType.CERTIFICATE_REQUEST)/verify_signature
else:
client_cert_verify = TLSHandshake(type=TLSHandshakeType.CERTIFICATE_VERIFY)/verify_signature
if self.incorrect_tlsrecord_type_cert_req:
- log.info("sending TLS Record type as ALERT instead of HANDSHAKE in certificate request packet")
+ log_test.info("sending TLS Record type as ALERT instead of HANDSHAKE in certificate request packet")
client_cert_record = TLSRecord(content_type=TLSContentType.ALERT)/client_cert_verify
else:
client_cert_record = TLSRecord(content_type=TLSContentType.HANDSHAKE)/client_cert_verify
self.pkt_history.append(str(client_cert_verify))
- #log.info('TLS ctxt: %s' %self.tls_ctx)
+ #log_test.info('TLS ctxt: %s' %self.tls_ctx)
client_ccs = TLSRecord(version="TLS_1_0")/TLSChangeCipherSpec()
enc_handshake_msg = self.get_encrypted_handshake_msg()
if self.invalid_content_type:
@@ -452,9 +453,9 @@
handshake_msg = str(TLSRecord(content_type=TLSContentType.HANDSHAKE)/enc_handshake_msg)
reqdata = str(TLS.from_records([client_certificate, client_key_ex, client_cert_record, client_ccs]))
reqdata += handshake_msg
- log.info("------> Sending Client Hello TLS Certificate payload of len %d ----------->" %len(reqdata))
+ log_test.info("------> Sending Client Hello TLS Certificate payload of len %d ----------->" %len(reqdata))
if self.dont_send_client_certificate:
- log.info('\nskipping sending client certificate part')
+ log_test.info('\nskipping sending client certificate part')
pass
else:
status = self.eapFragmentSend(EAP_RESPONSE, self.server_hello_done_eap_id, TLS_LENGTH_INCLUDED,
@@ -464,7 +465,7 @@
def _eapTlsCertReq_delay(self):
self.server_hello_done_received = True
- log.info('Sending client certificate request')
+ log_test.info('Sending client certificate request')
rex_pem = re.compile(r'\-+BEGIN[^\-]+\-+(.*?)\-+END[^\-]+\-+', re.DOTALL)
if self.client_cert:
@@ -488,19 +489,19 @@
verify_signature = self.get_verify_signature(self.client_priv_key)
if self.invalid_cert_req_handshake:
- log.info("Sending 'certificate-request' type of handshake message instead of 'certificate-verify' type")
+ log_test.info("Sending 'certificate-request' type of handshake message instead of 'certificate-verify' type")
client_cert_verify = TLSHandshake(type=TLSHandshakeType.CERTIFICATE_REQUEST)/verify_signature
else:
client_cert_verify = TLSHandshake(type=TLSHandshakeType.CERTIFICATE_VERIFY)/verify_signature
if self.incorrect_tlsrecord_type_cert_req:
- log.info("Sending TLS Record type as ALERT instead of HANDSHAKE in certificate request packet")
+ log_test.info("Sending TLS Record type as ALERT instead of HANDSHAKE in certificate request packet")
client_cert_record = TLSRecord(content_type=TLSContentType.ALERT)/client_cert_verify
else:
client_cert_record = TLSRecord(content_type=TLSContentType.HANDSHAKE)/client_cert_verify
self.pkt_history.append(str(client_cert_verify))
- #log.info('TLS ctxt: %s' %self.tls_ctx)
+ #log_test.info('TLS ctxt: %s' %self.tls_ctx)
client_ccs = TLSRecord(version="TLS_1_0")/TLSChangeCipherSpec()
enc_handshake_msg = self.get_encrypted_handshake_msg()
@@ -510,10 +511,10 @@
handshake_msg = str(TLSRecord(content_type=TLSContentType.HANDSHAKE)/enc_handshake_msg)
reqdata = str(TLS.from_records([client_certificate, client_key_ex, client_cert_record, client_ccs]))
reqdata += handshake_msg
- log.info("------> Sending Client Hello TLS Certificate payload of len %d ----------->" %len(reqdata))
+ log_test.info("------> Sending Client Hello TLS Certificate payload of len %d ----------->" %len(reqdata))
if self.dont_send_client_certificate:
- log.info('\nSkipping sending client certificate part')
+ log_test.info('\nSkipping sending client certificate part')
pass
else:
status = self.eapFragmentSend(EAP_RESPONSE, self.server_hello_done_eap_id, TLS_LENGTH_INCLUDED,
@@ -524,11 +525,11 @@
def _eapTlsChangeCipherSpec(self):
def eapol_cb(pkt):
r = str(pkt)
- log.info('data received in change cipher spec function is %s'%pkt.show())
+ log_test.info('data received in change cipher spec function is %s'%pkt.show())
tls_data = r[self.TLS_OFFSET:]
- log.info('Verifying TLS Change Cipher spec record type %x' %ord(tls_data[0]))
+ log_test.info('Verifying TLS Change Cipher spec record type %x' %ord(tls_data[0]))
assert tls_data[0] == self.CHANGE_CIPHER
- log.info('Handshake finished. Sending empty data')
+ log_test.info('Handshake finished. Sending empty data')
eap_payload = self.eapTLS(EAP_RESPONSE, pkt[EAP].id, 0, '')
self.eapol_send(EAPOL_EAPPACKET, eap_payload)
@@ -544,7 +545,7 @@
def _eapTlsFinished(self):
self.nextEvent = None
def eapol_cb(pkt):
- log.info('Server authentication successfull')
+ log_test.info('Server authentication successfull')
timeout = 5
if self.failTest is True:
diff --git a/src/test/utils/EapolAAA.py b/src/test/utils/EapolAAA.py
index d256e0b..a27001a 100644
--- a/src/test/utils/EapolAAA.py
+++ b/src/test/utils/EapolAAA.py
@@ -20,6 +20,7 @@
from struct import *
import sys
from nose.tools import assert_equal, assert_not_equal, assert_raises, assert_true
+from CordTestUtils import log_test
USER = "raduser"
PASS = "radpass"
@@ -71,8 +72,8 @@
if mac is None:
mac = self.mymac
self.llheader = Ether(dst = PAE_GROUP_ADDR, src = mac, type = ETHERTYPE_PAE)
- log.info('llheader packet is %s'%self.llheader.show())
- log.info('source mac of packet is %s'%mac)
+ log_test.info('llheader packet is %s'%self.llheader.show())
+ log_test.info('source mac of packet is %s'%mac)
self.recv_sock = L2Socket(iface = self.intf, type = ETHERTYPE_PAE)
def cleanup(self):
@@ -225,43 +226,41 @@
@classmethod
def eap_invalid_tls_packets_info(self, invalid_field_name = None, invalid_field_value = None):
- log.info( 'Changing invalid field values in tls auth packets' )
+ log_test.info( 'Changing invalid field values in tls auth packets' )
if invalid_field_name == 'eapolTlsVersion':
global EAPOL_VERSION
- log.info( 'Changing invalid field values in tls auth packets====== version changing' )
+ log_test.info( 'Changing invalid field values in tls auth packets====== version changing' )
EAPOL_VERSION = invalid_field_value
if invalid_field_name == 'eapolTlsType':
global EAP_TYPE_TLS
- log.info( 'Changing invalid field values in tls auth packets====== EAP TYPE TLS changing' )
+ log_test.info( 'Changing invalid field values in tls auth packets====== EAP TYPE TLS changing' )
EAP_TYPE_TLS = invalid_field_value
if invalid_field_name == 'eapolTypeID':
global EAP_TYPE_ID
- log.info( 'Changing invalid field values in tls auth packets====== EAP TYPE TLS changing' )
+ log_test.info( 'Changing invalid field values in tls auth packets====== EAP TYPE TLS changing' )
EAP_TYPE_ID = invalid_field_value
if invalid_field_name == 'eapolResponse':
global EAP_RESPONSE
- log.info( 'Changing invalid field values in tls auth packets====== EAP TYPE TLS changing' )
+ log_test.info( 'Changing invalid field values in tls auth packets====== EAP TYPE TLS changing' )
EAP_RESPONSE = invalid_field_value
@classmethod
def eap_tls_packets_field_value_replace(self, invalid_field_name = None):
- log.info( 'Changing invalid field values in tls auth packets' )
+ log_test.info( 'Changing invalid field values in tls auth packets' )
if invalid_field_name == 'eapolTlsVersion':
global EAPOL_VERSION
EAPOL_VERSION = 1
- log.info( 'Changing invalid field values in tls auth packets====== version changing' )
+ log_test.info( 'Changing invalid field values in tls auth packets====== version changing' )
if invalid_field_name == 'eapolTlsType':
global EAP_TYPE_TLS
EAP_TYPE_TLS = 13
- log.info( 'Changing invalid field values in tls auth packets====== version changing' )
+ log_test.info( 'Changing invalid field values in tls auth packets====== version changing' )
if invalid_field_name == 'eapolTypeID':
global EAP_TYPE_ID
EAP_TYPE_ID = 1
- log.info( 'Changing invalid field values in tls auth packets====== version changing' )
+ log_test.info( 'Changing invalid field values in tls auth packets====== version changing' )
if invalid_field_name == 'eapolResponse':
global EAP_RESPONSE
EAP_RESPONSE = 2
- log.info( 'Changing invalid field values in tls auth packets====== version changing' )
-
-
+ log_test.info( 'Changing invalid field values in tls auth packets====== version changing' )
diff --git a/src/test/utils/IGMP.py b/src/test/utils/IGMP.py
index 7e348bc..3a243eb 100644
--- a/src/test/utils/IGMP.py
+++ b/src/test/utils/IGMP.py
@@ -66,7 +66,7 @@
def post_build(self, pkt, payload):
pkt += payload
if self.aux_data_len != 0:
- print "WARNING: Auxiliary Data Length must be zero (0)"
+ print("WARNING: Auxiliary Data Length must be zero (0)")
return pkt
@@ -197,7 +197,7 @@
if __name__ == "__main__":
- print "test float encoding"
+ print("test float encoding")
from math import log
max_expected_error = 1.0 / (2<<3) # four bit precision
p = IGMPv3()
@@ -207,37 +207,37 @@
rel_err = float(v-d)/v if v!=0 else 0.0
assert rel_err <= max_expected_error
- print "construct membership query - general query"
+ print("construct membership query - general query")
mq = IGMPv3(type=IGMP_TYPE_MEMBERSHIP_QUERY, max_resp_code=120)
hexdump(str(mq))
- print "construct membership query - group-specific query"
+ print("construct membership query - group-specific query")
mq = IGMPv3(type=IGMP_TYPE_MEMBERSHIP_QUERY, max_resp_code=120, gaddr="224.0.0.1")
hexdump(str(mq))
- print "construct membership query - group-and-source-specific query"
+ print("construct membership query - group-and-source-specific query")
mq = IGMPv3(type=IGMP_TYPE_MEMBERSHIP_QUERY, max_resp_code=120, gaddr="224.0.0.1")
mq.srcs = ['1.2.3.4', '5.6.7.8']
hexdump(str(mq))
- print "fixup"
+ print("fixup")
mq = IGMPv3(type=IGMP_TYPE_MEMBERSHIP_QUERY)
mq.srcs = ['1.2.3.4', '5.6.7.8']
pkt = Ether() / IP() / mq
- print "before fixup:"
+ print("before fixup:")
hexdump(str(pkt))
- print "after fixup:"
+ print("after fixup:")
IGMPv3.fixup(pkt,'no')
hexdump(str(pkt))
- print "construct v3 membership report - join a single group"
+ print("construct v3 membership report - join a single group")
mr = IGMPv3(type=IGMP_TYPE_V3_MEMBERSHIP_REPORT, max_resp_code=30, gaddr="224.0.0.1")
mr.grps = [IGMPv3gr( rtype=IGMP_V3_GR_TYPE_EXCLUDE, mcaddr="229.10.20.30")]
hexdump(mr)
- print "construct v3 membership report - join two groups"
+ print("construct v3 membership report - join two groups")
mr = IGMPv3(type=IGMP_TYPE_V3_MEMBERSHIP_REPORT, max_resp_code=30, gaddr="224.0.0.1")
mr.grps = [
IGMPv3gr(rtype=IGMP_V3_GR_TYPE_EXCLUDE, mcaddr="229.10.20.30"),
@@ -245,9 +245,9 @@
]
hexdump(mr)
- print "construct v3 membership report - leave a group"
+ print("construct v3 membership report - leave a group")
mr = IGMPv3(type=IGMP_TYPE_V3_MEMBERSHIP_REPORT, max_resp_code=30, gaddr="224.0.0.1")
mr.grps = [IGMPv3gr(rtype=IGMP_V3_GR_TYPE_INCLUDE, mcaddr="229.10.20.30")]
hexdump(mr)
- print "all ok"
+ print("all ok")
diff --git a/src/test/utils/OnosFlowCtrl.py b/src/test/utils/OnosFlowCtrl.py
index 8ccc095..f3ab4fe 100644
--- a/src/test/utils/OnosFlowCtrl.py
+++ b/src/test/utils/OnosFlowCtrl.py
@@ -19,8 +19,8 @@
from nose.tools import *
import logging
logging.getLogger('scapy.runtime').setLevel(logging.ERROR)
-from scapy.all import *
from OnosCtrl import OnosCtrl, get_controller
+from CordTestUtils import log_test
class OnosFlowCtrl:
@@ -296,13 +296,13 @@
response = requests.post(url, auth = self.auth, data = json.dumps(flowJson) )
if response.ok:
if response.status_code in [200, 201]:
- log.info('Successfully POSTED flow for device %s' %str(deviceId))
+ log_test.info('Successfully POSTED flow for device %s' %str(deviceId))
return True
else:
- log.info('Post flow for device %s failed with status %d' %(str(deviceId),
+ log_test.info('Post flow for device %s failed with status %d' %(str(deviceId),
response.status_code))
return False
else:
- log.error('Flow post request returned with status %d' %response.status_code)
+ log_test.error('Flow post request returned with status %d' %response.status_code)
return False
diff --git a/src/test/utils/SSHTestAgent.py b/src/test/utils/SSHTestAgent.py
index e9022af..b2d1342 100644
--- a/src/test/utils/SSHTestAgent.py
+++ b/src/test/utils/SSHTestAgent.py
@@ -2,7 +2,7 @@
from paramiko import SSHClient, WarningPolicy, AutoAddPolicy
import logging
logging.getLogger('scapy.runtime').setLevel(logging.ERROR)
-from scapy.all import *
+from CordTestUtils import log_test
class SSHTestAgent(object):
key_file = os.getenv('SSH_KEY_FILE', None)
@@ -30,7 +30,7 @@
self.client.connect(self.host, username = self.user, password = self.password,
key_filename = self.key_file, timeout=timeout, port = self.port)
except:
- log.error('Unable to connect to test host %s' %self.host)
+ log_test.error('Unable to connect to test host %s' %self.host)
return False, None
channel = self.client.get_transport().open_session()
diff --git a/src/test/utils/Xos.py b/src/test/utils/Xos.py
index 20f2ee7..d4ce783 100644
--- a/src/test/utils/Xos.py
+++ b/src/test/utils/Xos.py
@@ -1,5 +1,6 @@
import os,time
from CordContainer import Container
+from CordTestUtils import log_test
class XosBase(object):
workspace = '/tmp/xos_scratch_workspace'
@@ -69,13 +70,13 @@
def start_services(self):
if not self.__ssh_key_check():
- log.info('SSH keys need to be generated before building XOS service containers')
- log.info('Use the following commands to generate ssh keys')
- log.info('ssh-keygen -t rsa -q -N ""')
- log.info('ssh-copy-id -i $HOME/.ssh/id_rsa ubuntu@localhost')
+ log_test.info('SSH keys need to be generated before building XOS service containers')
+ log_test.info('Use the following commands to generate ssh keys')
+ log_test.info('ssh-keygen -t rsa -q -N ""')
+ log_test.info('ssh-copy-id -i $HOME/.ssh/id_rsa ubuntu@localhost')
return False
if not os.access(self.profile_dir, os.F_OK):
- log.error('Profile directory %s does not exist' %self.profile_dir)
+ log_test.error('Profile directory %s does not exist' %self.profile_dir)
return False
self.build_images()
##copy the keys to the profile dir
diff --git a/src/test/vrouter/vrouterTest.py b/src/test/vrouter/vrouterTest.py
index dc1f281..ee7328d 100644
--- a/src/test/vrouter/vrouterTest.py
+++ b/src/test/vrouter/vrouterTest.py
@@ -16,7 +16,7 @@
import unittest
from nose.tools import *
from scapy.all import *
-from CordTestUtils import get_mac
+from CordTestUtils import get_mac, log_test
from OnosCtrl import OnosCtrl
from OltConfig import OltConfig
from OnosFlowCtrl import OnosFlowCtrl
@@ -38,7 +38,7 @@
#from cli import system
#from generic import *
-log.setLevel('INFO')
+log_test.setLevel('INFO')
class vrouter_exchange(CordLogger):
@@ -136,7 +136,7 @@
def onos_load_config(cls, config):
status, code = OnosCtrl.config(config)
if status is False:
- log.info('JSON request returned status %d' %code)
+ log_test.info('JSON request returned status %d' %code)
assert_equal(status, True)
@classmethod
@@ -158,7 +158,7 @@
for host,_ in peer_info:
iface = cls.port_map[index]
index += 1
- log.info('Assigning ip %s to interface %s' %(host, iface))
+ log_test.info('Assigning ip %s to interface %s' %(host, iface))
config_cmds = ( 'ifconfig {} 0'.format(iface),
'ifconfig {0} {1}'.format(iface, host),
'arping -I {0} {1} -c 2'.format(iface, host),
@@ -187,12 +187,12 @@
config = dict(res)
else:
config = network_cfg
- log.info('Restarting ONOS with new network configuration')
+ log_test.info('Restarting ONOS with new network configuration')
return cord_test_onos_restart(config = config)
@classmethod
def start_quagga(cls, networks = 4, peer_address = None, router_address = None):
- log.info('Restarting Quagga container with configuration for %d networks' %(networks))
+ log_test.info('Restarting Quagga container with configuration for %d networks' %(networks))
config = cls.generate_conf(networks = networks, peer_address = peer_address, router_address = router_address)
if networks <= 10000:
boot_delay = 25
@@ -286,7 +286,7 @@
cls.network_list = network_list
cls.network_mask = network_mask
zebra_routes = '\n'.join(net_list)
- #log.info('Zebra routes: \n:%s\n' %cls.zebra_conf + zebra_routes)
+ #log_test.info('Zebra routes: \n:%s\n' %cls.zebra_conf + zebra_routes)
return cls.zebra_conf + zebra_routes
@classmethod
@@ -321,7 +321,7 @@
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))
+ log_test.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 == dst_ip and p[IP].src == src_ip,
@@ -333,7 +333,7 @@
L2 = Ether(src = src_mac, dst = dst_mac)
L3 = IP(src = src_ip, dst = dst_ip)
pkt = L2/L3
- log.info('Sending a packet with dst ip %s, dst mac %s on port %s to verify if flows are correct' %
+ log_test.info('Sending a packet with dst ip %s, dst mac %s on port %s to verify if flows are correct' %
(dst_ip, dst_mac, self.port_map[egress]))
while self.start_sending is True:
sendp(pkt, count=50, iface = self.port_map[egress])
@@ -382,11 +382,11 @@
self.cliEnter()
##Now verify
hosts = json.loads(self.cli.hosts(jsonFormat = True))
- log.info('Discovered hosts: %s' %hosts)
+ log_test.info('Discovered hosts: %s' %hosts)
##We read from cli if we expect less number of routes to avoid cli timeouts
if networks <= 10000:
routes = json.loads(self.cli.routes(jsonFormat = True))
- #log.info('Routes: %s' %routes)
+ #log_test.info('Routes: %s' %routes)
if start_network is not None:
if start_network.split('/')[1] is 24:
assert_equal(len(routes['routes4']), networks)
@@ -398,7 +398,7 @@
assert_equal(len(routes['routes4']), 0)
flows = json.loads(self.cli.flows(jsonFormat = True))
flows = filter(lambda f: f['flows'], flows)
- #log.info('Flows: %s' %flows)
+ #log_test.info('Flows: %s' %flows)
assert_not_equal(len(flows), 0)
if invalid_peers is None:
self.vrouter_traffic_verify()
@@ -413,11 +413,11 @@
self.vrouter_traffic_verify(positive_test = False)
self.network_list = network_list_backup
if deactivate_activate_vrouter is True:
- log.info('Deactivating vrouter app in ONOS controller for negative scenario')
+ log_test.info('Deactivating vrouter app in ONOS controller for negative scenario')
self.vrouter_activate(deactivate = True)
#routes = json.loads(self.cli.routes(jsonFormat = False, cmd_exist = False))
#assert_equal(len(routes['routes4']), 'Command not found')
- log.info('Activating vrouter app again in ONOS controller for negative scenario')
+ log_test.info('Activating vrouter app again in ONOS controller for negative scenario')
self.vrouter_activate(deactivate = False)
routes = json.loads(self.cli.routes(jsonFormat = True))
assert_equal(len(routes['routes4']), networks)
@@ -428,7 +428,7 @@
def __vrouter_network_verify_negative(self, networks, peers = 1):
##Stop quagga. Test traffic again to see if flows were removed
- log.info('Stopping Quagga container')
+ log_test.info('Stopping Quagga container')
cord_test_quagga_stop()
if networks <= 10000:
routes = json.loads(self.cli.routes(jsonFormat = True))
@@ -436,14 +436,14 @@
if routes and routes.has_key('routes4'):
assert_equal(len(routes['routes4']), 0)
self.vrouter_traffic_verify(positive_test = False)
- log.info('OVS flows have been removed successfully after Quagga was stopped')
+ log_test.info('OVS flows have been removed successfully after Quagga was stopped')
self.start_quagga(networks = networks)
##Verify the flows again after restarting quagga back
if networks <= 10000:
routes = json.loads(self.cli.routes(jsonFormat = True))
assert_equal(len(routes['routes4']), networks)
self.vrouter_traffic_verify()
- log.info('OVS flows have been successfully reinstalled after Quagga was restarted')
+ log_test.info('OVS flows have been successfully reinstalled after Quagga was restarted')
def quagga_shell(self, cmd):
shell_cmds = ('vtysh', '"conf t"', '"{}"'.format(cmd))
diff --git a/src/test/xos/xosTest.py b/src/test/xos/xosTest.py
index baefb01..d3ffcf7 100644
--- a/src/test/xos/xosTest.py
+++ b/src/test/xos/xosTest.py
@@ -18,8 +18,8 @@
from docker import Client
from itertools import chain
from nose.tools import *
-from scapy.all import *
from CordContainer import *
+from CordTestUtils import log_test as log
import threading
import time
import os
@@ -522,4 +522,3 @@
def test_xos_api_core_get_all_users(self):
self.validate_url_response_data(url = self.XOS_API_CORE_GET_ALL_USERS)
-