Media/WebRTC/Steeplechase For Devs

From MozillaWiki
< Media‎ | WebRTC
Jump to: navigation, search

Introduction

This is how you can setup Steeplechase on a single machine. This enables you to verify that your test modifications are compatible with the way how Steeplechase executes the WebRTC mochitest, which is different from the regular mochitest test execution on TBPL or when you locally run the mochitests.

TL;DR

  • Clone the repositories of the required software packages
  • Install the dependencies & compile the packages
  • Execute the script to run steeplechase and all packages locally

Default Repository Layout

Clone the following repositories in the below described directory structure:

It's assumed that you have your copy of mozilla central already ([1]).

+- steeplechase
|
+- Negatus
|
+- simplesignaling
|
+- mozilla-central

Note: you can also provide different directory locations via parameters.

Preparing Packages

Steeplechase

Install steeplechase dependencies inside the 'steeplechase' directory:

 python setup.py install

Negatus

Note- If you are running on MacOS please verify that the contents of your Negatus/Makefile.macosx has below content (this might not be up to date on Github)

 XX=g++
 # g++ knows how to link in the c++ runtime and dylibs correctly; without it, we
 # would have to replicate the link line that g++ uses.
 LD:=$(CXX)
 CPPFLAGS=\
         -g \
         -mmacosx-version-min=10.7 \
         -stdlib=libc++ \
         `/usr/local/Cellar/nspr/4.10.8_1/bin/nspr-config --cflags`
 LDLIBS=`/usr/local/Cellar/nspr/4.10.8_1/bin/nspr-config --libs`
 include Makefile

Depending on your platform you probably need to install a copy of the NSPR library, e.g. 'brew install nspr' or your Linux package manager, before compiling from within the cloned Negatus directory

 make -f Makefile.macosx

or

 make -f Makefile.linux

should compile the binary called 'agent' for you. Starting the Negatus agent like this:

 ./agent

you should get an output like this:

 Command handler listening on 0.0.0.0:20701
 Heartbeat handler listening on 0.0.0.0:20700
 Query url: IPADDR=0.0.0.0%3A20701&NAME=SUTAgent
 No SUTAgent.ini data.
 No reboot callback data.

simplesignaling

This package requires node-js and npm to be installed on the system. You can procure Node.js from here To install the dependencies run this from within the cloned simplesignaling directory.

 npm install

After successfully installing the dependencies you should be able to simply run:

 node server.js

and get an output like this on your console

 info  - socket.io started

Run steeplechase locally

Linux

If you have everything cloned into the default repository layout and have a working Firefox build in your mozilla-central directory you should be able to simply execute from the steeplechase directory:

 ./scripts/runlocal_linux.sh

MacOS

Important: Verify the path on line 158 of steeplechase/runsteeplechase.py points to the MacOS path.

 --- a/steeplechase/runsteeplechase.py
 +++ b/steeplechase/runsteeplechase.py
 @@ -158,7 +158,7 @@ class Binary(ApplicationAsset):
      def path_to_launch(self):
          app = os.path.basename(self._path)
 -        return posixpath.join(self._remote_path, app)
 +        return posixpath.join(self._remote_path, 'MacOS', app)

Once this is done, you will need to run the below script

 sh runlocal_mac.sh

Note- The runlocal_mac.sh may not be currently checked into Github as its currently in development. If it is not present in the steeplechase directory, please create a file runlocal_mac.sh and fill it with this code and run as mentioned above.

After starting two Negatus and the simplesignaling server you should see two Firefox instances appear on your screen and dis-appear once they are done executing the test_peerConnection_basicAudio.html.