diff --git a/test/vagrant/README.md b/test/vagrant/README.md index 08638a8a..a150c213 100644 --- a/test/vagrant/README.md +++ b/test/vagrant/README.md @@ -13,6 +13,8 @@ in a "site.mk" file. You can add such a file, eg: VAGRANTS += generic/centos8 ``` +Beware memory exhaustion if you run too many simultaneously. + Logs appear in : /.log. You can also run a single vagrant test as follows: @@ -22,8 +24,8 @@ You can also run a single vagrant test as follows: The current status is as follows * freebsd/FreeBSD-12.1-STABLE -* generic/centos8 - some remaining nginx issue -* generic/opensuse42 - fastcgi is not installed +* generic/opensuse42 +* generic/centos8 - one state test fails For other vagrant boxes, see [search vagrant boxes](https://vagrantcloud.com/search) diff --git a/test/vagrant/nginx.sh b/test/vagrant/nginx.sh index 9c256946..bc4b239c 100755 --- a/test/vagrant/nginx.sh +++ b/test/vagrant/nginx.sh @@ -84,7 +84,7 @@ cat<<'EOF' > $dir/startnginx.sh sudo /usr/local/etc/rc.d/nginx restart else sudo pkill nginx - nginxbin=$(which nginx) + nginxbin=$(sudo which nginx) sudo $nginxbin -c $prefix/etc/nginx/nginx.conf fi EOF diff --git a/test/vagrant/vagrant.sh b/test/vagrant/vagrant.sh index 960d2df5..e45ed093 100755 --- a/test/vagrant/vagrant.sh +++ b/test/vagrant/vagrant.sh @@ -60,6 +60,7 @@ echo "$sshcmd" system=$($sshcmd uname) +buildfcgi=false case $system in FreeBSD) # packages for building @@ -73,26 +74,41 @@ case $system in $sshcmd sudo pkg install -y fcgi-devkit nginx ;; Linux) + # nginx restconf user: $wwwuser + if [ ! $($sshcmd id -u $wwwuser) ]; then + $sshcmd sudo useradd -M $wwwuser + fi case $release in centos) # centos 8 # packages for building $sshcmd sudo yum install -y git # cligen $sshcmd sudo yum install -y bison flex - # clixon - if [ ! $($sshcmd id -u $wwwuser) ]; then - $sshcmd sudo useradd -M $wwwuser - fi + # clixon $sshcmd sudo yum install -y fcgi-devel nginx # clixon utilities $sshcmd sudo yum install -y libcurl-devel ;; opensuse) # opensuse42 + # packages for building + $sshcmd sudo zypper install -y git + # cligen + $sshcmd sudo zypper install -y bison flex # clixon $sshcmd sudo zypper install -y nginx - # XXX: no fastcgi package? + buildfcgi=true # build fcgi from source + # clixon utilities + $sshcmd sudo zypper install -y libcurl-devel + # packages for building fcgi + $sshcmd sudo zypper install -y autoconf automake libtool ;; - *) + *) # ubuntu/apt based + # cligen + $sshcmd sudo apt install -y bison flex + # clixon + $sshcmd sudo apt install -y libfcgi-dev nginx + # clixon utilities + $sshcmd sudo apt install -y libcurl4-openssl-dev ;; esac ;; @@ -101,6 +117,12 @@ case $system in ;; esac +# Some platforms dont have fcgi, build the source (should all?) +if $buildfcgi; then + $sshcmd "test -d fcgi2 || git clone https://github.com/FastCGI-Archives/fcgi2" + $sshcmd "(cd fcgi2; ./autogen.sh; ./configure; make; sudo make install)" +fi + # Hide all complex nginx config in sub-script . ./nginx.sh $dir $idfile $port $wwwuser @@ -121,11 +143,11 @@ wwwuser=$2 if [ ! $(id -u clicon) ]; then if [ $release = "freebsd" ]; then sudo pw useradd clicon -d /nonexistent -s /usr/sbin/nologin; - sudo pw group mod clicon -m vagrant; + sudo pw group mod clicon -m vagrant; # start clixon tests as this users sudo pw group mod clicon -m $wwwuser; else - sudo useradd clicon; - sudo usermod -a -G clicon vagrant; + sudo useradd -M -U clicon; + sudo usermod -a -G clicon vagrant; # start clixon tests as this users sudo usermod -a -G clicon $wwwuser; fi fi