Skip to content

Commit

Permalink
Backed out 17 changesets (bug 1486004) for causing bustages in Access…
Browse files Browse the repository at this point in the history
…Check.h

CLOSED TREE

Backed out changeset 86a0855e1e45 (bug 1486004)
Backed out changeset 4fc98067edc5 (bug 1486004)
Backed out changeset 8ab3f1597fde (bug 1486004)
Backed out changeset b487e98320fb (bug 1486004)
Backed out changeset 4cba8e6bc515 (bug 1486004)
Backed out changeset d0db5eef2343 (bug 1486004)
Backed out changeset 50285a87de6b (bug 1486004)
Backed out changeset 9730c0303810 (bug 1486004)
Backed out changeset 140a9d2362f3 (bug 1486004)
Backed out changeset 9d1ce06f6039 (bug 1486004)
Backed out changeset 88a5a4ab39fa (bug 1486004)
Backed out changeset eb186c92232d (bug 1486004)
Backed out changeset 677f2129750e (bug 1486004)
Backed out changeset 81427a5f2103 (bug 1486004)
Backed out changeset 38d7def3d425 (bug 1486004)
Backed out changeset a9e73221c471 (bug 1486004)
Backed out changeset ebe8c2d5432e (bug 1486004)
  • Loading branch information
