[Git][NTPsec/ntpsec][master] 4 commits: CI: Shift five option testers creating/revealing cracks...

Matt Selsky (@selsky) gitlab at mg.gitlab.com
Sun Jun 25 17:09:39 UTC 2023



Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
f6dbc801 by James Browning at 2023-06-23T23:05:21-07:00
CI: Shift five option testers creating/revealing cracks...

Move the fetch operations from `script` to `before_script`,
and the actual test(s) from `after_script` to `script`.

This breaks the Alpine, CentOS, Fedora, and Gentoo option 
testers. The reason is It appears that `after_script` 
errors do not register; maybe they are for cleanup.

- - - - -
62aed229 by James Browning at 2023-06-23T23:05:21-07:00
CI: Adjust Gentoo and Alpine option testers to be Python 3 only. 

They used to ship with Python 2; now, they do not.
- - - - -
fee6311c by James Browning at 2023-06-23T23:05:21-07:00
CI: Make CentOS, Fedora, and OpenSUSE option testers have `pkg-config`.

It is required for option-tester and not included by
default, so add packaged `pkg-config`.

- - - - -
7ce41e8e by James Browning at 2023-06-23T23:19:05-07:00
`which` appears to not be POSIX replace it with `command -v` which is.

This originally came up because it broke CI option testers for
CentOS and Fedora.

- - - - -


5 changed files:

- .gitlab-opttest-ci.yml
- ntpclients/ntpleapfetch
- tests/option-tester.sh
- tests/python2-tester.sh
- tests/python3-tester.sh


Changes:

=====================================
.gitlab-opttest-ci.yml
=====================================
@@ -15,7 +15,7 @@ make-tarball:
 .option_tester: &option_tester
   stage: test
   needs: []
-  after_script:
+  script:
     - PYTHON=python2 bash tests/option-tester.sh
     - PYTHON=python3 bash tests/option-tester.sh
   tags:
@@ -26,7 +26,7 @@ make-tarball:
 .option_tester_py3_only: &option_tester_py3_only
   stage: test
   needs: []
-  after_script:
+  script:
     - PYTHON=python3 bash tests/option-tester.sh
   tags:
     - gitlab-org
@@ -34,40 +34,40 @@ make-tarball:
     - if: '$CI_PIPELINE_SOURCE == "schedule"'
 
 alpine-edge-options-tester:
-  <<: *option_tester
+  <<: *option_tester_py3_only
   image: alpine:edge
-  script:
+  before_script:
     - apk update && apk add gcc bison musl-dev openssl-dev libcap-dev python3-dev asciidoc libseccomp-dev bash
 
 alpine-options-tester:
-  <<: *option_tester
+  <<: *option_tester_py3_only
   image: alpine
-  script:
+  before_script:
     - apk update && apk add gcc bison musl-dev openssl-dev libcap-dev python3-dev asciidoc libseccomp-dev bash
 
 centos-options-tester:
   <<: *option_tester_py3_only
   image: quay.io/centos/centos:stream9
-  script:
-    - dnf -y --enablerepo=crb install bison gcc openssl-devel libcap-devel python3-devel pps-tools-devel libseccomp-devel bash
+  before_script:
+    - dnf -y --enablerepo=crb install bison gcc openssl-devel libcap-devel python3-devel pps-tools-devel libseccomp-devel pkgconf-pkg-config 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
+  before_script:
+    - yum -y install bison gcc openssl-devel libcap-devel pps-tools-devel python3-devel python2-devel libseccomp-devel pkgconf-pkg-config bash
   <<: *option_tester
 
 opensuse-leap-options-tester:
   <<: *option_tester_py3_only
   image: opensuse/leap
   allow_failure: true
-  script:
-    - zypper -n install bison gcc libopenssl-devel libcap-devel pps-tools-devel libseccomp-devel python3-devel python3-curses bash
+  before_script:
+    - zypper -n install bison gcc libopenssl-devel libcap-devel pps-tools-devel libseccomp-devel python3-devel python3-curses pkg-config bash
 
 gentoo-options-tester:
-  <<: *option_tester
+  <<: *option_tester_py3_only
   image: gentoo/stage3
