see also:

See the paper:


  • Perl
    • libjson-perl
    • libberkeleydb-perl
  • Python3
    • nose ((sudo) pip install nose)
      • For running unit tests
    • pystache ((sudo) pip install pystache)
      • For web interfaces
    • requests ((sudo) pip install requests)
    • python-serial
  • adb
  • R and ggplot2
    • For graphing


  • Rather than installing each python library individually, you can use pip install -r requirements.txt
  • Many scripts read a config.json file in the root. This provides a central location for values that will be used in many places, and may change often (mostly URLs).
  • If an app needs authentication info, this can be specified in the ~/tests\auth.json file. This way auth info can be kept out of git. The file should contain a JSON dictionary which will be passed in to the script template as AUTH. If you have a subdictionary named reddit, for instance, you can use {{#AUTH}}{{#reddit}}echo {{username}} {{password}} {{/reddit}}{{/AUTH}} to echo the username and password. get the password).


Each arduino has a 1 letter identifier (as a sticker on the device), and a path when it is connected to the computer (eg. /dev/ttyACM0).


  • {identifier} (on|off)
    • Turns the USB power on the Arduino circuitry on or off
  • {identifier}
    • Attempts to charge the phone to 100% or until it reports full, but will stop if the phone stops showing differences in battery level charge over the span of 10 minutes.


Tests live in the tests/ folder. With each subfolder being a single test. Each test however, can be customised for several apps. Each app should get its own subfolder, with a

  • file
    • The shell script which will be run on the device. Before being run, it is templated with information about the test run. The templating language is the standard Mustache one.
  • duration
    • A file specifying how long to run the test for
  • [optional]
    • A python file used for customising the test run. It should define a class named Test which subclasses libgreenminer.Test. Common uses are to override the before(), after(), or get_template_data() methods. See libgreenminer/ for more customisations. This file can also exist outside of the app folder. The resolution order for Test classes is: app-specific > testspecific > libgreenminer.

The Online Queue

  • web/ needs to be placed on a CGI server. It uses Berkeley DB to provide a JSON-based API for adding/getting tests.
  • The web/ cgi script provides an html form for easily adding new tests. To use this form, select any of thests you wish to be run, the number of repetitions, and the full apk ids (whitespace separated) for each commit you want tested.
  • Clients run the script, which downloads tasks from the queue server, runs them, and then reports them as finished. If there are no tests in the queue, it will poll the server at one minute intervals for new jobs.
  • You can remove items from the queue without running them with the script. Run -h for help.
  • web/ displays a report for a single test run
  • web/ displays a list of test runs, with sorting and searching
  • web/ aggregates and graphs data from many runs
  • web/make_graphs.R uses R and ggplot2 to graph the data collected by
  • summarizes run numbers/times for the queue.

Firefox builds

  • The Firefox hg repo should be cloned to ~/src/mozilla-central
  • does not make the build dir
  • {num_threads} {commits.list} [{niceness} = 19]
    • compiles Firefox apks for each revision given in the {commits.list} file, up to {num_threads} at a time. This process and all of its children are automatically niced to the specified level (or 19 by default).
  • the and scripts in compilation/ can be used to simplify creating a list of commits to give to
  • mozconfig-droid contains autoconf options for the Firefox build


  • {path to csv wattlog file}
    • Creates a .tar containing the test data, and uploads it to the server
    • Run automatically as a part of
  • {script} {duration} {commit}
    • Launches the monkey script {script} on firefox revision {commit} for {duration} seconds.
    • This script calls (before and after the test) and
  • {identifier}
    • prints info about the device, thd host, time, and environment in JSON format
    • attempts to make a fuse SSHFS mount of the scp.apks_folder at images_folder (from config.json)

Unit/Regression Tests

  • unit tests for libgreenminer are in libgreenminer/tests and can be run with 'cd libgreenminer; nosetests'
  • other regression tests are in regression_tests/. These tests can be run with regression_tests/, and will include the libgreenminer unit tests.