use cgecho for green output

This commit is contained in:
Andreas Steffen 2007-08-03 10:58:45 +00:00
parent d49cc7b383
commit 90b21fde11
12 changed files with 37 additions and 36 deletions

View File

@ -48,6 +48,8 @@ TESTRESULTSHTML=$TODAYDIR/all.html
INDEX=$TODAYDIR/index.html
DEFAULTTESTSDIR=$UMLTESTDIR/testing/tests
SOURCEIP_ROUTING_TABLE=100
testnumber="0"
failed_cnt="0"
passed_cnt="0"
@ -460,7 +462,7 @@ do
$TESTRESULTDIR/${host}.$file > /dev/null 2>&1
done
ssh $HOSTLOGIN ip route list \
ssh $HOSTLOGIN ip route list table $SOURCEIP_ROUTING_TABLE \
> $TESTRESULTDIR/${host}.iproute 2>/dev/null
ssh $HOSTLOGIN iptables -v -n -L \
> $TESTRESULTDIR/${host}.iptables 2>/dev/null
@ -480,7 +482,7 @@ do
<ul>
<li><a href="$host.auth.log">auth.log</a></li>
<li><a href="$host.daemon.log">daemon.log</a></li>
<li><a href="$host.iproute">ip route list</a></li>
<li><a href="$host.iproute">ip route list table $SOURCEIP_ROUTING_TABLE</a></li>
<li><a href="$host.iptables">iptables -L</a></li>
</ul>
</td>
@ -655,7 +657,7 @@ cecho-n "Copying test results to winnetou.."
ssh root@${ipv4_winnetou} mkdir -p $HTDOCS/testresults > /dev/null 2>&1
scp -r $TODAYDIR root@${ipv4_winnetou}:$HTDOCS/testresults > /dev/null 2>&1
ssh root@${ipv4_winnetou} ln -s $HTDOCS/images $HTDOCS/testresults/$TESTDATE/images > /dev/null 2>&1
cecho "done"
cgecho "done"
cecho ""
cecho "The results are available in $TODAYDIR"
cecho "or via the link http://$ipv4_winnetou/testresults/$TESTDATE"

View File

@ -121,4 +121,4 @@ do
esac
done
cecho "done"
cgecho "done"

View File

@ -37,25 +37,25 @@ if [ ! -f $LOGFILE ]
then
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
touch $LOGFILE
cecho "done"
cgecho "done"
fi
if [ ! -d ~/.ssh ]
then
cecho-n " * Creating directory '~/.ssh'.."
mkdir ~/.ssh
cecho "done"
cgecho "done"
fi
if [ -f ~/.ssh/known_hosts ]
then
cecho-n " * Backing up ~/.ssh/known_hosts to '~/.ssh/known_hosts.before_uml'.."
cp -fp ~/.ssh/known_hosts ~/.ssh/known_hosts.before_uml
cecho "done"
cgecho "done"
else
cecho-n " * Creating '~/.ssh/known_hosts'"
touch ~/.ssh/known_hosts
cecho "done"
cgecho "done"
fi
for host in $HOSTNAMEIPV4
@ -68,7 +68,7 @@ do
else
cecho-n " * Adding uml host $HOSTNAME ($IP) to '~/.ssh/known_hosts'.."
echo "$HOSTNAME,$IP `cat $DIR/../hosts/ssh_host_rsa_key.pub`" >> ~/.ssh/known_hosts
cecho "done"
cgecho "done"
fi
done
@ -84,5 +84,5 @@ else
cecho "not found"
cecho-n " * Generating ssh rsa key pair.."
echo "" | ssh-keygen -N "" -t rsa -f ~/.ssh/id_rsa >> $LOGFILE 2>&1
cecho "done"
cgecho "done"
fi

View File

@ -32,7 +32,7 @@ if [ ! -d $BUILDDIR ]
then
cecho-n " * Directory '$BUILDDIR' does not exist..creating.."
mkdir $BUILDDIR
cecho "done"
cgecho "done"
fi
LOGFILE=${BUILDDIR}/testing.log
@ -41,7 +41,7 @@ if [ ! -f $LOGFILE ]
then
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
touch $LOGFILE
cecho "done"
cgecho "done"
fi
LOOPDIR=loop
@ -76,4 +76,4 @@ do
umount $LOOPDIR
done
cecho "done"
cgecho "done"

View File

