| OLD | NEW |
| 1 set -e | 1 set -e |
| 2 | 2 |
| 3 hosts_fixup() { | 3 hosts_fixup() { |
| 4 echo "travis_fold:start:hosts_fixup" | 4 echo "travis_fold:start:hosts_fixup" |
| 5 echo "Rewriting hosts file" | 5 echo "Rewriting hosts file" |
| 6 echo "## /etc/hosts ##" | 6 echo "## /etc/hosts ##" |
| 7 cat /etc/hosts | 7 cat /etc/hosts |
| 8 sudo sed -i 's/^::1\s*localhost/::1/' /etc/hosts | 8 sudo sed -i 's/^::1\s*localhost/::1/' /etc/hosts |
| 9 sudo sh -c 'echo " | 9 sudo sh -c 'echo " |
| 10 127.0.0.1 web-platform.test | 10 127.0.0.1 web-platform.test |
| 11 127.0.0.1 www.web-platform.test | 11 127.0.0.1 www.web-platform.test |
| 12 127.0.0.1 www1.web-platform.test | 12 127.0.0.1 www1.web-platform.test |
| 13 127.0.0.1 www2.web-platform.test | 13 127.0.0.1 www2.web-platform.test |
| 14 127.0.0.1 xn--n8j6ds53lwwkrqhv28a.web-platform.test | 14 127.0.0.1 xn--n8j6ds53lwwkrqhv28a.web-platform.test |
| 15 127.0.0.1 xn--lve-6lad.web-platform.test | 15 127.0.0.1 xn--lve-6lad.web-platform.test |
| 16 " >> /etc/hosts' | 16 " >> /etc/hosts' |
| 17 echo "== /etc/hosts ==" | 17 echo "== /etc/hosts ==" |
| 18 cat /etc/hosts | 18 cat /etc/hosts |
| 19 echo "----------------" | 19 echo "----------------" |
| 20 echo "travis_fold:end:hosts_fixup" | 20 echo "travis_fold:end:hosts_fixup" |
| 21 } | 21 } |
| 22 | 22 |
| 23 install_chrome() { |
| 24 channel=$1 |
| 25 deb_archive=google-chrome-${channel}_current_amd64.deb |
| 26 wget https://dl.google.com/linux/direct/$deb_archive |
| 27 |
| 28 # Installation will fail in cases where the package has unmet dependencies. |
| 29 # When this occurs, attempt to use the system package manager to fetch the |
| 30 # required packages and retry. |
| 31 if ! sudo dpkg --install $deb_archive; then |
| 32 sudo apt-get install --fix-broken |
| 33 sudo dpkg --install $deb_archive |
| 34 fi |
| 35 } |
| 23 | 36 |
| 24 test_stability() { | 37 test_stability() { |
| 25 python check_stability.py $PRODUCT | 38 python check_stability.py $PRODUCT |
| 26 } | 39 } |
| 27 | 40 |
| 28 main() { | 41 main() { |
| 29 hosts_fixup | 42 hosts_fixup |
| 43 if [ $(echo $PRODUCT | grep '^chrome:') ]; then |
| 44 install_chrome $(echo $PRODUCT | grep --only-matching '\w\+$') |
| 45 fi |
| 30 test_stability | 46 test_stability |
| 31 } | 47 } |
| 32 | 48 |
| 33 main | 49 main |
| OLD | NEW |