-  script:
+  before_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
 


=====================================
ntpclients/ntpleapfetch
=====================================
@@ -224,7 +224,7 @@ export PATH="$PATHLIST$PATH"
 # Add to path to deal with embedded systems
 #
 for P in $REQUIREDCMDS ; do
-    if >/dev/null 2>&1 which "$P" ; then
+    if >/dev/null 2>&1 command -v "$P" ; then
         continue
     fi
     [ "$P" = "logger" ] && continue
@@ -233,9 +233,9 @@ for P in $REQUIREDCMDS ; do
 done
 
 # find sha1sum or shasum
-if >/dev/null 2>&1 which "sha1sum" ; then
+if >/dev/null 2>&1 command -v "sha1sum" ; then
     SHASUM="sha1sum"
-elif >/dev/null 2>&1 which "shasum" ; then
+elif >/dev/null 2>&1 command -v "shasum" ; then
     SHASUM="shasum"
 else
     echo "FATAL: Can not find sha1sum or shasum command, please install"
@@ -244,7 +244,7 @@ fi
 
 # Handle logging
 
-if ! LOGGER="`2>/dev/null which logger`" ; then
+if ! LOGGER="`2>/dev/null command -v logger`" ; then
     LOGGER=
 fi
 
@@ -412,7 +412,7 @@ if [ -n "$FORCE" ] || ! verifySHA1 $LEAPFILE "$VERBOSE" || [ $EXPIRES -lt `date
                 # the above chown fails on macOS and BSD, just force it
                 chown root:wheel $TMPFILE
             fi
-            ( which selinuxenabled && selinuxenabled && which chcon ) >/dev/null 2>&1
+            ( command -v selinuxenabled && selinuxenabled && command -v chcon ) >/dev/null 2>&1
             if  [ $? -eq 0 ] ; then
                 chcon --reference $REFFILE $TMPFILE
             fi


=====================================
tests/option-tester.sh
=====================================
@@ -16,7 +16,7 @@ then
 fi
 
 PURGE=""
-if which pkg-config
+if command -v pkg-config
 then
   SECCOMP="$(pkg-config libseccomp --variable=includedir)"
   SECCOMP="$SECCOMP/seccomp.h"
@@ -96,8 +96,8 @@ doit classic "--enable-classic-mode --refclock=all --disable-doc --disable-manpa
 
 doit all     "--enable-warnings --enable-attic --enable-debug --enable-debug-timing --refclock=all --enable-leap-smear --enable-mssntp --enable-early-droproot --disable-fuzz $LINUX --disable-doc --disable-manpage --enable-pylib=ext"
 
-if [ "`which asciidoc 2>/dev/null`" != "" -a \
-     "`which xsltproc 2>/dev/null`" != "" ]
+if [ "`command -v asciidoc 2>/dev/null`" != "" -a \
+     "`command -v xsltproc 2>/dev/null`" != "" ]
 then
 doit doc     ""
 fi


=====================================
tests/python2-tester.sh
=====================================
@@ -5,7 +5,7 @@
 # This is a clone of option-tester.sh
 # to build with python2 and do minimal (version) testing.
 
-if [ "`which python2 2>/dev/null`" = "" ]
+if [ "`command -v python2 2>/dev/null`" = "" ]
 then
   echo "# Error: No python2 on this system."
   exit 1


=====================================
tests/python3-tester.sh
=====================================
@@ -5,7 +5,7 @@
 # This is a clone of option-tester.sh
 # to build with python3 and do minimal (version) testing.
 
-if [ "`which python3 2>/dev/null`" = "" ]
+if [ "`command -v python3 2>/dev/null`" = "" ]
 then
   echo "# Error: No python3 on this system."
   exit 1



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/c2dff50b7ea64968449e49e416334410e35fee84...7ce41e8eb651a3a7acf521fde15bc6cc1b9bdd3a

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/compare/c2dff50b7ea64968449e49e416334410e35fee84...7ce41e8eb651a3a7acf521fde15bc6cc1b9bdd3a
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/20230625/88e43086/attachment-0001.htm>


More information about the vc mailing list