Bug 1633302 - Remote android tests must use root=True appropriately when dealing with app created files, r=gbrown.

Depends on D72576

Differential Revision: https://phabricator.services.mozilla.com/D72577
This commit is contained in:
Bob Clary 2020-04-27 15:45:59 +00:00
Родитель 1559eee282
Коммит 80ab483d5d
5 изменённых файлов: 16 добавлений и 15 удалений

Просмотреть файл

@ -201,7 +201,7 @@ class RemoteReftest(RefTest):
self.device.clear_logcat()
self.device.rm(self.remoteCache, force=True, recursive=True)
self.device.rm(self.remoteCache, force=True, recursive=True, root=True)
procName = options.app.split('/')[-1]
self.device.stop_application(procName)
@ -375,9 +375,9 @@ class RemoteReftest(RefTest):
return status
def cleanup(self, profileDir):
self.device.rm(self.remoteTestRoot, force=True, recursive=True)
self.device.rm(self.remoteProfile, force=True, recursive=True)
self.device.rm(self.remoteCache, force=True, recursive=True)
self.device.rm(self.remoteTestRoot, force=True, recursive=True, root=True)
self.device.rm(self.remoteProfile, force=True, recursive=True, root=True)
self.device.rm(self.remoteCache, force=True, recursive=True, root=True)
RefTest.cleanup(self, profileDir)

Просмотреть файл

@ -83,7 +83,8 @@ class RemoteGTests(object):
self.cleanup()
self.device.mkdir(self.remote_profile, parents=True)
self.device.mkdir(self.remote_minidumps, parents=True)
self.device.mkdir(self.remote_libdir, parents=True)
self.device.mkdir(self.remote_libdir, parents=True, root=True)
self.device.chmod(self.remote_libdir, recursive=True, root=True)
log.info("Running Android gtest")
if not self.device.is_app_installed(self.package):

Просмотреть файл

@ -135,7 +135,7 @@ class JUnitTestRunner(MochitestDesktop):
self.stopServers()
self.log.debug("Servers stopped")
self.device.stop_application(self.options.app)
self.device.rm(self.remote_profile, force=True, recursive=True)
self.device.rm(self.remote_profile, force=True, recursive=True, root=True)
if hasattr(self, 'profile'):
del self.profile
except Exception:

Просмотреть файл

@ -53,7 +53,7 @@ class MochiRemote(MochitestDesktop):
self.device.mkdir(logParent)
self.remoteProfile = posixpath.join(options.remoteTestRoot, "profile/")
self.device.rm(self.remoteProfile, force=True, recursive=True)
self.device.rm(self.remoteProfile, force=True, recursive=True, root=True)
self.counts = dict()
self.message_logger = MessageLogger(logger=None)
@ -73,19 +73,19 @@ class MochiRemote(MochitestDesktop):
self.remoteModulesDir = posixpath.join(options.remoteTestRoot, "modules/")
self.remoteCache = posixpath.join(options.remoteTestRoot, "cache/")
self.device.rm(self.remoteCache, force=True, recursive=True)
self.device.rm(self.remoteCache, force=True, recursive=True, root=True)
# move necko cache to a location that can be cleaned up
options.extraPrefs += ["browser.cache.disk.parent_directory=%s" % self.remoteCache]
self.remoteMozLog = posixpath.join(options.remoteTestRoot, "mozlog")
self.device.rm(self.remoteMozLog, force=True, recursive=True)
self.device.rm(self.remoteMozLog, force=True, recursive=True, root=True)
self.device.mkdir(self.remoteMozLog)
self.remoteChromeTestDir = posixpath.join(
options.remoteTestRoot,
"chrome")
self.device.rm(self.remoteChromeTestDir, force=True, recursive=True)
self.device.rm(self.remoteChromeTestDir, force=True, recursive=True, root=True)
self.device.mkdir(self.remoteChromeTestDir)
procName = options.app.split('/')[-1]
@ -104,14 +104,14 @@ class MochiRemote(MochitestDesktop):
def cleanup(self, options, final=False):
if final:
self.device.rm(self.remoteChromeTestDir, force=True, recursive=True)
self.device.rm(self.remoteChromeTestDir, force=True, recursive=True, root=True)
self.chromePushed = False
uploadDir = os.environ.get('MOZ_UPLOAD_DIR', None)
if uploadDir and self.device.is_dir(self.remoteMozLog):
self.device.pull(self.remoteMozLog, uploadDir)
self.device.rm(self.remoteLogFile, force=True)
self.device.rm(self.remoteProfile, force=True, recursive=True)
self.device.rm(self.remoteCache, force=True, recursive=True)
self.device.rm(self.remoteLogFile, force=True, root=True)
self.device.rm(self.remoteProfile, force=True, recursive=True, root=True)
self.device.rm(self.remoteCache, force=True, recursive=True, root=True)
MochitestDesktop.cleanup(self, options, final)
self.localProfile = None

Просмотреть файл

@ -41,7 +41,7 @@ class RemoteCPPUnitTests(cppunittests.CPPUnitTests):
self.setup_bin(progs)
def setup_bin(self, progs):
self.device.rm(self.remote_test_root, force=True, recursive=True)
self.device.rm(self.remote_test_root, force=True, recursive=True, root=True)
self.device.mkdir(self.remote_home_dir, parents=True)
self.device.mkdir(self.remote_tmp_dir)
self.device.mkdir(self.remote_bin_dir)