~hazmat/charms/precise/quantum-gateway/ssl-everywhere

« back to all changes in this revision

Viewing changes to unit_tests/test_quantum_utils.py

  • Committer: James Page
  • Date: 2013-11-17 21:53:21 UTC
  • mfrom: (37.1.5 quantum-gateway)
  • Revision ID: james.page@canonical.com-20131117215321-o4o6uje3itj2e4se
[gandelman-a][james-page] NVP support

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
import quantum_utils
8
8
 
 
9
try:
 
10
    import neutronclient
 
11
except ImportError:
 
12
    neutronclient = None
 
13
 
9
14
from test_utils import (
10
15
    CharmTestCase
11
16
)
60
65
        self.config.return_value = 'nvp'
61
66
        self.assertEquals(
62
67
            quantum_utils.get_early_packages(),
63
 
            ['openvswitch-datapath-dkms', 'linux-headers-2.6.18'])
 
68
            [])
64
69
 
65
70
    @patch.object(quantum_utils, 'EARLY_PACKAGES')
66
71
    def test_get_early_packages_no_dkms(self, _early_packages):
76
81
        self.assertNotEqual(quantum_utils.get_packages(), [])
77
82
 
78
83
    def test_configure_ovs_starts_service_if_required(self):
 
84
        self.config.return_value = 'ovs'
79
85
        self.service_running.return_value = False
80
86
        quantum_utils.configure_ovs()
81
87
        self.assertTrue(self.full_restart.called)
96
102
        ])
97
103
        self.add_bridge_port.assert_called_with('br-ex', 'eth0')
98
104
 
99
 
    def test_configure_ovs_nvp(self):
100
 
        self.config.return_value = 'nvp'
101
 
        quantum_utils.configure_ovs()
102
 
        self.add_bridge.assert_called_with('br-int')
103
 
 
104
105
    def test_do_openstack_upgrade(self):
105
106
        self.config.side_effect = self.test_config.get
106
107
        self.test_config.set('openstack-origin', 'cloud:precise-havana')
293
294
 
294
295
class TestQuantumAgentReallocation(CharmTestCase):
295
296
    def setUp(self):
 
297
        if not neutronclient:
 
298
            raise self.skipTest('Skipping, no neutronclient installed')
296
299
        super(TestQuantumAgentReallocation, self).setUp(quantum_utils,
297
300
                                                        TO_PATCH)
298
301