remote_access: IsDirWritable: combine two ssh commands
Since RemoteSh runs a shell, we can join the two `touch;rm` commands into
a single ssh connection. This gives a minor speed up.
BUG=brillo:985
TEST=`cros deploy` still works and is able to run verify write access
TEST=`./cbuildbot/run_tests` passes
Change-Id: I273b37c5f76456711da61249b6b92bb603e2fc02
Reviewed-on: https://chromium-review.googlesource.com/272801
Reviewed-by: Yiming Chen <yimingc@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/deploy_chrome_unittest.py b/scripts/deploy_chrome_unittest.py
index 42076c8..9845472 100644
--- a/scripts/deploy_chrome_unittest.py
+++ b/scripts/deploy_chrome_unittest.py
@@ -203,7 +203,7 @@
def testMountError(self):
"""Test that mount failure doesn't raise an exception by default."""
self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
- self.PatchObject(remote_access.RemoteDevice, 'IsPathWritable',
+ self.PatchObject(remote_access.RemoteDevice, 'IsDirWritable',
return_value=False, autospec=True)
self.deploy._MountRootfsAsWritable()
self.assertTrue(self.deploy._target_dir_is_still_readonly.is_set())
@@ -217,7 +217,7 @@
def testMountTempDir(self):
"""Test that mount succeeds if target dir is writable."""
self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())
- self.PatchObject(remote_access.RemoteDevice, 'IsPathWritable',
+ self.PatchObject(remote_access.RemoteDevice, 'IsDirWritable',
return_value=True, autospec=True)
self.deploy._MountRootfsAsWritable()
self.assertFalse(self.deploy._target_dir_is_still_readonly.is_set())