]> ruderich.org/simon Gitweb - safcm/safcm.git/blobdiff - cmd/safcm-remote/ainsl/ainsl_test.go
Add basic support for FreeBSD
[safcm/safcm.git] / cmd / safcm-remote / ainsl / ainsl_test.go
index 2526dca0860da6685453c29e6e36e6d5dddfac98..8e9b0c121a268747d2a234dab0e1a045927fd55f 100644 (file)
@@ -20,6 +20,7 @@ import (
        "io/fs"
        "os"
        "path/filepath"
+       "runtime"
        "syscall"
        "testing"
 
@@ -53,6 +54,12 @@ func TestHandle(t *testing.T) {
        }
        _, uid, _, gid := ft.CurrentUserAndGroup()
 
+       symlinkExists := "open file: too many levels of symbolic links"
+       if runtime.GOOS == "freebsd" {
+               // EMLINK instead of ELOOP
+               symlinkExists = "open file: too many links"
+       }
+
        tests := []struct {
                name       string
                path       string
@@ -268,7 +275,7 @@ func TestHandle(t *testing.T) {
                                },
                        },
                        nil,
-                       fmt.Errorf("open file: too many levels of symbolic links"),
+                       fmt.Errorf(symlinkExists),
                },
                {
                        "exists: fifo",