aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnkush Patel2026-02-05 14:42:40 +1300
committerJakob Unterwurzacher2026-03-08 21:35:59 +0100
commit4fa21dcb57c5a0b7761bfec606ffd0e94c293ce8 (patch)
treebac9fd670706e64f1624183b1ba946d4b966bb19 /tests
parent7bf3a3edf6ce940abf42054daa09de8e8cf9d083 (diff)
Added basic support for FreeBSD.
Freebsd-support: Change bash shebang to use /usr/bin/env Freebsd-support: Fix go vet "undefined" fixes when running make ci freebsd: stub xattr functions /proc/PID/fd does not exist on freebsd. freebsd-support: modify FchmodatNofollow for FreeBSD FreeBSD supports the Fchmodat system call, with the AT_SYMLINK_NOFOLLOW flag. FchmodatNofollow has been modified to use this system call and flag. freebsd-support: PR changes and fixes * Functions in fusefrontend_reverse/node_xattr_freebsd.go have been stubbed for now. * asuser_freebsd.go updated to only run f() when context is nil; otherwise log a warning and return an error. * emulate.go build flags updated, and FreeBSD specific version added. * sys_freebsd.go bug in Renameat2 with RENAME_EXCHANGE flag fixed. FreeBSD does not support atomic file swapping, so this flag now returns an error. * unix2syscall and atime is identical between FreeBSD and Darwin, updated filenames so Go will build the file for FreeBSD and Mac OS. freebsd-support: Addressed more PR comments and fixed build tags
Diffstat (limited to 'tests')
-rwxr-xr-xtests/canonical-benchmarks.bash3
-rwxr-xr-xtests/dl-linux-tarball.bash4
-rwxr-xr-xtests/fuse-unmount.bash5
-rw-r--r--tests/matrix/atime_darwin+freebsd.go (renamed from tests/matrix/atime_darwin.go)2
-rwxr-xr-xtests/reverse/linux-tarball-test.bash2
-rwxr-xr-xtests/sshfs-benchmark.bash2
-rwxr-xr-xtests/stress_tests/extractloop.bash2
-rwxr-xr-xtests/stress_tests/fsstress-gocryptfs.bash2
-rwxr-xr-xtests/stress_tests/pingpong.bash2
9 files changed, 16 insertions, 8 deletions
diff --git a/tests/canonical-benchmarks.bash b/tests/canonical-benchmarks.bash
index 4c1a357..963fd6a 100755
--- a/tests/canonical-benchmarks.bash
+++ b/tests/canonical-benchmarks.bash
@@ -1,4 +1,4 @@
-#!/bin/bash -eu
+#!/usr/bin/env bash
#
# Run the set of "canonical" benchmarks that are shown on
# https://nuetzlich.net/gocryptfs/comparison/
@@ -6,6 +6,7 @@
#
# This is called by the top-level script "benchmark.bash".
+set -eu
MYNAME=$(basename "$0")
diff --git a/tests/dl-linux-tarball.bash b/tests/dl-linux-tarball.bash
index 03c0e7d..3c325db 100755
--- a/tests/dl-linux-tarball.bash
+++ b/tests/dl-linux-tarball.bash
@@ -1,8 +1,10 @@
-#!/bin/bash -eu
+#!/usr/bin/env bash
#
# This script checks the size of /tmp/linux-3.0.tar.gz and downloads
# a fresh copy if the size is incorrect or the file is missing.
+set -eu
+
URL=https://cdn.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz
TGZ=/tmp/linux-3.0.tar.gz
diff --git a/tests/fuse-unmount.bash b/tests/fuse-unmount.bash
index b36f28c..02c6e4c 100755
--- a/tests/fuse-unmount.bash
+++ b/tests/fuse-unmount.bash
@@ -1,10 +1,13 @@
-#!/bin/bash -eu
+#!/usr/bin/env bash
#
# Compatibility wrapper around "fusermount" on Linux and "umount" on
# Mac OS X and friends.
#
# This script can be sourced or executed directly.
#
+
+set -eu
+
fuse-unmount() {
local MYNAME=$(basename "$BASH_SOURCE")
if [[ $# -eq 0 ]] ; then
diff --git a/tests/matrix/atime_darwin.go b/tests/matrix/atime_darwin+freebsd.go
index 5f89c69..43db0d5 100644
--- a/tests/matrix/atime_darwin.go
+++ b/tests/matrix/atime_darwin+freebsd.go
@@ -1,3 +1,5 @@
+//go:build darwin || freebsd
+
package matrix
import (
diff --git a/tests/reverse/linux-tarball-test.bash b/tests/reverse/linux-tarball-test.bash
index 4054c29..27afa23 100755
--- a/tests/reverse/linux-tarball-test.bash
+++ b/tests/reverse/linux-tarball-test.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -eu
diff --git a/tests/sshfs-benchmark.bash b/tests/sshfs-benchmark.bash
index 4695f8d..2421f20 100755
--- a/tests/sshfs-benchmark.bash
+++ b/tests/sshfs-benchmark.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
set -eu
diff --git a/tests/stress_tests/extractloop.bash b/tests/stress_tests/extractloop.bash
index 1f78a5e..714d2d7 100755
--- a/tests/stress_tests/extractloop.bash
+++ b/tests/stress_tests/extractloop.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Mount a gocryptfs filesystem somewhere on /tmp, then run two parallel
# infinite loops inside that do the following:
diff --git a/tests/stress_tests/fsstress-gocryptfs.bash b/tests/stress_tests/fsstress-gocryptfs.bash
index e6c3281..7e3f160 100755
--- a/tests/stress_tests/fsstress-gocryptfs.bash
+++ b/tests/stress_tests/fsstress-gocryptfs.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Mount a gocryptfs filesystem in /var/tmp and run fsstress against it
# in an infinite loop, only exiting on errors.
diff --git a/tests/stress_tests/pingpong.bash b/tests/stress_tests/pingpong.bash
index d0d21b3..4fd5ff2 100755
--- a/tests/stress_tests/pingpong.bash
+++ b/tests/stress_tests/pingpong.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Mounts two gocryptfs filesystems, "ping" and "pong" and moves the
# linux-3.0 kernel tree back and forth between them, checking integrity