Author: jfrederic.clere(a)jboss.com
Date: 2007-12-20 11:41:13 -0500 (Thu, 20 Dec 2007)
New Revision: 1266
Added:
trunk/build/unix/buildtest.rhel-httpd.linux2.sh
trunk/build/unix/buildtest.rhel-httpd.sh
Modified:
trunk/build/unix/build.sh
trunk/build/unix/util/buildroot.linux2.sh
Log:
Add a minimal test for httpd on Linux.
Modified: trunk/build/unix/build.sh
===================================================================
--- trunk/build/unix/build.sh 2007-12-20 13:58:12 UTC (rev 1265)
+++ trunk/build/unix/build.sh 2007-12-20 16:41:13 UTC (rev 1266)
@@ -876,3 +876,9 @@
# generate a list of dependencies
override ${build_top}/util/builddep $build_output_dir
${PACKAGE}.${build_version}.${BUILD_SYS}.${BUILD_CPU}.depends ${build_working_dir}
+
+# create a chrootable environment for testing:
+override ${build_top}/util/buildroot $build_output_dir
+
+# run a test
+override ${build_top}/buildtest.${PACKAGE}.sh $build_output_dir
Added: trunk/build/unix/buildtest.rhel-httpd.linux2.sh
===================================================================
--- trunk/build/unix/buildtest.rhel-httpd.linux2.sh (rev 0)
+++ trunk/build/unix/buildtest.rhel-httpd.linux2.sh 2007-12-20 16:41:13 UTC (rev 1266)
@@ -0,0 +1,43 @@
+#!/bin/sh
+# Copyright(c) 2007 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# @author Jean-Frederic Clere
+#
+# Run a test of the httpd.
+#
+root=$1
+
+sudo /usr/sbin/chroot $root /opt/jboss/httpd/sbin/apachectl start
+sleep 5
+curl -v
http://localhost | grep "It works\!"
+if [ $? -ne 0 ]; then
+ echo "Test FAILED cant start?"
+ sudo /bin/umount $root/proc
+ exit 1
+fi
+sudo /usr/sbin/chroot $root /opt/jboss/httpd/sbin/apachectl stop
+sleep 5
+sudo /bin/umount $root/proc
+curl -v
http://localhost
+if [ $? -eq 0 ]; then
+ echo "Test FAILED can't stop"
+ exit 1
+fi
Property changes on: trunk/build/unix/buildtest.rhel-httpd.linux2.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/build/unix/buildtest.rhel-httpd.sh
===================================================================
--- trunk/build/unix/buildtest.rhel-httpd.sh (rev 0)
+++ trunk/build/unix/buildtest.rhel-httpd.sh 2007-12-20 16:41:13 UTC (rev 1266)
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Copyright(c) 2007 Red Hat Middleware, LLC,
+# and individual contributors as indicated by the @authors tag.
+# See the copyright.txt in the distribution for a
+# full listing of individual contributors.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library in the file COPYING.LIB;
+# if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+#
+# @author Jean-Frederic Clere
+#
+echo "Not yet supported platform"
Property changes on: trunk/build/unix/buildtest.rhel-httpd.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/build/unix/util/buildroot.linux2.sh
===================================================================
--- trunk/build/unix/util/buildroot.linux2.sh 2007-12-20 13:58:12 UTC (rev 1265)
+++ trunk/build/unix/util/buildroot.linux2.sh 2007-12-20 16:41:13 UTC (rev 1266)
@@ -23,7 +23,7 @@
#
# Build a chrootable environment.
# $1 : Directory where the chroot will takes place.
-tools="/bin/bash /lib/ld-linux.so.2 /usr/bin/strace /usr/sbin/adduser /etc/passwd
/etc/group /etc/hosts"
+tools="/bin/bash /lib/ld-linux.so.2 /usr/bin/strace /etc/passwd /etc/group
/etc/hosts"
depfiles="/bin/sh /usr/bin/test"
# tools are the tools we need for the tests.
# depfiles are files the packages needed (to be generated).
@@ -39,11 +39,9 @@
# $2 : The executable file to process.
Processlibs()
{
- for lib in `ldd $2 | awk 'NF==4 { print $3 } ' | sort -u`
+ for lib in `sudo /usr/bin/ldd $2 | awk 'NF==4 { print $3 } ' | sort -u`
do
- dir=`dirname $lib`
- mkdir -p $1/$dir
- cp $lib $1/$dir
+ Processfile $1 $lib
done
}
@@ -55,7 +53,7 @@
{
dir=`dirname $2`
mkdir -p $1/$dir
- cp $2 $1/$dir
+ sudo cp $2 $1/$dir
}
#
@@ -84,9 +82,9 @@
# mount proc
mkdir -p $root/proc
-mount -t proc proc $root/proc
+sudo mount -t proc proc $root/proc
# Create needed device
mkdir -p $root/dev
-mknod $root/dev/null c 1 3
-mknod $root/dev/random c 1 8
+sudo mknod $root/dev/null c 1 3
+sudo mknod $root/dev/random c 1 8