mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 03:48:09 +02:00
test/nm-service: add support for creating a MACVLAN
...via AddAndActivate. nm-cloud-setup will do that.
This commit is contained in:
parent
cb17b73ff6
commit
163fa8445d
1 changed files with 15 additions and 0 deletions
|
|
@ -1860,6 +1860,21 @@ class NetworkManager(ExportedObj):
|
||||||
if con_type == NM.SETTING_WIRELESS_SETTING_NAME:
|
if con_type == NM.SETTING_WIRELESS_SETTING_NAME:
|
||||||
return self.find_device_first(dev_type=WifiDevice)
|
return self.find_device_first(dev_type=WifiDevice)
|
||||||
|
|
||||||
|
if con_type == NM.SETTING_MACVLAN_SETTING_NAME:
|
||||||
|
ifname = con_hash[NM.SETTING_CONNECTION_SETTING_NAME]["interface-name"]
|
||||||
|
mac = con_hash[NM.SETTING_WIRED_SETTING_NAME]["cloned-mac-address"]
|
||||||
|
hwaddr = "%02X:%02X:%02X:%02X:%02X:%02X" % (
|
||||||
|
mac[0],
|
||||||
|
mac[1],
|
||||||
|
mac[2],
|
||||||
|
mac[3],
|
||||||
|
mac[4],
|
||||||
|
mac[5],
|
||||||
|
)
|
||||||
|
device = MacvlanDevice(ifname, hwaddr)
|
||||||
|
self.add_device(device)
|
||||||
|
return device
|
||||||
|
|
||||||
if con_type == NM.SETTING_VLAN_SETTING_NAME:
|
if con_type == NM.SETTING_VLAN_SETTING_NAME:
|
||||||
|
|
||||||
iface = con_hash[NM.SETTING_CONNECTION_SETTING_NAME].get("interface-name")
|
iface = con_hash[NM.SETTING_CONNECTION_SETTING_NAME].get("interface-name")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue