Merge lp:~stgraber/upstart/upstart-fix-env-test into lp:upstart

Proposed by Stéphane Graber
Status: Merged
Merged at revision: 1438
Proposed branch: lp:~stgraber/upstart/upstart-fix-env-test
Merge into: lp:upstart
Diff against target: 27 lines (+6/-0)
2 files modified
init/main.c (+3/-0)
util/tests/test_initctl.c (+3/-0)
To merge this branch: bzr merge lp:~stgraber/upstart/upstart-fix-env-test
Reviewer Review Type Date Requested Status
James Hunt Approve
Review via email: mp+150447@code.launchpad.net

Description of the change

An earlier commit changed --inherit-env into --no-inherit-env, thereby changing
the default behaviour to inheriting the environment by default.

What the change didn't do however was restrict it to user sessions only, which
had the side effect of breaking the tests.

This branch does two things:
 1) set no_inherit_env = TRUE when not running under user sessions.
 2) pass --no-inherit-env to user session tests.

To post a comment you must log in.
Revision history for this message
James Hunt (jamesodhunt) wrote :

LGTM.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'init/main.c'
2--- init/main.c 2013-02-25 09:42:11 +0000
3+++ init/main.c 2013-02-25 22:08:21 +0000
4@@ -210,6 +210,9 @@
5
6 control_handle_bus_type ();
7
8+ if (! user_mode)
9+ no_inherit_env = TRUE;
10+
11 #ifndef DEBUG
12 if (use_session_bus == FALSE && user_mode == FALSE) {
13
14
15=== modified file 'util/tests/test_initctl.c'
16--- util/tests/test_initctl.c 2013-02-25 09:38:55 +0000
17+++ util/tests/test_initctl.c 2013-02-25 22:08:21 +0000
18@@ -824,6 +824,9 @@
19 NIH_MUST (nih_str_array_add (&args, NULL, NULL,
20 "--no-sessions"));
21
22+ NIH_MUST (nih_str_array_add (&args, NULL, NULL,
23+ "--no-inherit-env"));
24+
25 if (confdir) {
26 NIH_MUST (nih_str_array_add (&args, NULL, NULL,
27 "--confdir"));

Subscribers

People subscribed via source and target branches