@ -75,12 +75,12 @@ if [ ! -f $LOGFILE ]
then
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
touch $LOGFILE
cecho "done"
cgecho "done"
fi
cecho-n " * Unpacking kernel.."
tar xjf $KERNEL >> $LOGFILE 2>&1
cecho "done"
cgecho "done"
KERNELDIR=${BUILDDIR}/linux-${KERNELVERSION}
@ -109,7 +109,7 @@ if [ $UMLPATCH ]
then
cecho-n " * Applying uml patch.."
bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1
cecho "done"
cgecho "done"
fi
#######################################################
@ -125,10 +125,8 @@ make oldconfig ARCH=um >> $LOGFILE 2>&1
cecho-n " * Now compiling uml kernel.."
make linux ARCH=um >> $LOGFILE 2>&1
cecho "done"
cgecho "done"
cecho-n " * Copying uml kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'.."
mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}
cecho "done"
cgecho "done"

View File

@ -57,7 +57,7 @@ if [ ! -f $LOGFILE ]
then
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
touch $LOGFILE
cecho "done"
cgecho "done"
fi
ROOTFSDIR=$BUILDDIR/root-fs
@ -66,7 +66,7 @@ if [ ! -d $ROOTFSDIR ]
then
cecho-n " * Root file system directory '$ROOTFSDIR' does not exist..creating.."
mkdir $ROOTFSDIR
cecho "done"
cgecho "done"
fi
cd $ROOTFSDIR
@ -87,7 +87,7 @@ dd if=/dev/zero of=gentoo-fs count=$ROOTFSSIZE bs=1M >> $LOGFILE 2>&1
mkreiserfs -q -f gentoo-fs >> $LOGFILE 2>&1
mount -o loop gentoo-fs $LOOPDIR >> $LOGFILE 2>&1
tar xjpf $ROOTFS -C $LOOPDIR >> $LOGFILE 2>&1
cecho "done"
cgecho "done"
######################################################
# remove /etc/resolv.conf
@ -150,10 +150,8 @@ echo "ldconfig" >> $INSTALLSHELL
cecho-n " * Compiling $STRONGSWANVERSION within the root file system as chroot.."
chroot $LOOPDIR /bin/bash /install.sh >> $LOGFILE 2>&1
cecho "done"
rm -f $INSTALLSHELL
cgecho "done"
######################################################
# copying the host's ssh public key

View File

@ -24,6 +24,9 @@
function cecho {
echo -e "\033[1;31m$1\033[0m"
}
function cgecho {
echo -e "\033[1;32m$1\033[0m"
}
function cecho-n {
echo -en "\033[1;31m$1\033[0m"

View File

@ -68,7 +68,7 @@ do
ubda=$UMLHOSTFS \
\$SWITCH_${host} \
mem=${MEM}M con=pty con0=fd:0,fd:1" &
cecho "\033[1;32mdone"
cgecho "done"
fi
let "x0+=dx"
let "y0+=dy"
@ -114,7 +114,7 @@ do
cecho "exit"
exit 1
else
cecho "\033[1;32mup"
cgecho "up"
fi
done

View File

@ -31,9 +31,9 @@ do
cecho " * Great, umlswitch$n is already running!"
else
cecho-n " * Starting umlswitch$n.."
uml_switch -tap tap$n -unix /tmp/umlswitch$n >/dev/null 2>&1 </dev/null &
uml_switch -tap tap$n -unix /tmp/umlswitch$n -daemon >/dev/null 2>&1 </dev/null
sleep 2
eval ifconfig "tap$n \$IFCONFIG_$n up"
cecho "\033[1;32mdone"
cgecho "done"
fi
done

View File

@ -62,7 +62,7 @@ do
ubda=$UMLHOSTFS \
\$SWITCH_${host} \
mem=${MEM}M con=pty con0=fd:0,fd:1"
cecho "done"
cgecho "done"
fi
done
@ -105,7 +105,7 @@ do
cecho "exit"
exit 1
else
cecho "up"
cgecho "up"
fi
done

View File

@ -68,7 +68,7 @@ do
ubda=$UMLHOSTFS \
\$SWITCH_${host} \
mem=${MEM}M con=pty con0=fd:0,fd:1" &
cecho "done"
cgecho "done"
fi
let "x0+=dx"
let "y0+=dy"
@ -114,7 +114,7 @@ do
cecho "exit"
exit 1
else
cecho "up"
cgecho "up"
fi
done

View File

@ -39,7 +39,7 @@ for host in $HOSTS
do
uml_mconsole $host halt &> /dev/null
done
cecho "\033[1;32mdone"
cgecho "done"
#####################################################
# Shutting down the uml switches
@ -47,5 +47,5 @@ cecho "\033[1;32mdone"
cecho-n " * Stopping the UML switches.."
killall uml_switch &> /dev/null
rm -f /tmp/umlswitch[012] &> /dev/null 2>&1
cecho "\033[1;32mdone"
cgecho "done"