blob: d0dffcb9b33e50412b0e24584bacb223f3469a79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2016 SUSE Linux Products GmbH. All Rights Reserved.
#
# FSQA Test No. 337
#
# Test that the filesystem's implementation of the listxattrs system call lists
# all the xattrs an inode has.
#
. ./common/preamble
_begin_fstest auto quick attr metadata
# Import common functions.
. ./common/filter
. ./common/attr
# real QA test starts here
_supported_fs generic
_require_scratch
_require_attrs
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
# Create our test file with a few xattrs. The first 3 xattrs have a name that
# when given as input to a crc32c function result in the same checksum. This
# made btrfs list only one of the xattrs through listxattrs system call (because
# it packs xattrs with the same name checksum into the same btree item).
touch $SCRATCH_MNT/testfile
$SETFATTR_PROG -n user.foobar -v 123 $SCRATCH_MNT/testfile
$SETFATTR_PROG -n user.WvG1c1Td -v qwerty $SCRATCH_MNT/testfile
$SETFATTR_PROG -n user.J3__T_Km3dVsW_ -v hello $SCRATCH_MNT/testfile
$SETFATTR_PROG -n user.something -v pizza $SCRATCH_MNT/testfile
$SETFATTR_PROG -n user.ping -v pong $SCRATCH_MNT/testfile
# Now call getfattr with --dump, which calls the listxattrs system call.
# It should list all the xattrs we have set before.
_getfattr --absolute-names --dump $SCRATCH_MNT/testfile | _filter_scratch
status=0
exit
|