]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/019: extend protofile test
authorCatherine Hoang <catherine.hoang@oracle.com>
Thu, 17 Mar 2022 23:24:08 +0000 (23:24 +0000)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 Apr 2022 15:27:21 +0000 (23:27 +0800)
This test creates an xfs filesystem and verifies that the filesystem
matches what is specified by the protofile.

This patch extends the current test to check that a protofile can
specify setgid mode on directories. Also, check that the created
symlink isn’t broken.

Signed-off-by: Catherine Hoang <catherine.hoang@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/019
tests/xfs/019.out

index 3dfd5408a54db316a65c4ad6ca78575e1c932d79..535b7af1a769e9fedb2d17c1867a05434f1ef537 100755 (executable)
@@ -73,6 +73,10 @@ $
 setuid -u-666 0 0 $tempfile
 setgid --g666 0 0 $tempfile
 setugid -ug666 0 0 $tempfile
+directory_setgid d-g755 3 2
+file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_5 ---755 3 1 $tempfile
+$
+: back in the root
 block_device b--012 3 1 161 162 
 char_device c--345 3 1 177 178
 pipe p--670 0 0
@@ -114,6 +118,8 @@ _verify_fs()
                | xargs $here/src/lstat64 | _filter_stat)
        diff -q $SCRATCH_MNT/bigfile $tempfile.2 \
                || _fail "bigfile corrupted"
+       diff -q $SCRATCH_MNT/symlink $tempfile.2 \
+               || _fail "symlink broken"
 
        echo "*** unmount FS"
        _full "umount"
index 19614d9d4103717ca43a012e578ce033f44ad54f..8584f593e96c615218ff7cfad7a400920258b6c6 100644 (file)
@@ -7,7 +7,7 @@ Wrote 2048.00Kb (value 0x2c)
  File: "."
  Size: <DSIZE> Filetype: Directory
  Mode: (0777/drwxrwxrwx) Uid: (3) Gid: (1)
-Device: <DEVICE> Inode: <INODE> Links: 3 
+Device: <DEVICE> Inode: <INODE> Links: 4 
 
  File: "./bigfile"
  Size: 2097152 Filetype: Regular File
@@ -54,6 +54,16 @@ Device: <DEVICE> Inode: <INODE> Links: 1
  Mode: (0755/-rwxr-xr-x) Uid: (3) Gid: (1)
 Device: <DEVICE> Inode: <INODE> Links: 1 
 
+ File: "./directory_setgid"
+ Size: <DSIZE> Filetype: Directory
+ Mode: (2755/drwxr-sr-x) Uid: (3) Gid: (2)
+Device: <DEVICE> Inode: <INODE> Links: 2 
+
+ File: "./directory_setgid/file_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_5"
+ Size: 5 Filetype: Regular File
+ Mode: (0755/-rwxr-xr-x) Uid: (3) Gid: (2)
+Device: <DEVICE> Inode: <INODE> Links: 1 
+
  File: "./pipe"
  Size: 0 Filetype: Fifo File
  Mode: (0670/frw-rwx---) Uid: (0) Gid: (0)