Autotest: Add chromeos2 lab support to RPM Infrastructure.
Added support for devices in chromeos2 lab to the RPM Controller
codebase. It will determine if the device is behind a hydra device and
if so complete the proper login/logout procedures required.
So it turns out that theres a known pycurl/libcurl issue that can occur
sometimes when used with multiple threads and cause the python thread to
crash. Therefore I replaced the geturl call to utilize urllib instead.
BUG=chromium-os:30955
TEST=Expanded the functional tests and ensured the unittests still work.
Stress tested web calls in a while loop to ensure that no threads crash.
Change-Id: I646abe2f09cf00304892bad217e7f1a9561e1297
Reviewed-on: https://gerrit.chromium.org/gerrit/29822
Reviewed-by: Scott Zawalski <scottz@chromium.org>
Commit-Ready: Simran Basi <sbasi@chromium.org>
Tested-by: Simran Basi <sbasi@chromium.org>
diff --git a/site_utils/rpm_control_system/rpm_controller_unittest.py b/site_utils/rpm_control_system/rpm_controller_unittest.py
index 4ab2b3b..56315c6 100644
--- a/site_utils/rpm_control_system/rpm_controller_unittest.py
+++ b/site_utils/rpm_control_system/rpm_controller_unittest.py
@@ -18,9 +18,10 @@
def setUp(self):
super(TestSentryRPMController, self).setUp()
- self.ssh = self.mox.CreateMock(pexpect.spawn)
- self.rpm = rpm_controller.SentryRPMController('chromeos-rack1-host8',
- self.ssh)
+ self.ssh = self.mox.CreateMockAnything()
+ rpm_controller.pexpect.spawn = self.mox.CreateMockAnything()
+ rpm_controller.pexpect.spawn(mox.IgnoreArg()).AndReturn(self.ssh)
+ self.rpm = rpm_controller.SentryRPMController('chromeos-rack1-host8')
def testSuccessfullyChangeOutlet(self):