From 5670646c7998f3c43971b18b9fb11478d848769f Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Mon, 4 Mar 2013 18:47:08 +0100 Subject: [PATCH] autotests: work in progress --- liveboot_gw_autotest.sh | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/liveboot_gw_autotest.sh b/liveboot_gw_autotest.sh index d7fef5a..8a3d9c1 100755 --- a/liveboot_gw_autotest.sh +++ b/liveboot_gw_autotest.sh @@ -3,6 +3,11 @@ # copyright 2013 Holger Levsen # GPL2 licenced +if [ "$(id -n -u)" != "jenkins" ] ; then + echo "You must run this as user jenkins, exiting." + exit 1 +fi + set -e set -x export @@ -11,19 +16,34 @@ CORE_ROUTER=cr13 GATEWAY=gw1301 PSERVER=pserver1301 +# +# prepare ssh +# +TMPFILE=$(mktemp) +ssh-agent > $TMPFILE +source $TMPFILE +ssh-add ~/.ssh/id_ritest + # # prepare pserver # -ssh -i ~/.ssh/id_ritest $PSERVER "sudo dmsetup remove_all" -ssh -i ~/.ssh/id_ritest $PSERVER "sudo mkdir -p /mnt/local_hdd" -ssh -i ~/.ssh/id_ritest $PSERVER "sudo mount /dev/sda1 -t ext3 /mnt/local_hdd" +ssh -t $PSERVER "sudo dmsetup remove_all" +ssh -t $PSERVER "sudo mkdir -p /mnt/local_hdd" +ssh -t $PSERVER "sudo umount /mnt/local_hdd || true" +ssh -t $PSERVER "sudo mount /dev/sda1 -t ext3 /mnt/local_hdd" # # prepare core router # -ssh -i ~/.ssh/id_ritest $CORE_ROUTER "sudo rm /opt/autotest -rf" -ssh -i ~/.ssh/id_ritest $CORE_ROUTER "git clone git://git/ri/autotest.git /opt/autotest" -ssh -i ~/.ssh/id_ritest $CORE_ROUTER "cd /opt/autotest ; git checkout develop" -ssh -A -i ~/.ssh/id_ritest $CORE_ROUTER "cd /opt/autotest ; ./run-compile.sh --config config-jenkins.xml" +ssh -t $CORE_ROUTER "sudo rm /opt/autotest -rf" +ssh -t $CORE_ROUTER "git clone git://git/ri/autotest.git /opt/autotest" +ssh -t $CORE_ROUTER "cd /opt/autotest ; git checkout develop" + +# +# run autotests +# +ssh -t $CORE_ROUTER "cd /opt/autotest ; cp config-jenkins.xml config.xml" +#ssh -t -A $CORE_ROUTER "cd /opt/autotest ; ./run-compile.sh --config config-jenkins.xml" +ssh -t -A $CORE_ROUTER "cd /opt/autotest ; ./run-compile.sh" -- 2.39.5