summaryrefslogtreecommitdiff
path: root/tests/generic/307
blob: c4e213e10db417784110acea48d3fc23f34ee488 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
#
# FS QA Test No. 307
#
# Check if ctime is updated and written to disk after setfacl
#
# Regression test for the following extN commits
# c6ac12a ext4: update ctime when changing the file's permission by setfacl
# 30e2bab ext3: update ctime when changing the file's permission by setfacl
# 523825b ext2: update ctime when changing the file's permission by setfacl
#
# Based on test 277
#
. ./common/preamble
_begin_fstest auto quick acl

# Override the default cleanup function.
_cleanup()
{
	cd /
	rm -f $testfile
}

# Import common functions.
. ./common/filter
. ./common/attr

testfile=$SCRATCH_MNT/testfile.$seq

# real QA test starts here
_supported_fs generic
_require_scratch
_require_acls

echo "Silence is golden"

_scratch_mkfs >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1

touch $testfile
_scratch_cycle_mount
ctime1=`stat -c %Z $testfile`

sleep 1
setfacl -m 'u::x,g::x,o::x' $testfile
ctime2=`stat -c %Z $testfile`

_scratch_cycle_mount
ctime3=`stat -c %Z $testfile`

if [ "$ctime1" == "$ctime2" ]; then
	echo "error: ctime not updated after setfacl"
elif [ "$ctime1" == "$ctime3" ]; then
	echo "error: on disk ctime not updated"
else
	status=0
fi

exit