diff options
Diffstat (limited to 'testing/docker/desktop1604-test')
17 files changed, 540 insertions, 0 deletions
diff --git a/testing/docker/desktop1604-test/Dockerfile b/testing/docker/desktop1604-test/Dockerfile new file mode 100644 index 000000000..929b167c2 --- /dev/null +++ b/testing/docker/desktop1604-test/Dockerfile @@ -0,0 +1,116 @@ +FROM ubuntu:16.04 +MAINTAINER Joel Maher <joel.maher@gmail.com> + +RUN useradd -d /home/worker -s /bin/bash -m worker +WORKDIR /home/worker + +# %include testing/docker/recipes/tooltool.py +ADD topsrcdir/testing/docker/recipes/tooltool.py /setup/tooltool.py + +# %include testing/mozharness/external_tools/robustcheckout.py +ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py + +# %include testing/docker/recipes/common.sh +ADD topsrcdir/testing/docker/recipes/common.sh /setup/common.sh + +# %include testing/docker/recipes/install-mercurial.sh +ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh + +# Add the tooltool manifest containing the minidump_stackwalk binary. +# %include testing/config/tooltool-manifests/linux64/releng.manifest +ADD topsrcdir/testing/config/tooltool-manifests/linux64/releng.manifest /tmp/minidump_stackwalk.manifest + +# %include testing/docker/recipes/ubuntu1604-test-system-setup.sh +ADD topsrcdir/testing/docker/recipes/ubuntu1604-test-system-setup.sh /setup/system-setup.sh +RUN bash /setup/system-setup.sh + +# Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb +# %include testing/docker/recipes/xvfb.sh +ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh + +# %include testing/docker/recipes/run-task +ADD topsrcdir/testing/docker/recipes/run-task /home/worker/bin/run-task + +# %include taskcluster/scripts/tester/test-ubuntu.sh +ADD topsrcdir/taskcluster/scripts/tester/test-ubuntu.sh /home/worker/bin/test-linux.sh + +# This will create a host mounted filesystem when the cache is stripped +# on Try. This cancels out some of the performance losses of aufs. See +# bug 1291940. +VOLUME /home/worker/checkouts +VOLUME /home/worker/workspace + +# Set variable normally configured at login, by the shells parent process, these +# are taken from GNU su manual +ENV HOME /home/worker +ENV SHELL /bin/bash +ENV USER worker +ENV LOGNAME worker +ENV HOSTNAME taskcluster-worker +ENV LANG en_US.UTF-8 +ENV LC_ALL en_US.UTF-8 + +# Add utilities and configuration +COPY dot-files/config /home/worker/.config +COPY dot-files/pulse /home/worker/.pulse +COPY bin /home/worker/bin +RUN chmod +x bin/* +# TODO: remove this when buildbot is gone +COPY buildprops.json /home/worker/buildprops.json +COPY tc-vcs-config.yml /etc/taskcluster-vcs.yml + +# TODO: remove +ADD https://raw.githubusercontent.com/taskcluster/buildbot-step/master/buildbot_step /home/worker/bin/buildbot_step +RUN chmod u+x /home/worker/bin/buildbot_step + +# allow the worker user to access video devices +RUN usermod -a -G video worker + +RUN mkdir Documents; mkdir Pictures; mkdir Music; mkdir Videos; mkdir artifacts + +# install a new enough npm, plus tc-vcs and tc-npm-cache +RUN npm install -g npm@^2.0.0 \ + && npm install -g taskcluster-vcs@2.3.12 \ + && npm install -g taskcluster-npm-cache@1.1.14 \ + && rm -rf ~/.npm +ENV PATH $PATH:/home/worker/bin + +# TODO Re-enable worker when bug 1093833 lands +#USER worker + +# clean up +RUN rm -Rf .cache && mkdir -p .cache + +# Disable Ubuntu update prompt +# http://askubuntu.com/questions/515161/ubuntu-12-04-disable-release-notification-of-14-04-in-update-manager +ADD release-upgrades /etc/update-manager/release-upgrades + +# Disable tools with on-login popups that interfere with tests; see bug 1240084 and bug 984944. +ADD autostart/jockey-gtk.desktop autostart/deja-dup-monitor.desktop /etc/xdg/autostart/ + +# Bug 1345105 - Do not run periodical update checks and downloads +ADD autostart/gnome-software-service.desktop /etc/xdg/autostart/ + +# In test.sh we accept START_VNC to start a vnc daemon. +# Exposing this port allows it to work. +EXPOSE 5900 + +# This helps not forgetting setting DISPLAY=:0 when running +# tests outside of test.sh +ENV DISPLAY :0 + +# Disable apport (Ubuntu app crash reporter) to avoid stealing focus from test runs +ADD apport /etc/default/apport + +# Disable font antialiasing for now to match releng's setup +ADD fonts.conf /home/worker/.fonts.conf + +# Set up first-run experience for interactive mode +ADD motd /etc/taskcluster-motd +ADD taskcluster-interactive-shell /bin/taskcluster-interactive-shell +RUN chmod +x /bin/taskcluster-interactive-shell + +RUN chown -R worker:worker /home/worker + +# Set a default command useful for debugging +CMD ["/bin/bash", "--login"] diff --git a/testing/docker/desktop1604-test/apport b/testing/docker/desktop1604-test/apport new file mode 100644 index 000000000..42e5f8d3a --- /dev/null +++ b/testing/docker/desktop1604-test/apport @@ -0,0 +1 @@ +enabled=0 diff --git a/testing/docker/desktop1604-test/autostart/deja-dup-monitor.desktop b/testing/docker/desktop1604-test/autostart/deja-dup-monitor.desktop new file mode 100644 index 000000000..c3b8a4c67 --- /dev/null +++ b/testing/docker/desktop1604-test/autostart/deja-dup-monitor.desktop @@ -0,0 +1,19 @@ +[Desktop Entry] +Version=1.0 +X-Ubuntu-Gettext-Domain=deja-dup + +Name=Backup Monitor +Comment=Schedules backups at regular intervals + +Icon=deja-dup +TryExec=/usr/lib/deja-dup/deja-dup/deja-dup-monitor +Exec=/usr/lib/deja-dup/deja-dup/deja-dup-monitor + +# Bug 984944/1240084 - It prevents taking screenshots +X-GNOME-Autostart-Delay=false + +StartupNotify=false +NoDisplay=true + +Type=Application +Categories=System;Utility;Archiving; diff --git a/testing/docker/desktop1604-test/autostart/gnome-software-service.desktop b/testing/docker/desktop1604-test/autostart/gnome-software-service.desktop new file mode 100644 index 000000000..b563cc306 --- /dev/null +++ b/testing/docker/desktop1604-test/autostart/gnome-software-service.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=GNOME Software +Exec=/usr/bin/gnome-software --gapplication-service +OnlyShowIn=GNOME;Unity; +X-Ubuntu-Gettext-Domain=gnome-software + +# Bug 1345105 - Do not run periodical update checks and downloads +X-GNOME-Autostart-enabled=false diff --git a/testing/docker/desktop1604-test/autostart/jockey-gtk.desktop b/testing/docker/desktop1604-test/autostart/jockey-gtk.desktop new file mode 100644 index 000000000..e433ba898 --- /dev/null +++ b/testing/docker/desktop1604-test/autostart/jockey-gtk.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Name=Check for new hardware drivers +Comment=Notify about new hardware drivers available for the system +Icon=jockey +Exec=sh -c "test -e /var/cache/jockey/check || exec jockey-gtk --check" +Terminal=false +Type=Application +Categories=System;Settings;GTK;HardwareSettings; +NotShowIn=KDE; +X-Ubuntu-Gettext-Domain=jockey + +# Bug 984944/1240084 - It prevents taking screenshots +X-GNOME-Autostart-Delay=false + +NoDisplay=true diff --git a/testing/docker/desktop1604-test/bin/run-wizard b/testing/docker/desktop1604-test/bin/run-wizard new file mode 100755 index 000000000..88c84045c --- /dev/null +++ b/testing/docker/desktop1604-test/bin/run-wizard @@ -0,0 +1,108 @@ +#!/usr/bin/env python +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this, +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +from __future__ import print_function, unicode_literals + +import os +import subprocess +import sys +from textwrap import wrap + + +def call(cmd, **kwargs): + print(" ".join(cmd)) + return subprocess.call(cmd, **kwargs) + + +def resume(): + call(['run-mozharness']) + + +def setup(): + call(['run-mozharness', '--no-run-tests']) + print("Mozharness has finished downloading the build and " + "tests to {}.".format(os.path.join(os.getcwd(), 'build'))) + + +def clone(): + repo = os.environ['GECKO_HEAD_REPOSITORY'] + rev = os.environ['GECKO_HEAD_REV'] + clone_path = os.path.expanduser(os.path.join('~', 'gecko')) + + # try is too large to clone, instead clone central and pull + # in changes from try + if "hg.mozilla.org/try" in repo: + central = 'http://hg.mozilla.org/mozilla-central' + call(['hg', 'clone', '-U', central, clone_path]) + call(['hg', 'pull', '-u', '-r', rev, repo], cwd=clone_path) + else: + call(['hg', 'clone', '-u', rev, repo, clone_path]) + print("Finished cloning to {} at revision {}.".format( + clone_path, rev)) + + +def exit(): + pass + + +OPTIONS = [ + ('Resume task', resume, + "Resume the original task without modification. This can be useful for " + "passively monitoring it from another shell."), + ('Setup task', setup, + "Setup the task (download the application and tests) but don't run the " + "tests just yet. The tests can be run with a custom configuration later " + "(experimental)."), + ('Clone gecko', clone, + "Perform a clone of gecko using the task's repo and update it to the " + "task's revision."), + ('Exit', exit, "Exit this wizard and return to the shell.") +] + + +def _fmt_options(): + max_line_len = 60 + max_name_len = max(len(o[0]) for o in OPTIONS) + + # TODO Pad will be off if there are more than 9 options. + pad = ' ' * (max_name_len+6) + + msg = [] + for i, (name, _, desc) in enumerate(OPTIONS): + desc = wrap(desc, width=max_line_len) + desc = [desc[0]] + [pad + l for l in desc[1:]] + + optstr = '{}) {} - {}\n'.format( + i+1, name.ljust(max_name_len), '\n'.join(desc)) + msg.append(optstr) + msg.append("Select one of the above options: ") + return '\n'.join(msg) + + +def wizard(): + print("This wizard can help you get started with some common debugging " + "workflows.\nWhat would you like to do?\n") + print(_fmt_options(), end="") + choice = None + while True: + choice = raw_input().decode('utf8') + try: + choice = int(choice)-1 + if 0 <= choice < len(OPTIONS): + break + except ValueError: + pass + + print("Must provide an integer from 1-{}:".format(len(OPTIONS))) + + func = OPTIONS[choice][1] + ret = func() + + print("Use the 'run-wizard' command to start this wizard again.") + return ret + + +if __name__ == '__main__': + sys.exit(wizard()) diff --git a/testing/docker/desktop1604-test/buildprops.json b/testing/docker/desktop1604-test/buildprops.json new file mode 100644 index 000000000..f0967b026 --- /dev/null +++ b/testing/docker/desktop1604-test/buildprops.json @@ -0,0 +1,8 @@ +{ + "properties": { + "buildername": "" + }, + "sourcestamp": { + "changes": [] + } +} diff --git a/testing/docker/desktop1604-test/dot-files/config/pip/pip.conf b/testing/docker/desktop1604-test/dot-files/config/pip/pip.conf new file mode 100644 index 000000000..73c2b2a52 --- /dev/null +++ b/testing/docker/desktop1604-test/dot-files/config/pip/pip.conf @@ -0,0 +1,2 @@ +[global] +disable-pip-version-check = true diff --git a/testing/docker/desktop1604-test/dot-files/config/user-dirs.dirs b/testing/docker/desktop1604-test/dot-files/config/user-dirs.dirs new file mode 100644 index 000000000..2db2718d2 --- /dev/null +++ b/testing/docker/desktop1604-test/dot-files/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/desktop1604-test/dot-files/config/user-dirs.locale b/testing/docker/desktop1604-test/dot-files/config/user-dirs.locale new file mode 100644 index 000000000..7741b83a3 --- /dev/null +++ b/testing/docker/desktop1604-test/dot-files/config/user-dirs.locale @@ -0,0 +1 @@ +en_US diff --git a/testing/docker/desktop1604-test/dot-files/pulse/default.pa b/testing/docker/desktop1604-test/dot-files/pulse/default.pa new file mode 100644 index 000000000..39bb44aa7 --- /dev/null +++ b/testing/docker/desktop1604-test/dot-files/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/desktop1604-test/fonts.conf b/testing/docker/desktop1604-test/fonts.conf new file mode 100644 index 000000000..9784fcc98 --- /dev/null +++ b/testing/docker/desktop1604-test/fonts.conf @@ -0,0 +1,5 @@ +<match target="font"> + <edit name="antialias" mode="assign"> + <bool>false</bool> + </edit> +</match> diff --git a/testing/docker/desktop1604-test/motd b/testing/docker/desktop1604-test/motd new file mode 100644 index 000000000..f958393cd --- /dev/null +++ b/testing/docker/desktop1604-test/motd @@ -0,0 +1,6 @@ +Welcome to your taskcluster interactive shell! The regularly scheduled task +has been paused to give you a chance to set up your debugging environment. + +For your convenience, the exact mozharness command needed for this task can +be invoked using the 'run-mozharness' command. + diff --git a/testing/docker/desktop1604-test/release-upgrades b/testing/docker/desktop1604-test/release-upgrades new file mode 100644 index 000000000..d714f1d82 --- /dev/null +++ b/testing/docker/desktop1604-test/release-upgrades @@ -0,0 +1,17 @@ +# Default behavior for the release upgrader. + +[DEFAULT] +# Default prompting behavior, valid options: +# +# never - Never check for a new release. +# normal - Check to see if a new release is available. If more than one new +# release is found, the release upgrader will attempt to upgrade to +# the release that immediately succeeds the currently-running +# release. +# lts - Check to see if a new LTS release is available. The upgrader +# will attempt to upgrade to the first LTS release available after +# the currently-running one. Note that this option should not be +# used if the currently-running release is not itself an LTS +# release, since in that case the upgrader won't be able to +# determine if a newer release is available. +Prompt=never diff --git a/testing/docker/desktop1604-test/taskcluster-interactive-shell b/testing/docker/desktop1604-test/taskcluster-interactive-shell new file mode 100644 index 000000000..e569b40d3 --- /dev/null +++ b/testing/docker/desktop1604-test/taskcluster-interactive-shell @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +/home/worker/bin/run-wizard; + +SPAWN="$SHELL"; + +if [ "$SHELL" = "bash" ]; then + SPAWN="bash -li"; +fi; + +exec $SPAWN; diff --git a/testing/docker/desktop1604-test/tc-vcs-config.yml b/testing/docker/desktop1604-test/tc-vcs-config.yml new file mode 100644 index 000000000..25e13ee40 --- /dev/null +++ b/testing/docker/desktop1604-test/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/desktop1604-test/tester.env b/testing/docker/desktop1604-test/tester.env new file mode 100644 index 000000000..1bcac6132 --- /dev/null +++ b/testing/docker/desktop1604-test/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 |