Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1340584 - Remove devicemanagerSUT and references to sutagent; r=w…
Browse files Browse the repository at this point in the history
…lach

sutagent is no longer built or used; devicemanagerSUT is completely
unused. After this change, devicemanagerADB is the only implementation of
devicemanager, and test harness options like --dm_trans are eliminated.
  • Loading branch information
gbrownmozilla committed Mar 21, 2017
1 parent 59fda28 commit a2853ba
Show file tree
Hide file tree
Showing 79 changed files with 88 additions and 5,446 deletions.
3 changes: 0 additions & 3 deletions build/mobile/remoteautomation.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,6 @@ def read_stdout(self):
try:
newLogContent = self.dm.pullFile(self.proc, self.stdoutlen)
except DMError:
# we currently don't retry properly in the pullFile
# function in dmSUT, so an error here is not necessarily
# the end of the world
return False
if not newLogContent:
return False
Expand Down
16 changes: 5 additions & 11 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,12 @@ endif
run-cppunittests::
@$(PYTHON) $(MOZILLA_DIR)/testing/runcppunittests.py --xre-path=$(DIST)/bin --symbols-path=$(DIST)/crashreporter-symbols $(CPP_UNIT_TESTS)

cppunittests-remote: DM_TRANS?=adb
cppunittests-remote:
@if [ '${TEST_DEVICE}' != '' -o '$(DM_TRANS)' = 'adb' ]; then \
$(PYTHON) -u $(MOZILLA_DIR)/testing/remotecppunittests.py \
--xre-path=$(DEPTH)/dist/bin \
--localLib=$(DEPTH)/dist/$(MOZ_APP_NAME) \
--dm_trans=$(DM_TRANS) \
--deviceIP=${TEST_DEVICE} \
$(CPP_UNIT_TESTS) $(EXTRA_TEST_ARGS); \
else \
echo 'please prepare your host with environment variables for TEST_DEVICE'; \
fi
$(PYTHON) -u $(MOZILLA_DIR)/testing/remotecppunittests.py \
--xre-path=$(DEPTH)/dist/bin \
--localLib=$(DEPTH)/dist/$(MOZ_APP_NAME) \
--deviceIP=${TEST_DEVICE} \
$(CPP_UNIT_TESTS) $(EXTRA_TEST_ARGS); \

