[Armadeus-commitlog] SF.net SVN: armadeus:[1029] trunk/target/test/packages/test_boa.sh
Brought to you by:
sszy
|
From: <ar...@us...> - 2009-01-28 13:42:33
|
Revision: 1029
http://armadeus.svn.sourceforge.net/armadeus/?rev=1029&view=rev
Author: artemys
Date: 2009-01-28 13:42:31 +0000 (Wed, 28 Jan 2009)
Log Message:
-----------
[TEST] Add a test for Boa web server
Added Paths:
-----------
trunk/target/test/packages/test_boa.sh
Added: trunk/target/test/packages/test_boa.sh
===================================================================
--- trunk/target/test/packages/test_boa.sh (rev 0)
+++ trunk/target/test/packages/test_boa.sh 2009-01-28 13:42:31 UTC (rev 1029)
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+#
+# Script to test a Buildroot package for Armadeus Software release
+#
+# Copyright (C) 2008 The Armadeus Project
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+
+source ./test_helpers.sh
+source ./test_env.sh
+
+#DEBUG=True
+EXEC_NAME="boa"
+HTML_DIR="/var/www"
+HTML_FILE="$HTML_DIR/index.html"
+BOA_LOG_DIR="/var/log/boa"
+
+generate_html_test_file()
+{
+ cat << EOF > $HTML_FILE
+<html>
+ <head>
+ <title> Test of Boa Web Server </title>
+ </head>
+ <body>
+ <h1> If you can read that, then the test is OK ! ;-) </h1>
+ </body>
+</html>
+EOF
+}
+
+test_cleanup()
+{
+ rm -f "$HTML_FILE"
+ killall $EXEC_NAME
+}
+
+test_boa()
+{
+ show_test_banner "Boa"
+
+ is_package_installed $EXEC_NAME
+
+ if [ "$?" == 0 ]; then
+ mkdir -p $HTML_DIR
+ mkdir -p $BOA_LOG_DIR
+ generate_html_test_file
+ IP=`ifconfig eth0 | grep "inet addr" | cut -d ":" -f 2 | cut -d " " -f 1`
+ # Launch it
+ $EXEC_NAME
+ #
+ echo "Now you can access to http://"$IP"/index.html from your web browser"
+ sleep 8
+ if [ "$?" == 0 ]; then
+ ask_user "Did you manage to show the web page ? If OK say y"
+ if [ "$response" == "y" ]; then
+ echo_test_ok
+ test_cleanup
+ exit 0
+ fi
+ fi
+ fi
+ test_cleanup
+ exit_failed
+}
+
+test_boa
+
Property changes on: trunk/target/test/packages/test_boa.sh
___________________________________________________________________
Added: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|