From: Karel Zak Date: Mon, 5 Jun 2023 10:48:34 +0000 (+0200) Subject: tests: backport mount_setattr test X-Git-Tag: v2.39.1~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c85b08057a4664efe856de49b798b87a4e091af;p=thirdparty%2Futil-linux.git tests: backport mount_setattr test Signed-off-by: Karel Zak --- diff --git a/tests/helpers/test_enosys.c b/tests/helpers/test_enosys.c index 74d96196c8..9e93cc27f1 100644 --- a/tests/helpers/test_enosys.c +++ b/tests/helpers/test_enosys.c @@ -47,6 +47,10 @@ const struct syscall syscalls[] = { #ifdef __NR_fsopen { "fsopen", __NR_fsopen }, #endif +#ifdef __NR_mount_setattr + { "mount_setattr", __NR_mount_setattr }, +#endif + }; int main(int argc, char **argv) diff --git a/tests/ts/mount/fallback b/tests/ts/mount/fallback index bb51f3b03f..e2a1de77f6 100755 --- a/tests/ts/mount/fallback +++ b/tests/ts/mount/fallback @@ -10,7 +10,7 @@ ts_check_test_command "$TS_CMD_MOUNT" ts_check_test_command "$TS_CMD_UMOUNT" ts_check_test_command "$TS_CMD_FINDMNT" ts_check_test_command "$TS_CMD_LOSETUP" -ts_check_enosys_syscalls open_tree fsopen +ts_check_enosys_syscalls open_tree fsopen mount_setattr ts_skip_nonroot @@ -69,12 +69,12 @@ ts_finalize_subtest ts_init_subtest "mount_setattr" "$TS_CMD_MOUNT" "$DEVICE" "$MOUNTPOINT" >> $TS_OUTPUT 2>> $TS_ERRLOG ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" -$TS_CMD_ENOSYS -s mount_setattr -- \ +$TS_HELPER_ENOSYS -s mount_setattr -- \ "$TS_CMD_MOUNT" -o remount,ro "$MOUNTPOINT" \ >> $TS_OUTPUT 2>> $TS_ERRLOG $TS_CMD_FINDMNT --kernel --mountpoint "$MOUNTPOINT" --options "ro" &> /dev/null [ "$?" == "0" ] || ts_die "Cannot find read-only in $MOUNTPOINT in /proc/self/mountinfo" -$TS_CMD_ENOSYS -s mount_setattr -- \ +$TS_HELPER_ENOSYS -s mount_setattr -- \ "$TS_CMD_MOUNT" --make-slave "$MOUNTPOINT" \ >> $TS_OUTPUT 2>> $TS_ERRLOG $TS_CMD_FINDMNT -n --kernel --mountpoint "$MOUNTPOINT" -o PROPAGATION >> $TS_OUTPUT