endif # COMPILE_ENVIRONMENT
endif # CPP_UNIT_TESTS
Expand Down
4 changes: 0 additions & 4 deletions js/src/jit-test/jit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ def main(argv):
op.add_option('--deviceSerial', action='store',
type='string', dest='device_serial', default=None,
help='ADB device serial number of remote device to test')
op.add_option('--deviceTransport', action='store',
type='string', dest='device_transport', default='sut',
help='The transport to use to communicate with device:'
' [adb|sut]; default=sut')
op.add_option('--remoteTestRoot', dest='remote_test_root', action='store',
type='string', default='/data/local/tests',
help='The remote directory to use as test root'
Expand Down
31 changes: 11 additions & 20 deletions js/src/tests/lib/jittests.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,28 +665,19 @@ def push_progs(options, device, progs):

def run_tests_remote(tests, num_tests, prefix, options):
# Setup device with everything needed to run our tests.
from mozdevice import devicemanagerADB, devicemanagerSUT

if options.device_transport == 'adb':
if options.device_ip:
dm = devicemanagerADB.DeviceManagerADB(
options.device_ip, options.device_port,
deviceSerial=options.device_serial,
packageName=None,
deviceRoot=options.remote_test_root)
else:
dm = devicemanagerADB.DeviceManagerADB(
deviceSerial=options.device_serial,
packageName=None,
deviceRoot=options.remote_test_root)
else:
dm = devicemanagerSUT.DeviceManagerSUT(
from mozdevice import devicemanagerADB

if options.device_ip:
dm = devicemanagerADB.DeviceManagerADB(
options.device_ip, options.device_port,
deviceSerial=options.device_serial,
packageName=None,
deviceRoot=options.remote_test_root)
else:
dm = devicemanagerADB.DeviceManagerADB(
deviceSerial=options.device_serial,
packageName=None,
deviceRoot=options.remote_test_root)
if options.device_ip == None:
print('Error: you must provide a device IP to connect to via the'
' --device option')
sys.exit(1)

# Update the test root to point to our test directory.
jit_tests_dir = posixpath.join(options.remote_test_root, 'jit-tests')
Expand Down
1 change: 0 additions & 1 deletion layout/tools/reftest/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ def run_android_test(self, **kwargs):
args.app = self.substs["ANDROID_PACKAGE_NAME"]
if not args.utilityPath:
args.utilityPath = args.xrePath
args.dm_trans = "adb"
args.ignoreWindowSize = True
args.printDeviceInfo = False

Expand Down
1 change: 0 additions & 1 deletion layout/tools/reftest/mach_test_package_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def run_reftest_android(context, args):
args.utilityPath = context.hostutils
args.xrePath = context.hostutils
args.httpdPath = context.module_dir
args.dm_trans = 'adb'
args.ignoreWindowSize = True
args.printDeviceInfo = False

Expand Down
8 changes: 0 additions & 8 deletions layout/tools/reftest/reftestcommandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,6 @@ def __init__(self, **kwargs):
default="",
help="name of the pidfile to generate")

self.add_argument("--dm_trans",
action="store",
type=str,
dest="dm_trans",
default="adb",
help="the transport to use to communicate with device: "
"[adb|sut]; default=adb")

self.add_argument("--remoteTestRoot",
action="store",
type=str,
Expand Down
16 changes: 4 additions & 12 deletions layout/tools/reftest/remotereftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,26 +331,18 @@ def cleanup(self, profileDir):


def run_test_harness(parser, options):
if options.dm_trans == 'sut' and options.deviceIP is None:
print ("Error: If --dm_trans = sut, you must provide a device IP to "
"connect to via the --deviceIP option")
return 1

dm_args = {
'deviceRoot': options.remoteTestRoot,
'host': options.deviceIP,
'port': options.devicePort,
}

dm_cls = mozdevice.DroidSUT
if options.dm_trans == 'adb':
dm_args['adbPath'] = options.adb_path
if not dm_args['host']:
dm_args['deviceSerial'] = options.deviceSerial
dm_cls = mozdevice.DroidADB
dm_args['adbPath'] = options.adb_path
if not dm_args['host']:
dm_args['deviceSerial'] = options.deviceSerial

try:
dm = dm_cls(**dm_args)
dm = mozdevice.DroidADB(**dm_args)
except mozdevice.DMError:
traceback.print_exc()
print ("Automation Error: exception while initializing devicemanager. "
Expand Down
1 change: 0 additions & 1 deletion testing/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ def run_android_test(self, tests, symbols_path, manifest_path, log):
options.symbols_path = symbols_path
options.manifest_path = manifest_path
options.xre_path = self.bindir
options.dm_trans = "adb"
options.local_lib = self.bindir.replace('bin', 'fennec')
for file in os.listdir(os.path.join(self.topobjdir, "dist")):
if file.endswith(".apk") and file.startswith("fennec"):
Expand Down
26 changes: 6 additions & 20 deletions testing/mochitest/mochitest_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import os
import tempfile

from mozdevice import DroidADB, DroidSUT
from mozdevice import DroidADB
from mozprofile import DEFAULT_PORTS
import mozinfo
import mozlog
Expand Down Expand Up @@ -873,12 +873,6 @@ class AndroidArguments(ArgumentContainer):
"help": "ip address of remote device to test",
"default": None,
}],
[["--dm_trans"],
{"choices": ["adb", "sut"],
"default": "adb",
"help": "The transport to use for communication with the device [default: adb].",
"suppress": True,
}],
[["--adbpath"],
{"dest": "adbPath",
"default": None,
Expand Down Expand Up @@ -957,21 +951,13 @@ def validate(self, parser, options, context):
options.log_mach = '-'

device_args = {'deviceRoot': options.remoteTestRoot}
if options.dm_trans == "adb":
device_args['adbPath'] = options.adbPath
if options.deviceIP:
device_args['host'] = options.deviceIP
device_args['port'] = options.devicePort
elif options.deviceSerial:
device_args['deviceSerial'] = options.deviceSerial
options.dm = DroidADB(**device_args)
elif options.dm_trans == 'sut':
if options.deviceIP is None:
parser.error(
"If --dm_trans = sut, you must provide a device IP")
device_args['adbPath'] = options.adbPath
if options.deviceIP:
device_args['host'] = options.deviceIP
device_args['port'] = options.devicePort
options.dm = DroidSUT(**device_args)
elif options.deviceSerial:
device_args['deviceSerial'] = options.deviceSerial
options.dm = DroidADB(**device_args)

if not options.remoteTestRoot:
options.remoteTestRoot = options.dm.deviceRoot
Expand Down
2 changes: 1 addition & 1 deletion testing/mochitest/runrobocop.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def startup(self):
"Android sdk version '%s'; will use this to filter manifests" %
str(androidVersion))
mozinfo.info['android_version'] = androidVersion
if (self.options.dm_trans == 'adb' and self.options.robocopApk):
if self.options.robocopApk:
self.dm._checkCmd(["install", "-r", self.options.robocopApk])
self.log.debug("Robocop APK %s installed" %
self.options.robocopApk)
Expand Down
11 changes: 0 additions & 11 deletions testing/mozbase/docs/devicemanagement.rst

This file was deleted.

1 change: 0 additions & 1 deletion testing/mozbase/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ want to do then dive in!
setuprunning
mozhttpd
loggingreporting
devicemanagement

Indices and tables
==================
Expand Down
Loading

0 comments on commit a2853ba

Please sign in to comment.