3 # Copyright (c) 2017 All rights reserved
4 # This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
11 # - Peering OpenDaylight with Quagga:
12 # - Set up a Quagga instance in the functest container
13 # - Start a BGP router with OpenDaylight
14 # - Add the functest Quagga as a neighbor
15 # - Verify that the OpenDaylight and gateway Quagga peer
20 from sdnvpn.lib import config as sdnvpn_config
21 from sdnvpn.lib import utils as test_utils
22 from sdnvpn.lib.results import Results
24 COMMON_CONFIG = sdnvpn_config.CommonConfig()
25 TESTCASE_CONFIG = sdnvpn_config.TestcaseConfig(
26 "sdnvpn.test.functest.testcase_9")
28 logger = logging.getLogger('__name__')
30 parser = argparse.ArgumentParser()
32 parser.add_argument("-r", "--report",
33 help="Create json result file",
36 args = parser.parse_args()
40 results = Results(COMMON_CONFIG.line_length)
41 results.add_to_summary(0, "=")
42 results.add_to_summary(2, "STATUS", "SUBTEST")
43 results.add_to_summary(0, "=")
45 openstack_nodes = test_utils.get_nodes()
47 # node.is_odl() doesn't work in Apex
48 # https://jira.opnfv.org/browse/RELENG-192
49 controllers = [node for node in openstack_nodes
51 node.run_cmd("sudo systemctl status opendaylight")]
53 msg = ("Verify that all OpenStack nodes OVS br-int have "
54 "fail_mode set to secure")
55 results.record_action(msg)
56 results.add_to_summary(0, "-")
58 msg = ("Controller (ODL) list is empty. Skipping rest of tests.")
60 results.add_failure(msg)
61 return results.compile_summary()
63 msg = ("Controller (ODL) list is ready")
65 results.add_success(msg)
66 # Get fail_mode status on all nodes
67 fail_mode_statuses = test_utils.is_fail_mode_secure()
68 for node_name, status in fail_mode_statuses.iteritems():
69 msg = 'Node {} br-int is fail_mode secure'.format(node_name)
71 results.add_success(msg)
73 results.add_failure(msg)
75 return results.compile_summary()
77 if __name__ == '__main__':
78 logging.basicConfig(level=logging.INFO)