[Git][NTPsec/ntpsec][master] Add scheduled options-tester using CI runners

James Browning gitlab at mg.gitlab.com
Sun Feb 23 00:04:24 UTC 2020



James Browning pushed to branch master at NTPsec / ntpsec


Commits:
60c55885 by James Browning at 2020-02-23T00:04:15+00:00
Add scheduled options-tester using CI runners

- - - - -


3 changed files:

- .gitlab-ci.yml
- + .gitlab-opttest-ci.yml
- tests/option-tester.sh


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -22,6 +22,7 @@ pages:
 include:
   - template: Code-Quality.gitlab-ci.yml
   - template: SAST.gitlab-ci.yml
+  - local: '.gitlab-opttest-ci.yml'
 
 .job_template: &job_definition
   stage: build
@@ -557,7 +558,7 @@ coverity-scan:
   tags:
     - ubuntu-1604-lts
   only:
-    - schedules
+    - schedules AND branches at NTPsec/ntpsec
 
 macos-basic:
   <<: *job_definition


=====================================
.gitlab-opttest-ci.yml
=====================================
@@ -0,0 +1,139 @@
+.option_tester: &option_tester
+  stage: test
+  after_script:
+    - PYTHON=python2 bash tests/option-tester.sh
+    - PYTHON=python3 bash tests/option-tester.sh
+  tags:
+    - gitlab-org
+  only:
+    - schedules
+
+alpine-edge-options-tester:
+  <<: *option_tester
+  image: alpine:edge
+  script:
+    - apk update && apk add gcc bison musl-dev openssl-dev libcap-dev python2-dev python3-dev asciidoc libseccomp-dev bash
+
+alpine-options-tester:
+  <<: *option_tester
+  image: alpine
+  script:
+    - apk update && apk add gcc bison musl-dev openssl-dev libcap-dev python2-dev python3-dev asciidoc libseccomp-dev bash
+
+centos-options-tester:
+  <<: *option_tester
+  image: centos:latest
+  script:
+    - dnf -y --enablerepo=PowerTools install bison gcc openssl-devel libcap-devel python3-devel python2-devel pps-tools-devel libseccomp-devel bash
+
+fedora-latest-options-tester:
+  image: fedora:latest
+  script:
+    - yum -y install bison gcc openssl-devel libcap-devel pps-tools-devel python3-devel python2-devel libseccomp-devel bash
+  <<: *option_tester
+
+fedora-rawhide-options-tester:
+  image: registry.fedoraproject.org/fedora:rawhide
+  script:
+    - yum -y install bison gcc openssl-devel libcap-devel pps-tools-devel python3-devel python2-devel libseccomp-devel bash
+  <<: *option_tester
+
+opensuse-leap-options-tester:
+  <<: *option_tester
+  image: opensuse/leap
+  script:
+    - zypper -n install bison gcc libopenssl-devel libcap-devel pps-tools-devel python-devel python-curses libseccomp-devel python3-devel python3-curses bash
+
+opensuse-tumbleweed-options-tester:
+  <<: *option_tester
+  image: opensuse/tumbleweed
+  script:
+    - zypper -n install bison gcc libopenssl-devel libcap-devel pps-tools-devel python-devel python-curses libseccomp-devel python3-devel python3-curses bash
+
+gentoo-options-tester:
+  <<: *option_tester
+  image: gentoo/stage3-amd64
+  script:
+    - emerge-webrsync
+    - emerge -q y sys-libs/libcap sys-devel/bison net-misc/pps-tools app-text/asciidoc sys-libs/libseccomp app-shells/bash
+
+gentoo-hardened-options-tester:
+  <<: *option_tester
+  image: gentoo/stage3-amd64-hardened
+  script:
+    - emerge-webrsync
+    - emerge -q y sys-libs/libcap sys-devel/bison net-misc/pps-tools app-text/asciidoc sys-libs/libseccomp app-shells/bash
+
+macos-options-tester:
+  stage: test
+  script:
+    - PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig PYTHON=python2 tests/option-tester.sh
+    - PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig PYTHON=python3 tests/option-tester.sh
+  tags:
+    - macos
+  only:
+    - branches at NTPsec/ntpsec AND schedules
+
+fbsd-11-options-tester:
+  stage: test
+  script:
+    - PYTHON=python2 tests/option-tester.sh
+    - PYTHON=python3 tests/option-tester.sh
+  tags:
+    - freebsd-11
+  only:
+    - branches at NTPsec/ntpsec AND schedules
+
+fbsd-12-options-tester:
+  stage: test
+  script:
+    - PYTHON=python2 tests/option-tester.sh
+    - PYTHON=python3 tests/option-tester.sh
+  tags:
+    - freebsd-11
+  only:
+    - branches at NTPsec/ntpsec AND schedules
+
+.deb_option_tester: &deb_option_tester
+  stage: test
+  script:
+    - apt-get update
+    - apt-get install -y netbase bison gcc libssl-dev libcap-dev pps-tools python2.7-dev libseccomp-dev bash pkg-config python3-dev
+    - PYTHON=python2 bash tests/option-tester.sh
+    - PYTHON=python3 bash tests/option-tester.sh
+  tags:
+    - gitlab-org
+  only:
+    - schedules
+
+debian-i386-options-tester:
+  image: i386/debian:stable-slim
+  <<: *deb_option_tester
+
+debian-oldstable-options-tester:
+  image: debian:oldstable-slim
+  <<: *deb_option_tester
+
+debian-stable-options-tester:
+  image: debian:stable-slim
+  <<: *deb_option_tester
+
+debian-testing-options-tester:
+  image: debian:testing-slim
+  <<: *deb_option_tester
+
+debian-unstable-options-tester:
+  image: debian:unstable-slim
+  <<: *deb_option_tester
+
+ubuntu-devel-options-tester:
+  image: ubuntu:devel
+  <<: *deb_option_tester
+
+ubuntu-latest-options-tester:
+  image: ubuntu:latest
+  <<: *deb_option_tester
+
+ubuntu-rolling-options-tester:
+  image: ubuntu:rolling
+  <<: *deb_option_tester


