dbusmock.templates.networkmanager
NetworkManager mock template
This creates the expected methods and properties of the main org.freedesktop.NetworkManager object, but no devices. You can specify any property such as ‘NetworkingEnabled’, or ‘WirelessEnabled’ etc. in “parameters”.
Attributes
Classes
Global state |
|
Connectvity state |
|
Active connection state |
|
Infrastructure mode |
|
Device states |
|
Security flags |
|
Device flags |
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add an ethernet device. |
|
Add a WiFi Device. |
|
Add an access point to an existing WiFi device. |
|
Add an available connection to an existing WiFi device and access point. |
|
Add an active connection to an existing WiFi device. |
|
Remove the specified access point. |
|
Remove the specified WiFi connection. |
|
Remove the specified ActiveConnection. |
|
Add a connection. |
|
|
|
Update settings on a connection. |
|
|
|
|
|
Deletes a connection. |
Module Contents
- dbusmock.templates.networkmanager.__copyright__ = Multiline-String[source]
Show Value
""" (c) 2012 Canonical Ltd. (c) 2017 - 2022 Martin Pitt <martin@piware.de> """
- dbusmock.templates.networkmanager.SETTINGS_OBJ = '/org/freedesktop/NetworkManager/Settings'[source]
- dbusmock.templates.networkmanager.SETTINGS_IFACE = 'org.freedesktop.NetworkManager.Settings'[source]
- dbusmock.templates.networkmanager.WIRELESS_DEVICE_IFACE = 'org.freedesktop.NetworkManager.Device.Wireless'[source]
- dbusmock.templates.networkmanager.ACCESS_POINT_IFACE = 'org.freedesktop.NetworkManager.AccessPoint'[source]
- dbusmock.templates.networkmanager.CSETTINGS_IFACE = 'org.freedesktop.NetworkManager.Settings.Connection'[source]
- dbusmock.templates.networkmanager.ACTIVE_CONNECTION_IFACE = 'org.freedesktop.NetworkManager.Connection.Active'[source]
- class dbusmock.templates.networkmanager.NMState[source]
Global state
As per https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMState
- class dbusmock.templates.networkmanager.NMConnectivityState[source]
Connectvity state
As per https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMConnectivityState
- class dbusmock.templates.networkmanager.NMActiveConnectionState[source]
Active connection state
As per https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMActiveConnectionState
- class dbusmock.templates.networkmanager.InfrastructureMode[source]
Infrastructure mode
As per https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NM80211Mode
- class dbusmock.templates.networkmanager.DeviceState[source]
Device states
As per https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMDeviceState
- class dbusmock.templates.networkmanager.NM80211ApSecurityFlags[source]
Security flags
As per https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NM80211ApSecurityFlags
- class dbusmock.templates.networkmanager.NM80211ApFlags[source]
Device flags
As per https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NM80211ApFlags
- dbusmock.templates.networkmanager.SetDeviceActive(_self, device_path, active_connection_path)[source]
- dbusmock.templates.networkmanager.AddEthernetDevice(self, device_name, iface_name, state)[source]
Add an ethernet device.
You have to specify device_name, device interface name (e. g. eth0), and state. You can use the predefined DeviceState values (e. g. DeviceState.ACTIVATED) or supply a numeric value. For valid state values please visit https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMDeviceState
Please note that this does not set any global properties.
Returns the new object path.
- dbusmock.templates.networkmanager.AddWiFiDevice(self, device_name, iface_name, state)[source]
Add a WiFi Device.
You have to specify device_name, device interface name (e. g. wlan0) and state. You can use the predefined DeviceState values (e. g. DeviceState.ACTIVATED) or supply a numeric value. For valid state values, please visit https://developer.gnome.org/NetworkManager/unstable/nm-dbus-types.html#NMDeviceState
Please note that this does not set any global properties.
Returns the new object path.
- dbusmock.templates.networkmanager.AddAccessPoint(self, dev_path, ap_name, ssid, hw_address, mode, frequency, rate, strength, security)[source]
Add an access point to an existing WiFi device.
You have to specify WiFi Device path, Access Point object name, ssid, hw_address, mode, frequency, rate, strength and security. For valid access point property values, please visit https://developer.gnome.org/NetworkManager/unstable/gdbus-org.freedesktop.NetworkManager.AccessPoint.html
Please note that this does not set any global properties.
Returns the new object path.
- dbusmock.templates.networkmanager.AddWiFiConnection(self, dev_path, connection_name, ssid_name, _key_mgmt)[source]
Add an available connection to an existing WiFi device and access point.
You have to specify WiFi Device path, Connection object name, SSID and key management.
The SSID must match one of the previously created access points.
Please note that this only sets minimal global properties in ipv{4,6}, no others.
Returns the new object path.
- dbusmock.templates.networkmanager.AddActiveConnection(self, devices, connection_device, specific_object, name, state)[source]
Add an active connection to an existing WiFi device.
You have to a list of the involved WiFi devices, the connection path, the access point path, ActiveConnection object name and connection state.
Please note that this does not set any global properties.
Returns the new object path.
- dbusmock.templates.networkmanager.RemoveAccessPoint(self, dev_path, ap_path)[source]
Remove the specified access point.
You have to specify the device to remove the access point from, and the path of the access point.
Please note that this does not set any global properties.
- dbusmock.templates.networkmanager.RemoveWifiConnection(self, dev_path, connection_path)[source]
Remove the specified WiFi connection.
You have to specify the device to remove the connection from, and the path of the Connection.
Please note that this does not set any global properties.
- dbusmock.templates.networkmanager.RemoveActiveConnection(self, dev_path, active_connection_path)[source]
Remove the specified ActiveConnection.
You have to specify the device to remove the connection from, and the path of the ActiveConnection.
Please note that this does not set any global properties.
- dbusmock.templates.networkmanager.SettingsAddConnection(self, connection_settings)[source]
Add a connection.
connection_settings is a String String Variant Map Map. See https://developer.gnome.org/NetworkManager/0.9/spec.html #type-String_String_Variant_Map_Map
If you omit uuid, this method adds one for you.
- dbusmock.templates.networkmanager.ConnectionUpdate(self, settings)[source]
Update settings on a connection.
settings is a String String Variant Map Map. See https://developer.gnome.org/NetworkManager/0.9/spec.html#type-String_String_Variant_Map_Map
- dbusmock.templates.networkmanager.ConnectionDelete(self)[source]
Deletes a connection.
- This also
removes the deleted connection from any device,
removes any active connection(s) it might be associated with,
removes it from the Settings interface,
as well as deletes the object from the mock.
Note: If this was the only active connection, we change the global connection state.