Merge authors:
  Dimitri John Ledkov (xnox)
Related merge proposals:
  https://code.launchpad.net/~xnox/upstart/fix-private-telinit/+merge/210209
  proposed by: Dimitri John Ledkov (xnox)
  review: Approve - James Hunt (jamesodhunt)
------------------------------------------------------------
revno: 1609 [merge]
committer: James Hunt <[email protected]>
branch nick: upstart
timestamp: Tue 2014-03-11 14:02:35 +0000
message:
  * Merged lp:~xnox/upstart/fix-private-telinit.
modified:
  scripts/tests/test_pyupstart_system_init.py
  util/telinit.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 'scripts/tests/test_pyupstart_system_init.py'
--- scripts/tests/test_pyupstart_system_init.py	2014-03-05 10:34:32 +0000
+++ scripts/tests/test_pyupstart_system_init.py	2014-03-10 13:43:50 +0000
@@ -73,7 +73,7 @@
 
       # create a job and start it, marking it such that the .conf file
       # will be retained when object becomes unusable (after re-exec).
-      job = self.upstart.job_create('sleeper', 'exec sleep 123', retain=True)
+      job = self.upstart.job_create('connected-job', ['exec upstart-udev-bridge', 'respawn'], retain=True)
       self.assertTrue(job)
 
       # Used when recreating the job
@@ -103,11 +103,11 @@
       self.assertEqual(version, version_postexec)
 
       # Ensure the job is still running with the same PID
-      os.kill(pid, 0)
+      self.assertRaises(ProcessLookupError, os.kill, pid, 0)
 
       # XXX: The re-exec will have severed the D-Bus connection to
       # Upstart. Hence, revivify the job with some magic.
-      job = self.upstart.job_recreate('sleeper', conf_path)
+      job = self.upstart.job_recreate('connected-job', conf_path)
       self.assertTrue(job)
 
       # Recreate the instance
@@ -119,8 +119,8 @@
       self.assertEqual(len(pids), 1)
       self.assertTrue(pids['main'])
 
-      # The pid should not have changed after a restart
-      self.assertEqual(pid, pids['main'])
+      # The pid _must_ have changed after a restart
+      self.assertNotEqual(pid, pids['main'])
 
       job.stop()
 

=== modified file 'util/telinit.c'
--- util/telinit.c	2014-01-15 11:51:18 +0000
+++ util/telinit.c	2014-03-10 13:43:50 +0000
@@ -174,6 +174,7 @@
 	 * Upstart has severed all connections to perform the re-exec.
 	 */
 	ret = upstart_restart (upstart, NULL, NULL, NULL, 0);
+	dbus_connection_flush(upstart->connection);
 
 	/* We don't care about the return code, but we have to keep
 	 * the compiler happy.

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

Reply via email to