diff --git a/testing/sisyphus/bin/appinfo.js b/testing/sisyphus/bin/appinfo.js new file mode 100755 index 00000000000..115dfff8c0b --- /dev/null +++ b/testing/sisyphus/bin/appinfo.js @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is The Original Code is Mozilla Automated Testing Code + * + * The Initial Developer of the Original Code is + * Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2005 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Bob Clary + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +function AppInfo() +{ + // See http://developer.mozilla.org/en/docs/Using_nsIXULAppInfo + var appInfo; + + this.vendor = 'unknown'; + this.name = 'unknown'; + this.ID = 'unknown'; + this.version = 'unknown'; + this.appBuildID = 'unknown'; + this.platformVersion = 'unknown'; + this.platformBuildID = 'unknown'; + + try + { + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + + if('@mozilla.org/xre/app-info;1' in Components.classes) + { + // running under Mozilla 1.8 or later + appInfo = Components + .classes['@mozilla.org/xre/app-info;1'] + .getService(Components.interfaces.nsIXULAppInfo); + + this.vendor = appInfo.vendor; + this.name = appInfo.name; + this.ID = appInfo.ID; + this.version = appInfo.version; + this.appBuildID = appInfo.appBuildID; + this.platformVersion = appInfo.platformVersion; + this.platformBuildID = appInfo.platformBuildID; + } + } + catch(e) + { + } + + if (this.vendor == 'unknown') + { + var ua = navigator.userAgent; + var cap = ua.match(/rv:([\d.ab+]+).*Gecko\/(\d{8,8}) ([\S]+)\/([\d.]+)/); + + if (cap && cap.length == 5) + { + this.vendor = navigator.vendor ? navigator.vendor : 'Mozilla'; + this.name = cap[3]; + this.version = cap[4]; + this.appBuildID = cap[2] + '00'; + this.platformVersion = cap[1]; + this.platformBuildID = this.appBuildID; + } + } +} diff --git a/testing/sisyphus/bin/build.sh b/testing/sisyphus/bin/build.sh new file mode 100755 index 00000000000..bbab5dfc6fe --- /dev/null +++ b/testing/sisyphus/bin/build.sh @@ -0,0 +1,121 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +source $TEST_BIN/set-build-env.sh $@ + +case $product in + firefox|thunderbird) + cd $TREE/mozilla + + if ! make -f client.mk build 2>&1; then + error "during build" + fi + + case "$OSID" in + "mac") + if [[ "$buildtype" == "debug" ]]; then + if [[ "$product" == "firefox" ]]; then + executablepath=$product-$buildtype/dist/FirefoxDebug.app/Contents/MacOS + elif [[ "$product" == "thunderbird" ]]; then + executablepath=$product-$buildtype/dist/ThunderbirdDebug.app/Contents/MacOS + fi + else + if [[ "$product" == "firefox" ]]; then + executablepath=$product-$buildtype/dist/Firefox.app/Contents/MacOS + elif [[ "$product" == "thunderbird" ]]; then + executablepath=$product-$buildtype/dist/Thunderbird.app/Contents/MacOS + fi + fi + ;; + "linux") + executablepath=$product-$buildtype/dist/bin + ;; + esac + + if [[ "$OSID" != "win32" ]]; then + # + # patch unix-like startup scripts to exec instead of + # forking new processes + # + executable=`get_executable $product $branch $executablepath` + if [[ -z "$executable" ]]; then + error "get_executable $product $branch $executablepath returned empty path" + fi + + + executabledir=`dirname $executable` + + # patch to use exec to prevent forked processes + cd "$executabledir" + if [ -e "$product" ]; then + echo "$SCRIPT: patching $product" + cp $TEST_BIN/$product.diff . + patch -N -p0 < $product.diff + fi + if [ -e run-mozilla.sh ]; then + echo "$SCRIPT: patching run-mozilla.sh" + cp $TEST_BIN/run-mozilla.diff . + patch -N -p0 < run-mozilla.diff + fi + fi + ;; + js) + cd $TREE/mozilla/js/src + + if [[ $buildtype == "debug" ]]; then + export JSBUILDOPT= + else + export JSBUILDOPT=BUILD_OPT=1 + fi + + if ! make -f Makefile.ref ${JSBUILDOPT} clean 2>&1; then + error "during js/src clean" + fi + + if ! make -f Makefile.ref ${JSBUILDOPT} 2>&1; then + error "during js/src build" + fi + ;; +esac + + diff --git a/testing/sisyphus/bin/builder.sh b/testing/sisyphus/bin/builder.sh new file mode 100755 index 00000000000..88903a1f5fe --- /dev/null +++ b/testing/sisyphus/bin/builder.sh @@ -0,0 +1,152 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +TEST_LOG=/dev/null + +trap 'echo -e "\n*** ERROR ***\n\b" && tail $TEST_LOG' ERR + +# +# options processing +# +options="p:b:B:T:e:d:" +function usage() +{ + cat< $TEST_LOG 2>&1 + + done + done + done +fi + +# if checkout, ignore buildtypes +if echo "$buildcommands" | grep -iq checkout; then + for product in $products; do + for branch in $branches; do + + TEST_DATE=`date -u +%Y-%m-%d-%H-%M-%S``date +%z` + TEST_LOG="${TEST_DIR}/results/${TEST_DATE},$product,$branch$extra,$buildtype,$OSID,${MACHINE},checkout.log" + + echo "writing results to $TEST_LOG" + + + checkout.sh -p $product -b $branch -T opt $extraflag > $TEST_LOG 2>&1 + + done + done +fi + +if echo "$buildcommands" | grep -iq build; then + for product in $products; do + for branch in $branches; do + for buildtype in $buildtypes; do + + TEST_DATE=`date -u +%Y-%m-%d-%H-%M-%S``date +%z` + TEST_LOG="${TEST_DIR}/results/${TEST_DATE},$product,$branch$extra,$buildtype,$OSID,${MACHINE}-build.log" + + echo "writing results to $TEST_LOG" + + build.sh -p $product -b $branch -T $buildtype $extraflag > $TEST_LOG 2>&1 + done + done + done +fi + diff --git a/testing/sisyphus/bin/buildinfo.html b/testing/sisyphus/bin/buildinfo.html new file mode 100755 index 00000000000..ad6618f5574 --- /dev/null +++ b/testing/sisyphus/bin/buildinfo.html @@ -0,0 +1,16 @@ + + +Get Build Information + + + +

Get Build Information

+ + + diff --git a/testing/sisyphus/bin/check-spider.sh b/testing/sisyphus/bin/check-spider.sh new file mode 100755 index 00000000000..117b76f276b --- /dev/null +++ b/testing/sisyphus/bin/check-spider.sh @@ -0,0 +1,140 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +# +# options processing +# +options="p:b:x:N:d:" +function usage() +{ + cat < +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +source /work/mozilla/mozilla.com/test.mozilla.com/www/bin/set-build-env.sh $@ + +if [[ -z "$TREE" ]]; then + error "source tree not specified!" +fi + +cd $TREE + +case $product in + firefox|thunderbird) + if [[ ! ( -d mozilla && \ + -e mozilla/client.mk && \ + -e "mozilla/$project/config/mozconfig" ) ]]; then + if ! cvs -z3 -q co $BRANCH_CO_FLAGS \ + mozilla/client.mk mozilla/$project/config/mozconfig; then + error "during checkout of mozconfig" + fi + fi + + cd mozilla + + if ! make -f client.mk checkout 2>&1; then + error "during checkout of tree" + fi + ;; + js) + if [[ ! ( -d mozilla && \ + -e mozilla/js && \ + -e mozilla/js/src ) ]]; then + cvs -z3 -q co mozilla/js/src + fi + + cd mozilla/js/src + + if ! cvs -z3 -q update -d -P 2>&1; then + error "during checkout of js/src" + fi + + if ! cvs -z3 -q update -d -P -A editline config 2>&1; then + error "during checkout of js/src" + fi +# end for js shell + ;; + *) + error "unknown product $product" + ;; +esac + + + + + + + diff --git a/testing/sisyphus/bin/clean.sh b/testing/sisyphus/bin/clean.sh new file mode 100755 index 00000000000..4b2bce83de7 --- /dev/null +++ b/testing/sisyphus/bin/clean.sh @@ -0,0 +1,62 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +source /work/mozilla/mozilla.com/test.mozilla.com/www/bin/set-build-env.sh $@ + +case $product in + firefox|thunderbird) + cd $TREE/mozilla + + if ! make -f client.mk distclean 2>&1; then + error "during client.mk clean" + fi + ;; + + js) + cd $TREE/mozilla/js/src + + if ! make -f Makefile.ref clean 2>&1; then + error "during SpiderMonkey clean" + fi + ;; +esac diff --git a/testing/sisyphus/bin/combo.sh b/testing/sisyphus/bin/combo.sh new file mode 100755 index 00000000000..c82704005fe --- /dev/null +++ b/testing/sisyphus/bin/combo.sh @@ -0,0 +1,50 @@ +#!/bin/bash -e + +delim=, + +while getopts "d:" optname; + do + case $optname in + d) delim=$OPTARG;; + esac +done + +if [[ $OPTIND -gt 1 ]]; then + shift 2 +fi + + +if [[ -n "$4" ]]; then + for a in $1; do for b in $2; do for c in $3; do for d in $4; do echo $a$delim$b$delim$c$delim$d; done; done; done; done +elif [[ -n "$3" ]]; then + for a in $1; do for b in $2; do for c in $3; do echo $a$delim$b$delim$c; done; done; done +elif [[ -n "$2" ]]; then + for a in $1; do for b in $2; do echo $a$delim$b; done; done +elif [[ -n "$1" ]]; then + for a in $1; do echo $a; done +else + cat< +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +# +# options processing +# +options="d:n" +function usage() +{ + cat < /dev/null ; then + error "$directory is not accessible" +fi +directory=`pwd` +popd > /dev/null + +if [[ "$directory" == "/" ]]; then + error "directory $directory can not be root" +fi + +parent=`dirname "$directory"` +grandparent=`dirname "$parent"` + +if [[ "$parent" != "/tmp" && ( "$parent" == "/" || "$grandparent" == "/" ) ]]; then + error "directory $directory can not be a subdirectory of $parent" +fi + + +# clean the directory if requested +rm -fR $rmopt $directory +mkdir -p "$directory" diff --git a/testing/sisyphus/bin/create-profile.sh b/testing/sisyphus/bin/create-profile.sh new file mode 100755 index 00000000000..b764ccafa29 --- /dev/null +++ b/testing/sisyphus/bin/create-profile.sh @@ -0,0 +1,155 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +# +# options processing +# +options="p:b:x:D:N:L:U:d:" +function usage() +{ + cat < +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +args=$@ +script=`basename $0` + +# +# options processing +# +options="u:c:f:t:d:" +function usage() +{ + cat < +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** +use URI::Escape; +use lib "$ENV{HOME}/projects/mozilla.com/test.mozilla.com/www/bin/"; + +my $hook = shift @ARGV || usage("hook"); +my $sitelist = shift @ARGV || usage("sitelist"); + +open SITES, "<$sitelist" || die "unable to open $sitelist\n"; + +my @sites = ; + +close SITES; + +my $site; + +my $chromeurl; +my $testUrl; + +print "\n"; + +foreach $site (@sites) +{ + + chomp $site; + + my $spider = "chrome://spider/content/spider.xul?" . + "depth=0&timeout=120&waittime=5&hooksignal=on&autostart=on&autoquit=on&javascripterrors=off&" . + "javascriptwarnings=off&chromeerrors=on&xblerrors=on&csserrors=off&" . + "scripturl=" . + uri_escape("http://" . + $ENV{TEST_HTTP} . + $hook) . + "&" . + "url=" . uri_escape(uri_escape($site)); + + print "$site\
\n"; +} +print "\n"; + +sub usage +{ + my $arg = shift @_; + + print < +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +use File::Basename; +use File::Copy; +use Cwd; + +#my $DEBUG = 0; +#editTalkback("/tmp/test/firefox-1.5-nightly-opt/firefox/firefox", "talkbackid"); + +1; + +sub editTalkback +{ + my ($binary, $talkbackid) = @_; + my $rc; + my $signal; + my $home = $ENV{HOME}; + my $os = undef; + my $ostype = ""; + + # prevent replacements due to & in urls + $talkbackid =~ s/&/\\&/g; + + # hack around lack of available environment entries in both + # cygwin perl and redhat perl + open OSTYPE, "set | grep OSTYPE |" || die "Unable to open OSTYPE: $!"; + while () + { + chomp; + $ostype .= $_; + } + close OSTYPE; + + die "Unable to determine OSTYPE" if (!$ostype); + + if ($ostype =~ /cygwin/i) + { + $os = "win32"; + } + elsif ($ostype =~ /linux/i) + { + $os = "linux"; + } + elsif ($ostype =~ /darwin/) + { + $os = "mac"; + } + else + { + die "Unknown Operating System: $ostype"; + } + + if (!$binary) + { + die "binary argument missing"; + } + + if (! -f $binary) + { + die "$binary does not exist"; + } + + my $installpath = dirname($binary); + + #print "installpath=$installpath\n"; + + if (! -d $installpath) + { + die "$installpath does not exist"; + } + +# +# edit talkback to automatically submit +# + my $talkback=1; + + if ( -e "$installpath/extensions/talkback\@mozilla.org/components/master.ini") + { + chdir "$installpath/extensions/talkback\@mozilla.org/components/"; + } + elsif ( -e "$installpath/extensions/talkback\@mozilla.org/components/talkback/master.ini") + { + chdir "$installpath/extensions/talkback\@mozilla.org/components/talkback/"; + } + elsif ( -e "$installpath/components/master.ini") + { + chdir "$installpath/components"; + } + else + { + #print "Talkback not installed.\n"; + $talkback=0 ; + } + + if ( $talkback == 1 ) + { + # edit to automatically send talkback incidents + if ( -e "master.sed") + { + #print "talkback master.ini already edited\n"; + } + else + { + #print "editing talkback master.ini in " . cwd() . "\n"; + copy("/work/mozilla/mozilla.com/test.mozilla.com/www/bin/master.sed", "master.sed"); + system(("sed", "-ibak", "-f", "master.sed", "master.ini")); + + $rc = $? >> 8; + $signal = $? & 127; + $dumped = $? & 128; + if ($rc != 0) + { + die "non zero exitcode editing master.ini: $!"; + } + if ($signal) + { + #print "signal $signal editing master.ini\n"; + } + } + + open MASTER, "master.ini" || die "unable to open master.ini: $!"; + while () + { + chomp $_; + if (/VendorID = "([^"]*)"/) + { + ($vendorid) = $1; + } + elsif (/ProductID = "([^"]*)"/) + { + ($productid) = $1; + } + elsif (/PlatformID = "([^"]*)"/) + { + ($platformid) = $1; + } + elsif (/BuildID = "([^"]*)"/) + { + ($buildid) = $1; + } + } + close MASTER; + + if ("$DEBUG") + { + print "vendorid=$vendorid\n"; + print "productid=$productid\n"; + print "platformid=$platformid\n"; + print "buildid=$buildid\n"; + } + + my $appdata; + + if ($os eq "win32") + { + # get application data directory in windows format + $appdata = $ENV{APPDATA}; + if (!$appdata) + { + die "Empty Windows Application Data directory\n"; + } + + open PATH, "cygpath -d \"$appdata\"|" || die "Unable to open cygpath: $!"; + my $path = ""; + while () + { + chomp; + $path .= $_; + } + close PATH; + $path =~ s/\\/\\\\/g; + + if (!$path) + { + die "Unable to convert Windows Application Data directory to short format\n"; + } + + # convert application data directory to unix format + $appdata = ""; + open PATH, "cygpath -u $path|" || die "unable to open cygpath: $!"; + while () + { + chomp; + $appdata .= $_; + } + close PATH; + if (!$appdata) + { + die "Unix format Windows Application Data directory is empty\n"; + } + $talkbackdir = "$appdata/Talkback"; + } + elsif ($os eq "linux") + { + $talkbackdir="$home/.fullcircle"; + } + elsif ($os eq "mac") + { + $talkbackdir="$home/Library/Application\ Support/FullCircle"; + } + else + { + die "unknown os $os"; + } + + + if ( ! -e "$talkbackdir" ) + { + if (! mkdir "$talkbackdir", 755) + { + die "unable to create $talkbackdir\n: $!"; + } + } + + my $talkbackinidir; + + if ($os eq "win32") + { + $talkbackinidir="$talkbackdir/$vendorid/$productid/$platformid/$buildid/"; + + if ( ! -e "$talkbackdir/$vendorid" ) + { + if (! mkdir "$talkbackdir/$vendorid", 755) + { + die "unable to make $talkbackdir/$vendorid: $!"; + } + } + + if (! -e "$talkbackdir/$vendorid/$productid") + { + if (! mkdir "$talkbackdir/$vendorid/$productid", 755) + { + die "unable to make $talkbackdir/$vendorid/$productid: $!"; + } + } + + + if (! -e "$talkbackdir/$vendorid") + { + if (! mkdir "$talkbackdir/$vendorid/$productid/$platformid", 755) + { + die "unable to make $talkbackdir/$vendorid/$productid/$platformid: $!"; + } + } + + + if (! -e "$talkbackdir/$vendorid/$productid/$platformid") + { + if (! mkdir "$talkbackdir/$vendorid/$productid/$platformid", 755) + { + die "unable to make $talkbackdir/$vendorid/$productid/$platformid: $!"; + } + } + + if ( ! -e "$talkbackdir/$vendorid/$productid/$platformid/$buildid") + { + if (! mkdir "$talkbackdir/$vendorid/$productid/$platformid/$buildid", 755) + { + die "unable to make $talkbackdir/$vendorid/$productid/$platformid/$buildid: $!"; + } + } + } + elsif ($os eq "linux") + { + $talkbackinidir="$talkbackdir/$vendorid$productid$platformid$buildid"; + if (! -e "$talkbackdir/$vendorid$productid$platformid$buildid" ) + { + if (! mkdir "$talkbackdir/$vendorid$productid$platformid$buildid", 755) + { + die "unable to make $talkbackdir/$vendorid$productid$platformid$buildid: $!"; + } + } + } + elsif ($os eq "mac") + { + $talkbackinidir="$talkbackdir/$vendorid$productid$platformid$buildid"; + if (! -e "$talkbackdir/$vendorid$productid$platformid$buildid" ) + { + if (! mkdir "$talkbackdir/$vendorid$productid$platformid$buildid", 755) + { + die "unable to make $talkbackdir/$vendorid$productid$platformid$buildid: $!"; + } + } + } + else + { + die "$os not supported yet"; + } + + if (! chdir $talkbackinidir) + { + die "unable to cd $talkbackinidir: $!"; + } + + + if (!copy("/work/mozilla/mozilla.com/test.mozilla.com/www/talkback/$os/Talkback.ini", "Talkback.ini")) + { + die "unable to copy Talkback.ini: $!"; + } + + #print "patching Talkback.ini\n"; + if ($os eq "win32") + { + $rc = system(("sed", + "-ibak", + "-e", + "s|URLEdit .*|URLEdit = \"mozqa:$talkbackid\"|", + "Talkback.ini")) & 0xffff; + if ($rc != 0) + { + die "unable to edit Talkback.ini: $!"; + } + } + elsif ($os eq "linux") + { + $rc = system(("sed", + "-ibak", + "-e", + "s|URLEditControl .*|URLEditControl = \"mozqa:$talkbackid\"|", + "Talkback.ini")) & 0xffff; + if ($rc != 0) + { + die "unable to edit Talkback.ini: $!"; + } + } + elsif ($os eq "mac") + { + $rc = system(("sed", + "-ibak", + "-e", + "s|URLEditControl .*|URLEditControl = \"mozqa:$talkbackid\"|", + "Talkback.ini")) & 0xffff; + if ($rc != 0) + { + die "unable to edit Talkback.ini: $!"; + } + } + else + { + die "$os not supported yet"; + } + } +} + diff --git a/testing/sisyphus/bin/edit-talkback.sh b/testing/sisyphus/bin/edit-talkback.sh new file mode 100755 index 00000000000..963f68e46ab --- /dev/null +++ b/testing/sisyphus/bin/edit-talkback.sh @@ -0,0 +1,201 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +# +# options processing +# +options="p:b:x:i:d:" +function usage() +{ + cat < + +Get Build Information + + + + +

Get Build Information

+ + + diff --git a/testing/sisyphus/bin/hdiutil-expect.ex b/testing/sisyphus/bin/hdiutil-expect.ex new file mode 100755 index 00000000000..da94c8ebd3f --- /dev/null +++ b/testing/sisyphus/bin/hdiutil-expect.ex @@ -0,0 +1,9 @@ +#!/usr/bin/expect + +spawn hdiutil attach $argv + +expect { +"byte" {send "G"; exp_continue} +"Y/N" {send "Y\r"; exp_continue} +} + diff --git a/testing/sisyphus/bin/include.mk b/testing/sisyphus/bin/include.mk new file mode 100755 index 00000000000..3bac5a1b72e --- /dev/null +++ b/testing/sisyphus/bin/include.mk @@ -0,0 +1,9 @@ +dashes = ---------- +msg = @echo "$(1)": $(dashes) $(2) $(dashes) +prepend = sed 's/^/$(1): /' +html2text = lynx --dump $(1) +TEST_PROFILE?=TEST + +dumpvars = echo TARGETS=$$targets && for var in `echo $${!TEST_*}`; do echo $${var}=$${!var}; done + + diff --git a/testing/sisyphus/bin/install-build.sh b/testing/sisyphus/bin/install-build.sh new file mode 100755 index 00000000000..7680c6e23c4 --- /dev/null +++ b/testing/sisyphus/bin/install-build.sh @@ -0,0 +1,174 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +# +# options processing +# +options="p:b:x:f:d:" +function usage() +{ + cat < + +Install Extensions - 1 + + + +

Install Extensions - 1

+

+First restart to install extensions... +

+ + + diff --git a/testing/sisyphus/bin/install-extensions-2.html b/testing/sisyphus/bin/install-extensions-2.html new file mode 100755 index 00000000000..fbd2ce40571 --- /dev/null +++ b/testing/sisyphus/bin/install-extensions-2.html @@ -0,0 +1,15 @@ + + +Install Extensions - 2 + + + +

Install Extensions - 2

+

+Second restart to install extensions... +

+ + + diff --git a/testing/sisyphus/bin/install-extensions.sh b/testing/sisyphus/bin/install-extensions.sh new file mode 100755 index 00000000000..f1b560c4aa2 --- /dev/null +++ b/testing/sisyphus/bin/install-extensions.sh @@ -0,0 +1,166 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2005. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +echo "$SCRIPT $@" + +# +# options processing +# +options="p:b:x:N:E:d:" +function usage() +{ + cat < +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +# +# options processing +# +options="p:b:x:D:d:" +function usage() +{ + cat < +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# This script contains a number of variables, functions, etc which +# are reused across a number of scripts. It should be included in each +# script as follows: +# +# TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +# TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +# source ${TEST_BIN}/library.sh +# + +echo "calling $0 $@" + +# export variables +set -a + +# error message +# output error message end exit 2 + +error() +{ + echo "error in script $SCRIPT: $1" + if [[ "$0" == "-bash" || "$0" == "bash" ]]; then + return 0 + fi + exit 2 +} + +# get_executable product branch directory +# writes path to product executable to stdout + +get_executable() +{ + get_executable_product="$1" + get_executable_branch="$2" + get_executable_directory="$3" + + if [[ -z "$get_executable_product" || \ + -z "$get_executable_branch" || \ + -z "$get_executable_directory" ]]; then + error "usage: get_executable product branch directory" + elif [[ ! -d "$get_executable_directory" ]]; then + error "get_executable: executable directory \"$get_executable_directory\" does not exist" + else + # should use /u+x,g+x,a+x but mac os x uses an obsolete find + # filter the output to remove extraneous file in dist/bin for + # cvs builds on mac os x. + get_executable_name="$get_executable_product${EXE_EXT}" + if [[ "$OSID" == "mac" ]]; then + get_executable_filter="Contents/MacOS/$get_executable_product" + if [[ "$get_executable_product" == "thunderbird" ]]; then + get_executable_name="$get_executable_product-bin" + fi + else + get_executable_filter="$get_executable_product" + fi + if find "$get_executable_directory" -perm +111 -type f \ + -name "$get_executable_name" | \ + grep "$get_executable_filter"; then + true + fi + fi +} + + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +TEST_HTTP=${TEST_HTTP:-test.mozilla.com} +TEST_STARTUP_TIMEOUT=${TEST_STARTUP_TIMEOUT:-30} + +# set path to make life easier +PATH=${TEST_DIR}/bin:$PATH + +# make pipelines return exit code of intermediate steps +# requires bash 3.x +set -o pipefail + +if [[ "$0" == "-bash" || "$0" == "bash" ]]; then + SCRIPT="library.sh" +else + SCRIPT=`basename $0` +fi + +# save starting directory +STARTDIR=`pwd` + +# change working directory to the location of the script. +SCRIPTDIR=`dirname $0` +cd $SCRIPTDIR + +# set time format for pipeline timing reports +TIMEFORMAT="Elapsed time %0R seconds, User %0U seconds, System %0S seconds, CPU %P%%" + +# don't attach to running instance +MOZ_NO_REMOTE=1 + +# don't restart +NO_EM_RESTART=1 + +# bypass profile manager +MOZ_BYPASS_PROFILE_AT_STARTUP=1 + +# ah crap handler timeout +MOZ_GDB_SLEEP=10 + +# no dialogs on asserts +XPCOM_DEBUG_BREAK=warn + +#leak gauge +#NSPR_LOG_MODULES=DOMLeak:5,DocumentLeak:5,nsDocShellLeak:5 + +MALLOC_CHECK_=2 + +MACHINE=`uname -n` + +ulimit -c 0 + +if echo $OSTYPE | grep -iq cygwin; then + OSID=win32 + EXE_EXT=".exe" +elif echo $OSTYPE | grep -iq Linux; then + OSID=linux + EXE_EXT= +elif echo $OSTYPE | grep -iq darwin; then + OSID=mac + EXE_EXT= +else + error "Unknown OS $OSTYPE" +fi + + diff --git a/testing/sisyphus/bin/master.sed b/testing/sisyphus/bin/master.sed new file mode 100755 index 00000000000..ef41ed43c8e --- /dev/null +++ b/testing/sisyphus/bin/master.sed @@ -0,0 +1,3 @@ +s/DisableDontAsk = 0/DisableDontAsk = 1/ +s/DisableUI = 0/DisableUI = 1/ +s/DisableWizard = 0/DisableWizard = 1/ diff --git a/testing/sisyphus/bin/quit.js b/testing/sisyphus/bin/quit.js new file mode 100755 index 00000000000..935de3b519e --- /dev/null +++ b/testing/sisyphus/bin/quit.js @@ -0,0 +1,143 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; -*- */ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is The Original Code is Mozilla Automated Testing Code + * + * The Initial Developer of the Original Code is + * Mozilla Corporation. + * Portions created by the Initial Developer are Copyright (C) 2005 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Bob Clary + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +/* + From mozilla/toolkit/content + These files did not have a license +*/ + +function canQuitApplication() +{ + var os = Components.classes["@mozilla.org/observer-service;1"] + .getService(Components.interfaces.nsIObserverService); + if (!os) + { + return true; + } + + try + { + var cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"] + .createInstance(Components.interfaces.nsISupportsPRBool); + os.notifyObservers(cancelQuit, "quit-application-requested", null); + + // Something aborted the quit process. + if (cancelQuit.data) + { + return false; + } + } + catch (ex) + { + } + os.notifyObservers(null, "quit-application-granted", null); + return true; +} + +function goQuitApplication() +{ + const privs = 'UniversalPreferencesRead UniversalPreferencesWrite ' + + 'UniversalXPConnect'; + + try + { + netscape.security.PrivilegeManager.enablePrivilege(privs); + } + catch(ex) + { + throw('goQuitApplication: privilege failure ' + ex); + } + + if (!canQuitApplication()) + { + return false; + } + + const kAppStartup = '@mozilla.org/toolkit/app-startup;1'; + const kAppShell = '@mozilla.org/appshell/appShellService;1'; + var appService; + var forceQuit; + + if (kAppStartup in Components.classes) + { + appService = Components.classes[kAppStartup]. + getService(Components.interfaces.nsIAppStartup); + forceQuit = Components.interfaces.nsIAppStartup.eForceQuit; + + } + else if (kAppShell in Components.classes) + { + appService = Components.classes[kAppShell]. + getService(Components.interfaces.nsIAppShellService); + forceQuit = Components.interfaces.nsIAppShellService.eForceQuit; + } + else + { + throw 'goQuitApplication: no AppStartup/appShell'; + } + + var windowManager = Components. + classes['@mozilla.org/appshell/window-mediator;1'].getService(); + + var windowManagerInterface = windowManager. + QueryInterface(Components.interfaces.nsIWindowMediator); + + var enumerator = windowManagerInterface.getEnumerator(null); + + while (enumerator.hasMoreElements()) + { + var domWindow = enumerator.getNext(); + if (("tryToClose" in domWindow) && !domWindow.tryToClose()) + { + return false; + } + domWindow.close(); + } + + try + { + appService.quit(forceQuit); + } + catch(ex) + { + throw('goQuitApplication: ' + ex); + } + + return true; +} + + diff --git a/testing/sisyphus/bin/run-mozilla.diff b/testing/sisyphus/bin/run-mozilla.diff new file mode 100755 index 00000000000..34be7f413f7 --- /dev/null +++ b/testing/sisyphus/bin/run-mozilla.diff @@ -0,0 +1,11 @@ +--- run-mozilla.sh 2004-04-18 10:17:09.000000000 -0400 ++++ run-mozilla.sh.test 2005-08-18 22:27:42.906250000 -0400 +@@ -163,7 +163,7 @@ + ## + ## Run the program + ## +- "$prog" ${1+"$@"} ++ exec "$prog" ${1+"$@"} + exitcode=$? + if [ "$DEBUG_CORE_FILES" ] + then diff --git a/testing/sisyphus/bin/sayvars.sh b/testing/sisyphus/bin/sayvars.sh new file mode 100755 index 00000000000..f1aeda1064f --- /dev/null +++ b/testing/sisyphus/bin/sayvars.sh @@ -0,0 +1,6 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- + + for var in `echo ${!TEST_*}`; do + echo ${var}=${!var} >> $TEST_LOG + done diff --git a/testing/sisyphus/bin/set-build-env.sh b/testing/sisyphus/bin/set-build-env.sh new file mode 100755 index 00000000000..b521cd453e6 --- /dev/null +++ b/testing/sisyphus/bin/set-build-env.sh @@ -0,0 +1,226 @@ +#!/usr/local/bin/bash +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +export BUILDDIR=/work/mozilla/builds +export SHELL=/usr/local/bin/bash +export CONFIG_SHELL=/usr/local/bin/bash +export CONFIGURE_ENV_ARGS=/usr/local/bin/bash +export MOZ_CVS_FLAGS="-z3 -q" +export CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot +export MOZILLA_OFFICIAL=1 +export BUILD_OFFICIAL=1 + +# +# options processing +# +options="p:b:T:e:" +usage() +{ + cat < +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# Root of Visual Developer Studio Common files. +export VSCommonDir='C:\Program Files\Microsoft Visual Studio\Common' +export VSCommonDir_cyg=`cygpath -u "$VSCommonDir"` + +# Root of Visual Developer Studio installed files. +export MSDevDir='C:\Program Files\Microsoft Visual Studio\Common\MSDev98' +export MSDevDir_cyg=`cygpath -u "$MSDevDir"` + +# Root of Visual C++ installed files. +export MSVCDir='C:\Program Files\Microsoft Visual Studio\VC98' +export MSVCDir_cyg=`cygpath -u "$MSVCDir"` + +# VcOsDir is used to help create either a Windows 95 or Windows NT specific path. +export VcOsDir=WIN95 +if [[ "$OS" == "Windows_NT" ]]; then + export VcOsDir=WINNT +fi + +echo Setting environment for using Microsoft Visual C++ tools. + +if [[ "$OS" == "Windows_NT" ]]; then + export PATH="$MSDevDir_cyg/Bin":"$MSVCDir_cyg/Bin":"$VSCommonDir_cyg/Tools/$VcOsDir":"$VSCommonDir_cyg/Tools":"$MOZ_TOOLS/bin":"$PATH" +elif [[ "$OS" == "" ]]; then + export PATH="$MSDevDir_cyg/Bin":"MSVCDir_cyg/Bin":"$VSCommonDir_cyg/Tools/$VcOsDir":"$VSCommonDir_cyg/Tools":"$windir/SYSTEM":$MOZ_TOOLS/bin:"$PATH" +fi + +export INCLUDE="$MSVCDir\\ATL\\Include;$MSVCDir\\Include;$MSVCDir\\MFC\\Include;$INCLUDE" +export LIB="$MSVCDir\\Lib;$MSVCDir\\MFC\\Lib;$LIB" + +unset VcOsDir +unset VSCommonDir + diff --git a/testing/sisyphus/bin/set-msvc8-env.sh b/testing/sisyphus/bin/set-msvc8-env.sh new file mode 100755 index 00000000000..b9f8520d740 --- /dev/null +++ b/testing/sisyphus/bin/set-msvc8-env.sh @@ -0,0 +1,95 @@ +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +export VSINSTALLDIR='C:\Program Files\Microsoft Visual Studio 8' +export VS80COMNTOOLS='C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\' +export VCINSTALLDIR='C:\Program Files\Microsoft Visual Studio 8\VC' +export FrameworkDir='C:\WINDOWS\Microsoft.NET\Framework' +export FrameworkVersion='v2.0.50727' +export FrameworkSDKDir='C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0' + +export VSINSTALLDIR_cyg="/cygdrive/c/Program Files/Microsoft Visual Studio 8" +export VCINSTALLDIR_cyg="/cygdrive/c/Program Files/Microsoft Visual Studio 8/VC" + +export DevEnvDir="$VSINSTALLDIR\\Common7\\IDE" +export DevEnvDir_cyg="$VSINSTALLDIR_cyg/Common7/IDE" + +export MSVCDir="$VCINSTALLDIR" +export MSVCDir_cyg="$VCINSTALLDIR_cyg" + + +if [ -d "$MSVCDir_cyg"/PlatformSDK ] ; then + export PlatformSDKDir="$MSVCDir"\\PlatformSDK + export PlatformSDKDir_cyg="$MSVCDir_cyg"/PlatformSDK +elif [ -d "/cygdrive/c/Program Files/Microsoft Platform SDK" ] ; then + export PlatformSDKDir='C:\Program Files\Microsoft Platform SDK' + export PlatformSDKDir_cyg='/cygdrive/c/Program Files/Microsoft Platform SDK' +else + echo Can\'t find Platform SDK\! + break 2 +fi + +echo Platform SDK Location: $PlatformSDKDir_cyg + +if [ ! -f "$MOZ_TOOLS"/lib/libIDL-0.6_s.lib ] ; then + echo Can\'t find moztools\! Edit this file and check MOZ_TOOLS path. +fi + + +export PATH="\ +$DevEnvDir_cyg:\ +$PlatformSDKDir_cyg/bin:\ +$MSVCDir_cyg/bin:\ +$VSINSTALLDIR_cyg/Common7/Tools:\ +$VSINSTALLDIR_cyg/Common7/Tools/bin:\ +$MOZ_TOOLS/bin:\ +$PATH" + + export INCLUDE="\ +$MSVCDir\ATLMFC\INCLUDE;\ +$MSVCDir\INCLUDE;\ +$PlatformSDKDir\include;\ +$FrameworkSDKDir\include;\ +$INCLUDE" + + export LIB="\ +$MSVCDir\ATLMFC\LIB;\ +$MSVCDir\LIB;\ +$PlatformSDKDir\lib;\ +$FrameworkSDKDir\lib;\ +$LIB" + diff --git a/testing/sisyphus/bin/smoke-build.sh b/testing/sisyphus/bin/smoke-build.sh new file mode 100755 index 00000000000..ceb128eaf90 --- /dev/null +++ b/testing/sisyphus/bin/smoke-build.sh @@ -0,0 +1,90 @@ +#!/usr/local/bin/bash -e +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +if [[ -z "$1" ]]; then + echo smoke-build.sh directorypattern + exit 2 +fi + +for filepath in $@; do + echo $filepath + + base=`basename $filepath` + + version=`echo $base|sed 's/[^0-9.]*\([0-9]*\).*/\1/'` + product=`echo $base|sed 's/\([^-]*\)-.*/\1/'` + + case $version in + 1) branch=1.8.0;; + 2) branch=1.8.1;; + 3) branch=1.9.0;; + esac + + echo $product $branch + + install-build.sh -p "$product" -b "$branch" -x "/tmp/$product-$branch" \ + -f "$filepath" + + if [[ "$product" == "thunderbird" ]]; then + template="-L ${TEST_DIR}/profiles/imap" + else + unset template + fi + + create-profile.sh -p "$product" -b "$branch" \ + -x "/tmp/$product-$branch" \ + -D "/tmp/$product-$branch-profile" -N "$product-$branch-profile" \ + -U ${TEST_DIR}/prefs/test-user.js \ + $template + + install-extensions.sh -p "$product" -b "$branch" \ + -x "/tmp/$product-$branch" \ + -N "$product-$branch-profile" \ + -E ${TEST_DIR}/xpi + + check-spider.sh -p "$product" -b "$branch" \ + -x "/tmp/$product-$branch" \ + -N "$product-$branch-profile" + + uninstall-build.sh -p "$product" -b "$branch" -x "/tmp/$product-$branch" + +done diff --git a/testing/sisyphus/bin/spider.pl b/testing/sisyphus/bin/spider.pl new file mode 100755 index 00000000000..a97faa5e47e --- /dev/null +++ b/testing/sisyphus/bin/spider.pl @@ -0,0 +1,257 @@ +#!/usr/bin/perl +# -*- Mode: Perl; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is Mozilla Automated Testing Code +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2005 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# make unbuffered +select STDERR; $| = 1; +select STDOUT; $| = 1; + +my $TEST_BIN = $ENV{TEST_BIN} || "/work/mozilla/mozilla.com/test.mozilla.com/www/bin/"; + +use File::Temp qw/ tempfile tempdir /; +use File::Basename; +use Getopt::Mixed "nextOption"; +use URI::Escape; +use Time::HiRes qw(sleep); + +my $DEBUG = 0; + +my $product = ""; +my $executable = ""; +my $profile = ""; +my $url = ""; +my $domain = ""; +my $depth = 0; +my $timeout = 0; +my $wait = 0; +my $hook = ""; +my $start = "off"; +my $quit = "off"; +my $robot = "off"; +my $debug = "off"; +my $jserrors = "off"; +my $jswarnings = "off"; +my $chromeerrors = "off"; +my $xblerrors = "off"; +my $csserrors = "off"; + +parse_options(); + +my $hookon = ($hook ? "on" : "off"); +my $runtime = dirname($executable); + +chdir $runtime or + die "spider.pl: unable to change directory to runtime $runtime"; + + +my $chromeurl; + +my $testUrl; + +my $spider = "chrome://spider/content/spider.xul?" . + "domain=$domain&" . + "depth=$depth&" . + "timeout=$timeout" . + "&waittime=$wait&" . + "autostart=$start&" . + "autoquit=$quit&" . + "javascripterrors=$jserrors&" . + "javascriptwarnings=$jswarnings&" . + "chromeerrors=$chromeerrors&" . + "xblerrors=$xblerrors&" . + "csserrors=$csserrors&" . + "hooksignal=$hookon&" . + "url=" . uri_escape(uri_escape($url)); + +if ($hook) +{ + $spider .= "&scripturl=" . uri_escape($hook); +} + +my @args; +my $rc; +my $signal; +my $dumped; + +if ($product eq "thunderbird") +{ + @args = ($executable, "-P", $profile, $spider); +} +else +{ + @args = ($executable, "-P", $profile, "-chrome", $spider); +} + +system @args; +$rc = $? >> 8; + +if ($rc == 99) +{ + exit $rc; +} + +sub usage +{ + my $arg = shift @_; + my $value = shift @_; + + print < + +Start Spider + + +

Start Spider

+

+Initialize Spider... +

+ + diff --git a/testing/sisyphus/bin/test-setup.sh b/testing/sisyphus/bin/test-setup.sh new file mode 100755 index 00000000000..0dfc1e52a5b --- /dev/null +++ b/testing/sisyphus/bin/test-setup.sh @@ -0,0 +1,252 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +# +# options processing +# +options="p:b:u:f:c:B:T:x:N:D:L:U:E:d:" +function usage() +{ + cat< +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +TEST_LOG=/dev/null + +#trap 'echo -e "\n*** ERROR ***\n\b" && tail $TEST_LOG' ERR + +# +# options processing +# +options="p:b:e:T:t:" +function usage() +{ + cat<> $TEST_LOG 2>&1 + + $testscript $testargs -d $TEST_DIR/data/$data.data >> $TEST_LOG 2>&1 +done diff --git a/testing/sisyphus/bin/thunderbird.diff b/testing/sisyphus/bin/thunderbird.diff new file mode 100755 index 00000000000..86487dd5209 --- /dev/null +++ b/testing/sisyphus/bin/thunderbird.diff @@ -0,0 +1,11 @@ +--- thunderbird 2006-03-08 07:04:19.000000000 -0500 ++++ thunderbird.new 2006-04-20 14:14:41.864224000 -0400 +@@ -179,7 +179,7 @@ + then + echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@" + fi +-"$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@" ++exec "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@" + exitcode=$? + + ## Stop addon scripts diff --git a/testing/sisyphus/bin/timed_run.py b/testing/sisyphus/bin/timed_run.py new file mode 100755 index 00000000000..e415a300984 --- /dev/null +++ b/testing/sisyphus/bin/timed_run.py @@ -0,0 +1,114 @@ +#!/usr/bin/python -u +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Foundation. +# Portions created by the Initial Developer are Copyright (C) 2004 +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): Chris Cooper +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +# Usage: timed_run timeout prefix command args +import os, signal, sys, time + +# +# returns exit code as follows: +# +exitOSError = 66 +exitSignal = 77 +exitTimeout = 88 +exitInterrupt = 99 + +pid = None +prefix = sys.argv[2] +elapsedtime = 0 + +if prefix == "-": + prefix = '' +else: + prefix = prefix + ':' + +def alarm_handler(signum, frame): + global pid + global prefix + try: + print "%s EXIT STATUS: TIMED OUT (%s seconds)" % (prefix, sys.argv[1]) + os.kill(pid, signal.SIGKILL) + except: + pass + sys.exit(exitTimeout) + +def forkexec(command, args): + global prefix + global elapsedtime + #print command + #print args + try: + pid = os.fork() + if pid == 0: # Child + os.execvp(command, args) + else: # Parent + return pid + except OSError, e: + print "%s ERROR: %s %s failed: %d (%s) (%f seconds)" % (prefix, command, args, e.errno, e.strerror, elapsedtime) + sys.exit(exitOSError) + +signal.signal(signal.SIGALRM, alarm_handler) +signal.alarm(int(sys.argv[1])) +starttime = time.time() +try: + pid = forkexec(sys.argv[3], sys.argv[3:]) + status = os.waitpid(pid, 0)[1] + signal.alarm(0) # Cancel the alarm + stoptime = time.time() + elapsedtime = stoptime - starttime + if os.WIFEXITED(status): + rc = os.WEXITSTATUS(status) + msg = '' + if rc == 0: + msg = 'NORMAL' + elif rc < 3: + msg = 'ABNORMAL ' + str(rc) + rc = exitSignal + else: + msg = 'CRASHED ' + str(rc) + rc = exitSignal + + print "%s EXIT STATUS: %s (%f seconds)" % (prefix, msg, elapsedtime) + sys.exit(rc) + elif os.WIFSIGNALED(status): + print "%s EXIT STATUS: CRASHED signal %d (%f seconds)" % (prefix, os.WTERMSIG(status), elapsedtime) + sys.exit(exitSignal) + else: + print "%s EXIT STATUS: NONE (%f seconds)" % (prefix, elapsedtime) + sys.exit(0) +except KeyboardInterrupt: + os.kill(pid, 9) + sys.exit(exitInterrupt) diff --git a/testing/sisyphus/bin/uninstall-build.sh b/testing/sisyphus/bin/uninstall-build.sh new file mode 100755 index 00000000000..053f20aa4f0 --- /dev/null +++ b/testing/sisyphus/bin/uninstall-build.sh @@ -0,0 +1,163 @@ +#!/usr/local/bin/bash -e +# -*- Mode: Shell-script; tab-width: 4; indent-tabs-mode: nil; -*- +# ***** BEGIN LICENSE BLOCK ***** +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Original Code is mozilla.org code. +# +# The Initial Developer of the Original Code is +# Mozilla Corporation. +# Portions created by the Initial Developer are Copyright (C) 2006. +# the Initial Developer. All Rights Reserved. +# +# Contributor(s): +# Bob Clary +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 2 or later (the "GPL"), or +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), +# in which case the provisions of the GPL or the LGPL are applicable instead +# of those above. If you wish to allow use of your version of this file only +# under the terms of either the GPL or the LGPL, and not to allow others to +# use your version of this file under the terms of the MPL, indicate your +# decision by deleting the provisions above and replace them with the notice +# and other provisions required by the GPL or the LGPL. If you do not delete +# the provisions above, a recipient may use your version of this file under +# the terms of any one of the MPL, the GPL or the LGPL. +# +# ***** END LICENSE BLOCK ***** + +TEST_DIR=${TEST_DIR:-/work/mozilla/mozilla.com/test.mozilla.com/www} +TEST_BIN=${TEST_BIN:-$TEST_DIR/bin} +source ${TEST_BIN}/library.sh + +# +# options processing +# +options="p:b:x:d:" +function usage() +{ + cat < urls.txt +elif [[ "$test" == "ftp" ]]; then + $TEST_BIN/timed_run.py $TEST_DOWNLOAD_PAGE_TIMEOUT "test download" \ + "$executable" -P "$profilename" -spider -start -quit \ + -uri "$allurl" -timeout=$TEST_DOWNLOAD_PAGE_TIMEOUT \ + -hook "http://$TEST_HTTP/tests/mozilla.org/download-page/userhook-ftp.js" | \ + grep 'href: ' | sed 's/^href: //' > urls.txt +fi + +cat urls.txt | while read url; do + + echo "Processing $url" + + if [[ "$test" == "all" ]]; then + downloadproduct=`echo $url | sed 's|.*product=\([^\-]*\).*|\1|'` + downloadversion=`echo $url | sed 's|.*product=[^\-]*-\([0-9.]*\).*|\1|'` + elif [[ "$test" == "ftp" ]]; then + downloadproduct=`echo $url | sed 's|.*/\([a-zA-Z]*\)-[^/]*|\1|'` + downloadversion=`echo $url | sed 's|\(.*\)/\([^/]*\)|\2|' | sed 's|[a-zA-Z]*-\([0-9.]*\)\..*|\1|'` + fi + + echo "downloadproduct=$downloadproduct" + echo "downloadversion=$downloadversion" + + case "$downloadversion" in + 1.5*) + downloadbranch="1.8.0" + ;; + 2.*) + downloadbranch="1.8.1" + ;; + 3.*) + downloadbranch="1.9.0" + ;; + *) + echo "unknown download branch: $downloadbranch" + exit 2 + ;; + esac + + filepath=`mktemp DOWNLOAD.XXXXXX` + + downloadexecutablepath="/tmp/download-$downloadproduct-$downloadbranch" + downloadprofilepath="/tmp/download-$downloadproduct-$downloadbranch-profile" + downloadprofilename="download-$downloadproduct-$downloadbranch-profile" + + if ! download.sh -u "$url" -f $filepath $credentials; then + continue; + fi + + if ! install-build.sh -p "$downloadproduct" -b "$downloadbranch" \ + -x $downloadexecutablepath \ + -f `pwd`/$filepath; then + continue + fi + + rm $filepath + + if [[ "$downloadproduct" == "thunderbird" ]]; then + template="-L /work/mozilla/mozilla.com/test.mozilla.com/www/profiles/imap" + else + unset template + fi + + if ! create-profile.sh -p "$downloadproduct" -b "$downloadbranch" \ + -x $downloadexecutablepath \ + -D $downloadprofilepath \ + -N $downloadprofilename \ + -U /work/mozilla/mozilla.com/test.mozilla.com/www/prefs/mail-user.js \ + $template; then + continue + fi + + if ! install-extensions.sh -p "$downloadproduct" -b "$downloadbranch" \ + -x $downloadexecutablepath \ + -N $downloadprofilename \ + -E /work/mozilla/mozilla.com/test.mozilla.com/www/xpi; then + continue + fi + + if ! check-spider.sh -p "$downloadproduct" -b "$downloadbranch" \ + -x $downloadexecutablepath \ + -N $downloadprofilename; then + continue + fi + + downloadexecutable=`get_executable $downloadproduct $downloadbranch $downloadexecutablepath` + + $TEST_BIN/timed_run.py $TEST_DOWNLOAD_BUILD_TIMEOUT "..." \ + "$downloadexecutable" \ + -spider -P $downloadprofilename \ + -uri "http://$TEST_HTTP/bin/buildinfo.html" \ + -hook "http://$TEST_HTTP/tests/mozilla.org/download-page/userhook.js" \ + -start -quit + + if ! uninstall-build.sh -p "$downloadproduct" -b "$downloadbranch" \ + -x $downloadexecutablepath; then + continue + fi + + +done diff --git a/testing/sisyphus/tests/mozilla.org/download-page/userhook-ftp.js b/testing/sisyphus/tests/mozilla.org/download-page/userhook-ftp.js new file mode 100755 index 00000000000..9395a394cdc --- /dev/null +++ b/testing/sisyphus/tests/mozilla.org/download-page/userhook-ftp.js @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ + +var gOS; +var gURLS = {}; + +function userOnStart() +{ + dlog('userOnStart()'); + + if (navigator.oscpu.search(/Linux/) != -1) + gOS = 'linux'; + else if (navigator.oscpu.search(/Mac/) != -1) + gOS = 'mac'; + else if (navigator.oscpu.search(/Windows/) != -1) + gOS = 'win32'; + +} + +function userOnBeforePage() +{ + dlog('userOnBeforePage()'); +} + +function userOnPause() +{ + dlog('userOnPause()'); +} + +function userOnAfterPage() +{ + dlog('userOnAfterPage()'); + + var win = gSpider.mDocument.defaultView; + if (win.wrappedJSObject) + { + win = win.wrappedJSObject; + } + + //cdump('processing = ' + win.location.href); + + var links = win.document.links; + var length = links.length; + + + for (var ilink = 0; ilink < length; ilink++) + { + + var href = links[ilink].href; + + if (typeof gURLS[href] != 'undefined') + continue; + + gURLS[href] = 1; + + switch(gOS) + { + case 'linux': + if (/\.linux-i686\.tar\.(gz|bz2)$/.test(href)) + { + cdump('href: ' + href); + } + break; + + case 'mac': + if (/\.mac\.dmg$/.test(href)) + { + cdump('href: ' + href); + } + break; + + case 'win32': + if (/\.win32\.(zip|installer\.exe)$/.test(href)) + { + cdump('href: ' + href); + } + break; + + default: + break; + } + } + + gPageCompleted = true; +} + + +function userOnStop() +{ + dlog('userOnStop()'); +} + diff --git a/testing/sisyphus/tests/mozilla.org/download-page/userhook.js b/testing/sisyphus/tests/mozilla.org/download-page/userhook.js new file mode 100755 index 00000000000..ac337e50566 --- /dev/null +++ b/testing/sisyphus/tests/mozilla.org/download-page/userhook.js @@ -0,0 +1,413 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ + + +function userOnStart() +{ + dlog('userOnStart()'); + + debugger; + + loadBundle('chrome://browser-region/locale/region.properties'); + loadBundle('chrome://branding/content/searchconfig.properties'); + loadBundle('resource:/browserconfig.properties'); + +} + +function userOnBeforePage() +{ + dlog('userOnBeforePage()'); +} + +function userOnPause() +{ + dlog('userOnPause()'); +} + +function userOnAfterPage() +{ + dlog('userOnAfterPage()'); + + var win = gSpider.mDocument.defaultView; + if (win.wrappedJSObject) + { + win = win.wrappedJSObject; + } + + + cdump('win.location.href =' + win.location.href); + cdump('win.appInfo.toSource() = ' + win.appInfo.toSource()); + + var xmlhttp = new XMLHttpRequest(); + var date = new Date(); + + if (!('toLocalFormat' in Date.prototype)) + { + date.toLocaleFormat = function(fmt) { + var year = this.getFullYear().toString(); + var mon = (this.getMonth() + 1).toString() + var day = (this.getDate()).toString(); + + if (mon.length < 2) + { + mon = '0' + mon; + } + if (day.length < 2) + { + day = '0' + day; + } + return year + mon + day; + }; + } + + xmlhttp.open('get', 'http://test.mozilla.com/credentials/builds.xml', false); + xmlhttp.send(null); + + if (!xmlhttp.responseXML) + { + cdump('Unable to retrieve credentials'); + gPageCompleted = true; + return; + } + + var password = xmlhttp.responseXML.documentElement.getAttribute('password'); + + xmlhttp.open('post', + 'http://bclary.com/log/2006/02/24/update/index.pl', + false, + 'buildid', + password); + + xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); + + + var preferencesList = [ + 'app.distributor', + 'app.distributor.channel', + 'app.releaseNotesURL', + 'app.update.channel', + 'app.update.url', + 'app.update.url.details', + 'app.update.url.manual', + 'browser.contentHandlers.types.0.title', + 'browser.contentHandlers.types.0.uri', + 'browser.contentHandlers.types.1.title', + 'browser.contentHandlers.types.1.uri', + 'browser.contentHandlers.types.2.title', + 'browser.contentHandlers.types.2.uri', + 'browser.search.defaultenginename', + 'browser.search.order.1', + 'browser.search.order.2', + 'browser.search.order.3', + 'browser.search.order.4', + 'browser.search.order.5', + 'browser.search.order.6', + 'browser.search.order.7', + 'browser.search.order.8', + 'browser.search.order.Yahoo', + 'browser.search.order.Yahoo.1', + 'browser.search.order.Yahoo.2', + 'browser.search.param.Google.1.custom', + 'browser.search.param.Google.1.default', + 'browser.search.param.Google.release', + 'browser.search.param.Yahoo.release', + 'browser.search.param.yahoo-f-CN', + 'browser.search.param.yahoo-fr', + 'browser.search.param.yahoo-fr-cjkt', + 'browser.search.searchEnginesURL', + 'browser.search.selectedEngine', + 'browser.search.suggest.enabled', + 'browser.search.useDBForOrder', + 'browser.startup.homepage', + 'keyword.URL', + 'mozilla.partner.id', + 'startup.homepage_override_url', + 'startup.homepage_welcome_url' + ]; + + var preferences = new Preferences(''); + var data = {}; + + for (var i = 0; i < preferencesList.length; i++) + { + var prefName = preferencesList[i]; + var prefValue = preferences.getPref(prefName); + if (/^(chrome:\/\/|resource:\/)/.test(prefValue)) + { +debugger; + var override = getOverridePref(prefName, prefValue); + prefValue += '->' + override; + } + + cdump('preference ' + prefName + '=' + prefValue); + data[prefName] = prefValue; + } + + data['000 runDate'] = date.toLocaleFormat('%Y%c%d'); + + data['001 appInfo.vendor'] = win.appInfo.vendor; + data['002 appInfo.name'] = win.appInfo.name; + data['003 appInfo.version'] = win.appInfo.version; + data['004 appInfo.platformVersion'] = win.appInfo.platformVersion; + data['005 navigator.language'] = navigator.language; + data['006 navigator.platform'] = navigator.platform; + data['007 appInfo.platformBuildID'] = win.appInfo.platformBuildID; + data['008 appInfo.buildID'] = win.appInfo.appBuildID; + data['009 navigator.buildID'] = navigator.buildID; + data['010 appInfo.ID'] = win.appInfo.ID; + + var qs = ''; + + for (var n in data) + { + qs += n + '=' + encodeURIComponent(data[n]) + '&'; + } + qs = qs.substring(0, qs.length - 1); + + cdump(qs); + xmlhttp.send(qs); + + gPageCompleted = true; +} + + +function userOnStop() +{ + dlog('userOnStop()'); +} + +function Preferences(aPrefRoot) +{ + this.privs = 'UniversalXPConnect UniversalPreferencesRead UniversalPreferencesWrite'; + + if (typeof netscape != 'undefined' && + 'security' in netscape && + 'PrivilegeManager' in netscape.security && + 'enablePrivilege' in netscape.security.PrivilegeManager) + { + netscape.security.PrivilegeManager.enablePrivilege(this.privs); + } + + const nsIPrefService = Components.interfaces.nsIPrefService; + const nsIPrefBranch = Components.interfaces.nsIPrefBranch; + const nsPrefService_CONTRACTID = "@mozilla.org/preferences-service;1"; + + this.prefRoot = aPrefRoot; + this.prefService = Components.classes[nsPrefService_CONTRACTID].getService(nsIPrefService); + this.prefBranch = this.prefService.getBranch(aPrefRoot).QueryInterface(Components.interfaces.nsIPrefBranch2); + +} + +function Preferences_getPrefRoot() +{ + if (typeof netscape != 'undefined' && + 'security' in netscape && + 'PrivilegeManager' in netscape.security && + 'enablePrivilege' in netscape.security.PrivilegeManager) + { + netscape.security.PrivilegeManager.enablePrivilege(this.privs); + } + + return this.prefBranch.root; +} + +function Preferences_getPrefType(aPrefName) +{ + if (typeof netscape != 'undefined' && + 'security' in netscape && + 'PrivilegeManager' in netscape.security && + 'enablePrivilege' in netscape.security.PrivilegeManager) + { + netscape.security.PrivilegeManager.enablePrivilege(this.privs); + } + + return this.prefBranch.getPrefType(aPrefName); +} + +function Preferences_getPref(aPrefName) +{ + if (typeof netscape != 'undefined' && + 'security' in netscape && + 'PrivilegeManager' in netscape.security && + 'enablePrivilege' in netscape.security.PrivilegeManager) + { + netscape.security.PrivilegeManager.enablePrivilege(this.privs); + } + + var prefType = this.prefBranch.getPrefType(aPrefName); + var value; + + + if (prefType == this.prefBranch.PREF_INVALID) + { + cdump('Preferences.prototype.getPref: ' + aPrefName + ' invalid type ' + prefType); + cdump('Assuming string'); + prefType = this.prefBranch.PREF_STRING; + } + + switch(prefType) + { + case this.prefBranch.PREF_STRING: + try + { + value = this.prefBranch.getCharPref(aPrefName); + } + catch(ex) + { + cdump('Ignoring ' + ex); + } + break; + case this.prefBranch.PREF_INT: + try + { + value = this.prefBranch.getIntPref(aPrefName); + } + catch(ex) + { + cdump('Ignoring ' + ex); + } + break; + case this.prefBranch.PREF_BOOL: + try + { value = this.prefBranch.getBoolPref(aPrefName); + } + catch(ex) + { + cdump('Ignoring ' + ex); + } + break; + default: + cdump('Preferences.prototype.getPref: ' + aPrefName + ' unknown type ' + prefType); + break; + } + return value; +} + +function Preferences_setPref(aPrefName, aPrefValue) +{ + if (typeof netscape != 'undefined' && + 'security' in netscape && + 'PrivilegeManager' in netscape.security && + 'enablePrivilege' in netscape.security.PrivilegeManager) + { + netscape.security.PrivilegeManager.enablePrivilege(this.privs); + } + + var prefType = this.getPrefType(aPrefName); + + if (prefType == this.prefBranch.PREF_INVALID) + { + cdump('Preferences.prototype.getPref: ' + aPrefName + ' invalid type ' + prefType); + cdump('Assuming string'); + prefType = this.prefBranch.PREF_STRING; + } + + switch(prefType) + { + case this.prefBranch.PREF_INVALID: + cdump('Preferences.prototype.setPref: ' + aPrefName + ' invalid type ' + prefType); + break; + case this.prefBranch.PREF_STRING: + if (typeof aPrefValue != 'string') + { + cdump('Preferences.prototype.setPref: ' + aPrefName + ' invalid value for type string ' + aPrefValue); + } + else + { + try + { + value = this.prefBranch.setCharPref(aPrefName, aPrefValue); + } + catch(ex) + { + cdump('Ignoring ' + ex); + } + } + break; + case this.prefBranch.PREF_INT: + if (typeof aPrefValue != 'number') + { + cdump('Preferences.prototype.setPref: ' + aPrefName + ' invalid value for type number ' + aPrefValue); + } + else + { + try + { + value = this.prefBranch.setIntPref(aPrefName, aPrefValue); + } + catch(ex) + { + cdump('Ignoring ' + ex); + } + } + break; + case this.prefBranch.PREF_BOOL: + if (typeof aPrefValue != 'boolean') + { + cdump('Preferences.prototype.setPref: ' + aPrefName + ' invalid value for type boolean ' + aPrefValue); + } + else + { + try + { + value = this.prefBranch.setBoolPref(aPrefName, aPrefValue); + } + catch(ex) + { + cdump('Ignoring ' + ex); + } + } + break; + default: + cdump('Preferences.prototype.setPref: ' + aPrefName + ' unknown type ' + prefType); + break; + } +} + +Preferences.prototype.getPref = Preferences_getPref; +Preferences.prototype.setPref = Preferences_setPref; + +function loadBundle(uri) +{ + try + { + var bundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]. + getService(Components.interfaces.nsIStringBundleService); + + var bundle = bundleService.createBundle(uri); + var enumBundle = bundle.getSimpleEnumeration(); + + while (enumBundle.hasMoreElements()) + { + var item = enumBundle.getNext().QueryInterface(Components.interfaces.nsIPropertyElement); + cdump('bundle ' + uri + ' key : ' + item.key + ', value : ' + item.value); + } + } + catch(ex) + { + cdump('Error loading bundle ' + uri + ': ' + ex); + } +} + + +function getOverridePref(prefName, uri) +{ + var bundleService = Components.classes["@mozilla.org/intl/stringbundle;1"]. + getService(Components.interfaces.nsIStringBundleService); + + var bundle = bundleService.createBundle(uri); + var value; + + try + { + value = bundle.GetStringFromName(prefName); + } + catch(ex) + { + cdump('Ignoring ' + ex); + } + return value; +} + + + +