Merge lp:~xnox/upstart/buildd-cgmanager into lp:upstart/async

Proposed by Dimitri John Ledkov on 2014-06-05
Status: Merged
Merged at revision: 1664
Proposed branch: lp:~xnox/upstart/buildd-cgmanager
Merge into: lp:upstart/async
Diff against target: 39 lines (+17/-11)
1 file modified
test/tests/test_util_check_env.c (+17/-11)
To merge this branch: bzr merge lp:~xnox/upstart/buildd-cgmanager
Reviewer Review Type Date Requested Status
James Hunt 2014-06-05 Approve on 2014-06-05
Review via email: mp+222165@code.launchpad.net
To post a comment you must log in.
James Hunt (jamesodhunt) wrote :

Thanks - applied with minor tweaks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test/tests/test_util_check_env.c'
2--- test/tests/test_util_check_env.c 2014-05-12 13:21:06 +0000
3+++ test/tests/test_util_check_env.c 2014-06-05 11:09:52 +0000
4@@ -165,18 +165,24 @@
5
6
7 #ifdef ENABLE_CGROUPS
8- TEST_FEATURE ("checking for cgmanager");
9- ret = connect_to_cgmanager();
10- switch(ret) {
11- case -2: TEST_FAILED("Found no cgroup manager"); break;
12- case -1: TEST_FAILED("Error connecting to cgmanager"); break;
13- case 0: print_my_cgroup(); break;
14- default: TEST_FAILED("Unknown error from connect_to_cgmanager: %d", ret);
15+ struct stat buffer;
16+ int status;
17+ if (stat("/sys/fs/cgroup/cgmanager/sock", &buffer) == 0) {
18+ TEST_FEATURE ("checking for cgmanager");
19+ ret = connect_to_cgmanager();
20+ switch(ret) {
21+ case -2: TEST_FAILED("Found no cgroup manager"); break;
22+ case -1: TEST_FAILED("Error connecting to cgmanager"); break;
23+ case 0: print_my_cgroup(); break;
24+ default: TEST_FAILED("Unknown error from connect_to_cgmanager: %d", ret);
25+ }
26+
27+ TEST_FEATURE("cgroup sandbox");
28+ TEST_EQ(check_cgroup_sandbox(), 0);
29+ disconnect_cgmanager();
30+ } else {
31+ nih_warn ("Skipping CGManager tests, CGManager socket not found");
32 }
33-
34- TEST_FEATURE("cgroup sandbox");
35- TEST_EQ(check_cgroup_sandbox(), 0);
36- disconnect_cgmanager();
37 #endif /* ENABLE_CGROUPS */
38
39 }

Subscribers

People subscribed via source and target branches