~jamesodhunt/upstart/make-cgroups-quiet-in-debug-mode

« back to all changes in this revision

Viewing changes to test/tests/test_util_check_env.c

  • Committer: James Hunt
  • Date: 2014-07-24 16:20:37 UTC
  • mfrom: (1658.1.2 upstart)
  • Revision ID: james.hunt@ubuntu.com-20140724162037-v2l03grpoo6rhjb0
* Merge of lp:~serge-hallyn/upstart/upstart-fix-cgm-env-tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
                TEST_FEATURE ("checking for cgmanager");
170
170
                ret = connect_to_cgmanager ();
171
171
                switch (ret) {
172
 
                case -2: TEST_FAILED ("Found no cgroup manager"); break;
173
 
                case -1: TEST_FAILED ("Error connecting to cgmanager"); break;
174
 
                case 0: print_my_cgroup (); break;
175
 
                default: TEST_FAILED ("Unknown error from connect_to_cgmanager: %d", ret);
 
172
                case -2:
 
173
                        nih_warn ("Found no cgroup manager");
 
174
                        goto out_skip;
 
175
                case -1:
 
176
                        nih_warn ("Error connecting to cgmanager");
 
177
                        goto out_skip;
 
178
                case 0:
 
179
                        print_my_cgroup ();
 
180
                        break;
 
181
                default: nih_warn ("Unknown error from connect_to_cgmanager: %d", ret);
 
182
                        goto out_skip;
176
183
                }
177
184
 
178
185
                TEST_FEATURE ("cgroup sandbox");
179
 
                TEST_EQ (check_cgroup_sandbox (), 0);
180
 
                disconnect_cgmanager ();
 
186
                if (check_cgroup_sandbox() != 0)
 
187
                        nih_warn ("Could not create cgroup sandbox");
181
188
        } else {
182
189
                nih_warn ("Skipping CGManager tests, CGManager socket not found");
183
190
        }
 
191
out_skip:
 
192
        disconnect_cgmanager();
 
193
        if (ret)
 
194
                nih_warn ("Skipping CGManager tests, CGManager not properly configured");
184
195
#endif /* ENABLE_CGROUPS */
185
196
 
186
197
}