cicd tests

This commit is contained in:
Olof Hagsand 2020-09-07 16:15:12 +00:00
parent 1db969d3a7
commit afe64cbd5e
4 changed files with 27 additions and 35 deletions

View file

@ -46,6 +46,8 @@ SHELL = /bin/sh
# eg :
# HOSTS += vandal.hagsand.com # i86_32 ubuntu
# ...
# You can also set RESTCONF to fcgi or evhtp
RESTCONF=fcgi
HOSTS=
-include site.mk
@ -56,9 +58,9 @@ all: $(HOSTS)
# Real hosts reachable by ssh
$(HOSTS):
ifdef LOGDIR
./cicd.sh $@ 2>&1 > $(LOGDIR)/$@.log
./cicd.sh $@ $(RESTCONF) 2>&1 > $(LOGDIR)/$@-$(RESTCONF).log
else
./cicd.sh $@ 2>&1 | tee /$@.log
./cicd.sh $@ $(RESTCONF) 2>&1 | tee /$@-$(RESTCONF).log
endif
clean:

View file

@ -21,12 +21,14 @@
set -eux # x
if [ $# -ne 1 ]; then
echo "usage: $0 <host>"
if [ $# -ne 2 ]; then
echo "usage: $0 <host> <restconf>"
echo " where <restconf> is fcgi or evhtp"
exit -1
fi
h=$1
h=$1 # Host
restconf=$2
SCRIPTS="cligen-mk.sh clixon-mk.sh clixon-config.sh"
@ -43,8 +45,13 @@ ssh -t $h "(cd src/cligen; /tmp/cligen-mk.sh)"
# pull git changes and build clixon
ssh -t $h "test -d src/clixon || (cd src;git clone https://github.com/clicon/clixon.git)"
ssh -t $h "(cd src/clixon;git pull)"
ssh -t $h "(cd src/clixon; /tmp/clixon-config.sh)"
ssh -t $h "(cd src/clixon; /tmp/clixon-config.sh $evhtp)"
ssh -t $h "(cd src/clixon; /tmp/clixon-mk.sh)"
ssh -t $h sudo ldconfig
# Run clixon test suite
if [ "$restconf" = "fcgi" ]; then
ssh -t $h sudo systemctl start nginx
else
ssh -t $h sudo systemctl stop nginx
fi
ssh -t $h "(cd src/clixon/test; ./sum.sh)"

View file

@ -1,8 +1,16 @@
#!/bin/sh
# A top-level configurer for clixon
set -eux
if [ $(uname) = "FreeBSD" ]; then
./configure --with-cligen=/usr/local --with-wwwuser=www --enable-optyangs
else
./configure --enable-optyangs
if [ $# -ne 1 ]; then
echo "usage: $0 <restconf>"
echo " where <restconf> is fcgi or evhtp"
exit -1
fi
restconf=$1
if [ $(uname) = "FreeBSD" ]; then
./configure --with-cligen=/usr/local --with-wwwuser=www --enable-optyangs --with-restconf=$restconf
else
./configure --enable-optyangs --with-restconf=$restconf
fi