tests: remount before ncpfs smoke setup
All checks were successful
Source release / source-package (push) Successful in 1m14s

This commit is contained in:
OpenAI
2026-06-10 21:05:06 +00:00
committed by Mario Fetka
parent d3ec80814e
commit 66ecec74a3

View File

@@ -17,6 +17,7 @@ if [ "$#" -lt 4 ]; then
echo "Set NWFS_NCPFS_DOSINFO_GRANT_OBJECT/TYPE/RIGHTS to grant temporary rights for DOS info mutation/readback; default: EVERYONE/2/[FMA]. Set object empty to skip." >&2
echo "Set NWFS_NCPFS_DOSINFO_USER/PASSWORD to verify IRM NCP readback as a non-SUPERVISOR user; default: NOPASSUSER with no password. Set user empty to skip." >&2
echo "Set NWFS_NCPFS_DOSINFO_REMOUNT=0 to avoid clean supervisor/non-supervisor remounts around DOS info/IRM checks. Default is 1." >&2
echo "Set NWFS_NCPFS_PREP_REMOUNT=0 to reuse an existing primary mount during initial reset/create. Default is 1." >&2
echo "Set NWFS_NCPFS_RESET_TESTDIR=0 to keep an existing test directory. Default is 1 and removes TESTDIR before the smoke." >&2
echo "Set NWFS_NCPFS_HOST_RESET_TESTDIR=0 to forbid host-side reset fallback when NCPFS cannot create at the volume root. Default is 1." >&2
echo "Set NWFS_NCPFS_DIR_QUOTA_4K to override the directory quota limit; set it empty to skip. Directory quota is off by default for NetWare 3.x/4.x smoke." >&2
@@ -66,6 +67,7 @@ DOSINFO_RIGHTS_GRANTED=0
DOSINFO_MOUNTED_BY_SCRIPT=0
DOSINFO_CLEAN_MOUNT=0
DOSINFO_REMOUNT=${NWFS_NCPFS_DOSINFO_REMOUNT:-1}
PREP_REMOUNT=${NWFS_NCPFS_PREP_REMOUNT:-1}
VERIFY_ACL=${NWFS_NCPFS_VERIFY_ACL:-auto}
MKDIR_ERR=$(mktemp "${TMPDIR:-/tmp}/nwfs_ncpfs_mkdir.XXXXXX")
WRITE_ERR=$(mktemp "${TMPDIR:-/tmp}/nwfs_ncpfs_write.XXXXXX")
@@ -317,6 +319,34 @@ ncpfs_mount_path() {
fi
}
remount_primary_supervisor() {
reason=$1
echo "remounting $MOUNTPOINT as $USER $reason" >&2
ncpfs_umount_path "$MOUNTPOINT"
ncpfs_mount_path "$USER" "$PASSWORD" "$MOUNTPOINT"
MOUNTED_BY_SCRIPT=1
}
ensure_primary_supervisor_mount_for_prep() {
case "$PREP_REMOUNT" in
1|yes|true|on)
remount_primary_supervisor "before test directory reset/create"
;;
0|no|false|off)
if mountpoint -q "$MOUNTPOINT" 2>/dev/null; then
echo "using existing NCP mount at $MOUNTPOINT" >&2
else
ncpfs_mount_path "$USER" "$PASSWORD" "$MOUNTPOINT"
MOUNTED_BY_SCRIPT=1
fi
;;
*)
echo "invalid NWFS_NCPFS_PREP_REMOUNT=$PREP_REMOUNT" >&2
exit 2
;;
esac
}
remount_primary_supervisor_for_dosinfo() {
case "$DOSINFO_REMOUNT" in
1|yes|true|on) ;;
@@ -327,10 +357,7 @@ remount_primary_supervisor_for_dosinfo() {
;;
esac
echo "remounting $MOUNTPOINT as $USER before DOS info mutation" >&2
ncpfs_umount_path "$MOUNTPOINT"
ncpfs_mount_path "$USER" "$PASSWORD" "$MOUNTPOINT"
MOUNTED_BY_SCRIPT=1
remount_primary_supervisor "before DOS info mutation"
}
remount_dosinfo_user_for_readback() {
@@ -375,10 +402,7 @@ remount_primary_supervisor_after_dosinfo_readback() {
;;
esac
echo "remounting $MOUNTPOINT as $USER after DOS info readback" >&2
ncpfs_umount_path "$MOUNTPOINT"
ncpfs_mount_path "$USER" "$PASSWORD" "$MOUNTPOINT"
MOUNTED_BY_SCRIPT=1
remount_primary_supervisor "after DOS info readback"
}
grant_dosinfo_rights_if_needed() {
@@ -458,12 +482,7 @@ mount_dosinfo_user_if_requested() {
DOSINFO_NCP_TEST_PATH=$DOSINFO_MOUNTPOINT/$TESTDIR
}
if mountpoint -q "$MOUNTPOINT" 2>/dev/null; then
echo "using existing NCP mount at $MOUNTPOINT" >&2
else
ncpfs_mount_path "$USER" "$PASSWORD" "$MOUNTPOINT"
MOUNTED_BY_SCRIPT=1
fi
ensure_primary_supervisor_mount_for_prep
NCP_TEST_PATH=$MOUNTPOINT/$TESTDIR
HOST_TEST_PATH=$SYSROOT/$TESTDIR
@@ -498,10 +517,18 @@ else
echo "cannot create $NW_TEST_PATH through NCPFS at $MOUNTPOINT" >&2
cat "$MKDIR_ERR" >&2 || true
if [ "$RESET_TESTDIR" = 1 ] || [ "$RESET_TESTDIR" = yes ] || [ "$RESET_TESTDIR" = true ] || [ "$RESET_TESTDIR" = on ]; then
if host_reset_testdir && [ -d "$NCP_TEST_PATH" ]; then
echo "created $NW_TEST_PATH host-side because NCPFS create was denied" >&2
if host_reset_testdir; then
remount_primary_supervisor "after host-side test directory reset"
if [ -d "$NCP_TEST_PATH" ]; then
echo "created $NW_TEST_PATH host-side because NCPFS create was denied" >&2
else
echo "The server was reached, but the NCP create was denied and host-side reset did not make the path visible." >&2
echo "Try passing a writable relative SYS path, e.g.:" >&2
echo " $0 $SERVER $USER '***' $SYSROOT $MOUNTPOINT SYSTEM/NWFSTEST $VOLUME" >&2
exit 1
fi
else
echo "The server was reached, but the NCP create was denied and host-side reset did not make the path visible." >&2
echo "The server was reached, but the NCP create was denied and host-side reset is disabled or failed." >&2
echo "Try passing a writable relative SYS path, e.g.:" >&2
echo " $0 $SERVER $USER '***' $SYSROOT $MOUNTPOINT SYSTEM/NWFSTEST $VOLUME" >&2
exit 1