2 . tests/scripts/common-functions
3 . tests/scripts/common-vm
9 export FORGE_HOME=/usr/share/gforge
12 #export FILTER="func/PluginsMediawiki/mediawikiTest.php"
13 export FILTER="DEBDebian70Tests.php"
14 #export FILTER="func/PluginsMoinMoin/moinmoinTest.php"
20 COWBUILDERCONFIG=$BUILDERDIR/config/$DIST.config
23 PKGNAME=$(dpkg-parsechangelog | awk '/^Source:/ { print $2 }')
24 PKGVERS=$(dpkg-parsechangelog | awk '/^Version:/ { print $2 }')
28 if [ -d $CHECKOUTPATH/.svn ] ; then
29 MINOR=-$MINOR+svn$(svn info | awk '/^Revision:/ { print $2 }')
30 elif [ -d $CHECKOUTPATH/.bzr ] ; then
31 MINOR=-$MINOR+bzr$(bzr revno)
32 elif [ -d $CHECKOUTPATH/.git ] ; then
33 MINOR=-$MINOR+git$(git describe --always)
35 MINOR=-$MINOR+$(TZ=UTC date +%Y%m%d%H%M%S)
37 ARCH=$(dpkg-architecture -qDEB_BUILD_ARCH)
39 # Build out of the source tree
41 CHANGEFILE=${BUILDRESULT}/${PKGNAME}_${SMAJOR}${MINOR}_${ARCH}.changes
43 rm -rf $BUILDPLACE/$PKGNAME-$MAJOR
44 cp -r src/ $BUILDPLACE/$PKGNAME-$MAJOR
45 cd $BUILDPLACE/$PKGNAME-$MAJOR
46 dch -b -v $MAJOR$MINOR -D UNRELEASED "This is $DIST-$ARCH autobuild"
47 sed -i -e "1s/UNRELEASED/$DIST/" debian/changelog
48 pdebuild --configfile $COWBUILDERCONFIG --buildresult $BUILDRESULT
51 REPOPATH=$WORKSPACE/build/debian
53 [ ! -d $REPOPATH ] || rm -r $REPOPATH
54 mkdir -p $REPOPATH/conf
55 DEFAULTKEY=buildbot@$(hostname -f)
56 SIGNKEY=${DEBEMAIL:-$DEFAULTKEY}
57 cat > $REPOPATH/conf/distributions <<EOF
62 Architectures: amd64 i386 source
63 Origin: buildbot.fusionforge.org
64 Description: FusionForge autobuilt repository
68 reprepro -Vb $REPOPATH include $DIST $CHANGEFILE
72 destroy_vm -t debian7 $HOST
73 start_vm_if_not_keeped -t debian7 $HOST
74 setup_debian_3rdparty_repo
77 cat tests/preseed/* | sed s/@FORGE_ADMIN_PASSWORD@/$FORGE_ADMIN_PASSWORD/ | ssh root@$HOST "LANG=C debconf-set-selections"
80 export DEBMIRROR DEBMIRRORSEC
81 ssh root@$HOST "echo \"deb $DEBMIRROR $DIST main\" > /etc/apt/sources.list"
82 ssh root@$HOST "echo \"deb $DEBMIRRORSEC $DIST/updates main\" > /etc/apt/sources.list.d/security.list"
83 ssh root@$HOST "apt-get update"
84 ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -o debug::pkgproblemresolver=true -y --force-yes dist-upgrade"
86 ssh root@$HOST "echo \"deb $DEBMIRROR unstable main\" >> /etc/apt/sources.list"
87 ssh root@$HOST "apt-get update"
88 ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -o debug::pkgproblemresolver=true -y --force-yes install loggerhead libapache2-mod-wsgi"
90 ssh root@$HOST "echo \"deb $DEBMIRROR $DIST main\" > /etc/apt/sources.list"
91 ssh root@$HOST "apt-get update"
93 ssh root@$HOST "echo \"deb file:/debian $DIST main\" >> /etc/apt/sources.list"
94 scp -r $WORKSPACE/build/debian root@$HOST:/
95 gpg --export --armor | ssh root@$HOST "apt-key add -"
97 ssh root@$HOST "apt-get update"
100 ssh root@$HOST "UCF_FORCE_CONFFNEW=yes DEBIAN_FRONTEND=noninteractive LANG=C apt-get -o debug::pkgproblemresolver=true -y --force-yes install rsync postgresql-contrib fusionforge-full"
101 echo "Set forge admin password"
102 ssh root@$HOST "/usr/share/gforge/bin/forge_set_password $FORGE_ADMIN_USERNAME $FORGE_ADMIN_PASSWORD"
103 ssh root@$HOST "LANG=C a2dissite default ; LANG=C invoke-rc.d apache2 reload"
104 ssh root@$HOST "(echo [core];echo use_ssl=no) > /etc/gforge/config.ini.d/zzz-buildbot.ini"
105 ssh root@$HOST "(echo [moinmoin];echo use_frame=no) >> /etc/gforge/config.ini.d/zzz-buildbot.ini"
106 ssh root@$HOST "(echo [mediawiki];echo unbreak_frames=yes) >> /etc/gforge/config.ini.d/zzz-buildbot.ini"
107 ssh root@$HOST "[ -e /var/lib/gforge/.bazaar/bazaar.conf ] && sed -i -e s,https://,http://,g /var/lib/gforge/.bazaar/bazaar.conf"
110 echo "Dump freshly installed database"
111 ssh root@$HOST "su - postgres -c \"pg_dumpall\" > /root/dump"
114 echo "Stop cron daemon"
115 ssh root@$HOST "invoke-rc.d cron stop" || true
118 ssh root@$HOST "apt-get -o debug::pkgproblemresolver=true -y install selenium"
120 # Install selenium tests
121 ssh root@$HOST "[ -d $FORGE_HOME ] || mkdir -p $FORGE_HOME"
122 rsync -a --delete tests/ root@$HOST:$FORGE_HOME/tests/
124 # Transfer hudson config
125 ssh root@$HOST "cat > $FORGE_HOME/tests/config/phpunit" <<-EOF
126 HUDSON_URL=$HUDSON_URL
132 echo "Run phpunit test on $HOST in $FORGE_HOME"
133 ssh root@$HOST "$FORGE_HOME/tests/func/vncxstartsuite.sh $FILTER"
135 rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
137 stop_vm_if_not_keeped -t debian7 $@