summaryrefslogtreecommitdiff
path: root/callouts
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-04-22 12:19:29 +0200
committerThomas Haller <thaller@redhat.com>2014-04-22 12:24:25 +0200
commitab0c37d042f749f6f859b3010c079e53f1739dbf (patch)
tree9e4dd393603ea784612aa50b72d0f0ea05721c78 /callouts
parent6fcbd205971370c58f937b50c6cb51bbbda0a51a (diff)
dispatcher/test: fix tests after adding PATH environment variable
These tests were broken by commit 45ed459ae32976a120f607046021b48bf728c1d6. Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'callouts')
-rw-r--r--callouts/tests/dispatcher-old-down1
-rw-r--r--callouts/tests/dispatcher-old-up1
-rw-r--r--callouts/tests/dispatcher-old-vpn-down1
-rw-r--r--callouts/tests/dispatcher-old-vpn-up1
-rw-r--r--callouts/tests/test-dispatcher-envp.c12
5 files changed, 14 insertions, 2 deletions
diff --git a/callouts/tests/dispatcher-old-down b/callouts/tests/dispatcher-old-down
index 6396287f7b..836f353289 100644
--- a/callouts/tests/dispatcher-old-down
+++ b/callouts/tests/dispatcher-old-down
@@ -12,6 +12,7 @@ interface=wlan0
path=/org/freedesktop/NetworkManager/Devices/0
[env]
+PATH=
CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311
CONNECTION_ID=Random Connection
DEVICE_IFACE=wlan0
diff --git a/callouts/tests/dispatcher-old-up b/callouts/tests/dispatcher-old-up
index 76e3be8dec..a35812eeb9 100644
--- a/callouts/tests/dispatcher-old-up
+++ b/callouts/tests/dispatcher-old-up
@@ -31,6 +31,7 @@ nameservers=68.87.77.134 68.87.72.134 192.168.1.1
domains=hsd1.mn.comcast.net.
[env]
+PATH=
CONNECTION_UUID=3fd2a33a-d81b-423f-ae99-e6baba742311
CONNECTION_ID=Random Connection
DEVICE_IFACE=wlan0
diff --git a/callouts/tests/dispatcher-old-vpn-down b/callouts/tests/dispatcher-old-vpn-down
index c11cbfd1eb..4fab5e9562 100644
--- a/callouts/tests/dispatcher-old-vpn-down
+++ b/callouts/tests/dispatcher-old-vpn-down
@@ -31,6 +31,7 @@ nameservers=68.87.77.134 68.87.72.134 192.168.1.1
domains=hsd1.mn.comcast.net.
[env]
+PATH=
CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e
CONNECTION_ID=Random Connection
DEVICE_IFACE=wlan0
diff --git a/callouts/tests/dispatcher-old-vpn-up b/callouts/tests/dispatcher-old-vpn-up
index ad47c91d50..3c350dbf07 100644
--- a/callouts/tests/dispatcher-old-vpn-up
+++ b/callouts/tests/dispatcher-old-vpn-up
@@ -31,6 +31,7 @@ nameservers=68.87.77.134 68.87.72.134 192.168.1.1
domains=hsd1.mn.comcast.net.
[env]
+PATH=
CONNECTION_UUID=355653c0-34d3-4777-ad25-f9a498b7ef8e
CONNECTION_ID=Random Connection
DEVICE_IFACE=wlan0
diff --git a/callouts/tests/test-dispatcher-envp.c b/callouts/tests/test-dispatcher-envp.c
index c8c0aadefc..3ac0c9b56e 100644
--- a/callouts/tests/test-dispatcher-envp.c
+++ b/callouts/tests/test-dispatcher-envp.c
@@ -560,10 +560,18 @@ test_generic (const char *path, const char *file, const char *override_vpn_ip_if
/* Compare dispatcher generated env and expected env */
for (iter = denv; iter && *iter; iter++) {
gpointer foo;
+ const char *i_value = *iter;
- foo = g_hash_table_lookup (expected_env, *iter);
+ if (strstr (i_value, "PATH=") == i_value) {
+ g_assert_cmpstr (&i_value[strlen("PATH=")], ==, g_getenv ("PATH"));
+
+ /* The path is constructed dynamically. Ignore the actual value. */
+ i_value = "PATH=";
+ }
+
+ foo = g_hash_table_lookup (expected_env, i_value);
if (!foo)
- g_warning ("Failed to find %s in environment", *iter);
+ g_warning ("Failed to find %s in environment", i_value);
g_assert (foo);
}