testing/docker/tester/bin/test.sh
author Sebastian Hengst <archaeopteryx@coole-files.de>
Mon, 19 Dec 2016 21:15:07 +0100
changeset 354459 9d0c5328c89782f32bb458487278944bf219a417
parent 354455 taskcluster/docker/tester/bin/test.sh@fe7303de56be76914f0eebe008b0ef02c803b6cd
child 354523 0f3603e365f029bc9ea5f926d32f6f0f8aa4d998
permissions -rw-r--r--
Backed out changeset fe7303de56be (bug 1302763) for failing webdriver tests on Linux x64 debug (geckodriver.manifest fetch failed). r=backout

#! /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 "${@}"