summaryrefslogtreecommitdiff
path: root/adb/test_device.py
diff options
context:
space:
mode:
authorJustin DeMartino <jjdemartino@google.com>2020-10-14 19:39:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-10-14 19:39:53 +0000
commit0d11af03e43f110b0bb160f7e20436d0043e3038 (patch)
tree48f8bcca856276ec73a86dd3fb26143d3ca64578 /adb/test_device.py
parent075666ebd0dee8d0c4a2efa54f7c324a3f67ee2a (diff)
parenta6c01e4e98d2b343dcecfc99611e2e6250c730db (diff)
Merge changes from topic "SP1A.200921.001" into s-keystone-qcom-dev
* changes: fs_mgr: adb-remount-test.sh: filter out more administrivia mounts. Merge SP1A.200921.001 Change-Id: I90b97c4e9fb10b1f45e74def404823eed5b1aaa8
Diffstat (limited to 'adb/test_device.py')
-rwxr-xr-xadb/test_device.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/adb/test_device.py b/adb/test_device.py
index c1caafcf6..a92d4a711 100755
--- a/adb/test_device.py
+++ b/adb/test_device.py
@@ -1271,6 +1271,31 @@ class FileOperationsTest:
if temp_dir is not None:
shutil.rmtree(temp_dir)
+ def test_push_sync_multiple(self):
+ """Sync multiple host directories to a specific path."""
+
+ try:
+ temp_dir = tempfile.mkdtemp()
+ temp_files = make_random_host_files(in_dir=temp_dir, num_files=32)
+
+ device_dir = posixpath.join(self.DEVICE_TEMP_DIR, 'sync_src_dst')
+
+ # Clean up any stale files on the device.
+ device = adb.get_device() # pylint: disable=no-member
+ device.shell(['rm', '-rf', device_dir])
+ device.shell(['mkdir', '-p', device_dir])
+
+ host_paths = [os.path.join(temp_dir, x.base_name) for x in temp_files]
+ device.push(host_paths, device_dir, sync=True)
+
+ self.verify_sync(device, temp_files, device_dir)
+
+ self.device.shell(['rm', '-rf', self.DEVICE_TEMP_DIR])
+ finally:
+ if temp_dir is not None:
+ shutil.rmtree(temp_dir)
+
+
def test_push_dry_run_nonexistent_file(self):
"""Push with dry run."""