1#!/bin/bash -u
2
3# This is an example execution script.
4# This script changes with the problem you are trying to fix.
5# This particular script was used to triage a problem where a glibc
6# compiled with a new compiler would expose a problem in piglit.
7# Note it returns 0 only when the installation of the image succeeded
8# (ie: the machine booted after installation)
9
10source common/common.sh
11
12#export BISECT_STAGE=TRIAGE
13echo "BISECT_STAGE=${BISECT_STAGE}"
14
15echo "State of sets"
16wc -l ${bisect_dir}/*_SET
17
18board=x86-alex
19DUT=172.17.186.180
20
21echo "Cleaning up"
22{ sudo emerge -C cross-i686-pc-linux-gnu/glibc || exit 125; } &>> /tmp/glibc_triage.log
23
24echo "Building"
25{ sudo -E emerge cross-i686-pc-linux-gnu/glibc || exit 125; } &>> /tmp/glibc_triage.log
26
27echo "Building image"
28{ /home/llozano/trunk/src/scripts/build_image --board=${board} test || exit 125; } &>> /tmp/glibc_triage.log
29
30echo "Installing image"
31cros flash ${DUT} latest &> /tmp/tmp_cros_flash_result.log
32
33cat /tmp/tmp_cros_flash_result.log >> /tmp/cros_flash_result.log
34
35grep "Cros Flash completed successfully" /tmp/tmp_cros_flash_result.log || exit 125
36
37echo "Trying piglit"
38
39echo "export DISPLAY=:0.0; echo \$DISPLAY; /usr/local/piglit/lib/piglit/bin/glx-close-display -auto" > /tmp/repro.sh
40SSH_OPTS="-oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -oServerAliveInterval=10 -i /var/cache/chromeos-cache/distfiles/target/./chrome-src/src/third_party/chromite/ssh_keys/testing_rsa"
41scp ${SSH_OPTS} /tmp/repro.sh root@${DUT}:/tmp
42
43# notice the bash -l here. Otherwise the DISPLAY cannot be set
44( ssh ${SSH_OPTS} root@${DUT} -- /bin/bash -l /tmp/repro.sh ) > /tmp/result
45grep pass /tmp/result || { echo "PIGLIT FAILED"; exit 1; }
46
47echo "PIGLIT PASSED"
48
49exit 0
50