=====================================
tests/option-tester.sh
=====================================
@@ -10,43 +10,59 @@
 
 # set pipefail to catch pipeline failures
 # Unfortunately, it doesn't work on some older sh-es
-if /bin/sh -c "set -o pipefail" 2> /dev/null
+if (set -o pipefail) 2>/dev/null
 then
   set -o pipefail
 fi
 
+PURGE=""
+SECCOMP="$(pkg-config libseccomp --variable=includedir)"
+SECCOMP="$SECCOMP/seccomp.h"
 LINUX=""
-if [ `uname -s` = "Linux" -a -f /usr/include/seccomp.h ]
+if [ `uname -s` = "Linux" -a -n "$SECCOMP" -a -f "$SECCOMPH" ]
 then
   # Not supported on CentOS 6
   LINUX="--enable-seccomp"
 fi
 
+if [ -z ${PYTHON} ]
+then
+    PYTHON="python"
+fi
+
 doit ()
 {
   DIR=test-$1
   [ ! -d $DIR ] && mkdir $DIR
   rm -rf $DIR/*
-  ./waf configure --out=$DIR $2 2>&1 | tee    $DIR/test.log
+  $PYTHON ./waf configure --out=$DIR $2 2>&1 | tee    $DIR/test.log
   WAF1=$?
   WAF2=0
   WAF3=0
   if [ "$WAF1" = 0 ]
   then
-  echo                           2>&1    | tee -a $DIR/test.log
-  ./waf build                    2>&1    | tee -a $DIR/test.log
+  echo                                 2>&1    | tee -a $DIR/test.log
+  $PYTHON ./waf build                   2>&1    | tee -a $DIR/test.log
   WAF2=$?
   if [ "$WAF2" = 0 ]
   then
-  echo                           2>&1    | tee -a $DIR/test.log
-  ./waf check                    2>&1    | tee -a $DIR/test.log
+  echo                                 2>&1    | tee -a $DIR/test.log
+  $PYTHON ./waf check                   2>&1    | tee -a $DIR/test.log
   WAF3=$?
+  else
+    PURGE="${PURGE} ${PYTHON}-${DIR}-build"
+  fi
+  else
+    PURGE="${PURGE} ${PYTHON}-${DIR}-config"
   fi
+  if [ "$WAF1" != 0 -o "$WAF2" != 0 -o "$WAF3" != 0 ]
+  then
+    echo                               2>&1   | tee -a $DIR/test.log
+    echo "Trouble with $DIR"           2>&1   | tee -a $DIR/test.log
   fi
-  if [ "$WAF1" != 0 -o "$WAF2" != 0 -o "$WAF3" != 0 ] 
+  if [ "$WAF3" != 0 ]
   then
-    echo                                  2>&1   | tee -a $DIR/test.log
-    echo "Trouble with $DIR"              2>&1   | tee -a $DIR/test.log
+    PURGE="${PURGE} ${PYTHON-}${DIR}3-check"
   fi
   echo
   echo
@@ -77,24 +93,30 @@ grep "The configuration failed"  test*/test.log
 grep ^Trouble                    test*/test.log
 echo
 
-echo -n "## ";  python --version
+echo -n "## ";  $PYTHON --version
 if test -n "$PYTHONPATH"
 then
   echo "## PYTHONPATH is" \"$PYTHONPATH\"
 fi
 
-if ! /bin/sh -c "set -o pipefail" 2> /dev/null
+if (set -o pipefail) 2>/dev/null
 then
   echo "### Old sh - no pipefail"
   echo "### We can't test for errors during build"
   echo "### You will have to scan the log files."
+  PURGE="${PURGE} pipefail"
 fi
 
-if [ `uname -s` = "Linux" -a ! -f /usr/include/seccomp.h ]
+if [ `uname -s` = "Linux" -a -z "$SECCOMP" ]
 then
     echo
     echo "### Warning: Missing seccomp.h (on a Linux system)"
     echo
+    PURGE="${PURGE} seccomp"
 fi
 
-
+if [ -n "$PURGE" ]
+then
+    echo "## errors encountered during execution:${PURGE}"
+    exit 1
+fi



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/60c55885cd225ada5c05d4e7a950c567df3bb8c7

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/60c55885cd225ada5c05d4e7a950c567df3bb8c7
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20200223/561e6733/attachment-0001.htm>


More information about the vc mailing list