#!/bin/sh
#**********************************************************************
#   Copyright (C) International Business Machines  Corp., 2004
#
#   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.
#
#   This program 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 General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program;  if not, write to the Free Software
#   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
#
#  FILE       : manual_tests 
#
#  PURPOSE    : Wrapper to collect all manual test result files.
#  DESCRIPTION: The script creates a file and adds to it relevant time and
#  system information.  The script then goes through looking for all the 
#  test result files and appends them to the created file. if one of the 
#  result files is missing, the script will inform the user and exit without
#  creating a file.
#  Individual test results files will be deleted at the end.
#
#  HISTORY    :
#    08/2004 Originated by Loulwa Salem <loulwa@us.ibm.com>
# 
# **********************************************************************

FILE="manual_test_results.txt"
LIST="login securetty inittab mingetty mount amtu audit aurun openssl"

touch $FILE 
echo SYSTEM INFO: `uname -a` >> $FILE
echo "" >> $FILE
echo UPTIME: `uptime` >> $FILE
echo "" >> $FILE
echo CPU INFO: >> $FILE
cat /proc/cpuinfo >> $FILE

for i in $LIST; do
	if [ ! -f "$i"_test.txt ]; then
		echo "Please run $i test first then execute this script"
		exit
	fi
done
echo "All manual test results have been added to $FILE"
for i in $LIST; do
	echo "******************** BEGIN $i TEST ********************" >> $FILE
	cat "$i"_test.txt >> $FILE
	echo "******************** END $i TEST ********************" >> $FILE
	echo "" >> $FILE
	rm -f "$i"_test.txt
done
