summaryrefslogtreecommitdiffstats
path: root/testing/docker/tester
diff options
context:
space:
mode:
Diffstat (limited to 'testing/docker/tester')
-rw-r--r--testing/docker/tester/Dockerfile33
-rw-r--r--testing/docker/tester/REGISTRY1
-rw-r--r--testing/docker/tester/VERSION1
-rw-r--r--testing/docker/tester/bin/test.sh31
-rw-r--r--testing/docker/tester/dot-config/pip/pip.conf2
-rw-r--r--testing/docker/tester/dot-config/user-dirs.dirs15
-rw-r--r--testing/docker/tester/dot-config/user-dirs.locale1
-rw-r--r--testing/docker/tester/dot-pulse/default.pa164
-rw-r--r--testing/docker/tester/tc-vcs-config.yml40
-rw-r--r--testing/docker/tester/tester.env4
10 files changed, 292 insertions, 0 deletions
diff --git a/testing/docker/tester/Dockerfile b/testing/docker/tester/Dockerfile
new file mode 100644
index 000000000..547417ffa
--- /dev/null
+++ b/testing/docker/tester/Dockerfile
@@ -0,0 +1,33 @@
+FROM taskcluster/base-test:0.1.3
+MAINTAINER Jonas Finnemann Jensen <jopsen@gmail.com>
+
+# Add utilities and configuration
+COPY dot-config /home/worker/.config
+COPY dot-pulse /home/worker/.pulse
+COPY bin /home/worker/bin
+ADD https://s3-us-west-2.amazonaws.com/test-caching/packages/linux64-stackwalk /usr/local/bin/linux64-minidump_stackwalk
+ADD https://raw.githubusercontent.com/taskcluster/buildbot-step/master/buildbot_step /home/worker/bin/buildbot_step
+COPY tc-vcs-config.yml /etc/taskcluster-vcs.yml
+
+# Run test setup script
+RUN chmod u+x /home/worker/bin/buildbot_step
+RUN chmod u+x /usr/local/bin/linux64-minidump_stackwalk
+RUN apt-get install -y python-pip && pip install virtualenv;
+RUN mkdir Documents; mkdir Pictures; mkdir Music; mkdir Videos; mkdir artifacts
+RUN npm install -g taskcluster-vcs@2.3.12
+RUN npm install -g taskcluster-npm-cache@1.3.3
+RUN npm install -g node-gyp
+RUN rm -Rf .cache && mkdir -p .cache
+ENV PATH $PATH:/home/worker/bin
+ENV MINIDUMP_STACKWALK /usr/local/bin/linux64-minidump_stackwalk
+
+# Remove once running under 'worker' user. This is necessary for pulseaudio to start
+# XXX: change this back to worker:worker once permissions issues are resolved
+RUN chown -R root:root /home/worker
+
+
+# TODO Re-enable worker when bug 1093833 lands
+#USER worker
+
+# Set a default command useful for debugging
+CMD ["/bin/bash", "--login"]
diff --git a/testing/docker/tester/REGISTRY b/testing/docker/tester/REGISTRY
new file mode 100644
index 000000000..cb1e1bb48
--- /dev/null
+++ b/testing/docker/tester/REGISTRY
@@ -0,0 +1 @@
+taskcluster
diff --git a/testing/docker/tester/VERSION b/testing/docker/tester/VERSION
new file mode 100644
index 000000000..cb498ab2c
--- /dev/null
+++ b/testing/docker/tester/VERSION
@@ -0,0 +1 @@
+0.4.8
diff --git a/testing/docker/tester/bin/test.sh b/testing/docker/tester/bin/test.sh
new file mode 100644
index 000000000..6a5c9de74
--- /dev/null
+++ b/testing/docker/tester/bin/test.sh
@@ -0,0 +1,31 @@
+#! /bin/bash -vex
+
+set -x -e
+
+: GECKO_HEAD_REPOSITORY ${GECKO_HEAD_REPOSITORY:=https://hg.mozilla.org/mozilla-central}
+: GECKO_HEAD_REV ${GECKO_HEAD_REV:=default}
+: WORKSPACE ${WORKSPACE:=/home/worker/workspace}
+
+
+# TODO: when bug 1093833 is solved and tasks can run as non-root, reduce this
+# to a simple fail-if-root check
+if [ $(id -u) = 0 ]; then
+ chown -R worker:worker /home/worker
+ # drop privileges by re-running this script
+ exec sudo -E -u worker bash /home/worker/bin/test.sh "${@}"
+fi
+
+####
+# Now get the test-linux.sh script from the given Gecko tree and run it with
+# the same arguments.
+####
+
+[ -d $WORKSPACE ] || mkdir -p $WORKSPACE
+cd $WORKSPACE
+
+script=taskcluster/scripts/tester/test-b2g.sh
+url=${GECKO_HEAD_REPOSITORY}/raw-file/${GECKO_HEAD_REV}/${script}
+curl --fail -o ./test-b2g.sh --retry 10 $url
+chmod +x ./test-b2g.sh
+exec ./test-b2g.sh "${@}"
+
diff --git a/testing/docker/tester/dot-config/pip/pip.conf b/testing/docker/tester/dot-config/pip/pip.conf
new file mode 100644
index 000000000..73c2b2a52
--- /dev/null
+++ b/testing/docker/tester/dot-config/pip/pip.conf
@@ -0,0 +1,2 @@
+[global]
+disable-pip-version-check = true
diff --git a/testing/docker/tester/dot-config/user-dirs.dirs b/testing/docker/tester/dot-config/user-dirs.dirs
new file mode 100644
index 000000000..0d19da4e4
--- /dev/null
+++ b/testing/docker/tester/dot-config/user-dirs.dirs
@@ -0,0 +1,15 @@
+# This file is written by xdg-user-dirs-update
+# If you want to change or add directories, just edit the line you're
+# interested in. All local changes will be retained on the next run
+# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
+# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
+# absolute path. No other format is supported.
+#
+XDG_DESKTOP_DIR="$HOME/Desktop"
+XDG_DOWNLOAD_DIR="$HOME/Downloads"
+XDG_TEMPLATES_DIR="$HOME/Templates"
+XDG_PUBLICSHARE_DIR="$HOME/Public"
+XDG_DOCUMENTS_DIR="$HOME/Documents"
+XDG_MUSIC_DIR="$HOME/Music"
+XDG_PICTURES_DIR="$HOME/Pictures"
+XDG_VIDEOS_DIR="$HOME/Videos"
diff --git a/testing/docker/tester/dot-config/user-dirs.locale b/testing/docker/tester/dot-config/user-dirs.locale
new file mode 100644
index 000000000..7741b83a3
--- /dev/null
+++ b/testing/docker/tester/dot-config/user-dirs.locale
@@ -0,0 +1 @@
+en_US
diff --git a/testing/docker/tester/dot-pulse/default.pa b/testing/docker/tester/dot-pulse/default.pa
new file mode 100644
index 000000000..39bb44aa7
--- /dev/null
+++ b/testing/docker/tester/dot-pulse/default.pa
@@ -0,0 +1,164 @@
+#!/usr/bin/pulseaudio -nF
+#
+# This file is part of PulseAudio.
+#
+# PulseAudio is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# PulseAudio is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with PulseAudio; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+# This startup script is used only if PulseAudio is started per-user
+# (i.e. not in system mode)
+
+.nofail
+
+### Load something into the sample cache
+#load-sample-lazy x11-bell /usr/share/sounds/gtk-events/activate.wav
+#load-sample-lazy pulse-hotplug /usr/share/sounds/startup3.wav
+#load-sample-lazy pulse-coldplug /usr/share/sounds/startup3.wav
+#load-sample-lazy pulse-access /usr/share/sounds/generic.wav
+
+.fail
+
+### Automatically restore the volume of streams and devices
+load-module module-device-restore
+load-module module-stream-restore
+load-module module-card-restore
+
+### Automatically augment property information from .desktop files
+### stored in /usr/share/application
+load-module module-augment-properties
+
+### Load audio drivers statically
+### (it's probably better to not load these drivers manually, but instead
+### use module-udev-detect -- see below -- for doing this automatically)
+#load-module module-alsa-sink
+#load-module module-alsa-source device=hw:1,0
+#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
+#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
+#load-module module-null-sink
+#load-module module-pipe-sink
+
+### Automatically load driver modules depending on the hardware available
+.ifexists module-udev-detect.so
+load-module module-udev-detect
+.else
+### Use the static hardware detection module (for systems that lack udev/hal support)
+load-module module-detect
+.endif
+
+### Automatically connect sink and source if JACK server is present
+.ifexists module-jackdbus-detect.so
+.nofail
+load-module module-jackdbus-detect
+.fail
+.endif
+
+### Automatically load driver modules for Bluetooth hardware
+# This module causes a pulseaudio startup failure on "gecko-tester"
+#.ifexists module-bluetooth-discover.so
+#load-module module-bluetooth-discover
+#.endif
+
+### Load several protocols
+.ifexists module-esound-protocol-unix.so
+load-module module-esound-protocol-unix
+.endif
+load-module module-native-protocol-unix
+
+### Network access (may be configured with paprefs, so leave this commented
+### here if you plan to use paprefs)
+#load-module module-esound-protocol-tcp
+#load-module module-native-protocol-tcp
+#load-module module-zeroconf-publish
+
+### Load the RTP receiver module (also configured via paprefs, see above)
+#load-module module-rtp-recv
+
+### Load the RTP sender module (also configured via paprefs, see above)
+#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'"
+#load-module module-rtp-send source=rtp.monitor
+
+### Load additional modules from GConf settings. This can be configured with the paprefs tool.
+### Please keep in mind that the modules configured by paprefs might conflict with manually
+### loaded modules.
+.ifexists module-gconf.so
+.nofail
+load-module module-gconf
+.fail
+.endif
+
+### Automatically restore the default sink/source when changed by the user
+### during runtime
+### NOTE: This should be loaded as early as possible so that subsequent modules
+### that look up the default sink/source get the right value
+load-module module-default-device-restore
+
+### Automatically move streams to the default sink if the sink they are
+### connected to dies, similar for sources
+load-module module-rescue-streams
+
+### Make sure we always have a sink around, even if it is a null sink.
+load-module module-always-sink
+
+### Honour intended role device property
+load-module module-intended-roles
+
+### Automatically suspend sinks/sources that become idle for too long
+load-module module-suspend-on-idle
+
+### If autoexit on idle is enabled we want to make sure we only quit
+### when no local session needs us anymore.
+# This module causes a pulseaudio startup failure on "gecko-tester"
+#.ifexists module-console-kit.so
+#load-module module-console-kit
+#.endif
+
+### Enable positioned event sounds
+load-module module-position-event-sounds
+
+### Cork music streams when a phone stream is active
+#load-module module-cork-music-on-phone
+
+### Modules to allow autoloading of filters (such as echo cancellation)
+### on demand. module-filter-heuristics tries to determine what filters
+### make sense, and module-filter-apply does the heavy-lifting of
+### loading modules and rerouting streams.
+load-module module-filter-heuristics
+load-module module-filter-apply
+
+### Load DBus protocol
+#.ifexists module-dbus-protocol.so
+#load-module module-dbus-protocol
+#.endif
+
+# X11 modules should not be started from default.pa so that one daemon
+# can be shared by multiple sessions.
+
+### Load X11 bell module
+#load-module module-x11-bell sample=bell-windowing-system
+
+### Register ourselves in the X11 session manager
+#load-module module-x11-xsmp
+
+### Publish connection data in the X11 root window
+#.ifexists module-x11-publish.so
+#.nofail
+#load-module module-x11-publish
+#.fail
+#.endif
+
+load-module module-switch-on-port-available
+
+### Make some devices default
+#set-default-sink output
+#set-default-source input
diff --git a/testing/docker/tester/tc-vcs-config.yml b/testing/docker/tester/tc-vcs-config.yml
new file mode 100644
index 000000000..25e13ee40
--- /dev/null
+++ b/testing/docker/tester/tc-vcs-config.yml
@@ -0,0 +1,40 @@
+# Default configuration used by the tc-vs tools these can be overridden by
+# passing the config you wish to use over the command line...
+git: git
+hg: hg
+
+repoCache:
+ # Repo url to clone when running repo init..
+ repoUrl: https://gerrit.googlesource.com/git-repo.git
+ # Version of repo to utilize...
+ repoRevision: master
+ # The root where all downloaded cache files are stored on the local machine...
+ cacheDir: '{{env.HOME}}/.tc-vcs-repo/'
+ # Name/prefixed used as part of the base url.
+ cacheName: sources/{{name}}.tar.gz
+ # Command used to upload the tarball
+ uploadTar: "curl --header 'Content-Type: application/x-tar' --header 'Content-Encoding: gzip' -X PUT --data-binary @'{{source}}' '{{url}}'"
+ # Large http get requests are often slower using nodes built in http layer so
+ # we utilize a subprocess which is responsible for fetching...
+ get: curl --connect-timeout 30 --speed-limit 500000 -L -o {{dest}} {{url}}
+ # Used to create clone tarball
+ compress: tar -czf {{dest}} {{source}}
+ # All cache urls use tar + gz this is the command used to extract those files
+ # downloaded by the "get" command.
+ extract: tar -x -z -C {{dest}} -f {{source}}
+
+cloneCache:
+ # The root where all downloaded cache files are stored on the local machine...
+ cacheDir: '{{env.HOME}}/.tc-vcs/'
+ # Command used to upload the tarball
+ uploadTar: "curl --header 'Content-Type: application/x-tar' --header 'Content-Encoding: gzip' -X PUT --data-binary @'{{source}}' '{{url}}'"
+ # Large http get requests are often slower using nodes built in http layer so
+ # we utilize a subprocess which is responsible for fetching...
+ get: curl --connect-timeout 30 --speed-limit 500000 -L -o {{dest}} {{url}}
+ # Used to create clone tarball
+ compress: tar -czf {{dest}} {{source}}
+ # All cache urls use tar + gz this is the command used to extract those files
+ # downloaded by the "get" command.
+ extract: tar -x -z --strip-components 1 -C {{dest}} -f {{source}}
+ # Name/prefixed used as part of the base url.
+ cacheName: clones/{{name}}.tar.gz
diff --git a/testing/docker/tester/tester.env b/testing/docker/tester/tester.env
new file mode 100644
index 000000000..1bcac6132
--- /dev/null
+++ b/testing/docker/tester/tester.env
@@ -0,0 +1,4 @@
+GAIA_REV=tip
+GAIA_REF=tip
+GAIA_BASE_REPOSITORY=https://hg.mozilla.org/integration/gaia-central
+GAIA_HEAD_REPOSITORY=https://hg.mozilla.org/integration/gaia-central