]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
CI fixes for FreeBSD (#4351)
authorTerry Burton <tez@terryburton.co.uk>
Wed, 5 Jan 2022 21:43:17 +0000 (21:43 +0000)
committerGitHub <noreply@github.com>
Wed, 5 Jan 2022 21:43:17 +0000 (15:43 -0600)
* CI FreeBSD: Reenable some tests

* CI: Temporary patch for hostapd build

Build currently fails on LLVM with FreeBSD.

* CI FreeBSD: Cache the eapol_test build

.github/workflows/ci-freebsd.yml
scripts/ci/eapol_test-build.sh

index 219ce28c81c324950c66525117bb0cf65e84da29..cf0c93819ec4521341c90c099f01182f9be7510d 100644 (file)
@@ -7,6 +7,10 @@ on:
       - run-fuzzer**
   pull_request:
 
+env:
+  HOSTAPD_BUILD_DIR: eapol_test.ci
+  HOSTAPD_GIT_TAG: hostap_2_9
+
 jobs:
   freebsd-build:
 
@@ -38,13 +42,20 @@ jobs:
       run: git lfs pull
       working-directory: freeradius
 
+    - name: Restore eapol_test build directory from cache
+      uses: actions/cache@v2
+      id: hostapd-cache
+      with:
+        path: ${{ env.HOSTAPD_BUILD_DIR }}
+        key: hostapd-freebsd-${{ env.HOSTAPD_GIT_TAG }}-v4
+
     - name: Test using a FreeBSD VirtualBox VM
       uses: vmactions/freebsd-vm@v0.1.5
       with:
         usesh: true
-#        sync: sshfs
         sync: rsync
         mem: 4096
+        envs: 'HOSTAPD_BUILD_DIR HOSTAPD_GIT_TAG'
         prepare: |
           pkg install -y         \
             curl                 \
@@ -76,13 +87,8 @@ jobs:
           cd freeradius
           ./configure
           gmake -j `sysctl -n hw.ncpu`
-          # Disable some tests that are currently broken on FreeBSD
-          # Failing with: talloc type issue
-          echo                   > src/lib/server/trunk_tests.mk
           # Failing with: Failed to send packet for ID 123: udp_send failed: EINVAL: Invalid argument
           echo 'test.radclient:' > src/tests/radclient/all.mk
-          echo 'test.digest:'    > src/tests/digest/all.mk
-          echo 'test.radmin:'    > src/tests/radmin/all.mk
           gmake test
 
     #
index 03f756375332647b2f93927d45e6fe4df3124d58..0797d148539eae1e454cf752cbd85e6dba9eed10 100755 (executable)
@@ -89,6 +89,23 @@ if ! [ -e "${HOSTAPD_DIR}/.git" ] && ! git clone --branch "${HOSTAPD_GIT_TAG}" -
     exit 1
 fi
 
+#
+#  Required for LLVM builds until 2.10 which includes commit 12388313a0
+#
+patch -d "${TMP_BUILD_DIR}/hostapd" -p1 --ignore-whitespace <<'EOF'
+--- a/src/radius/radius_client.c
++++ b/src/radius/radius_client.c
+@@ -814,7 +814,7 @@ static void radius_client_receive(int sock, void *eloop_ctx, void *sock_ctx)
+ {
+        struct radius_client_data *radius = eloop_ctx;
+        struct hostapd_radius_servers *conf = radius->conf;
+-       RadiusType msg_type = (RadiusType) sock_ctx;
++       RadiusType msg_type = (uintptr_t) sock_ctx;
+        int len, roundtrip;
+        unsigned char buf[3000];
+        struct radius_msg *msg;
+EOF
+
 cp -n "$BUILD_CONF_FILE" "$WPA_SUPPLICANT_DIR/.config"
 
 if ! ${MAKE} -C "${WPA_SUPPLICANT_DIR}" -j8 eapol_test 1>&2 || [ ! -e "${WPA_SUPPLICANT_DIR}/eapol_test" ]; then