Implement variable boot delay for quagga for vrouter tests.
diff --git a/src/test/utils/CordContainer.py b/src/test/utils/CordContainer.py
index 0d26630..e2ab5f5 100644
--- a/src/test/utils/CordContainer.py
+++ b/src/test/utils/CordContainer.py
@@ -241,7 +241,7 @@
host_guest_map = ( (host_quagga_config, guest_quagga_config), )
def __init__(self, name = 'cord-quagga', image = 'cord-test/quagga', tag = 'latest',
- boot_delay = 30, restart = False, config_file = quagga_config_file):
+ boot_delay = 15, restart = False, config_file = quagga_config_file):
super(Quagga, self).__init__(name, image, tag = tag, quagga_config = self.quagga_config)
if not self.img_exists():
self.build_image(image)
diff --git a/src/test/utils/CordTestServer.py b/src/test/utils/CordTestServer.py
index 806b36b..ca19950 100644
--- a/src/test/utils/CordTestServer.py
+++ b/src/test/utils/CordTestServer.py
@@ -12,16 +12,20 @@
class CordTestServer(socketserver.BaseRequestHandler):
- def restart_onos(self, args):
+ def restart_onos(self, *args):
print('Restarting ONOS')
onos = Onos(restart = True)
self.request.sendall('DONE')
- def restart_quagga(self, args):
- if args is None:
- args = Quagga.quagga_config_file
- print('Restarting QUAGGA with config file %s'%args)
- quagga = Quagga(restart = True, config_file = args)
+ def restart_quagga(self, *args):
+ config_file = Quagga.quagga_config_file
+ boot_delay = 15
+ if args:
+ config_file = args[0]
+ if len(args) > 1:
+ boot_delay = int(args[1])
+ print('Restarting QUAGGA with config file %s, delay %d secs'%(config_file, boot_delay))
+ quagga = Quagga(restart = True, config_file = config_file, boot_delay = boot_delay)
self.request.sendall('DONE')
callback_table = { 'RESTART_ONOS' : restart_onos,
@@ -32,12 +36,13 @@
data = self.request.recv(1024).strip()
cmd = data.split()[0]
try:
- args = ' '.join(data.split()[1:])
+ #args = ' '.join(data.split()[1:])
+ args = data.split()[1:]
except:
args = None
if self.callback_table.has_key(cmd):
- self.callback_table[cmd](self, args)
+ self.callback_table[cmd](self, *args)
class ThreadedTestServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
allow_reuse_address = True
@@ -69,13 +74,13 @@
return False
@nottest
-def cord_test_quagga_restart(config_file = None):
+def cord_test_quagga_restart(config_file = None, boot_delay = 30):
'''Send QUAGGA restart to server'''
if config_file is None:
config_file = Quagga.quagga_config_file
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect( (CORD_TEST_HOST, CORD_TEST_PORT) )
- s.sendall('RESTART_QUAGGA {}\n'.format(config_file))
+ s.sendall('RESTART_QUAGGA {0} {1}\n'.format(config_file, boot_delay))
data = s.recv(1024).strip()
s.close()
if data == 'DONE':
diff --git a/src/test/vrouter/vrouterTest.py b/src/test/vrouter/vrouterTest.py
index 723e256..a4712ea 100644
--- a/src/test/vrouter/vrouterTest.py
+++ b/src/test/vrouter/vrouterTest.py
@@ -38,9 +38,9 @@
log stdout
service advanced-vty
!
-debug zebra rib
-debug zebra kernel
-debug zebra fpm
+!debug zebra rib
+!debug zebra kernel
+!debug zebra fpm
!
!interface eth1
! ip address 10.10.0.3/16
@@ -147,7 +147,11 @@
guest_config_file = os.path.join(Quagga.guest_quagga_config, 'testrib_gen.conf')
with open(host_config_file, 'w') as f:
f.write(config)
- cord_test_quagga_restart(config_file = guest_config_file)
+ if networks <= 10000:
+ boot_delay = 25
+ else:
+ boot_delay = 75
+ cord_test_quagga_restart(config_file = guest_config_file, boot_delay = boot_delay)
@classmethod
def zgenerate_vrouter_conf(cls, networks = 4):