Merge lp:~vorlon/upstart/shell-error-message-match into lp:upstart

Proposed by Steve Langasek on 2013-09-13
Status: Merged
Merged at revision: 1533
Proposed branch: lp:~vorlon/upstart/shell-error-message-match
Merge into: lp:upstart
Diff against target: 36 lines (+6/-2)
2 files modified
ChangeLog (+4/-0)
init/tests/test_job_process.c (+2/-2)
To merge this branch: bzr merge lp:~vorlon/upstart/shell-error-message-match
Reviewer Review Type Date Requested Status
Upstart Reviewers 2013-09-13 Pending
Review via email: mp+185414@code.launchpad.net

Description of the change

Some Debian buildds use bash as /bin/sh. They shouldn't but this is allowed
by policy; so upstart's test suite shouldn't fail under such circumstances
because of keying on shell-specific output strings.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2013-09-13 04:43:00 +0000
3+++ ChangeLog 2013-09-13 04:49:15 +0000
4@@ -5,6 +5,10 @@
5 * extra/Makefile.am:
6 - don't pass cflags from unrelated libraries when building, only
7 pass them to those bridges which use the relevant libraries.
8+ * init/tests/test_job_process.c: adjust test case to not key on the
9+ text of error messages which will vary depending on whether
10+ /bin/sh is dash or bash; and use TEST_STR_MATCH so that in the
11+ event of future failures, we know why it's failing.
12
13 2013-09-05 James Hunt <james.hunt@ubuntu.com>
14
15
16=== modified file 'init/tests/test_job_process.c'
17--- init/tests/test_job_process.c 2013-07-01 23:15:19 +0000
18+++ init/tests/test_job_process.c 2013-09-13 04:49:15 +0000
19@@ -3068,7 +3068,7 @@
20 TEST_NE_P (output, NULL);
21
22 TEST_TRUE (fgets (buffer, sizeof(buffer), output));
23- TEST_EQ (fnmatch ("*sh*/this/command/does/not/exist*not found*", buffer, 0), 0);
24+ TEST_STR_MATCH (buffer, "*sh:*/this/command/does/not/exist:*");
25
26 TEST_FILE_END (output);
27 fclose (output);
28@@ -3555,7 +3555,7 @@
29 TEST_NE_P (output, NULL);
30
31 TEST_TRUE (fgets (buffer, sizeof(buffer), output));
32- TEST_EQ (fnmatch ("/proc/self/fd/9*/this/command/does/not/exist*not found*", buffer, 0), 0);
33+ TEST_STR_MATCH (buffer, "/proc/self/fd/9*/this/command/does/not/exist:*");
34
35 TEST_FILE_END (output);
36 fclose (output);

Subscribers

People subscribed via source and target branches