зеркало из https://github.com/mozilla/gecko-dev.git
Bug 993478 - Let a user select docroot for the webserver, r=jgriffin
This commit is contained in:
Родитель
7cd22032f1
Коммит
8f5afee871
|
@ -475,6 +475,10 @@ class BaseMarionetteOptions(OptionParser):
|
||||||
dest='sources',
|
dest='sources',
|
||||||
action='store',
|
action='store',
|
||||||
help='path to sources.xml (Firefox OS only)')
|
help='path to sources.xml (Firefox OS only)')
|
||||||
|
self.add_option('--server-root',
|
||||||
|
dest='server_root',
|
||||||
|
action='store',
|
||||||
|
help='sets the web server\'s root directory to the given path')
|
||||||
|
|
||||||
def parse_args(self, args=None, values=None):
|
def parse_args(self, args=None, values=None):
|
||||||
options, tests = OptionParser.parse_args(self, args, values)
|
options, tests = OptionParser.parse_args(self, args, values)
|
||||||
|
@ -545,7 +549,8 @@ class BaseMarionetteTestRunner(object):
|
||||||
logcat_dir=None, xml_output=None, repeat=0, gecko_path=None,
|
logcat_dir=None, xml_output=None, repeat=0, gecko_path=None,
|
||||||
testvars=None, tree=None, type=None, device_serial=None,
|
testvars=None, tree=None, type=None, device_serial=None,
|
||||||
symbols_path=None, timeout=None, es_servers=None, shuffle=False,
|
symbols_path=None, timeout=None, es_servers=None, shuffle=False,
|
||||||
sdcard=None, this_chunk=1, total_chunks=1, sources=None, **kwargs):
|
sdcard=None, this_chunk=1, total_chunks=1, sources=None, server_root=None,
|
||||||
|
**kwargs):
|
||||||
self.address = address
|
self.address = address
|
||||||
self.emulator = emulator
|
self.emulator = emulator
|
||||||
self.emulatorBinary = emulatorBinary
|
self.emulatorBinary = emulatorBinary
|
||||||
|
@ -581,6 +586,7 @@ class BaseMarionetteTestRunner(object):
|
||||||
self.shuffle = shuffle
|
self.shuffle = shuffle
|
||||||
self.sdcard = sdcard
|
self.sdcard = sdcard
|
||||||
self.sources = sources
|
self.sources = sources
|
||||||
|
self.server_root = server_root
|
||||||
self.this_chunk = this_chunk
|
self.this_chunk = this_chunk
|
||||||
self.total_chunks = total_chunks
|
self.total_chunks = total_chunks
|
||||||
self.mixin_run_tests = []
|
self.mixin_run_tests = []
|
||||||
|
@ -654,9 +660,12 @@ class BaseMarionetteTestRunner(object):
|
||||||
host = "127.0.0.1"
|
host = "127.0.0.1"
|
||||||
if need_external_ip:
|
if need_external_ip:
|
||||||
host = moznetwork.get_ip()
|
host = moznetwork.get_ip()
|
||||||
|
docroot = self.server_root or os.path.join(os.path.dirname(os.path.dirname(__file__)), 'www')
|
||||||
|
if not os.path.isdir(docroot):
|
||||||
|
raise Exception("Server root %s is not a valid path" % docroot)
|
||||||
self.httpd = MozHttpd(host=host,
|
self.httpd = MozHttpd(host=host,
|
||||||
port=0,
|
port=0,
|
||||||
docroot=os.path.join(os.path.dirname(os.path.dirname(__file__)), 'www'))
|
docroot=docroot)
|
||||||
self.httpd.start()
|
self.httpd.start()
|
||||||
self.marionette.baseurl = 'http://%s:%d/' % (host, self.httpd.httpd.server_port)
|
self.marionette.baseurl = 'http://%s:%d/' % (host, self.httpd.httpd.server_port)
|
||||||
self.logger.info('running webserver on %s' % self.marionette.baseurl)
|
self.logger.info('running webserver on %s' % self.marionette.baseurl)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче