Cleanup for using cord-tester logger over scapy logger which was an ugly hack.
Change-Id: I8af565f8eb4f69ddc6605e717a0c83772cc9417f
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