Ejemplo n.º 1
0
    def test_set_indicator_state_default_impl(self):
        management = fake.FakeManagement()
        task_mock = mock.MagicMock(spec_set=['node'])

        self.assertRaises(exception.UnsupportedDriverExtension,
                          management.set_indicator_state, task_mock,
                          components.CHASSIS, 'led-0', indicator_states.ON)
Ejemplo n.º 2
0
    def test_get_supported_indicators_default_impl(self):
        management = fake.FakeManagement()
        task_mock = mock.MagicMock(spec_set=['node'])

        expected = {
            components.CHASSIS: {
                'led-0': {
                    "readonly": True,
                    "states": [indicator_states.OFF, indicator_states.ON]
                }
            },
            components.SYSTEM: {
                'led': {
                    "readonly":
                    False,
                    "states": [
                        indicator_states.BLINKING, indicator_states.OFF,
                        indicator_states.ON
                    ]
                }
            }
        }

        self.assertEqual(expected,
                         management.get_supported_indicators(task_mock))
Ejemplo n.º 3
0
    def test_get_indicator_state_default_impl(self):
        management = fake.FakeManagement()
        task_mock = mock.MagicMock(spec_set=['node'])

        expected = indicator_states.ON

        self.assertEqual(
            expected, management.get_indicator_state(
                task_mock, components.CHASSIS, 'led-0'))
Ejemplo n.º 4
0
    def __init__(self):
        self.power = fake.FakePower()
        self.deploy = fake.FakeDeploy()

        self.a = fake.FakeVendorA()
        self.b = fake.FakeVendorB()
        self.mapping = {'first_method': self.a, 'second_method': self.b}
        self.vendor = utils.MixinVendorInterface(self.mapping)
        self.console = fake.FakeConsole()
        self.management = fake.FakeManagement()
Ejemplo n.º 5
0
    def __init__(self):
        self.power = fake.FakePower()
        self.deploy = fake.FakeDeploy()
        self.boot = fake.FakeBoot()

        self.a = fake.FakeVendorA()
        self.b = fake.FakeVendorB()
        self.mapping = {'first_method': self.a,
                        'second_method': self.b,
                        'third_method_sync': self.b,
                        'fourth_method_shared_lock': self.b}
        self.vendor = utils.MixinVendorInterface(self.mapping)
        self.console = fake.FakeConsole()
        self.management = fake.FakeManagement()
        self.inspect = fake.FakeInspect()
        self.raid = fake.FakeRAID()
Ejemplo n.º 6
0
    def test_inject_nmi_default_impl(self):
        management = fake.FakeManagement()
        task_mock = mock.MagicMock(spec_set=['node'])

        self.assertRaises(exception.UnsupportedDriverExtension,
                          management.inject_nmi, task_mock)
Ejemplo n.º 7
0
    def test_get_mac_addresses(self):
        management = fake.FakeManagement()
        task_mock = mock.MagicMock(spec_set=['node'])

        self.assertRaises(exception.UnsupportedDriverExtension,
                          management.get_mac_addresses, task_mock)
Ejemplo n.º 8
0
    def test_set_boot_mode_default_impl(self):
        management = fake.FakeManagement()
        task_mock = mock.MagicMock(spec_set=['node'])

        self.assertRaises(exception.UnsupportedDriverExtension,
                          management.set_boot_mode, task_mock, 'whatever')
Ejemplo n.º 9
0
 def __init__(self):
     self.power = fake.FakePower()
     self.boot = pxe.PXEBoot()
     self.deploy = ansible_deploy.AnsibleDeploy()
     self.management = fake.FakeManagement()