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
=== modified file 'init/main.c'
--- init/main.c 2013-02-25 09:42:11 +0000
+++ init/main.c 2013-02-25 22:08:21 +0000
@@ -210,6 +210,9 @@
210210
211 control_handle_bus_type ();211 control_handle_bus_type ();
212212
213 if (! user_mode)
214 no_inherit_env = TRUE;
215
213#ifndef DEBUG216#ifndef DEBUG
214 if (use_session_bus == FALSE && user_mode == FALSE) {217 if (use_session_bus == FALSE && user_mode == FALSE) {
215218
216219
=== modified file 'util/tests/test_initctl.c'
--- util/tests/test_initctl.c 2013-02-25 09:38:55 +0000
+++ util/tests/test_initctl.c 2013-02-25 22:08:21 +0000
@@ -824,6 +824,9 @@
824 NIH_MUST (nih_str_array_add (&args, NULL, NULL,824 NIH_MUST (nih_str_array_add (&args, NULL, NULL,
825 "--no-sessions"));825 "--no-sessions"));
826826
827 NIH_MUST (nih_str_array_add (&args, NULL, NULL,
828 "--no-inherit-env"));
829
827 if (confdir) {830 if (confdir) {
828 NIH_MUST (nih_str_array_add (&args, NULL, NULL,831 NIH_MUST (nih_str_array_add (&args, NULL, NULL,
829 "--confdir"));832 "--confdir"));

Subscribers

People subscribed via source and target branches