File tree Expand file tree Collapse file tree 15 files changed +158
-0
lines changed Expand file tree Collapse file tree 15 files changed +158
-0
lines changed Original file line number Diff line number Diff line change
1
+ Tests with consistent results are provided in the selftest folder.
2
+ Since many people develop testing infrastructure around xfstests,
3
+ these tests are helpful to confirm the testing setup is working as
4
+ expected.
5
+
6
+ The provided tests include:
7
+ selftest/001 - pass
8
+ selftest/002 - fail from output mismatch
9
+ selftest/003 - fail via _fail
10
+ selftest/004 - skip
11
+ selftest/005 - crash
12
+ selftest/006 - hang
13
+
14
+ Two groups are used for these tests: selftest and dangerous_selftest.
15
+ selftest/00[1-4] are in the selftest group and selftest/00[5-6] are
16
+ in the dangerous_selftest group.
17
+
18
+ The selftest will only be run if explicitly speficied. To run the
19
+ selftest, you can specify individual tests, e.g.
20
+
21
+ # ./check selftest/001
22
+
23
+ or use the groups under selftest/, e.g.
24
+
25
+ # ./check -g selftest/selftest
26
+ # ./check -g selftest/dangerous_selftest
27
+
28
+ Note, you cannot use the group names without including the folder name
29
+ (ie. "-g selftest").
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ dangerous_fsstress_repair race fsstress and xfs_scrub online repair
38
38
dangerous_fsstress_scrub race fsstress and xfs_scrub checking
39
39
dangerous_repair fuzzers to evaluate xfs_repair offline repair
40
40
dangerous_scrub fuzzers to evaluate xfs_scrub checking
41
+ dangerous_selftest selftests that crash/hang
41
42
data data loss checkers
42
43
dax direct access mode for persistent memory files
43
44
db xfs_db functional tests
@@ -111,6 +112,7 @@ samefs overlayfs when all layers are on the same fs
111
112
scrub filesystem metadata scrubbers
112
113
seed btrfs seeded filesystems
113
114
seek llseek functionality
115
+ selftest tests with fixed results, used to validate testing setup
114
116
send btrfs send/receive
115
117
shrinkfs decreasing the size of a filesystem
116
118
shutdown FS_IOC_SHUTDOWN ioctl
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # SPDX-License-Identifier: GPL-2.0
3
+ #
4
+ # FS QA Test No. 001
5
+ #
6
+ # A test that should always pass
7
+ #
8
+ . ./common/preamble
9
+ _begin_fstest selftest
10
+
11
+ echo " Silence is golden"
12
+ status=0
13
+ exit
Original file line number Diff line number Diff line change
1
+ QA output created by 001
2
+ Silence is golden
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # SPDX-License-Identifier: GPL-2.0
3
+ #
4
+ # FS QA Test No. 002
5
+ #
6
+ # A test that should always fail due to output mismatch
7
+ #
8
+ . ./common/preamble
9
+ _begin_fstest selftest
10
+
11
+ echo " I am intentionally broken"
12
+ status=0
13
+ exit
Original file line number Diff line number Diff line change
1
+ QA output created by 002
2
+ Silence is golden
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # SPDX-License-Identifier: GPL-2.0
3
+ #
4
+ # FS QA Test No. 003
5
+ #
6
+ # A test that _fail's
7
+ #
8
+
9
+ . ./common/preamble
10
+ _begin_fstest selftest
11
+
12
+ _fail " I have _fail'ed"
13
+
14
+ status=0
15
+ exit
Original file line number Diff line number Diff line change
1
+ QA output created by 003
2
+ Silence is golden
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # SPDX-License-Identifier: GPL-2.0
3
+ #
4
+ # FS QA Test No. 004
5
+ #
6
+ # A test that should always be skipped
7
+ #
8
+ . ./common/preamble
9
+ _begin_fstest selftest
10
+
11
+ _notrun " Always skip me"
12
+
13
+ echo " I should be skipped"
14
+ status=0
15
+ exit
Original file line number Diff line number Diff line change
1
+ QA output created by 004
2
+ Silence is golden
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # SPDX-License-Identifier: GPL-2.0
3
+ #
4
+ # FS QA Test No. 005
5
+ #
6
+ # A test that crashes
7
+ #
8
+ . ./common/preamble
9
+ _begin_fstest dangerous_selftest
10
+
11
+ echo 1 > /proc/sys/kernel/sysrq
12
+ echo c > /proc/sysrq-trigger
13
+
14
+ echo " I should have crashed by now"
15
+ status=0
16
+ exit
Original file line number Diff line number Diff line change
1
+ QA output created by 005
2
+ Silence is golden
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # SPDX-License-Identifier: GPL-2.0
3
+ #
4
+ # FS QA Test No. 006
5
+ #
6
+ # A test that hangs
7
+ #
8
+
9
+ . ./common/preamble
10
+ _begin_fstest dangerous_selftest
11
+
12
+ while :
13
+ do
14
+ sleep 1d
15
+ done
16
+
17
+ echo " I should still be sleeping"
18
+ status=0
19
+ exit
Original file line number Diff line number Diff line change
1
+ QA output created by 006
2
+ Silence is golden
Original file line number Diff line number Diff line change
1
+ #
2
+ # Copyright (c) 2023 Google, Inc. All Rights Reserved.
3
+ #
4
+
5
+ TOPDIR = ../..
6
+ include $(TOPDIR ) /include/builddefs
7
+ include $(TOPDIR ) /include/buildgrouplist
8
+
9
+ SELFTEST_DIR = selftest
10
+ TARGET_DIR = $(PKG_LIB_DIR ) /$(TESTS_DIR ) /$(SELFTEST_DIR )
11
+ DIRT = group.list
12
+
13
+ default : $(DIRT )
14
+
15
+ include $(BUILDRULES )
16
+
17
+ install :
18
+ $(INSTALL ) -m 755 -d $(TARGET_DIR )
19
+ $(INSTALL ) -m 755 $(TESTS ) $(TARGET_DIR )
20
+ $(INSTALL ) -m 644 group.list $(TARGET_DIR )
21
+ $(INSTALL ) -m 644 $(OUTFILES ) $(TARGET_DIR )
22
+
23
+ # Nothing.
24
+ install-dev install-lib :
You can’t perform that action at this time.
0 commit comments