* Added [Vagrant tests](test/vagrant/README.md)

* Fixed memleak in restconf-fcgi
This commit is contained in:
Olof Hagsand 2020-06-08 08:16:42 +00:00
parent 7ffa2920a4
commit ab73794292
14 changed files with 458 additions and 32 deletions

View file

@ -41,25 +41,19 @@ SHELL = /bin/sh
.PHONY: all clean distclean depend install uninstall
HOSTS=
# The "hosts" file must exist and define the HOSTS variable
# Include "site.mk" file if it exists and define the HOSTS variables
# eg :
# HOSTS += vandal.hagsand.com # i86_32 ubuntu
# ...
-include hosts
HOSTS=
-include site.mk
SCRIPTS = cligen-mk.sh
SCRIPTS += clixon-mk.sh
SCRIPTS += clixon-config.sh
.PHONY: all clean distclean depend install uninstall $(HOSTS) $(VAGRANTS)
.PHONY: all clean distclean depend install uninstall $(HOSTS)
all: $(HOSTS)
all: $(HOSTS) $(VAGRANTS)
# Real hosts reachable by ssh
$(HOSTS):
for s in $(SCRIPTS); do \
(scp $$s $@:/tmp/ ; ssh $@ chmod 750 /tmp/$$s || exit 1) \
done;
./cicd.sh $@ 2>&1 | tee $@.log
clean:

View file

@ -1,15 +1,13 @@
CICD scripts
============
Manual scripts for running committed code on a set of hosts.
Hosts scripts
=============
Manual scripts for running committed code on a set of remote hosts accessible with ssh.
The script then uses a Makefile and logs in to each host, pulls from
git, configure, makes and runs through the tests. Make is used to get
concurrency - non-trivial with bash, eg with `make -j 10`
concurrency, eg with `make -j 10`
Note there are other cicd scripts than this, such as the the "travis" scrips.
The Makefile contains a configurable HOSTS variable, which ius defined
in a "hosts" file. You must add such a file, eg:
The Makefile contains a configurable HOSTS variable, which is defined
in a "site.mk" file. You must add such a file, eg:
```
HOSTS += vandal.hagsand.com # i86_32 ubuntu
```

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
# CI/CD script complementing trevor github
# Login in to a number of hosts and fo the following:
# Triggered from Makefile
# Login in to a number of hosts and do the following:
# 0. Create and transfer sub-scripts used in main script: cligen-mk.sh clixon-mk.sh clixon-config.sh
# 1. pull latest version
# 2. Run configure
@ -27,14 +28,23 @@ fi
h=$1
SCRIPTS="cligen-mk.sh clixon-mk.sh clixon-config.sh"
# Copy test scripts to remote machine
scp $SCRIPTS $h:/tmp/
ssh -t $h "(cd /tmp; chmod 750 $SCRIPTS)"
# pull git changes and build cligen
ssh -t $h "test -d src || mkdir src"
ssh -t $h "test -d src/cligen || (cd src;git clone https://github.com/olofhagsand/cligen.git)"
ssh -t $h "(cd src/cligen;git pull)"
ssh -t $h "(cd src/cligen;./configure)"
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-mk.sh)"
ssh -t $h sudo ldconfig
# Run clixon test suite
ssh -t $h "(cd src/clixon/test; ./sum.sh)"