From 80c72006433ddedbe7a92717a6173c24d10fe4df Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Mon, 7 Mar 2016 22:09:31 +0100 Subject: [PATCH] test --- test/all.sh | 6 +++++- test/clixon | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ test/test1.sh | 2 +- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100755 test/clixon diff --git a/test/all.sh b/test/all.sh index 98e3b2d0..2409c238 100755 --- a/test/all.sh +++ b/test/all.sh @@ -1,4 +1,8 @@ #!/bin/sh + +# include err() and new() functions +. ./lib.sh + for test in test*.sh; do echo "Running $test" ./$test @@ -8,4 +12,4 @@ for test in test*.sh; do exit $errcode fi done - +echo OK diff --git a/test/clixon b/test/clixon new file mode 100755 index 00000000..2fc9be73 --- /dev/null +++ b/test/clixon @@ -0,0 +1,55 @@ +#!/bin/sh +# cd to working dir +cd /tmp +if [ $# -ne 0 ]; then + echo "usage: $0" + exit 1 +fi +rm -rf clixon +git clone https://github.com/clicon/clixon.git +if [ $? -ne 0 ]; then + echo "Error in git clone" + exit 1 +fi +cd clixon +CFLAGS=-Werror ./configure +if [ $? -ne 0 ]; then + echo "Error in configure" + exit 1 +fi +make +if [ $? -ne 0 ]; then + echo "Error in make" + exit 1 +fi +sudo make install +if [ $? -ne 0 ]; then + echo "Error in make install" + exit 1 +fi +sudo make install-include +if [ $? -ne 0 ]; then + echo "Error in make install-include" + exit 1 +fi +cd example +make +if [ $? -ne 0 ]; then + echo "Error in make" + exit 1 +fi +sudo make install +if [ $? -ne 0 ]; then + echo "Error in make install" + exit 1 +fi +cd ../test +#./all.sh +(cd /home/olof/src/clixon/test; ./all.sh) +errcode=$? +if [ $errcode -ne 0 ]; then + echo "test error" + exit $errcode +fi +cd ../.. +rm -rf clixon diff --git a/test/test1.sh b/test/test1.sh index ff34347e..67d7d66d 100755 --- a/test/test1.sh +++ b/test/test1.sh @@ -21,7 +21,7 @@ clifn "clixon_cli -1f $clixon_cf set interfaces interface eth0" "" new "cli show configuration" clifn "clixon_cli -1f $clixon_cf show conf cli" "interfaces interface name eth0 -interfaces interface enabled htrue" +interfaces interface enabled true" new "Kill backend" # kill backend