tests: backport mount_setattr test
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
5004732d8c
commit
8c85b08057
2 changed files with 7 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue