Skip to content


Subversion checkout URL

You can clone with
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (39 sloc) 1.704 kB
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at
"""Publishes a SUTAgent.ini file to the specified device."""
import errno
import os
import sys
from optparse import OptionParser
from mozdevice import DeviceManagerSUT
def main(ip, port, filename):
dm = DeviceManagerSUT(ip, port)
if __name__ == '__main__':
parser = OptionParser()
parser.add_option('-i', '--ip', dest='ip', help='IP address of device; '
'can also be specified through the TEST_DEVICE '
'environment variable')
parser.add_option('-p', '--port', dest='port', type='int', default=20701,
help='Agent port on device; defaults to 20701')
parser.add_option('-f', '--file', dest='file', default='SUTAgent.ini',
help='SUTAgent ini file to copy to device; defaults '
'to ./SUTAgent.ini')
(options, args) = parser.parse_args()
# Verify Options
ip = options.ip
port = options.port
file = options.file
if not ip:
ip = os.environ.get('TEST_DEVICE')
if not ip:
print 'You must specify an ip address for the device via the -i ' \
'option or through\nthe TEST_DEVICE environment variable.'
if not os.path.isfile(file):
print 'SUTAgent ini file "%s" is not found or not a regular file.' % \
main(ip, port, file)
Jump to Line
Something went wrong with that request. Please try again.