2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 . ..
/common
/download_mars.sh
10 . ..
/common
/download_builds.sh
11 . ..
/common
/check_updates.sh
13 ftp_server
="http://stage.mozilla.org/pub/mozilla.org"
14 aus_server
="https://aus2.mozilla.org"
17 config_file
="updates.cfg"
25 echo "Usage: verify.sh [OPTION] [CONFIG_FILE]"
26 echo " -u, --update-only only download update.xml"
27 echo " -t, --test-only only test that MARs exist"
28 echo " -m, --mars-only only test MARs"
29 echo " -c, --complete complete upgrade test"
39 while [ "$#" -gt "$pass_arg_count" ]
59 # Move the unrecognized arg to the end of the list
63 pass_arg_count
=`expr $pass_arg_count + 1`
70 echo "Using config file $config_file"
72 echo "Using default config file $config_file"
75 if [ "$runmode" == "0" ]
83 # initialize all config variables
93 for locale
in $locales
95 for patch_type
in partial complete
97 if [ "$runmode" == "$MARS_ONLY" ] ||
[ "$runmode" == "$COMPLETE" ] ||
98 [ "$runmode" == "$TEST_ONLY" ]
100 if [ "$runmode" == "$TEST_ONLY" ]
102 download_mars
"${aus_server}/update/1/$product/$release/$build_id/$platform/$locale/$channel/update.xml" $patch_type 1
105 download_mars
"${aus_server}/update/1/$product/$release/$build_id/$platform/$locale/$channel/update.xml" $patch_type
108 if [ "$err" != "0" ]; then
109 echo "FAIL: download_mars returned non-zero exit code: $err"
113 update_path
="$product/$release/$build_id/$platform/$locale/$channel"
114 mkdir
-p updates
/$update_path/complete
115 mkdir
-p updates
/$update_path/partial
116 wget
--no-check-certificate -q -O $patch_type updates
/$update_path/$patch_type/update.xml
"${aus_server}/update/1/$update_path/update.xml"
119 if [ "$runmode" == "$COMPLETE" ]
121 if [ -z "$from" ] ||
[ -z "$to" ]
125 from_path
=`echo $from | sed "s/%locale%/${locale}/"`
126 to_path
=`echo $to | sed "s/%locale%/${locale}/"`
127 download_builds
"${ftp_server}/${from_path}" "${ftp_server}/${to_path}"
129 if [ "$err" != "0" ]; then
130 echo "FAIL: download_builds returned non-zero exit code: $err"
133 source_file
=`basename "$from_path"`
134 target_file
=`basename "$to_path"`
135 check_updates
"$platform" "downloads/$source_file" "downloads/$target_file" $locale
137 if [ "$err" == "0" ]; then
139 elif [ "$err" == "1" ]; then
140 echo "FAIL: check_updates returned failure for $platform downloads/$source_file vs. downloads/$target_file: $err"
141 elif [ "$err" == "2" ]; then
142 echo "WARN: check_updates returned warning for $platform downloads/$source_file vs. downloads/$target_file: $err"
144 echo "FAIL: check_updates returned unknown error for $platform downloads/$source_file vs. downloads/$target_file: $err"