Adds configuring vpp/hc on all nodes
[apex.git] / tests / test_apex_network_environment.py
1 ##############################################################################
2 # Copyright (c) 2016 Dan Radez (Red Hat)
3 #
4 # All rights reserved. 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
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 from apex.network_settings import NetworkSettings
11 from apex.network_environment import NetworkEnvironment
12 from apex.network_environment import NetworkEnvException
13
14 from nose.tools import assert_equal
15 from nose.tools import assert_raises
16 from nose.tools import assert_is_instance
17 from nose.tools import assert_not_equal
18
19
20 class TestNetworkEnvironment(object):
21     @classmethod
22     def setup_class(klass):
23         """This method is run once for each class before any tests are run"""
24
25     @classmethod
26     def teardown_class(klass):
27         """This method is run once for each class _after_ all tests are run"""
28
29     def setUp(self):
30         """This method is run once before _each_ test method is executed"""
31
32     def teardown(self):
33         """This method is run once after _each_ test method is executed"""
34
35     def test_init(self):
36         assert_raises(NetworkEnvException, NetworkEnvironment,
37                       None, '../build/network-environment.yaml')
38
39     def test_get_netenv_settings(self):
40         ns = NetworkSettings('../config/network/network_settings.yaml', True)
41         ne = NetworkEnvironment(ns, '../build/network-environment.yaml',
42                                 compute_pre_config=True,
43                                 controller_pre_config=True)
44         assert_is_instance(ne.get_netenv_settings(), dict)
45         assert_not_equal(ne.get_netenv_settings(), {})