use cgecho for green output
This commit is contained in:
+5
-3
@@ -48,6 +48,8 @@ TESTRESULTSHTML=$TODAYDIR/all.html
|
|||||||
INDEX=$TODAYDIR/index.html
|
INDEX=$TODAYDIR/index.html
|
||||||
DEFAULTTESTSDIR=$UMLTESTDIR/testing/tests
|
DEFAULTTESTSDIR=$UMLTESTDIR/testing/tests
|
||||||
|
|
||||||
|
SOURCEIP_ROUTING_TABLE=100
|
||||||
|
|
||||||
testnumber="0"
|
testnumber="0"
|
||||||
failed_cnt="0"
|
failed_cnt="0"
|
||||||
passed_cnt="0"
|
passed_cnt="0"
|
||||||
@@ -460,7 +462,7 @@ do
|
|||||||
$TESTRESULTDIR/${host}.$file > /dev/null 2>&1
|
$TESTRESULTDIR/${host}.$file > /dev/null 2>&1
|
||||||
done
|
done
|
||||||
|
|
||||||
ssh $HOSTLOGIN ip route list \
|
ssh $HOSTLOGIN ip route list table $SOURCEIP_ROUTING_TABLE \
|
||||||
> $TESTRESULTDIR/${host}.iproute 2>/dev/null
|
> $TESTRESULTDIR/${host}.iproute 2>/dev/null
|
||||||
ssh $HOSTLOGIN iptables -v -n -L \
|
ssh $HOSTLOGIN iptables -v -n -L \
|
||||||
> $TESTRESULTDIR/${host}.iptables 2>/dev/null
|
> $TESTRESULTDIR/${host}.iptables 2>/dev/null
|
||||||
@@ -480,7 +482,7 @@ do
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="$host.auth.log">auth.log</a></li>
|
<li><a href="$host.auth.log">auth.log</a></li>
|
||||||
<li><a href="$host.daemon.log">daemon.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>
|
<li><a href="$host.iptables">iptables -L</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
@@ -655,7 +657,7 @@ cecho-n "Copying test results to winnetou.."
|
|||||||
ssh root@${ipv4_winnetou} mkdir -p $HTDOCS/testresults > /dev/null 2>&1
|
ssh root@${ipv4_winnetou} mkdir -p $HTDOCS/testresults > /dev/null 2>&1
|
||||||
scp -r $TODAYDIR root@${ipv4_winnetou}:$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
|
ssh root@${ipv4_winnetou} ln -s $HTDOCS/images $HTDOCS/testresults/$TESTDATE/images > /dev/null 2>&1
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
cecho ""
|
cecho ""
|
||||||
cecho "The results are available in $TODAYDIR"
|
cecho "The results are available in $TODAYDIR"
|
||||||
cecho "or via the link http://$ipv4_winnetou/testresults/$TESTDATE"
|
cecho "or via the link http://$ipv4_winnetou/testresults/$TESTDATE"
|
||||||
|
|||||||
@@ -121,4 +121,4 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
|
|||||||
@@ -37,25 +37,25 @@ if [ ! -f $LOGFILE ]
|
|||||||
then
|
then
|
||||||
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
|
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
|
||||||
touch $LOGFILE
|
touch $LOGFILE
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d ~/.ssh ]
|
if [ ! -d ~/.ssh ]
|
||||||
then
|
then
|
||||||
cecho-n " * Creating directory '~/.ssh'.."
|
cecho-n " * Creating directory '~/.ssh'.."
|
||||||
mkdir ~/.ssh
|
mkdir ~/.ssh
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ~/.ssh/known_hosts ]
|
if [ -f ~/.ssh/known_hosts ]
|
||||||
then
|
then
|
||||||
cecho-n " * Backing up ~/.ssh/known_hosts to '~/.ssh/known_hosts.before_uml'.."
|
cecho-n " * Backing up ~/.ssh/known_hosts to '~/.ssh/known_hosts.before_uml'.."
|
||||||
cp -fp ~/.ssh/known_hosts ~/.ssh/known_hosts.before_uml
|
cp -fp ~/.ssh/known_hosts ~/.ssh/known_hosts.before_uml
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
else
|
else
|
||||||
cecho-n " * Creating '~/.ssh/known_hosts'"
|
cecho-n " * Creating '~/.ssh/known_hosts'"
|
||||||
touch ~/.ssh/known_hosts
|
touch ~/.ssh/known_hosts
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for host in $HOSTNAMEIPV4
|
for host in $HOSTNAMEIPV4
|
||||||
@@ -68,7 +68,7 @@ do
|
|||||||
else
|
else
|
||||||
cecho-n " * Adding uml host $HOSTNAME ($IP) to '~/.ssh/known_hosts'.."
|
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
|
echo "$HOSTNAME,$IP `cat $DIR/../hosts/ssh_host_rsa_key.pub`" >> ~/.ssh/known_hosts
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -84,5 +84,5 @@ else
|
|||||||
cecho "not found"
|
cecho "not found"
|
||||||
cecho-n " * Generating ssh rsa key pair.."
|
cecho-n " * Generating ssh rsa key pair.."
|
||||||
echo "" | ssh-keygen -N "" -t rsa -f ~/.ssh/id_rsa >> $LOGFILE 2>&1
|
echo "" | ssh-keygen -N "" -t rsa -f ~/.ssh/id_rsa >> $LOGFILE 2>&1
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ if [ ! -d $BUILDDIR ]
|
|||||||
then
|
then
|
||||||
cecho-n " * Directory '$BUILDDIR' does not exist..creating.."
|
cecho-n " * Directory '$BUILDDIR' does not exist..creating.."
|
||||||
mkdir $BUILDDIR
|
mkdir $BUILDDIR
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LOGFILE=${BUILDDIR}/testing.log
|
LOGFILE=${BUILDDIR}/testing.log
|
||||||
@@ -41,7 +41,7 @@ if [ ! -f $LOGFILE ]
|
|||||||
then
|
then
|
||||||
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
|
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
|
||||||
touch $LOGFILE
|
touch $LOGFILE
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
LOOPDIR=loop
|
LOOPDIR=loop
|
||||||
@@ -76,4 +76,4 @@ do
|
|||||||
umount $LOOPDIR
|
umount $LOOPDIR
|
||||||
done
|
done
|
||||||
|
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
|
|||||||
@@ -75,12 +75,12 @@ if [ ! -f $LOGFILE ]
|
|||||||
then
|
then
|
||||||
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
|
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
|
||||||
touch $LOGFILE
|
touch $LOGFILE
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cecho-n " * Unpacking kernel.."
|
cecho-n " * Unpacking kernel.."
|
||||||
tar xjf $KERNEL >> $LOGFILE 2>&1
|
tar xjf $KERNEL >> $LOGFILE 2>&1
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
|
|
||||||
KERNELDIR=${BUILDDIR}/linux-${KERNELVERSION}
|
KERNELDIR=${BUILDDIR}/linux-${KERNELVERSION}
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ if [ $UMLPATCH ]
|
|||||||
then
|
then
|
||||||
cecho-n " * Applying uml patch.."
|
cecho-n " * Applying uml patch.."
|
||||||
bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1
|
bzcat $UMLPATCH | patch -p1 >> $LOGFILE 2>&1
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#######################################################
|
#######################################################
|
||||||
@@ -125,10 +125,8 @@ make oldconfig ARCH=um >> $LOGFILE 2>&1
|
|||||||
|
|
||||||
cecho-n " * Now compiling uml kernel.."
|
cecho-n " * Now compiling uml kernel.."
|
||||||
make linux ARCH=um >> $LOGFILE 2>&1
|
make linux ARCH=um >> $LOGFILE 2>&1
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
|
|
||||||
cecho-n " * Copying uml kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'.."
|
cecho-n " * Copying uml kernel to '${BUILDDIR}/linux-uml-${KERNELVERSION}'.."
|
||||||
mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}
|
mv linux ${BUILDDIR}/linux-uml-${KERNELVERSION}
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ if [ ! -f $LOGFILE ]
|
|||||||
then
|
then
|
||||||
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
|
cecho-n " * Logfile '$LOGFILE' does not exist..creating.."
|
||||||
touch $LOGFILE
|
touch $LOGFILE
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ROOTFSDIR=$BUILDDIR/root-fs
|
ROOTFSDIR=$BUILDDIR/root-fs
|
||||||
@@ -66,7 +66,7 @@ if [ ! -d $ROOTFSDIR ]
|
|||||||
then
|
then
|
||||||
cecho-n " * Root file system directory '$ROOTFSDIR' does not exist..creating.."
|
cecho-n " * Root file system directory '$ROOTFSDIR' does not exist..creating.."
|
||||||
mkdir $ROOTFSDIR
|
mkdir $ROOTFSDIR
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $ROOTFSDIR
|
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
|
mkreiserfs -q -f gentoo-fs >> $LOGFILE 2>&1
|
||||||
mount -o loop gentoo-fs $LOOPDIR >> $LOGFILE 2>&1
|
mount -o loop gentoo-fs $LOOPDIR >> $LOGFILE 2>&1
|
||||||
tar xjpf $ROOTFS -C $LOOPDIR >> $LOGFILE 2>&1
|
tar xjpf $ROOTFS -C $LOOPDIR >> $LOGFILE 2>&1
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
|
|
||||||
######################################################
|
######################################################
|
||||||
# remove /etc/resolv.conf
|
# remove /etc/resolv.conf
|
||||||
@@ -150,10 +150,8 @@ echo "ldconfig" >> $INSTALLSHELL
|
|||||||
|
|
||||||
cecho-n " * Compiling $STRONGSWANVERSION within the root file system as chroot.."
|
cecho-n " * Compiling $STRONGSWANVERSION within the root file system as chroot.."
|
||||||
chroot $LOOPDIR /bin/bash /install.sh >> $LOGFILE 2>&1
|
chroot $LOOPDIR /bin/bash /install.sh >> $LOGFILE 2>&1
|
||||||
cecho "done"
|
|
||||||
|
|
||||||
rm -f $INSTALLSHELL
|
rm -f $INSTALLSHELL
|
||||||
|
cgecho "done"
|
||||||
|
|
||||||
######################################################
|
######################################################
|
||||||
# copying the host's ssh public key
|
# copying the host's ssh public key
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
function cecho {
|
function cecho {
|
||||||
echo -e "\033[1;31m$1\033[0m"
|
echo -e "\033[1;31m$1\033[0m"
|
||||||
}
|
}
|
||||||
|
function cgecho {
|
||||||
|
echo -e "\033[1;32m$1\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
function cecho-n {
|
function cecho-n {
|
||||||
echo -en "\033[1;31m$1\033[0m"
|
echo -en "\033[1;31m$1\033[0m"
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ do
|
|||||||
ubda=$UMLHOSTFS \
|
ubda=$UMLHOSTFS \
|
||||||
\$SWITCH_${host} \
|
\$SWITCH_${host} \
|
||||||
mem=${MEM}M con=pty con0=fd:0,fd:1" &
|
mem=${MEM}M con=pty con0=fd:0,fd:1" &
|
||||||
cecho "\033[1;32mdone"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
let "x0+=dx"
|
let "x0+=dx"
|
||||||
let "y0+=dy"
|
let "y0+=dy"
|
||||||
@@ -114,7 +114,7 @@ do
|
|||||||
cecho "exit"
|
cecho "exit"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
cecho "\033[1;32mup"
|
cgecho "up"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ do
|
|||||||
cecho " * Great, umlswitch$n is already running!"
|
cecho " * Great, umlswitch$n is already running!"
|
||||||
else
|
else
|
||||||
cecho-n " * Starting umlswitch$n.."
|
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
|
sleep 2
|
||||||
eval ifconfig "tap$n \$IFCONFIG_$n up"
|
eval ifconfig "tap$n \$IFCONFIG_$n up"
|
||||||
cecho "\033[1;32mdone"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ do
|
|||||||
ubda=$UMLHOSTFS \
|
ubda=$UMLHOSTFS \
|
||||||
\$SWITCH_${host} \
|
\$SWITCH_${host} \
|
||||||
mem=${MEM}M con=pty con0=fd:0,fd:1"
|
mem=${MEM}M con=pty con0=fd:0,fd:1"
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ do
|
|||||||
cecho "exit"
|
cecho "exit"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
cecho "up"
|
cgecho "up"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ do
|
|||||||
ubda=$UMLHOSTFS \
|
ubda=$UMLHOSTFS \
|
||||||
\$SWITCH_${host} \
|
\$SWITCH_${host} \
|
||||||
mem=${MEM}M con=pty con0=fd:0,fd:1" &
|
mem=${MEM}M con=pty con0=fd:0,fd:1" &
|
||||||
cecho "done"
|
cgecho "done"
|
||||||
fi
|
fi
|
||||||
let "x0+=dx"
|
let "x0+=dx"
|
||||||
let "y0+=dy"
|
let "y0+=dy"
|
||||||
@@ -114,7 +114,7 @@ do
|
|||||||
cecho "exit"
|
cecho "exit"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
cecho "up"
|
cgecho "up"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ for host in $HOSTS
|
|||||||
do
|
do
|
||||||
uml_mconsole $host halt &> /dev/null
|
uml_mconsole $host halt &> /dev/null
|
||||||
done
|
done
|
||||||
cecho "\033[1;32mdone"
|
cgecho "done"
|
||||||
|
|
||||||
#####################################################
|
#####################################################
|
||||||
# Shutting down the uml switches
|
# Shutting down the uml switches
|
||||||
@@ -47,5 +47,5 @@ cecho "\033[1;32mdone"
|
|||||||
cecho-n " * Stopping the UML switches.."
|
cecho-n " * Stopping the UML switches.."
|
||||||
killall uml_switch &> /dev/null
|
killall uml_switch &> /dev/null
|
||||||
rm -f /tmp/umlswitch[012] &> /dev/null 2>&1
|
rm -f /tmp/umlswitch[012] &> /dev/null 2>&1
|
||||||
cecho "\033[1;32mdone"
|
cgecho "done"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user