Add mac address to the fakedriver node
Change-Id: I70c6ee68c66789f15f2dc2c56e23c797af6fa65e
This commit is contained in:
parent
af7de384e2
commit
879744ad62
@ -32,6 +32,9 @@ class FakeDriver(AbstractSystemsDriver):
|
||||
'uuid': DEFAULT_UUID,
|
||||
'name': 'fake',
|
||||
'power_state': 'Off',
|
||||
'nics': [
|
||||
{'address': '00:5c:52:31:3a:9c'}
|
||||
]
|
||||
}
|
||||
])
|
||||
cls._config = config
|
||||
@ -159,3 +162,8 @@ class FakeDriver(AbstractSystemsDriver):
|
||||
devinfo = system.get('boot_image') or {}
|
||||
devinfo[device] = (boot_image, write_protected, bool(boot_image))
|
||||
self._update(system, boot_image=devinfo)
|
||||
|
||||
def get_nics(self, identity):
|
||||
nics = self._get(identity)['nics']
|
||||
return [{'id': nic.get('address'), 'mac': nic.get('address')}
|
||||
for nic in nics]
|
||||
|
@ -97,3 +97,8 @@ class FakeDriverTestCase(base.BaseTestCase):
|
||||
self.assertFalse(self.test_driver.get_secure_boot(UUID))
|
||||
self.test_driver.set_secure_boot(UUID, True)
|
||||
self.assertTrue(self.test_driver.get_secure_boot(UUID))
|
||||
|
||||
def test_interface(self):
|
||||
self.assertEqual([{'id': '00:5c:52:31:3a:9c',
|
||||
'mac': '00:5c:52:31:3a:9c'}],
|
||||
self.test_driver.get_nics(UUID))
|
||||
|
Loading…
Reference in New Issue
Block a user