Merge authors:
  Serge Hallyn (serge-hallyn)
Related merge proposals:
  
https://code.launchpad.net/~serge-hallyn/upstart/upstart-fix-cgm-env-tests/+merge/227976
  proposed by: Serge Hallyn (serge-hallyn)
  review: Approve - James Hunt (jamesodhunt)
------------------------------------------------------------
revno: 1659 [merge]
committer: James Hunt <[email protected]>
branch nick: upstart
timestamp: Thu 2014-07-24 17:20:37 +0100
message:
  * Merge of lp:~serge-hallyn/upstart/upstart-fix-cgm-env-tests.
modified:
  test/test_util_common.c
  test/tests/test_util_check_env.c


--
lp:upstart
https://code.launchpad.net/~upstart-devel/upstart/trunk

Your team Upstart Reviewers is subscribed to branch lp:upstart.
To unsubscribe from this branch go to 
https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'test/test_util_common.c'
--- test/test_util_common.c	2014-07-10 16:45:19 +0000
+++ test/test_util_common.c	2014-07-23 18:34:26 +0000
@@ -1468,21 +1468,31 @@
 		*p = '\0';
 		if (cgmanager_create_sync(NULL, cgroup_manager, line, cg,
 					&e) != 0) {
-			nih_error("%s: failed to create cgroup %s:%s",
-				__func__, line, cg);
+			NihError *nerr;
+			nerr = nih_error_get();
+			nih_error("%s: failed to create cgroup %s:%s: %s",
+				__func__, line, cg, nerr->message);
+			nih_free(nerr);
 			goto out;
 		}
 		if (e == 1)
 			nih_warn("%s: boggle: cgroup %s:%s already existed",
 					__func__, line, cg);
 		if (cgmanager_remove_on_empty_sync(NULL, cgroup_manager, line,
-					cg) != 0)
-			nih_warn("%s: failed to mark %s:%s remove-on-empty",
-				__func__, line, cg);
+					cg) != 0) {
+			NihError *nerr;
+			nerr = nih_error_get();
+			nih_warn("%s: failed to mark %s:%s remove-on-empty: %s",
+				__func__, line, cg, nerr->message);
+			nih_free(nerr);
+		}
 		if (cgmanager_move_pid_sync(NULL, cgroup_manager, line, cg,
 					mypid) != 0) {
-			nih_error("%s: failed to move myself to cgroup %s:%s",
-				__func__, line, cg);
+			NihError *nerr;
+			nerr = nih_error_get();
+			nih_error("%s: failed to move myself to cgroup %s:%s: %s",
+				__func__, line, cg, nerr->message);
+			nih_free(nerr);
 			goto out;
 		}
 	}

=== modified file 'test/tests/test_util_check_env.c'
--- test/tests/test_util_check_env.c	2014-06-05 12:53:33 +0000
+++ test/tests/test_util_check_env.c	2014-07-24 16:17:26 +0000
@@ -169,18 +169,29 @@
 		TEST_FEATURE ("checking for cgmanager");
 		ret = connect_to_cgmanager ();
 		switch (ret) {
-		case -2: TEST_FAILED ("Found no cgroup manager"); break;
-		case -1: TEST_FAILED ("Error connecting to cgmanager"); break;
-		case 0: print_my_cgroup (); break;
-		default: TEST_FAILED ("Unknown error from connect_to_cgmanager: %d", ret);
+		case -2:
+			nih_warn ("Found no cgroup manager");
+			goto out_skip;
+		case -1:
+			nih_warn ("Error connecting to cgmanager");
+			goto out_skip;
+		case 0:
+			print_my_cgroup ();
+			break;
+		default: nih_warn ("Unknown error from connect_to_cgmanager: %d", ret);
+			goto out_skip;
 		}
 
 		TEST_FEATURE ("cgroup sandbox");
-		TEST_EQ (check_cgroup_sandbox (), 0);
-		disconnect_cgmanager ();
+		if (check_cgroup_sandbox() != 0)
+			nih_warn ("Could not create cgroup sandbox");
 	} else {
 		nih_warn ("Skipping CGManager tests, CGManager socket not found");
 	}
+out_skip:
+	disconnect_cgmanager();
+	if (ret)
+		nih_warn ("Skipping CGManager tests, CGManager not properly configured");
 #endif /* ENABLE_CGROUPS */
 
 }

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to