test code v1
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# Test Case: Write, Truncate, and Create Rejection
|
||||
|
||||
**Test ID**: TC063-setattr-write-reject
|
||||
**Category**: Read-Only Enforcement
|
||||
**Priority**: Critical
|
||||
|
||||
## Objective
|
||||
|
||||
Verify direct open-for-write, truncate, and create requests return EROFS and
|
||||
leave the mounted tree unchanged.
|
||||
|
||||
## Procedure
|
||||
|
||||
Mount vfs/vfs-plain.erofs and run:
|
||||
|
||||
sha256 /tmp/repo22-g3/mnt/testdir/file.txt > TC063-before.txt
|
||||
./g3_vfs_probe expect-error open-rdwr \
|
||||
/tmp/repo22-g3/mnt/testdir/file.txt 30
|
||||
./g3_vfs_probe expect-error truncate \
|
||||
/tmp/repo22-g3/mnt/testdir/file.txt 30
|
||||
./g3_vfs_probe expect-error create \
|
||||
/tmp/repo22-g3/mnt/testdir/newfile.txt 30
|
||||
sha256 /tmp/repo22-g3/mnt/testdir/file.txt > TC063-after.txt
|
||||
cmp TC063-before.txt TC063-after.txt
|
||||
test ! -e /tmp/repo22-g3/mnt/testdir/newfile.txt
|
||||
|
||||
## Expected Results
|
||||
|
||||
All mutation syscalls report errno 30, the file hash is unchanged, and no new
|
||||
entry exists. Record output and cleanup.
|
||||
Reference in New Issue
Block a user