]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
FreeBSD fixes and CI (#4177)
authorTerry Burton <tez@terryburton.co.uk>
Mon, 9 Aug 2021 22:59:18 +0000 (23:59 +0100)
committerGitHub <noreply@github.com>
Mon, 9 Aug 2021 22:59:18 +0000 (16:59 -0600)
.github/workflows/ci-freebsd.yml
src/lib/util/debug.c

index b0e66fbe5e63c011818b5e4b9e921479d7615f5a..251d630dfd6be9323c1b6faba5fd18791b08ba62 100644 (file)
@@ -3,7 +3,7 @@ name: CI FreeBSD
 on:
   push:
     branches:
-      - packaging_test
+      - ci-debug
   schedule:
     - cron: '0 20 * * *'
 
@@ -39,9 +39,10 @@ jobs:
       working-directory: freeradius
 
     - name: Test using a FreeBSD VirtualBox VM
-      uses: vmactions/freebsd-vm@v0.0.9
+      uses: vmactions/freebsd-vm@v0.1.5
       with:
         usesh: true
+        sync: sshfs
         prepare: |
           pkg install -y         \
             curl                 \
@@ -63,7 +64,7 @@ jobs:
             net-snmp             \
             openldap-client      \
             python3              \
-            py37-pip             \
+            py38-pip             \
             postgresql12-client  \
             talloc               \
             unixODBC
@@ -81,3 +82,38 @@ jobs:
           echo 'test.digest:'    > src/tests/digest/all.mk
           echo 'test.radmin:'    > src/tests/radmin/all.mk
           gmake test
+
+    #
+    #  If the CI has failed and the branch is ci-debug then we start a tmate
+    #  session to provide interactive shell access to the session.
+    #
+    #  The SSH rendezvous point will be emited continuously in the job output,
+    #  which will look something like:
+    #
+    #      SSH: ssh VfuX8SrNuU5pGPMyZcz7TpJTa@sfo2.tmate.io
+    #
+    #  For example:
+    #
+    #      git push origin ci-debug --force
+    #
+    #  Look at the job output in: https://github.com/FreeRADIUS/freeradius-server/actions
+    #
+    #      ssh VfuX8SrNuU5pGPMyZcz7TpJTa@sfo2.tmate.io
+    #
+    #  Access requires that you have the private key corresponding to the
+    #  public key of the GitHub user that initiated the job.
+    #
+    #  The above will open a shell for the MacOS environment on which the
+    #  FreeBSD VM is running within VirtualBox.
+    #
+    #  Access the FreeBSD VM with:
+    #
+    #      ssh -t freebsd
+    #
+    - name: "Debug: Start tmate"
+      uses: mxschmitt/action-tmate@v3
+      with:
+        limit-access-to-actor: true
+        repo-token: ${{ secrets.GITHUB_TOKEN }}
+      if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }}
+
index ea7061560de449ba49110d918b519aca146aa006..67eda5cff205fa6ecbb384a8fcb50c794c39e60c 100644 (file)
@@ -274,13 +274,13 @@ int fr_get_lsan_state(void)
 #endif
 
 #if defined(HAVE_SYS_PROCCTL_H)
-static int fr_get_debug_state(void)
+int fr_get_debug_state(void)
 {
        int status;
 
        if (procctl(P_PID, getpid(), PROC_TRACE_STATUS, &status) == -1) {
                fr_strerror_printf("Cannot get dumpable flag: procctl(PROC_TRACE_STATUS) failed: %s", fr_syserror(errno));
-               return DEBUG_STATE_UNKNOWN;
+               return DEBUGGER_STATE_UNKNOWN;
        }
 
        /*
@@ -292,9 +292,9 @@ static int fr_get_debug_state(void)
         *      the ptrace(2) syscall, data is set to 0.  If a debugger is attached,
         *      data is set to the pid of the debugger process.
         */
-       if (status <= 0) return DEBUG_STATE_NOT_ATTACHED;
+       if (status <= 0) return DEBUGGER_STATE_NOT_ATTACHED;
 
-       return DEBUG_STATE_ATTACHED;
+       return DEBUGGER_STATE_ATTACHED;
 }
 #elif defined(__APPLE__)
 /** The ptrace_attach() method no longer works as of macOS 11.4 (we always get eperm)