2 # Create an LXC container and launch the functional testsuite
3 . $(dirname $0)/common-functions
8 rsync -av root@$HOST:/var/log/ $WORKSPACE/reports/
15 # Destroy the VM if found
18 sudo /usr/local/sbin/lxc-wrapper start $(basename $HOST .local)
20 echo "Waiting for $HOST to come up..."
22 # Done in this script rather than lxc-wrapper, because we have the SSH key
23 while [ $i -lt 10 ] && ! ssh -o 'StrictHostKeyChecking=no' root@$HOST uname -a >/dev/null; do
28 if [ $i -lt 10 ] ; then
39 sudo /usr/local/sbin/lxc-wrapper stop $(basename $HOST .local)
45 sudo /usr/local/sbin/lxc-wrapper destroy $(basename $HOST .local)
50 if [ -z "$HOST" ] ; then echo "HOST undefined" ;exit 1; fi
52 if [ ! -z "$EPEL_REPO" ] ; then
53 echo "Installing specific EPEL REPO $EPEL_REPO"
54 ssh -o 'StrictHostKeyChecking=no' root@$HOST "cat > /etc/yum.repos.d/epel.repo" <<-EOF
55 # Name: EPEL RPM Repository for Red Hat Enterprise \$releasever - epel
56 # URL: http://fedoraproject.org/wiki/EPEL
58 name=Extra Packages for Enterprise Linux \$releasever - \$basearch
59 baseurl=$EPEL_REPO/\$releasever/\$basearch
60 #mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel\$releasever&arch=\$basearch
61 failovermethod=priority
66 echo "Installing standard EPEL REPO"
67 ssh -o 'StrictHostKeyChecking=no' root@$HOST yum install -y epel-release
71 setup_epel_testing_repo() {
72 if [ -z "$HOST" ] ; then echo "HOST undefined" ;exit 1; fi
74 echo "Installing EPEL Testing REPO"
75 ssh -o 'StrictHostKeyChecking=no' root@$HOST "cat > /etc/yum.repos.d/epel-testing.repo" <<-EOF
76 # Name: EPEL RPM Repository for Red Hat Enterprise Testing \$releasever - epel
77 # URL: http://fedoraproject.org/wiki/EPEL
79 name=Extra Packages for Enterprise Linux Testing \$releasever - \$basearch
80 mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel\$releasever&arch=\$basearch
81 failovermethod=priority
93 if [ -z "$HOST" ]; then
94 echo "Usage: $0 vm_hostname"
133 case $INSTALL_METHOD in
150 # LXC post-install...
151 if [ $INSTALL_OS == "debian" ]; then
152 ssh -o 'StrictHostKeyChecking=no' root@$HOST "echo \"deb $DEBMIRRORSEC $DIST/updates main\" > /etc/apt/sources.list.d/security.list"
153 ssh -o 'StrictHostKeyChecking=no' root@$HOST "echo 'APT::Install-Recommends \"false\";' > /etc/apt/apt.conf.d/01InstallRecommends"
154 ssh -o 'StrictHostKeyChecking=no' root@$HOST "apt-get update"
157 if [ $INSTALL_OS == "debian" ]; then
158 ssh -o 'StrictHostKeyChecking=no' root@$HOST "apt-get install -y rsync haveged"
160 ssh -o 'StrictHostKeyChecking=no' root@$HOST "yum install -y rsync"
162 ssh -o 'StrictHostKeyChecking=no' root@$HOST "yum --enablerepo=epel install -y haveged"
164 rsync -av --delete autoinstall src tests root@$HOST:/usr/src/fusionforge/
165 if [ $INSTALL_METHOD = "src" ]; then
166 ssh -o 'StrictHostKeyChecking=no' root@$HOST "/usr/src/fusionforge/autoinstall/install-src.sh"
168 ssh -o 'StrictHostKeyChecking=no' root@$HOST "/usr/src/fusionforge/autoinstall/build.sh"
169 ssh -o 'StrictHostKeyChecking=no' root@$HOST "/usr/src/fusionforge/autoinstall/install.sh"
174 echo "Run phpunit test on $HOST"
175 echo "export JOB_URL=$JOB_URL" | ssh -o 'StrictHostKeyChecking=no' root@$HOST tee -a .bashrc
176 #ssh -o 'StrictHostKeyChecking=no' root@$HOST "TESTGLOB='func/50_PluginsScmBzr/*' /usr/src/fusionforge/tests/func_tests-xvnc.sh $INSTALL_METHOD/$INSTALL_OS" || retcode=$?
177 ssh -o 'StrictHostKeyChecking=no' root@$HOST "/usr/src/fusionforge/tests/func_tests-xvnc.sh $INSTALL_METHOD/$INSTALL_OS $*" || retcode=$?
181 if [ $retcode = 0 ] ; then
182 case $INSTALL_METHOD in
184 rsync -av --delete root@$HOST:/usr/src/debian-repository/local/ $WORKSPACE/packages/
187 rsync -av --delete root@$HOST:/usr/src/fusionforge/build/RPMS/ $WORKSPACE/packages/