try native travis test

This commit is contained in:
Olof hagsand 2020-11-29 22:33:15 +01:00
parent 19fb063f82
commit bccad164ae
2 changed files with 65 additions and 2 deletions

View file

@ -5,7 +5,7 @@ arch: amd64
branches: branches:
only: only:
- master - master
script: ./configure --with-restconf=fcgi && make && sudo make install && make test script:
- ./configure --with-restconf=fcgi && make && sudo make install && (cd example; make; sudo make install) && (cd util; make; sudo make install) && (cd test; make all)
before_script: before_script:
- sudo apt-get install -y libfcgi-dev
- ./test/travis/before_script.sh - ./test/travis/before_script.sh

View file

@ -4,3 +4,66 @@
# Note travis builds and installs, then starts a clixon container where all tests are run from. # Note travis builds and installs, then starts a clixon container where all tests are run from.
git clone https://github.com/clicon/cligen.git git clone https://github.com/clicon/cligen.git
(cd cligen && ./configure && make && sudo make install) (cd cligen && ./configure && make && sudo make install)
# clixon utilities
sudo apt install -y libcurl4-openssl-dev
sudo apt install -y g++
# This is for nginx/restconf
wwwuser=www-data
apt-get install -y libfcgi-dev
sudo useradd -M $wwwuser
sudo apt install -y nginx
# Nginx conf file
cat<<EOF > /etc/nginx/nginx.conf
#
user $wwwuser;
error_log /var/log/nginx/error.log;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80 default_server;
listen localhost:80 default_server;
listen [::]:80 default_server;
server_name localhost;
server_name _;
#:well-known is in root, otherwise restconf would be ok
location / {
fastcgi_pass unix:/www-data/fastcgi_restconf.sock;
include fastcgi_params;
}
location /streams {
fastcgi_pass unix:/www-data/fastcgi_restconf.sock;
include fastcgi_params;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
}
}
EOF
sudo pkill nginx
sudo nginx -c /etc/nginx/nginx.conf
# Start clixon
sudo useradd -M -U clicon;
sudo usermod -a -G clicon vagrant; # start clixon tests as this users
sudo usermod -a -G clicon $wwwuser;