xref: /openbsd/regress/sys/ffs/tests/symlink/10.t (revision 09467b48)
1#!/bin/sh
2# $FreeBSD: src/tools/regression/fstest/tests/symlink/10.t,v 1.1 2007/01/17 01:42:11 pjd Exp $
3
4desc="symlink returns EROFS if the file name2 would reside on a read-only file system"
5
6n0=`namegen`
7n1=`namegen`
8n2=`namegen`
9
10expect 0 mkdir ${n0} 0755
11dd if=/dev/zero of=tmpdisk bs=1k count=1024 status=none
12vnconfig vnd1 tmpdisk
13newfs /dev/rvnd1c >/dev/null
14mount /dev/vnd1c ${n0}
15
16expect 0 symlink test ${n0}/${n1}
17expect 0 unlink ${n0}/${n1}
18mount -ur /dev/vnd1c
19expect EROFS symlink test ${n0}/${n1}
20mount -uw /dev/vnd1c
21expect 0 symlink test ${n0}/${n1}
22expect 0 unlink ${n0}/${n1}
23
24umount /dev/vnd1c
25vnconfig -u vnd1
26rm tmpdisk
27expect 0 rmdir ${n0}
28