diff options
Diffstat (limited to 'fuse/test-fuse.sh')
-rwxr-xr-x | fuse/test-fuse.sh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/fuse/test-fuse.sh b/fuse/test-fuse.sh index 6d2f0fe0..0a429f73 100755 --- a/fuse/test-fuse.sh +++ b/fuse/test-fuse.sh @@ -1,6 +1,6 @@ #!/bin/bash - # libguestfs -# Copyright (C) 2009 Red Hat Inc. +# Copyright (C) 2009-2011 Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -92,15 +92,20 @@ $guestfish <<EOF run part-disk /dev/sda mbr mkfs ext2 /dev/sda1 - mount /dev/sda1 / + mount_options acl,user_xattr /dev/sda1 / write /hello.txt hello write /world.txt "hello world" touch /empty + touch /user_xattr + setxattr user.test hello123 8 /user_xattr + touch /acl + # XXX hack until libguestfs gets ACL support + debug sh "setfacl -m u:500:r /sysroot/acl" | cat > /dev/null EOF stage Mounting the filesystem $guestmount \ - -a "$image" -m /dev/sda1 \ + -a "$image" -m /dev/sda1:/:acl,user_xattr \ -o uid="$(id -u)" -o gid="$(id -g)" "$mp" # To debug guestmount, add this to the end of the preceding command: # -v -x & sleep 60 @@ -223,9 +228,22 @@ world bigger biggest" ] +stage 'Checking extended attribute (xattr) read operation' +if getfattr --help > /dev/null 2>&1 ; then + [ "$(getfattr -d user_xattr | grep -v ^#)" = 'user.test="hello123"' ] +fi + +stage Checking POSIX ACL read operation +if getfacl --help > /dev/null 2>&1 ; then + [ "$(getfacl -n acl | grep -v ^#)" = "user::rw- +user:500:r-- +group::r-- +mask::r-- +other::r--" ] +fi + # These ones are not yet tested by the current script: #stage XXX statfs/statvfs -#stage XXX xattr operations # These ones cannot easily be tested by the current script, eg because # this script doesn't run as root: |