platform/dev: add 'chromite' import & process id handling.
Current devserver does not have 'chromite' dependency. Also, in real devserver,
the cros_update process's id is different from the shell id, and the
path of 'stateful_update' is different from that in drone/shard.
This CL:
1. add 'chromite' import
2. pass the 'devserver directory' to ChromiumOSUpdater.
3. Create a process group before newing the cros_update process. Use the
process group id as the unique file identifier. Kill the whole process group if
neccessary.
BUG=chromium:636467
TEST=local autotest to trigger repair & provision.
real test in devserver chromeos4-devserver2.
pass testCROSAU in dev_integration_test.
Change-Id: Iddf7fcbcaf508b516a8c09bbe7b09fd7209c14a4
Reviewed-on: https://chromium-review.googlesource.com/367741
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/devserver_integration_test.py b/devserver_integration_test.py
index 6de4cca..96e51c4 100755
--- a/devserver_integration_test.py
+++ b/devserver_integration_test.py
@@ -438,8 +438,8 @@
c. 'kill_au_proc'
"""
host_name = '100.0.0.0'
- p = subprocess.Popen(['sleep 100'], shell=True)
- pid = p.pid
+ p = subprocess.Popen(['sleep 100'], shell=True, preexec_fn=os.setsid)
+ pid = os.getpgid(p.pid)
status = 'updating'
progress_tracker = cros_update_progress.AUProgress(host_name, pid)
progress_tracker.WriteStatus(status)