summary refs log tree commit diff
path: root/dispatcher
diff options
context:
space:
mode:
Diffstat (limited to 'dispatcher')
-rw-r--r--dispatcher/nm-dispatcher-utils.c2
-rw-r--r--dispatcher/tests/dispatcher-connectivity-full10
-rw-r--r--dispatcher/tests/dispatcher-connectivity-unknown10
-rw-r--r--dispatcher/tests/dispatcher-down1
-rw-r--r--dispatcher/tests/dispatcher-external1
-rw-r--r--dispatcher/tests/dispatcher-up1
-rw-r--r--dispatcher/tests/dispatcher-vpn-down1
-rw-r--r--dispatcher/tests/dispatcher-vpn-up1
-rw-r--r--dispatcher/tests/test-dispatcher-envp.c4
9 files changed, 12 insertions, 19 deletions
diff --git a/dispatcher/nm-dispatcher-utils.c b/dispatcher/nm-dispatcher-utils.c
index 362f3126..4d04eeca 100644
--- a/dispatcher/nm-dispatcher-utils.c
+++ b/dispatcher/nm-dispatcher-utils.c
@@ -575,6 +575,8 @@ done:
 
 	_items_add_key0 (items, NULL, "PATH", g_getenv ("PATH"));
 
+	_items_add_key (items, NULL, "NM_DISPATCHER_ACTION", action);
+
 	*out_error_message = NULL;
 	g_ptr_array_add (items, NULL);
 	return (char **) g_ptr_array_free (g_steal_pointer (&items), FALSE);
diff --git a/dispatcher/tests/dispatcher-connectivity-full b/dispatcher/tests/dispatcher-connectivity-full
index 0b2796d1..937e79d7 100644
--- a/dispatcher/tests/dispatcher-connectivity-full
+++ b/dispatcher/tests/dispatcher-connectivity-full
@@ -1,6 +1,5 @@
 [main]
-action=connectiviy-change
-expected-iface=wlan0
+action=connectivity-change
 uuid=3fd2a33a-d81b-423f-ae99-e6baba742311
 id=Random Connection
 connectivity-state=FULL
@@ -14,10 +13,5 @@ path=/org/freedesktop/NetworkManager/Devices/0
 
 [env]
 PATH=
-CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311
-CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
-CONNECTION_ID=Random Connection
-CONNECTION_FILENAME=/dispatcher/tests/dispatcher-connectivity-full
-DEVICE_IFACE=wlan0
-DEVICE_IP_IFACE=wlan0
+NM_DISPATCHER_ACTION=connectivity-change
 CONNECTIVITY_STATE=FULL
diff --git a/dispatcher/tests/dispatcher-connectivity-unknown b/dispatcher/tests/dispatcher-connectivity-unknown
index 4d797712..9aa48e4a 100644
--- a/dispatcher/tests/dispatcher-connectivity-unknown
+++ b/dispatcher/tests/dispatcher-connectivity-unknown
@@ -1,6 +1,5 @@
 [main]
-action=connectiviy-change
-expected-iface=wlan0
+action=connectivity-change
 uuid=3fd2a33a-d81b-423f-ae99-e6baba742311
 id=Random Connection
 connectivity-state=UNKNOWN
@@ -14,9 +13,4 @@ path=/org/freedesktop/NetworkManager/Devices/0
 
 [env]
 PATH=
-CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311
-CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
-CONNECTION_ID=Random Connection
-CONNECTION_FILENAME=/dispatcher/tests/dispatcher-connectivity-unknown
-DEVICE_IFACE=wlan0
-DEVICE_IP_IFACE=wlan0
+NM_DISPATCHER_ACTION=connectivity-change
diff --git a/dispatcher/tests/dispatcher-down b/dispatcher/tests/dispatcher-down
index e0e44a72..8e2a2818 100644
--- a/dispatcher/tests/dispatcher-down
+++ b/dispatcher/tests/dispatcher-down
@@ -13,6 +13,7 @@ path=/org/freedesktop/NetworkManager/Devices/0
 
 [env]
 PATH=
+NM_DISPATCHER_ACTION=down
 CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311
 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
 CONNECTION_ID=Random Connection
diff --git a/dispatcher/tests/dispatcher-external b/dispatcher/tests/dispatcher-external
index 41f01d46..46d6c797 100644
--- a/dispatcher/tests/dispatcher-external
+++ b/dispatcher/tests/dispatcher-external
@@ -23,6 +23,7 @@ gateway=0.0.0.0
 
 [env]
 PATH=
+NM_DISPATCHER_ACTION=up
 CONNECTION_UUID=92bbc2fb-7304-46be-8ebb-6093dbe19a6a
 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
 CONNECTION_FILENAME=/dispatcher/tests/dispatcher-external
diff --git a/dispatcher/tests/dispatcher-up b/dispatcher/tests/dispatcher-up
index ad7e87d3..0a27e3de 100644
--- a/dispatcher/tests/dispatcher-up
+++ b/dispatcher/tests/dispatcher-up
@@ -36,6 +36,7 @@ domains=hsd1.mn.comcast.net.
 
 [env]
 PATH=
+NM_DISPATCHER_ACTION=up
 CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311
 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
 CONNECTION_ID=Random Connection
diff --git a/dispatcher/tests/dispatcher-vpn-down b/dispatcher/tests/dispatcher-vpn-down
index c921f105..e439668f 100644
--- a/dispatcher/tests/dispatcher-vpn-down
+++ b/dispatcher/tests/dispatcher-vpn-down
@@ -36,6 +36,7 @@ domains=hsd1.mn.comcast.net.
 
 [env]
 PATH=
+NM_DISPATCHER_ACTION=vpn-down
 CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e
 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
 CONNECTION_ID=Random Connection
diff --git a/dispatcher/tests/dispatcher-vpn-up b/dispatcher/tests/dispatcher-vpn-up
index cbafc031..09c94c1c 100644
--- a/dispatcher/tests/dispatcher-vpn-up
+++ b/dispatcher/tests/dispatcher-vpn-up
@@ -36,6 +36,7 @@ domains=hsd1.mn.comcast.net.
 
 [env]
 PATH=
+NM_DISPATCHER_ACTION=vpn-up
 CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e
 CONNECTION_DBUS_PATH=/org/freedesktop/NetworkManager/Connections/5
 CONNECTION_ID=Random Connection
diff --git a/dispatcher/tests/test-dispatcher-envp.c b/dispatcher/tests/test-dispatcher-envp.c
index 1203c6ac..5fa4a314 100644
--- a/dispatcher/tests/test-dispatcher-envp.c
+++ b/dispatcher/tests/test-dispatcher-envp.c
@@ -66,9 +66,7 @@ parse_main (GKeyFile *kf,
 	NMSettingConnection *s_con;
 	GVariantBuilder props;
 
-	*out_expected_iface = g_key_file_get_string (kf, "main", "expected-iface", error);
-	if (*out_expected_iface == NULL)
-		return FALSE;
+	*out_expected_iface = g_key_file_get_string (kf, "main", "expected-iface", NULL);
 
 	*out_connectivity_state = g_key_file_get_string (kf, "main", "connectivity-state", NULL);
 	*out_vpn_ip_iface = g_key_file_get_string (kf, "main", "vpn-ip-iface", NULL);