[autotest] Make 'pool' a parameter of Reimager.attempt()
It doesn't really make sense to have 'pool' be an attribute of a Reimager
instance, so make it get passed around as needed instead.
BUG=None
TEST=unit
TEST=do a run_suite with a pool option and ensure it succeeds.
Change-Id: I8f2c405affd130404026fc72c8f3ef3be98edfa8
Reviewed-on: https://gerrit.chromium.org/gerrit/24223
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/server/cros/dynamic_suite_unittest.py b/server/cros/dynamic_suite_unittest.py
index f3e40c6..f241dad 100755
--- a/server/cros/dynamic_suite_unittest.py
+++ b/server/cros/dynamic_suite_unittest.py
@@ -305,7 +305,8 @@
dependencies=[],
priority='Low')
self.mox.ReplayAll()
- self.reimager._schedule_reimage_job(self._BUILD, self._NUM, self._BOARD)
+ self.reimager._schedule_reimage_job(self._BUILD, self._BOARD, None,
+ self._NUM)
def expect_attempt(self, success, ex=None, check_hosts=True):
@@ -324,8 +325,9 @@
self.mox.StubOutWithMock(self.reimager, '_schedule_reimage_job')
self.reimager._schedule_reimage_job(self._BUILD,
- self._NUM,
- self._BOARD).AndReturn(canary)
+ self._BOARD,
+ None,
+ self._NUM).AndReturn(canary)
if check_hosts:
self.mox.StubOutWithMock(self.reimager, '_count_usable_hosts')
self.reimager._count_usable_hosts(
@@ -359,7 +361,7 @@
rjob.record('END GOOD', mox.IgnoreArg(), mox.IgnoreArg())
self.reimager._clear_build_state(mox.StrContains(canary.hostname))
self.mox.ReplayAll()
- self.reimager.attempt(self._BUILD, self._BOARD, rjob.record, True)
+ self.reimager.attempt(self._BUILD, self._BOARD, None, rjob.record, True)
self.reimager.clear_reimaged_host_state(self._BUILD)
@@ -372,7 +374,7 @@
rjob.record('END FAIL', mox.IgnoreArg(), mox.IgnoreArg())
self.reimager._clear_build_state(mox.StrContains(canary.hostname))
self.mox.ReplayAll()
- self.reimager.attempt(self._BUILD, self._BOARD, rjob.record, True)
+ self.reimager.attempt(self._BUILD, self._BOARD, None, rjob.record, True)
self.reimager.clear_reimaged_host_state(self._BUILD)
@@ -385,7 +387,7 @@
rjob.record('FAIL', mox.IgnoreArg(), canary.name, mox.IgnoreArg())
rjob.record('END FAIL', mox.IgnoreArg(), mox.IgnoreArg())
self.mox.ReplayAll()
- self.reimager.attempt(self._BUILD, self._BOARD, rjob.record, True)
+ self.reimager.attempt(self._BUILD, self._BOARD, None, rjob.record, True)
self.reimager.clear_reimaged_host_state(self._BUILD)
@@ -398,7 +400,7 @@
rjob.record('START', mox.IgnoreArg(), mox.IgnoreArg())
rjob.record('END ERROR', mox.IgnoreArg(), mox.IgnoreArg(), ex_message)
self.mox.ReplayAll()
- self.reimager.attempt(self._BUILD, self._BOARD, rjob.record, True)
+ self.reimager.attempt(self._BUILD, self._BOARD, None, rjob.record, True)
self.reimager.clear_reimaged_host_state(self._BUILD)
@@ -412,7 +414,8 @@
rjob.record('END GOOD', mox.IgnoreArg(), mox.IgnoreArg())
self.reimager._clear_build_state(mox.StrContains(canary.hostname))
self.mox.ReplayAll()
- self.reimager.attempt(self._BUILD, self._BOARD, rjob.record, False)
+ self.reimager.attempt(self._BUILD, self._BOARD, None, rjob.record,
+ False)
self.reimager.clear_reimaged_host_state(self._BUILD)
@@ -429,7 +432,7 @@
rjob.record('END WARN', mox.IgnoreArg(), mox.IgnoreArg(),
mox.StrContains('Too few hosts'))
self.mox.ReplayAll()
- self.reimager.attempt(self._BUILD, self._BOARD, rjob.record, True)
+ self.reimager.attempt(self._BUILD, self._BOARD, None, rjob.record, True)
self.reimager.clear_reimaged_host_state(self._BUILD)
@@ -446,7 +449,7 @@
rjob.record('END ERROR', mox.IgnoreArg(), mox.IgnoreArg(),
mox.StrContains('All hosts'))
self.mox.ReplayAll()
- self.reimager.attempt(self._BUILD, self._BOARD, rjob.record, True)
+ self.reimager.attempt(self._BUILD, self._BOARD, None, rjob.record, True)
self.reimager.clear_reimaged_host_state(self._BUILD)