1 # Copyright (c) 2017 All rights reserved
2 # This program and the accompanying materials
3 # are made available under the terms of the Apache License, Version 2.0
4 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
13 # - odl datastore state
14 # - ovs state (openflow and dp)
15 # - optional - memory dump from odl
20 import sdnvpn.lib.utils as test_utils
21 import functest.utils.functest_utils as ft_utils
22 from functest.utils.constants import CONST
24 LIB_PATH = os.path.dirname(
25 os.path.abspath(inspect.getfile(inspect.currentframe())))
28 def gather_logs(name):
29 openstack_nodes = test_utils.get_nodes()
31 ft_utils.execute_command_raise('rm -rf /tmp/sdnvpn-logs/;'
32 'mkdir -p /tmp/sdnvpn-logs/')
33 for node in openstack_nodes:
34 node.put_file('%s/../sh_utils/fetch-log-script.sh'
36 '/tmp/fetch-log-script.sh')
37 node.run_cmd('sudo bash /tmp/fetch-log-script.sh')
38 node.get_file('/tmp/log_output.tar.gz',
39 '/tmp/log_output-%s.tar.gz'
40 % node.get_dict()['name'])
41 ft_utils.execute_command_raise('mkdir -p /tmp/sdnvpn-logs/')
42 ft_utils.execute_command_raise(
43 'cd /tmp/sdnvpn-logs/; '
44 'tar -xzvf /tmp/log_output-%s.tar.gz --strip-components=1'
45 % node.get_dict()['name'])
47 ft_utils.execute_command_raise('cd %s;tar czvf sdnvpn-logs-%s.tar.gz'
49 % (CONST.__getattribute__('dir_results'),
53 if __name__ == '__main__':