Mihai Alexandru Michis committed Jul 16, 2020
1 parent 3b50638 commit a1d49fb
Show file tree
Hide file tree
Showing 47 changed files with 1,104 additions and 1,316 deletions.
20 changes: 10 additions & 10 deletions build/mobile/remoteautomation.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def runApp(self, testURL, env, app, profileDir, extraArgs,
for |timeout| seconds.
"""
if self.device.is_file(self.remoteLog):
self.device.rm(self.remoteLog)
self.device.rm(self.remoteLog, root=True)
self.log.info("remoteautomation.py | runApp deleted %s" % self.remoteLog)

if timeout == -1:
Expand Down Expand Up @@ -209,7 +209,7 @@ def launchApp(self, cmd, env=None, e10s=True, messageLogger=None, counts=None):

if self.appName and self.device.process_exist(self.appName):
print("remoteautomation.py %s is already running. Stopping..." % self.appName)
self.device.stop_application(self.appName)
self.device.stop_application(self.appName, root=True)

self.counts = counts
if self.counts is not None:
Expand Down Expand Up @@ -268,7 +268,7 @@ def read_stdout(self):
except ADBTimeoutError:
raise
except Exception as e:
self.log.exception("remoteautomation.py | exception reading log: %s" % str(e))
self.log.info("remoteautomation.py | exception reading log: %s" % str(e))
return False
if not newLogContent:
return False
Expand Down Expand Up @@ -354,12 +354,12 @@ def wait(self, timeout=None, noOutputTimeout=None):
endTime = datetime.datetime.now() + datetime.timedelta(seconds=timeout)
# wait for log creation on startup
retries = 0
while retries < 20 and not self.device.is_file(self.remoteLog):
while retries < 20 and not self.device.is_file(self.remoteLog, root=True):
retries += 1
time.sleep(1)
if self.device.is_file(self.remoteLog):
if self.device.is_file(self.remoteLog, root=True):
# We must change the remote log's permissions so that the shell can read it.
self.device.chmod(self.remoteLog, mask="666")
self.device.chmod(self.remoteLog, mask="666", root=True)
else:
print("Failed wait for remote log: %s missing?" % self.remoteLog)
while top == self.procName:
Expand Down Expand Up @@ -408,15 +408,15 @@ def kill(self, stagedShutdown=False):
if stagedShutdown:
# Trigger an ANR report with "kill -3" (SIGQUIT)
try:
self.device.pkill(self.procName, sig=3, attempts=1)
self.device.pkill(self.procName, sig=3, attempts=1, root=True)
except ADBTimeoutError:
raise
except: # NOQA: E722
pass
time.sleep(3)
# Trigger a breakpad dump with "kill -6" (SIGABRT)
try:
self.device.pkill(self.procName, sig=6, attempts=1)
self.device.pkill(self.procName, sig=6, attempts=1, root=True)
except ADBTimeoutError:
raise
except: # NOQA: E722
Expand All @@ -432,7 +432,7 @@ def kill(self, stagedShutdown=False):
retries += 1
if self.device.process_exist(self.procName):
try:
self.device.pkill(self.procName, sig=9, attempts=1)
self.device.pkill(self.procName, sig=9, attempts=1, root=True)
except ADBTimeoutError:
raise
except: # NOQA: E722
Expand All @@ -448,7 +448,7 @@ def kill(self, stagedShutdown=False):
if self.device.process_exist(crashreporter):
print("Warning: %s unexpectedly found running. Killing..." % crashreporter)
try:
self.device.pkill(crashreporter)
self.device.pkill(crashreporter, root=True)
except ADBTimeoutError:
raise
except: # NOQA: E722
Expand Down
2 changes: 1 addition & 1 deletion js/src/jit-test/jit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def main(argv):
type=str, dest='device_serial', default=None,
help='ADB device serial number of remote device to test')
op.add_argument('--remoteTestRoot', dest='remote_test_root', action='store',
type=str, default='/data/local/tmp/test_root',
type=str, default='/data/local/tests',
help='The remote directory to use as test root'
' (e.g. %(default)s)')
op.add_argument('--localLib', dest='local_lib', action='store',
Expand Down
2 changes: 1 addition & 1 deletion js/src/jit-test/tests/TypedObject/directives.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
|jit-test| skip-if: !this.hasOwnProperty('TypedObject')
|jit-test| skip-if: !this.hasOwnProperty("TypedObject")
4 changes: 2 additions & 2 deletions js/src/tests/jstests.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def parse_args():
type=str, dest='device_serial', default=None,
help='ADB device serial number of remote device to test')
harness_og.add_argument('--remoteTestRoot', dest='remote_test_root', action='store',
type=str, default='/data/local/tmp/test_root',
type=str, default='/data/local/tests',
help='The remote directory to use as test root'
' (e.g. %(default)s)')
harness_og.add_argument('--localLib', dest='local_lib', action='store',
Expand Down Expand Up @@ -608,7 +608,7 @@ def main():
jtd_tests = posixpath.join(options.remote_test_root, 'tests', 'tests')
init_remote_dir(device, jtd_tests)
device.push(test_dir, jtd_tests, timeout=600)
device.chmod(jtd_tests, recursive=True)
device.chmod(jtd_tests, recursive=True, root=True)
prefix[0] = options.js_shell
for test in test_gen:
out = run_test_remote(test, device, prefix, options)
Expand Down
7 changes: 3 additions & 4 deletions js/src/tests/lib/jittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def command(self, prefix, libdir, moduledir, remote_prefix=None):
for inc in self.other_script_includes:
cmd += ['-f', scriptdir_var + inc]
if self.skip_if_cond:
cmd += ['-e', 'if ({}) quit({})'.format(self.skip_if_cond, self.SKIPPED_EXIT_STATUS)]
cmd += ['-e', "if ({}) quit({})".format(self.skip_if_cond, self.SKIPPED_EXIT_STATUS)]
cmd += ['--module-load-path', moduledir]
if self.is_module:
cmd += ['--module', path]
Expand Down Expand Up @@ -425,7 +425,6 @@ def run_test_remote(test, device, prefix, options):
if test.tz_pacific:
env['TZ'] = 'PST8PDT'

# replace with shlex.join when move to Python 3.8+
cmd = ADBDevice._escape_command_line(cmd)
start = datetime.now()
try:
Expand Down Expand Up @@ -788,11 +787,11 @@ def run_tests_remote(tests, num_tests, prefix, options, slog):

init_remote_dir(device, jit_tests_dir)
device.push(JS_TESTS_DIR, jtd_tests, timeout=600)
device.chmod(jtd_tests, recursive=True)
device.chmod(jtd_tests, recursive=True, root=True)

device.push(os.path.dirname(TEST_DIR), options.remote_test_root,
timeout=600)
device.chmod(options.remote_test_root, recursive=True)
device.chmod(options.remote_test_root, recursive=True, root=True)
except (ADBError, ADBTimeoutError):
print("TEST-UNEXPECTED-FAIL | jit_test.py" +
" : Device initialization failed")
Expand Down
17 changes: 9 additions & 8 deletions js/src/tests/lib/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def push_libs(options, device, dest_dir):
if file in required_libs:
remote_file = posixpath.join(dest_dir, file)
device.push(os.path.join(options.local_lib, file), remote_file)
device.chmod(remote_file)
device.chmod(remote_file, root=True)


def push_progs(options, device, progs, dest_dir):
Expand All @@ -28,12 +28,13 @@ def push_progs(options, device, progs, dest_dir):
remote_file = posixpath.join(dest_dir,
os.path.basename(local_file))
device.push(local_file, remote_file)
device.chmod(remote_file)
device.chmod(remote_file, root=True)


def init_remote_dir(device, path):
device.rm(path, recursive=True, force=True)
device.mkdir(path, parents=True)
def init_remote_dir(device, path, root=True):
device.rm(path, recursive=True, force=True, root=root)
device.mkdir(path, parents=True, root=root)
device.chmod(path, recursive=True, root=root)


# We only have one device per test run.
Expand All @@ -49,15 +50,15 @@ def init_device(options):
if DEVICE is not None:
return DEVICE

from mozdevice import ADBDeviceFactory, ADBError, ADBTimeoutError
from mozdevice import ADBDevice, ADBError, ADBTimeoutError
try:
if not options.local_lib:
# if not specified, use the local directory containing
# the js binary to find the necessary libraries.
options.local_lib = posixpath.dirname(options.js_shell)

DEVICE = ADBDeviceFactory(device=options.device_serial,
test_root=options.remote_test_root)
DEVICE = ADBDevice(device=options.device_serial,
test_root=options.remote_test_root)

init_remote_dir(DEVICE, options.remote_test_root)

Expand Down
7 changes: 1 addition & 6 deletions layout/tools/reftest/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,7 @@ def _run_reftest(self, **kwargs):
if conditions.is_android(self):
from mozrunner.devices.android_device import (verify_android_device, InstallIntent)
install = InstallIntent.NO if kwargs.get('no_install') else InstallIntent.YES
verbose = False
if kwargs.get('log_mach_verbose') or kwargs.get('log_tbpl_level') == 'debug' or \
kwargs.get('log_mach_level') == 'debug' or kwargs.get('log_raw_level') == 'debug':
verbose = True
verify_android_device(self, install=install, xre=True, network=True,
app=kwargs["app"], device_serial=kwargs["deviceSerial"],
verbose=verbose)
app=kwargs["app"], device_serial=kwargs["deviceSerial"])
return reftest.run_android_test(**kwargs)
return reftest.run_desktop_test(**kwargs)
2 changes: 1 addition & 1 deletion layout/tools/reftest/reftestcommandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def __init__(self, **kwargs):
type=str,
dest="remoteTestRoot",
help="Remote directory to use as test root "
"(eg. /data/local/tmp/test_root).")
"(eg. /mnt/sdcard/tests or /data/local/tests).")

self.add_argument("--httpd-path",
action="store",
Expand Down
27 changes: 12 additions & 15 deletions layout/tools/reftest/remotereftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from six.moves.urllib_request import urlopen

from mozdevice import ADBDeviceFactory, ADBTimeoutError
from mozdevice import ADBDevice, ADBTimeoutError
from remoteautomation import RemoteAutomation, fennecLogcatFilters

from output import OutputHandler
Expand Down Expand Up @@ -164,16 +164,13 @@ def __init__(self, options, scriptDir):
self.localLogName = options.localLogName

verbose = False
if options.log_mach_verbose or options.log_tbpl_level == 'debug' or \
options.log_mach_level == 'debug' or options.log_raw_level == 'debug':
if options.log_tbpl_level == 'debug' or options.log_mach_level == 'debug':
verbose = True
print("set verbose!")
expected = options.app.split('/')[-1]
self.device = ADBDeviceFactory(adb=options.adb_path or 'adb',
device=options.deviceSerial,
test_root=options.remoteTestRoot,
verbose=verbose,
run_as_package=expected)
self.device = ADBDevice(adb=options.adb_path or 'adb',
device=options.deviceSerial,
test_root=options.remoteTestRoot,
verbose=verbose)
if options.remoteTestRoot is None:
options.remoteTestRoot = posixpath.join(self.device.test_root, "reftest")
options.remoteProfile = posixpath.join(options.remoteTestRoot, "profile")
Expand Down Expand Up @@ -213,10 +210,10 @@ def __init__(self, options, scriptDir):
expected = options.app.split('/')[-1]
if not self.device.is_app_installed(expected):
raise Exception("%s is not installed on this device" % expected)
self.device.run_as_package = expected

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)
Expand Down Expand Up @@ -330,7 +327,7 @@ def createReftestProfile(self, options, **kwargs):
# make sure the parent directories of the profile which
# may have been created by the push, also have their
# permissions set to allow access.
self.device.chmod(options.remoteTestRoot, recursive=True)
self.device.chmod(options.remoteTestRoot, recursive=True, root=True)
except Exception:
print("Automation Error: Failed to copy profiledir to device")
raise
Expand Down Expand Up @@ -401,9 +398,9 @@ def runApp(self, options, cmdargs=None, timeout=None, debuggerInfo=None, symbols
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)


Expand Down
2 changes: 1 addition & 1 deletion python/mozbuild/mozbuild/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ class GTestCommands(MachCommandBase):
dest='remote_test_root',
group='Android',
help='Remote directory to use as test root '
'(eg. /data/local/tmp/test_root).')
'(eg. /mnt/sdcard/tests or /data/local/tests).')
@CommandArgument('--libxul',
dest='libxul_path',
group='Android',
Expand Down
2 changes: 1 addition & 1 deletion python/mozperftest/mozperftest/system/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, *args, **kw):
self._provided_logger = kw.pop("logger")
super(ADBLoggedDevice, self).__init__(*args, **kw)

def _get_logger(self, logger_name, verbose):
def _get_logger(self, logger_name):
return self._provided_logger


Expand Down
20 changes: 12 additions & 8 deletions python/mozperftest/mozperftest/system/android_perf_tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, device, log=None, timeout=None):
def tune_performance(self):
self.log.info("tuning android device performance")
self.set_svc_power_stayon()
if self.device.is_rooted:
if self.device._have_su or self.device._have_android_su:
device_name = self.device.shell_output(
"getprop ro.product.model", timeout=self.timeout
)
Expand All @@ -36,10 +36,12 @@ def tune_performance(self):
self.device.clear_logcat(timeout=self.timeout)
self.log.info("android device performance tuning complete")

def _set_value_and_check_exitcode(self, file_name, value):
def _set_value_and_check_exitcode(self, file_name, value, root=False):
self.log.info("setting {} to {}".format(file_name, value))
if self.device.shell_bool(
" ".join(["echo", str(value), ">", str(file_name)]), timeout=self.timeout,
" ".join(["echo", str(value), ">", str(file_name)]),
root=root,
timeout=self.timeout,
):
self.log.info("successfully set {} to {}".format(file_name, value))
else:
Expand All @@ -63,7 +65,9 @@ def turn_off_services(self):
]
for service in services:
self.log.info(" ".join(["turning off service:", service]))
self.device.shell_bool(" ".join(["stop", service]), timeout=self.timeout)
self.device.shell_bool(
" ".join(["stop", service]), root=True, timeout=self.timeout
)

services_list_output = self.device.shell_output(
"service list", timeout=self.timeout
Expand Down Expand Up @@ -109,7 +113,7 @@ def set_virtual_memory_parameters(self):
}

for key, value in commands.items():
self._set_value_and_check_exitcode(key, value)
self._set_value_and_check_exitcode(key, value, root=True)

def set_cpu_performance_parameters(self, device_name=None):
self.log.info("setting cpu performance parameters")
Expand Down Expand Up @@ -154,7 +158,7 @@ def set_cpu_performance_parameters(self, device_name=None):
)

for key, value in commands.items():
self._set_value_and_check_exitcode(key, value)
self._set_value_and_check_exitcode(key, value, root=True)

def set_gpu_performance_parameters(self, device_name=None):
self.log.info("setting gpu performance parameters")
Expand Down Expand Up @@ -204,7 +208,7 @@ def set_gpu_performance_parameters(self, device_name=None):
)

for key, value in commands.items():
self._set_value_and_check_exitcode(key, value)
self._set_value_and_check_exitcode(key, value, root=True)

def set_kernel_performance_parameters(self):
self.log.info("setting kernel performance parameters")
Expand All @@ -215,4 +219,4 @@ def set_kernel_performance_parameters(self):
"/sys/kernel/debug/msm-bus-dbg/shell-client/slv": "512",
}
for key, value in commands.items():
self._set_value_and_check_exitcode(key, value)
self._set_value_and_check_exitcode(key, value, root=True)
6 changes: 0 additions & 6 deletions python/mozperftest/mozperftest/tests/test_android.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ def __init__(self, **args):
self._logger = mock.MagicMock()
self._have_su = True
self._have_android_su = True
self._have_root_shell = True
self.is_rooted = True

def clear_logcat(self, *args, **kwargs):
return True
Expand Down Expand Up @@ -62,8 +60,6 @@ def test_android_perf_tuning_rooted(device):
# on rooted devices correctly
device._have_su = True
device._have_android_su = True
device._have_root_shell = True
device.is_rooted = True
with mock.patch(
"mozperftest.system.android_perf_tuner.PerformanceTuner.set_kernel_performance_parameters"
) as mockfunc:
Expand All @@ -78,8 +74,6 @@ def test_android_perf_tuning_nonrooted(device):
# on non-rooted devices correctly
device._have_su = False
device._have_android_su = False
device._have_root_shell = False
device.is_rooted = False
with mock.patch(
"mozperftest.system.android_perf_tuner.PerformanceTuner.set_kernel_performance_parameters"
) as mockfunc:
Expand Down
4 changes: 2 additions & 2 deletions python/mozperftest/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from setuptools import setup

PACKAGE_NAME = "mozperftest"
PACKAGE_VERSION = "0.2"
PACKAGE_VERSION = "0.1"

deps = ["jsonschema", "mozlog >= 6.0", "mozdevice >= 4.0.0", "mozproxy", "mozinfo"]
deps = ["jsonschema", "mozlog >= 6.0", "mozdevice >= 3.0.2,<4", "mozproxy", "mozinfo"]

setup(
name=PACKAGE_NAME,
Expand Down
Loading

0 comments on commit a1d49fb

Please sign in to comment.