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

Latest commit

 

History

History
175 lines (132 loc) · 6.23 KB

INSTALL.md

File metadata and controls

175 lines (132 loc) · 6.23 KB

Installation Instructions

There are three separate components in a complete autophone system:

  • one or more servers running the autophone app
  • mobile devices with root access running the SUT agent
  • a server running phonedash to collect, serve, and present the results

Multiple autophone servers can run on the same machine. Until mozpool support is added, each server runs independently with no knowledge of the others and should be configured with individual device pools. If running two or more instances from the same installation, you will need to use the --cache-dir option on all but the primary to avoid cache contention.

The phonedash server is optional, e.g. for development environments. It can be found at https://github.com/markrcote/phonedash/. It is customized for the s1s2 test and will be eventually deprecated in favour of DataZilla.

Setting up autophone

Autophone doesn't have a setup.py script, but "pip install -r requirements.txt" will install all prerequisite packages.

Autophone is packaged with two tests: s1s2 and unittests.

s1s2

s1s2 measures fennec load times for a couple different pages, served both remotely and from a local file.

Put the pages to be served into autophone/configs. You will need a way to serve them (FIXME: autophone should do this). If you're using phonedash, it can serve the files by just dropping them into phonedash/html/.

The s1s2 test is configured in the file configs/s1s2_settings.ini:

[htmlfiles]
file3 = configs/Twitter_files
file1 = configs/startup6.html
file2 = configs/Twitter2.html

[urls]
# These must resolve, so ensure this matches what is in the code for
# the testroot
local-twitter = file://mnt/sdcard/s1test/Twitter2.html
local-blank = file://mnt/sdcard/s1test/startup6.html
remote-twitter = http://192.168.1.133:8100/Twitter2.html
remote-blank = http://192.168.1.133:8100/startup6.html

[settings]
iterations = 20
resulturl = http://192.168.1.133:8100/api/s1s2_add/

[htmlfiles] contains the paths of files to transfer to the phone. [urls] lists local and remote URLs (FIXME: we could make this less redundant). Remember that the remote links must be external IPs, since they are loaded from the mobile devices.

The resulturl is the URL used to POST results to the database.

unittests

Autophone requires additional Python packages in order to run the unittests:

The unittests also require a local installation of the XRE and the utility programs such as xpcshell. A local build of Firefox can be used.

In order to process crash minidumps, you will also need a local installation of breakpad's minidump_stackwalk. You can build minidump_stack via:

svn checkout http://google-breakpad.googlecode.com/svn/trunk/ google-breakpad-read-only cd google-breakpad-read-only if [[ $(uname) == "Darwin" ]]; then CC=clang CXX=clang++ ./configure else CXXFLAGS="-g -O1" ./configure fi make sudo make install

If you wish to run a development environment, you will also need to set up an ElasticSearch and Autolog server. Note that you do not need to set up test data using testdata.py but you will need to create an autolog index using curl -XPUT 'http://localhost:9200/autolog/' once the ElasticSearch server is up and running and before you start the Autolog server.

See https://wiki.mozilla.org/Auto-tools/Projects/Autolog for more details.

To configure Autolog to display the results for a device, you will need to update the OSNames property in js/Config.js in Autolog. See http://hg.mozilla.org/automation/autolog/file/2a32ea0367f5/js/Config.js#l67 . Note that the key for the device should consist of the string 'autophone-' followed by the same value as used in SUTAgent.ini's HARDWARE property for the device.

Once you have the XRE, utility programs and minidump_stack installed, change configs/unittest_default.ini to point to your local environment.

Email notifications

If you want to get notifications indicating when Autophone has disabled a device due to errors, you can create email.ini like so:

[report]
from = <from address>

[email]
dest = <list of to addresses>
server = <SMTP server>
port = <SMTP server port, defaults to 465>
ssl = <enable SMTP over SSL, defaults to true>
username = <username for SMTP, optional>
password = <password for SMTP, optional>

Setting up devices

Each device must be rooted and have the SUT agent installed. See https://wiki.mozilla.org/Auto-tools/Projects/SUTAgent for details on the SUT agent.

After installing the SUT agent on all the phones, you need to configure them. For each device, you will have to edit SUTAgent.ini appropriately to configure how it connects to the registration server, setting "POOL" to the phone's serial number (you can see the serial numbers of all connected devices via "adb devices"), "IPAddr" to the external IP of the machine running autophone (this is the SUT "registration server"), and "HARDWARE" to some short descriptive string, e.g. "samsung_gs2" or "droid_pro".

You may also need to add a "Network Settings" section if you wish to configure your device to connect to a specific network on startup.

An example SUTAgent.ini file might be:

[Registration Server]
IPAddr = 192.168.1.124
PORT = 28001
HARDWARE = lg_g2x
POOL = 033c20444240b197

[Network Settings]
SSID = Mozilla Ateam
AUTH = open
ENCR = disabled
KEY = auto
ADHOC = 0

Run "python publishAgentIni.py -i " to push the SUTAgent.ini file to the phone found at that IP.

Setting up phonedash

Phonedash is a templeton-based app (https://github.com/markrcote/templeton). It stores results in either a MySQL or a sqlite database.

Database configuration goes into server/settings.cfg. The file has one section, [database], with the following options:

  • SQL_TYPE: can be set to either "mysql" (default) or "sqlite".
  • SQL_DB: database name (MySQL) or path (sqlite)
  • SQL_SERVER: MySQL database server IP or hostname
  • SQL_USER: MySQL username
  • SQL_PASSWD: MySQL password

When phonedash is started, it will create the requisite table if not found.