1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-01-18 06:03:54 +03:00

Refactor network tests and update MAC address handling for consistency

This commit is contained in:
Adolfo Gómez García 2024-08-21 16:32:26 +02:00
parent afa8757264
commit 94a3a791cd
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23
3 changed files with 9 additions and 2 deletions

View File

@ -183,7 +183,7 @@ DEF_VMS_CONFIGURATION: list[prox_types.VMConfiguration] = [
digest='digest',
networks=[
prox_types.NetworkConfiguration(
net='net', type='type', mac=f'{i:02x}:{i+1:02x}:{i+2:02x}:{i+3:02x}:{i+4:02x}:{i+5:02x}'
net='net', type='type', macaddr=f'{i:02x}:{i+1:02x}:{i+2:02x}:{i+3:02x}:{i+4:02x}:{i+5:02x}'
)
],
tpmstate0='tpmstate0',

View File

@ -346,3 +346,10 @@ class TestProxmoxClient(UDSTransactionTestCase):
vmconfig = self.pclient.get_vm_config(self.test_vm.id)
self.assertIsInstance(vmconfig, prox_types.VMConfiguration)
self.assertEqual(vmconfig.name, self.test_vm.name)
def test_set_vm_net_mac(self) -> None:
with self._create_test_vm() as vm:
mac = '00:11:22:33:44:55'
self.pclient.set_vm_net_mac(vm.id, mac)
vmconfig = self.pclient.get_vm_config(vm.id)
self.assertEqual(vmconfig.networks[0].macaddr, mac)

View File

@ -121,7 +121,7 @@ class TestProxmoxFixedService(UDSTransactionTestCase):
# Get first network mac
self.assertEqual(
service.get_mac('1'), fixtures.VMS_CONFIGURATION[0].networks[0].mac.lower()
service.get_mac('1'), fixtures.VMS_CONFIGURATION[0].networks[0].macaddr.lower()
)
# Get guest ip address