From 7e98d41a6e009f348cd328e4b3bda2fd4352b94e Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 21 Jun 2021 08:55:09 -0700 Subject: [PATCH] fstests: move test group info to test files Refactor every test in the entire test suite to use the new boilerplate functions. This also migrates all the test group information into the test files. This patch has been autogenerated via the command: ./tools/convert-group btrfs ceph cifs ext4 f2fs generic nfs ocfs2 overlay perf shared udf xfs Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Eric Biggers Signed-off-by: Eryu Guan --- tests/btrfs/001 | 19 +++---------------- tests/btrfs/002 | 19 +++---------------- tests/btrfs/003 | 15 ++++----------- tests/btrfs/004 | 15 ++++----------- tests/btrfs/005 | 21 +++------------------ tests/btrfs/006 | 21 +++------------------ tests/btrfs/007 | 14 ++++---------- tests/btrfs/008 | 15 ++++----------- tests/btrfs/009 | 22 +++------------------- tests/btrfs/010 | 14 +++----------- tests/btrfs/011 | 14 ++++---------- tests/btrfs/012 | 23 ++++------------------- tests/btrfs/013 | 22 +++------------------- tests/btrfs/014 | 10 ++-------- tests/btrfs/015 | 22 +++------------------- tests/btrfs/016 | 13 ++++--------- tests/btrfs/017 | 21 +++------------------ tests/btrfs/018 | 22 +++------------------- tests/btrfs/019 | 15 ++++----------- tests/btrfs/020 | 17 ++++------------- tests/btrfs/021 | 21 +++------------------ tests/btrfs/022 | 21 +++------------------ tests/btrfs/023 | 20 +++----------------- tests/btrfs/024 | 20 +++----------------- tests/btrfs/025 | 14 ++++---------- tests/btrfs/026 | 19 +++---------------- tests/btrfs/027 | 22 +++------------------- tests/btrfs/028 | 22 +++------------------- tests/btrfs/029 | 21 +++------------------ tests/btrfs/030 | 14 ++++---------- tests/btrfs/031 | 21 +++------------------ tests/btrfs/032 | 19 +++---------------- tests/btrfs/033 | 22 +++------------------- tests/btrfs/034 | 14 ++++---------- tests/btrfs/035 | 19 +++---------------- tests/btrfs/036 | 17 ++++------------- tests/btrfs/037 | 14 ++++---------- tests/btrfs/038 | 13 ++++--------- tests/btrfs/039 | 13 ++++--------- tests/btrfs/040 | 13 ++++--------- tests/btrfs/041 | 15 ++++----------- tests/btrfs/042 | 21 +++------------------ tests/btrfs/043 | 13 ++++--------- tests/btrfs/044 | 13 ++++--------- tests/btrfs/045 | 13 ++++--------- tests/btrfs/046 | 12 ++++-------- tests/btrfs/047 | 24 ++++-------------------- tests/btrfs/048 | 16 ++++------------ tests/btrfs/049 | 17 ++++------------- tests/btrfs/050 | 14 ++++---------- tests/btrfs/051 | 14 ++++---------- tests/btrfs/052 | 15 ++++----------- tests/btrfs/053 | 14 ++++---------- tests/btrfs/054 | 14 ++++---------- tests/btrfs/055 | 15 ++++----------- tests/btrfs/056 | 15 ++++----------- tests/btrfs/057 | 23 ++++------------------- tests/btrfs/058 | 15 ++++----------- tests/btrfs/059 | 17 ++++------------- tests/btrfs/060 | 21 +++------------------ tests/btrfs/061 | 21 +++------------------ tests/btrfs/062 | 21 +++------------------ tests/btrfs/063 | 21 +++------------------ tests/btrfs/064 | 21 +++------------------ tests/btrfs/065 | 21 +++------------------ tests/btrfs/066 | 21 +++------------------ tests/btrfs/067 | 21 +++------------------ tests/btrfs/068 | 21 +++------------------ tests/btrfs/069 | 21 +++------------------ tests/btrfs/070 | 21 +++------------------ tests/btrfs/071 | 21 +++------------------ tests/btrfs/072 | 21 +++------------------ tests/btrfs/073 | 21 +++------------------ tests/btrfs/074 | 21 +++------------------ tests/btrfs/075 | 15 ++++----------- tests/btrfs/076 | 17 ++++------------- tests/btrfs/077 | 12 ++++-------- tests/btrfs/078 | 13 ++++--------- tests/btrfs/079 | 15 ++++----------- tests/btrfs/080 | 14 ++++---------- tests/btrfs/081 | 18 +++--------------- tests/btrfs/082 | 19 +++---------------- tests/btrfs/083 | 14 ++++---------- tests/btrfs/084 | 14 ++++---------- tests/btrfs/085 | 17 ++++------------- tests/btrfs/086 | 19 +++---------------- tests/btrfs/087 | 14 ++++---------- tests/btrfs/088 | 19 +++---------------- tests/btrfs/089 | 23 ++++------------------- tests/btrfs/090 | 21 +++------------------ tests/btrfs/091 | 20 +++----------------- tests/btrfs/092 | 14 ++++---------- tests/btrfs/093 | 19 +++---------------- tests/btrfs/094 | 15 ++++----------- tests/btrfs/095 | 15 ++++----------- tests/btrfs/096 | 18 +++--------------- tests/btrfs/097 | 14 ++++---------- tests/btrfs/098 | 15 ++++----------- tests/btrfs/099 | 21 +++------------------ tests/btrfs/100 | 18 ++++-------------- tests/btrfs/101 | 18 ++++-------------- tests/btrfs/102 | 20 ++++---------------- tests/btrfs/103 | 19 +++---------------- tests/btrfs/104 | 24 +++--------------------- tests/btrfs/105 | 14 ++++---------- tests/btrfs/106 | 19 +++---------------- tests/btrfs/107 | 22 +++------------------- tests/btrfs/108 | 14 ++++---------- tests/btrfs/109 | 14 ++++---------- tests/btrfs/110 | 14 ++++---------- tests/btrfs/111 | 14 ++++---------- tests/btrfs/112 | 19 +++---------------- tests/btrfs/113 | 19 +++---------------- tests/btrfs/114 | 22 +++------------------- tests/btrfs/115 | 23 +++-------------------- tests/btrfs/116 | 19 +++---------------- tests/btrfs/117 | 18 +++--------------- tests/btrfs/118 | 14 ++++---------- tests/btrfs/119 | 14 ++++---------- tests/btrfs/120 | 14 ++++---------- tests/btrfs/121 | 24 +++--------------------- tests/btrfs/122 | 25 +++---------------------- tests/btrfs/123 | 22 +++------------------- tests/btrfs/124 | 17 ++++------------- tests/btrfs/125 | 18 ++++-------------- tests/btrfs/126 | 24 ++++-------------------- tests/btrfs/127 | 14 ++++---------- tests/btrfs/128 | 14 ++++---------- tests/btrfs/129 | 14 ++++---------- tests/btrfs/130 | 22 +++------------------- tests/btrfs/131 | 22 +++------------------- tests/btrfs/132 | 17 ++++------------- tests/btrfs/133 | 14 ++++---------- tests/btrfs/134 | 14 ++++---------- tests/btrfs/135 | 14 ++++---------- tests/btrfs/136 | 24 +++--------------------- tests/btrfs/137 | 14 ++++---------- tests/btrfs/138 | 22 +++------------------- tests/btrfs/139 | 23 +++-------------------- tests/btrfs/140 | 22 +++------------------- tests/btrfs/141 | 22 +++------------------- tests/btrfs/142 | 24 ++++-------------------- tests/btrfs/143 | 24 ++++-------------------- tests/btrfs/144 | 14 ++++---------- tests/btrfs/145 | 14 ++++---------- tests/btrfs/146 | 16 ++++------------ tests/btrfs/147 | 14 ++++---------- tests/btrfs/148 | 20 +++----------------- tests/btrfs/149 | 14 ++++---------- tests/btrfs/150 | 22 +++------------------- tests/btrfs/151 | 22 +++------------------- tests/btrfs/152 | 20 +++----------------- tests/btrfs/153 | 22 +++------------------- tests/btrfs/154 | 21 +++------------------ tests/btrfs/155 | 14 ++++---------- tests/btrfs/156 | 24 ++++-------------------- tests/btrfs/157 | 22 +++------------------- tests/btrfs/158 | 22 +++------------------- tests/btrfs/159 | 14 ++++---------- tests/btrfs/160 | 16 ++++------------ tests/btrfs/161 | 22 +++------------------- tests/btrfs/162 | 22 +++------------------- tests/btrfs/163 | 17 ++++------------- tests/btrfs/164 | 17 ++++------------- tests/btrfs/165 | 22 +++------------------- tests/btrfs/166 | 14 ++++---------- tests/btrfs/167 | 22 +++------------------- tests/btrfs/168 | 13 ++++--------- tests/btrfs/169 | 13 ++++--------- tests/btrfs/170 | 19 +++---------------- tests/btrfs/171 | 24 +++--------------------- tests/btrfs/172 | 22 +++------------------- tests/btrfs/173 | 19 ++----------------- tests/btrfs/174 | 19 ++----------------- tests/btrfs/175 | 19 ++----------------- tests/btrfs/176 | 22 +++------------------- tests/btrfs/177 | 19 ++----------------- tests/btrfs/178 | 14 ++++---------- tests/btrfs/179 | 22 +++------------------- tests/btrfs/180 | 24 ++++-------------------- tests/btrfs/181 | 22 +++------------------- tests/btrfs/182 | 24 ++++-------------------- tests/btrfs/183 | 19 +++---------------- tests/btrfs/184 | 21 +++------------------ tests/btrfs/185 | 17 ++++------------- tests/btrfs/186 | 13 ++++--------- tests/btrfs/187 | 19 +++---------------- tests/btrfs/188 | 13 ++++--------- tests/btrfs/189 | 13 ++++--------- tests/btrfs/190 | 24 ++++-------------------- tests/btrfs/191 | 14 ++++---------- tests/btrfs/192 | 17 ++++------------- tests/btrfs/193 | 22 +++------------------- tests/btrfs/194 | 22 +++------------------- tests/btrfs/195 | 23 +++-------------------- tests/btrfs/196 | 16 ++++------------ tests/btrfs/197 | 17 ++++------------- tests/btrfs/198 | 22 +++------------------- tests/btrfs/199 | 18 ++++-------------- tests/btrfs/200 | 13 ++++--------- tests/btrfs/201 | 15 ++++----------- tests/btrfs/202 | 21 +++------------------ tests/btrfs/203 | 13 ++++--------- tests/btrfs/204 | 22 +++------------------- tests/btrfs/205 | 20 +++----------------- tests/btrfs/206 | 22 +++------------------- tests/btrfs/207 | 22 +++------------------- tests/btrfs/208 | 10 +++------- tests/btrfs/209 | 14 ++++---------- tests/btrfs/210 | 24 ++++-------------------- tests/btrfs/211 | 14 ++++---------- tests/btrfs/212 | 17 ++++------------- tests/btrfs/213 | 17 ++++------------- tests/btrfs/214 | 16 ++++------------ tests/btrfs/215 | 22 +++------------------- tests/btrfs/216 | 24 ++++-------------------- tests/btrfs/217 | 25 ++++--------------------- tests/btrfs/218 | 22 +++------------------- tests/btrfs/219 | 17 ++++------------- tests/btrfs/220 | 16 ++++------------ tests/btrfs/221 | 14 ++++---------- tests/btrfs/222 | 14 ++++---------- tests/btrfs/223 | 20 +++----------------- tests/btrfs/224 | 23 +++-------------------- tests/btrfs/225 | 17 ++++------------- tests/btrfs/226 | 22 ++++------------------ tests/btrfs/227 | 14 ++++---------- tests/btrfs/228 | 22 +++------------------- tests/btrfs/229 | 14 ++++---------- tests/btrfs/230 | 24 ++++-------------------- tests/btrfs/231 | 14 ++++---------- tests/btrfs/232 | 22 +++------------------- tests/btrfs/233 | 14 ++++---------- tests/btrfs/234 | 20 +++----------------- tests/btrfs/235 | 14 ++++---------- tests/btrfs/236 | 14 ++++---------- tests/btrfs/237 | 22 +++------------------- tests/btrfs/238 | 24 ++++-------------------- tests/btrfs/239 | 14 ++++---------- tests/btrfs/240 | 15 ++++----------- tests/btrfs/241 | 14 ++++---------- tests/ceph/001 | 18 ++---------------- tests/ceph/002 | 18 ++---------------- tests/ceph/003 | 18 ++---------------- tests/ceph/004 | 22 +++------------------- tests/cifs/001 | 15 ++++----------- tests/ext4/001 | 19 +++---------------- tests/ext4/002 | 16 ++++------------ tests/ext4/003 | 13 ++++--------- tests/ext4/004 | 15 ++++----------- tests/ext4/005 | 21 +++------------------ tests/ext4/006 | 15 ++++----------- tests/ext4/007 | 15 ++++----------- tests/ext4/008 | 15 ++++----------- tests/ext4/009 | 15 ++++----------- tests/ext4/010 | 15 ++++----------- tests/ext4/011 | 15 ++++----------- tests/ext4/012 | 15 ++++----------- tests/ext4/013 | 15 ++++----------- tests/ext4/014 | 15 ++++----------- tests/ext4/015 | 15 ++++----------- tests/ext4/016 | 15 ++++----------- tests/ext4/017 | 15 ++++----------- tests/ext4/018 | 15 ++++----------- tests/ext4/019 | 15 ++++----------- tests/ext4/020 | 22 +++------------------- tests/ext4/021 | 22 +++------------------- tests/ext4/022 | 22 +++------------------- tests/ext4/023 | 19 ++++--------------- tests/ext4/024 | 20 ++------------------ tests/ext4/025 | 18 ++---------------- tests/ext4/026 | 20 +++----------------- tests/ext4/027 | 14 ++++---------- tests/ext4/028 | 14 ++++---------- tests/ext4/029 | 14 ++++---------- tests/ext4/030 | 22 +++------------------- tests/ext4/031 | 22 +++------------------- tests/ext4/032 | 17 +++-------------- tests/ext4/033 | 17 ++++------------- tests/ext4/034 | 22 +++------------------- tests/ext4/035 | 21 +++------------------ tests/ext4/036 | 22 ++++------------------ tests/ext4/037 | 23 ++++------------------- tests/ext4/038 | 20 +++----------------- tests/ext4/039 | 14 +++----------- tests/ext4/040 | 18 +++--------------- tests/ext4/041 | 18 +++--------------- tests/ext4/042 | 21 +++------------------ tests/ext4/043 | 24 ++++-------------------- tests/ext4/044 | 22 +++------------------- tests/ext4/045 | 22 +++------------------- tests/ext4/046 | 22 +++------------------- tests/ext4/047 | 24 ++++-------------------- tests/ext4/048 | 13 +++---------- tests/ext4/049 | 22 +++------------------- tests/ext4/050 | 14 +++----------- tests/ext4/271 | 14 +++----------- tests/ext4/301 | 13 +++---------- tests/ext4/302 | 13 +++---------- tests/ext4/303 | 13 +++---------- tests/ext4/304 | 13 +++---------- tests/ext4/305 | 12 ++++-------- tests/ext4/306 | 13 ++++--------- tests/ext4/307 | 14 +++----------- tests/ext4/308 | 18 +++--------------- tests/f2fs/001 | 19 +++---------------- tests/f2fs/002 | 19 ++----------------- tests/generic/001 | 14 +++++--------- tests/generic/002 | 18 +++--------------- tests/generic/003 | 21 +++------------------ tests/generic/004 | 16 ++++------------ tests/generic/005 | 13 ++++--------- tests/generic/006 | 12 ++++-------- tests/generic/007 | 13 ++++--------- tests/generic/008 | 13 +++---------- tests/generic/009 | 19 +++---------------- tests/generic/010 | 14 ++++---------- tests/generic/011 | 14 ++++---------- tests/generic/012 | 19 +++---------------- tests/generic/013 | 14 ++++---------- tests/generic/014 | 12 ++++-------- tests/generic/015 | 16 ++++------------ tests/generic/016 | 19 +++---------------- tests/generic/017 | 13 +++---------- tests/generic/018 | 20 +++----------------- tests/generic/019 | 14 ++++---------- tests/generic/020 | 13 +++---------- tests/generic/021 | 19 +++---------------- tests/generic/022 | 19 +++---------------- tests/generic/023 | 19 +++---------------- tests/generic/024 | 19 +++---------------- tests/generic/025 | 19 +++---------------- tests/generic/026 | 17 ++++------------- tests/generic/027 | 20 +++----------------- tests/generic/028 | 19 +++---------------- tests/generic/029 | 19 +++---------------- tests/generic/030 | 19 +++---------------- tests/generic/031 | 21 ++++----------------- tests/generic/032 | 15 ++++----------- tests/generic/033 | 20 +++----------------- tests/generic/034 | 15 ++++----------- tests/generic/035 | 21 ++++----------------- tests/generic/036 | 19 +++---------------- tests/generic/037 | 14 ++++---------- tests/generic/038 | 15 ++++----------- tests/generic/039 | 16 ++++------------ tests/generic/040 | 16 ++++------------ tests/generic/041 | 16 ++++------------ tests/generic/042 | 20 +++----------------- tests/generic/043 | 13 +++---------- tests/generic/044 | 13 +++---------- tests/generic/045 | 13 +++---------- tests/generic/046 | 13 +++---------- tests/generic/047 | 13 +++---------- tests/generic/048 | 13 +++---------- tests/generic/049 | 13 +++---------- tests/generic/050 | 15 ++++----------- tests/generic/051 | 16 ++++------------ tests/generic/052 | 14 +++----------- tests/generic/053 | 13 +++---------- tests/generic/054 | 14 +++----------- tests/generic/055 | 14 +++----------- tests/generic/056 | 16 ++++------------ tests/generic/057 | 16 ++++------------ tests/generic/058 | 19 +++---------------- tests/generic/059 | 16 ++++------------ tests/generic/060 | 19 +++---------------- tests/generic/061 | 19 +++---------------- tests/generic/062 | 15 ++++----------- tests/generic/063 | 19 +++---------------- tests/generic/064 | 15 +++------------ tests/generic/065 | 16 ++++------------ tests/generic/066 | 16 ++++------------ tests/generic/067 | 21 +++------------------ tests/generic/068 | 14 ++++---------- tests/generic/069 | 13 ++++--------- tests/generic/070 | 14 ++++---------- tests/generic/071 | 22 ++++------------------ tests/generic/072 | 19 +++---------------- tests/generic/073 | 16 ++++------------ tests/generic/074 | 14 ++++---------- tests/generic/075 | 13 ++++--------- tests/generic/076 | 16 +++++----------- tests/generic/077 | 16 +++++----------- tests/generic/078 | 19 +++---------------- tests/generic/079 | 13 ++++--------- tests/generic/080 | 13 ++++--------- tests/generic/081 | 15 ++++----------- tests/generic/082 | 21 +++------------------ tests/generic/083 | 16 ++++------------ tests/generic/084 | 20 +++----------------- tests/generic/085 | 15 ++++----------- tests/generic/086 | 19 +++---------------- tests/generic/087 | 14 ++++---------- tests/generic/088 | 13 +++---------- tests/generic/089 | 13 +++---------- tests/generic/090 | 16 ++++------------ tests/generic/091 | 15 +++------------ tests/generic/092 | 17 +++-------------- tests/generic/093 | 16 ++++------------ tests/generic/094 | 22 ++++------------------ tests/generic/095 | 20 +++----------------- tests/generic/096 | 20 +++----------------- tests/generic/097 | 14 ++++---------- tests/generic/098 | 18 +++--------------- tests/generic/099 | 16 ++++------------ tests/generic/100 | 16 ++++------------ tests/generic/101 | 14 ++++---------- tests/generic/102 | 14 +++----------- tests/generic/103 | 21 ++++----------------- tests/generic/104 | 14 ++++---------- tests/generic/105 | 16 ++++------------ tests/generic/106 | 14 ++++---------- tests/generic/107 | 14 ++++---------- tests/generic/108 | 15 ++++----------- tests/generic/109 | 21 +++------------------ tests/generic/110 | 16 ++++------------ tests/generic/111 | 16 ++++------------ tests/generic/112 | 13 ++++--------- tests/generic/113 | 12 ++++-------- tests/generic/114 | 14 ++++---------- tests/generic/115 | 16 ++++------------ tests/generic/116 | 16 ++++------------ tests/generic/117 | 20 +++----------------- tests/generic/118 | 16 ++++------------ tests/generic/119 | 16 ++++------------ tests/generic/120 | 13 +++---------- tests/generic/121 | 16 ++++------------ tests/generic/122 | 16 ++++------------ tests/generic/123 | 13 ++++--------- tests/generic/124 | 14 ++++---------- tests/generic/125 | 13 +++---------- tests/generic/126 | 14 ++++---------- tests/generic/127 | 14 ++++---------- tests/generic/128 | 13 +++---------- tests/generic/129 | 13 +++---------- tests/generic/130 | 13 +++---------- tests/generic/131 | 14 +++----------- tests/generic/132 | 13 +++---------- tests/generic/133 | 13 +++---------- tests/generic/134 | 16 ++++------------ tests/generic/135 | 13 +++---------- tests/generic/136 | 16 ++++------------ tests/generic/137 | 16 ++++------------ tests/generic/138 | 18 ++++-------------- tests/generic/139 | 18 ++++-------------- tests/generic/140 | 18 ++++-------------- tests/generic/141 | 13 +++---------- tests/generic/142 | 16 ++++------------ tests/generic/143 | 16 ++++------------ tests/generic/144 | 16 ++++------------ tests/generic/145 | 16 ++++------------ tests/generic/146 | 16 ++++------------ tests/generic/147 | 16 ++++------------ tests/generic/148 | 16 ++++------------ tests/generic/149 | 16 ++++------------ tests/generic/150 | 16 ++++------------ tests/generic/151 | 16 ++++------------ tests/generic/152 | 16 ++++------------ tests/generic/153 | 16 ++++------------ tests/generic/154 | 16 ++++------------ tests/generic/155 | 16 ++++------------ tests/generic/156 | 16 ++++------------ tests/generic/157 | 16 ++++------------ tests/generic/158 | 16 ++++------------ tests/generic/159 | 16 ++++------------ tests/generic/160 | 16 ++++------------ tests/generic/161 | 14 +++++--------- tests/generic/162 | 14 +++++--------- tests/generic/163 | 14 +++++--------- tests/generic/164 | 14 +++++--------- tests/generic/165 | 14 +++++--------- tests/generic/166 | 14 +++++--------- tests/generic/167 | 14 +++++--------- tests/generic/168 | 14 +++++--------- tests/generic/169 | 20 +++----------------- tests/generic/170 | 14 +++++--------- tests/generic/171 | 16 ++++------------ tests/generic/172 | 16 ++++------------ tests/generic/173 | 16 ++++------------ tests/generic/174 | 16 ++++------------ tests/generic/175 | 19 +++---------------- tests/generic/176 | 19 +++---------------- tests/generic/177 | 14 ++++---------- tests/generic/178 | 16 ++++------------ tests/generic/179 | 16 ++++------------ tests/generic/180 | 16 ++++------------ tests/generic/181 | 16 ++++------------ tests/generic/182 | 16 ++++------------ tests/generic/183 | 16 ++++------------ tests/generic/184 | 19 +++---------------- tests/generic/185 | 16 ++++------------ tests/generic/186 | 16 ++++------------ tests/generic/187 | 16 ++++------------ tests/generic/188 | 16 ++++------------ tests/generic/189 | 16 ++++------------ tests/generic/190 | 16 ++++------------ tests/generic/191 | 16 ++++------------ tests/generic/192 | 14 +++----------- tests/generic/193 | 16 +++++----------- tests/generic/194 | 16 ++++------------ tests/generic/195 | 16 ++++------------ tests/generic/196 | 16 ++++------------ tests/generic/197 | 16 ++++------------ tests/generic/198 | 20 +++----------------- tests/generic/199 | 16 ++++------------ tests/generic/200 | 16 ++++------------ tests/generic/201 | 16 ++++------------ tests/generic/202 | 16 ++++------------ tests/generic/203 | 16 ++++------------ tests/generic/204 | 16 ++++------------ tests/generic/205 | 16 ++++------------ tests/generic/206 | 16 ++++------------ tests/generic/207 | 19 +++---------------- tests/generic/208 | 21 +++------------------ tests/generic/209 | 19 +++---------------- tests/generic/210 | 19 +++---------------- tests/generic/211 | 19 +++---------------- tests/generic/212 | 19 +++---------------- tests/generic/213 | 19 +++---------------- tests/generic/214 | 13 ++++--------- tests/generic/215 | 15 ++++----------- tests/generic/216 | 16 ++++------------ tests/generic/217 | 16 ++++------------ tests/generic/218 | 16 ++++------------ tests/generic/219 | 14 +++----------- tests/generic/220 | 16 ++++------------ tests/generic/221 | 12 +++--------- tests/generic/222 | 16 ++++------------ tests/generic/223 | 21 +++------------------ tests/generic/224 | 15 ++++----------- tests/generic/225 | 20 +++----------------- tests/generic/226 | 14 +++----------- tests/generic/227 | 16 ++++------------ tests/generic/228 | 15 +++++---------- tests/generic/229 | 18 ++++-------------- tests/generic/230 | 14 +++----------- tests/generic/231 | 14 +++----------- tests/generic/232 | 13 +++---------- tests/generic/233 | 13 +++---------- tests/generic/234 | 14 +++----------- tests/generic/235 | 14 +++----------- tests/generic/236 | 13 ++++--------- tests/generic/237 | 16 ++++------------ tests/generic/238 | 18 ++++-------------- tests/generic/239 | 14 ++++---------- tests/generic/240 | 22 ++++------------------ tests/generic/241 | 22 ++++------------------ tests/generic/242 | 17 ++++------------- tests/generic/243 | 17 ++++------------- tests/generic/244 | 17 ++++------------- tests/generic/245 | 14 ++++---------- tests/generic/246 | 15 ++++----------- tests/generic/247 | 14 +++++--------- tests/generic/248 | 14 ++++---------- tests/generic/249 | 15 ++++----------- tests/generic/250 | 16 ++++------------ tests/generic/251 | 11 ++++------- tests/generic/252 | 16 ++++------------ tests/generic/253 | 22 +++------------------- tests/generic/254 | 22 +++------------------- tests/generic/255 | 19 +++---------------- tests/generic/256 | 19 +++---------------- tests/generic/257 | 15 ++++----------- tests/generic/258 | 19 +++---------------- tests/generic/259 | 22 +++------------------- tests/generic/260 | 11 +++-------- tests/generic/261 | 22 +++------------------- tests/generic/262 | 22 +++------------------- tests/generic/263 | 15 +++------------ tests/generic/264 | 22 +++------------------- tests/generic/265 | 17 ++++------------- tests/generic/266 | 17 ++++------------- tests/generic/267 | 17 ++++------------- tests/generic/268 | 17 ++++------------- tests/generic/269 | 14 +++----------- tests/generic/270 | 14 +++----------- tests/generic/271 | 17 ++++------------- tests/generic/272 | 17 ++++------------- tests/generic/273 | 12 +++--------- tests/generic/274 | 12 +++--------- tests/generic/275 | 14 +++----------- tests/generic/276 | 17 ++++------------- tests/generic/277 | 13 ++++--------- tests/generic/278 | 17 ++++------------- tests/generic/279 | 17 ++++------------- tests/generic/280 | 21 +++------------------ tests/generic/281 | 17 ++++------------- tests/generic/282 | 17 ++++------------- tests/generic/283 | 17 ++++------------- tests/generic/284 | 21 +++------------------ tests/generic/285 | 13 ++++--------- tests/generic/286 | 14 ++++---------- tests/generic/287 | 21 +++------------------ tests/generic/288 | 9 +++------ tests/generic/289 | 21 +++------------------ tests/generic/290 | 21 +++------------------ tests/generic/291 | 21 +++------------------ tests/generic/292 | 21 +++------------------ tests/generic/293 | 21 +++------------------ tests/generic/294 | 20 +++----------------- tests/generic/295 | 21 +++------------------ tests/generic/296 | 21 +++------------------ tests/generic/297 | 16 ++++------------ tests/generic/298 | 16 ++++------------ tests/generic/299 | 20 +++----------------- tests/generic/300 | 20 +++----------------- tests/generic/301 | 21 +++------------------ tests/generic/302 | 21 +++------------------ tests/generic/303 | 16 ++++------------ tests/generic/304 | 16 ++++------------ tests/generic/305 | 21 +++------------------ tests/generic/306 | 15 ++++----------- tests/generic/307 | 12 ++++-------- tests/generic/308 | 13 ++++--------- tests/generic/309 | 10 ++++------ tests/generic/310 | 13 ++++--------- tests/generic/311 | 14 ++++---------- tests/generic/312 | 20 +++----------------- tests/generic/313 | 13 ++++--------- tests/generic/314 | 21 ++++----------------- tests/generic/315 | 19 +++---------------- tests/generic/316 | 21 ++++----------------- tests/generic/317 | 16 ++++------------ tests/generic/318 | 16 ++++------------ tests/generic/319 | 21 +++------------------ tests/generic/320 | 21 +++------------------ tests/generic/321 | 15 ++++----------- tests/generic/322 | 15 ++++----------- tests/generic/323 | 21 ++++----------------- tests/generic/324 | 19 +++---------------- tests/generic/325 | 15 ++++----------- tests/generic/326 | 21 +++------------------ tests/generic/327 | 21 +++------------------ tests/generic/328 | 21 +++------------------ tests/generic/329 | 17 ++++------------- tests/generic/330 | 17 ++++------------- tests/generic/331 | 17 ++++------------- tests/generic/332 | 17 ++++------------- tests/generic/333 | 14 +++++--------- tests/generic/334 | 14 +++++--------- tests/generic/335 | 14 ++++---------- tests/generic/336 | 14 ++++---------- tests/generic/337 | 19 +++---------------- tests/generic/338 | 17 ++++------------- tests/generic/339 | 22 ++++------------------ tests/generic/340 | 17 ++--------------- tests/generic/341 | 14 ++++---------- tests/generic/342 | 14 ++++---------- tests/generic/343 | 14 ++++---------- tests/generic/344 | 19 ++----------------- tests/generic/345 | 19 ++----------------- tests/generic/346 | 19 ++----------------- tests/generic/347 | 15 ++++----------- tests/generic/348 | 14 ++++---------- tests/generic/349 | 23 ++++++----------------- tests/generic/350 | 23 ++++++----------------- tests/generic/351 | 24 ++++++------------------ tests/generic/352 | 22 +++------------------- tests/generic/353 | 22 +++------------------- tests/generic/354 | 17 ++--------------- tests/generic/355 | 21 +++------------------ tests/generic/356 | 14 +++++--------- tests/generic/357 | 14 +++++--------- tests/generic/358 | 14 +++++--------- tests/generic/359 | 14 +++++--------- tests/generic/360 | 21 +++------------------ tests/generic/361 | 16 ++++------------ tests/generic/362 | 24 ++++-------------------- tests/generic/363 | 24 ++++-------------------- tests/generic/364 | 24 ++++-------------------- tests/generic/365 | 22 +++------------------- tests/generic/366 | 22 +++------------------- tests/generic/367 | 22 +++------------------- tests/generic/368 | 22 +++------------------- tests/generic/369 | 22 +++------------------- tests/generic/370 | 22 +++------------------- tests/generic/371 | 22 +++------------------- tests/generic/372 | 14 +++++--------- tests/generic/373 | 14 +++++--------- tests/generic/374 | 14 +++++--------- tests/generic/375 | 19 +++---------------- tests/generic/376 | 14 ++++---------- tests/generic/377 | 19 +++---------------- tests/generic/378 | 22 +++------------------- tests/generic/379 | 14 ++++---------- tests/generic/380 | 19 +++---------------- tests/generic/381 | 22 +++------------------- tests/generic/382 | 22 +++------------------- tests/generic/383 | 21 +++------------------ tests/generic/384 | 14 ++++---------- tests/generic/385 | 15 ++++----------- tests/generic/386 | 22 +++------------------- tests/generic/387 | 22 +++------------------- tests/generic/388 | 16 ++++------------ tests/generic/389 | 22 +++------------------- tests/generic/390 | 17 ++++------------- tests/generic/391 | 17 ++++------------- tests/generic/392 | 18 +++--------------- tests/generic/393 | 19 +++---------------- tests/generic/394 | 17 ++++------------- tests/generic/395 | 22 +++------------------- tests/generic/396 | 24 ++++-------------------- tests/generic/397 | 22 +++------------------- tests/generic/398 | 30 ++++-------------------------- tests/generic/399 | 24 ++++-------------------- tests/generic/400 | 22 +++------------------- tests/generic/401 | 20 +++----------------- tests/generic/402 | 20 ++------------------ tests/generic/403 | 22 +++------------------- tests/generic/404 | 17 ++++------------- tests/generic/405 | 17 ++++------------- tests/generic/406 | 24 ++++-------------------- tests/generic/407 | 12 ++++-------- tests/generic/408 | 12 ++++-------- tests/generic/409 | 17 ++++------------- tests/generic/410 | 17 ++++------------- tests/generic/411 | 17 ++++------------- tests/generic/412 | 18 +++--------------- tests/generic/413 | 22 +++------------------- tests/generic/414 | 14 +++++--------- tests/generic/415 | 20 +++----------------- tests/generic/416 | 22 +++------------------- tests/generic/417 | 23 +++-------------------- tests/generic/418 | 22 +++------------------- tests/generic/419 | 22 +++------------------- tests/generic/420 | 22 +++------------------- tests/generic/421 | 22 +++------------------- tests/generic/422 | 20 +++----------------- tests/generic/423 | 17 ++++------------- tests/generic/424 | 17 ++++------------- tests/generic/425 | 14 +++++--------- tests/generic/426 | 19 +++---------------- tests/generic/427 | 22 +++------------------- tests/generic/428 | 22 +++------------------- tests/generic/429 | 22 +++------------------- tests/generic/430 | 18 ++---------------- tests/generic/431 | 18 ++---------------- tests/generic/432 | 18 ++---------------- tests/generic/433 | 18 ++---------------- tests/generic/434 | 18 ++---------------- tests/generic/435 | 22 +++------------------- tests/generic/436 | 12 ++++-------- tests/generic/437 | 22 +++------------------- tests/generic/438 | 17 ++++------------- tests/generic/439 | 22 ++++------------------ tests/generic/440 | 22 +++------------------- tests/generic/441 | 16 ++++------------ tests/generic/442 | 16 ++++------------ tests/generic/443 | 22 +++------------------- tests/generic/444 | 19 +++---------------- tests/generic/445 | 12 ++++-------- tests/generic/446 | 18 ++---------------- tests/generic/447 | 14 ++++---------- tests/generic/448 | 14 ++++---------- tests/generic/449 | 22 +++------------------- tests/generic/450 | 17 ++++------------- tests/generic/451 | 22 +++------------------- tests/generic/452 | 24 ++++-------------------- tests/generic/453 | 18 +++--------------- tests/generic/454 | 18 +++--------------- tests/generic/455 | 15 ++++----------- tests/generic/456 | 16 ++++------------ tests/generic/457 | 15 ++++----------- tests/generic/458 | 21 +++------------------ tests/generic/459 | 18 ++++-------------- tests/generic/460 | 16 ++++------------ tests/generic/461 | 16 ++++------------ tests/generic/462 | 22 +++------------------- tests/generic/463 | 17 ++++------------- tests/generic/464 | 22 +++------------------- tests/generic/465 | 16 ++++------------ tests/generic/466 | 21 +++------------------ tests/generic/467 | 19 +++---------------- tests/generic/468 | 22 +++------------------- tests/generic/469 | 16 ++++------------ tests/generic/470 | 17 ++++------------- tests/generic/471 | 12 +++--------- tests/generic/472 | 18 ++++-------------- tests/generic/473 | 24 ++++-------------------- tests/generic/474 | 20 +++----------------- tests/generic/475 | 16 ++++------------ tests/generic/476 | 16 ++++------------ tests/generic/477 | 19 +++---------------- tests/generic/478 | 22 +++------------------- tests/generic/479 | 14 ++++---------- tests/generic/480 | 14 ++++---------- tests/generic/481 | 14 ++++---------- tests/generic/482 | 18 ++++-------------- tests/generic/483 | 14 ++++---------- tests/generic/484 | 17 ++++------------- tests/generic/485 | 15 ++++----------- tests/generic/486 | 17 ++++------------- tests/generic/487 | 16 ++++------------ tests/generic/488 | 19 ++----------------- tests/generic/489 | 14 ++++---------- tests/generic/490 | 14 ++++---------- tests/generic/491 | 23 ++++------------------- tests/generic/492 | 22 +++------------------- tests/generic/493 | 21 +++------------------ tests/generic/494 | 21 +++------------------ tests/generic/495 | 22 +++------------------- tests/generic/496 | 18 ++++-------------- tests/generic/497 | 18 ++++-------------- tests/generic/498 | 14 ++++---------- tests/generic/499 | 19 +++---------------- tests/generic/500 | 17 ++++------------- tests/generic/501 | 14 ++++---------- tests/generic/502 | 14 ++++---------- tests/generic/503 | 22 +++------------------- tests/generic/504 | 17 ++++------------- tests/generic/505 | 22 +++------------------- tests/generic/506 | 22 +++------------------- tests/generic/507 | 17 ++++------------- tests/generic/508 | 22 +++------------------- tests/generic/509 | 14 ++++---------- tests/generic/510 | 14 ++++---------- tests/generic/511 | 19 +++---------------- tests/generic/512 | 14 ++++---------- tests/generic/513 | 21 ++++----------------- tests/generic/514 | 19 +++---------------- tests/generic/515 | 19 +++---------------- tests/generic/516 | 16 ++++------------ tests/generic/517 | 21 ++++----------------- tests/generic/518 | 21 ++++----------------- tests/generic/519 | 22 +++------------------- tests/generic/520 | 19 ++++--------------- tests/generic/521 | 22 +++------------------- tests/generic/522 | 22 +++------------------- tests/generic/523 | 19 +++---------------- tests/generic/524 | 22 +++------------------- tests/generic/525 | 23 ++++------------------- tests/generic/526 | 14 ++++---------- tests/generic/527 | 14 ++++---------- tests/generic/528 | 13 ++++--------- tests/generic/529 | 18 +++--------------- tests/generic/530 | 18 +++--------------- tests/generic/531 | 18 +++--------------- tests/generic/532 | 13 ++++--------- tests/generic/533 | 22 +++------------------- tests/generic/534 | 14 ++++---------- tests/generic/535 | 17 ++++------------- tests/generic/536 | 22 +++------------------- tests/generic/537 | 21 +++------------------ tests/generic/538 | 22 +++------------------- tests/generic/539 | 14 ++++---------- tests/generic/540 | 21 +++------------------ tests/generic/541 | 21 +++------------------ tests/generic/542 | 21 +++------------------ tests/generic/543 | 21 +++------------------ tests/generic/544 | 21 +++------------------ tests/generic/545 | 14 ++++---------- tests/generic/546 | 17 ++++------------- tests/generic/547 | 14 ++++---------- tests/generic/548 | 22 +++------------------- tests/generic/549 | 22 +++------------------- tests/generic/550 | 22 +++------------------- tests/generic/551 | 22 +++------------------- tests/generic/552 | 14 ++++---------- tests/generic/553 | 18 +++++------------- tests/generic/554 | 27 ++++++--------------------- tests/generic/555 | 14 ++++---------- tests/generic/556 | 7 ++----- tests/generic/557 | 14 ++++---------- tests/generic/558 | 20 +++----------------- tests/generic/559 | 22 +++------------------- tests/generic/560 | 22 +++------------------- tests/generic/561 | 17 ++++------------- tests/generic/562 | 19 +++---------------- tests/generic/563 | 17 ++++------------- tests/generic/564 | 18 +++++------------- tests/generic/565 | 27 ++++++--------------------- tests/generic/566 | 16 ++++------------ tests/generic/567 | 21 ++++----------------- tests/generic/568 | 14 ++++---------- tests/generic/569 | 16 ++++------------ tests/generic/570 | 16 ++++------------ tests/generic/571 | 14 +++----------- tests/generic/572 | 17 ++++------------- tests/generic/573 | 17 ++++------------- tests/generic/574 | 17 ++++------------- tests/generic/575 | 17 ++++------------- tests/generic/576 | 17 ++++------------- tests/generic/577 | 17 ++++------------- tests/generic/578 | 17 ++++------------- tests/generic/579 | 17 ++++------------- tests/generic/580 | 22 +++------------------- tests/generic/581 | 16 ++++------------ tests/generic/582 | 22 +++------------------- tests/generic/583 | 22 +++------------------- tests/generic/584 | 22 +++------------------- tests/generic/585 | 22 +++------------------- tests/generic/586 | 16 ++++------------ tests/generic/587 | 21 +++------------------ tests/generic/588 | 14 ++++---------- tests/generic/589 | 17 ++++------------- tests/generic/590 | 14 +++----------- tests/generic/591 | 16 ++++------------ tests/generic/592 | 22 +++------------------- tests/generic/593 | 22 +++------------------- tests/generic/594 | 22 +++------------------- tests/generic/595 | 17 ++++------------- tests/generic/596 | 17 ++++------------- tests/generic/597 | 17 ++++------------- tests/generic/598 | 17 ++++------------- tests/generic/599 | 20 +++----------------- tests/generic/600 | 22 +++------------------- tests/generic/601 | 22 +++------------------- tests/generic/602 | 22 +++------------------- tests/generic/603 | 17 ++++------------- tests/generic/604 | 22 +++------------------- tests/generic/605 | 22 +++------------------- tests/generic/606 | 22 +++------------------- tests/generic/607 | 22 +++------------------- tests/generic/608 | 22 +++------------------- tests/generic/609 | 17 ++++------------- tests/generic/610 | 21 ++++----------------- tests/generic/611 | 24 ++++-------------------- tests/generic/612 | 22 +++------------------- tests/generic/613 | 22 +++------------------- tests/generic/614 | 19 +++---------------- tests/generic/615 | 19 +++---------------- tests/generic/616 | 22 +++------------------- tests/generic/617 | 22 +++------------------- tests/generic/618 | 22 +++------------------- tests/generic/619 | 22 +++------------------- tests/generic/620 | 17 ++++------------- tests/generic/621 | 14 +++----------- tests/generic/622 | 14 +++----------- tests/generic/623 | 18 ++---------------- tests/generic/624 | 19 ++----------------- tests/generic/625 | 19 ++----------------- tests/generic/626 | 22 +++------------------- tests/generic/627 | 20 +++----------------- tests/generic/628 | 16 ++++------------ tests/generic/629 | 16 ++++------------ tests/generic/630 | 23 ++++------------------- tests/generic/631 | 16 ++++------------ tests/generic/632 | 20 ++------------------ tests/generic/633 | 22 +++------------------- tests/generic/634 | 21 +++------------------ tests/generic/635 | 21 +++------------------ tests/generic/636 | 22 +++------------------- tests/generic/637 | 23 ++++------------------- tests/generic/638 | 22 +++------------------- tests/nfs/001 | 17 ++++------------- tests/ocfs2/001 | 21 +++------------------ tests/overlay/001 | 22 +++------------------- tests/overlay/002 | 22 +++------------------- tests/overlay/003 | 22 +++------------------- tests/overlay/004 | 22 +++------------------- tests/overlay/005 | 17 ++++------------- tests/overlay/006 | 23 ++++------------------- tests/overlay/007 | 16 ++++------------ tests/overlay/008 | 21 +++------------------ tests/overlay/009 | 21 +++------------------ tests/overlay/010 | 21 +++------------------ tests/overlay/011 | 21 +++------------------ tests/overlay/012 | 23 ++++------------------- tests/overlay/013 | 21 +++------------------ tests/overlay/014 | 22 +++------------------- tests/overlay/015 | 22 +++------------------- tests/overlay/016 | 21 +++------------------ tests/overlay/017 | 21 +++------------------ tests/overlay/018 | 21 +++------------------ tests/overlay/019 | 22 +++------------------- tests/overlay/020 | 22 +++------------------- tests/overlay/021 | 22 +++------------------- tests/overlay/022 | 17 ++++------------- tests/overlay/023 | 24 ++++-------------------- tests/overlay/024 | 22 +++------------------- tests/overlay/025 | 17 ++++------------- tests/overlay/026 | 22 +++------------------- tests/overlay/027 | 17 ++++------------- tests/overlay/028 | 22 +++------------------- tests/overlay/029 | 17 ++++------------- tests/overlay/030 | 13 ++++--------- tests/overlay/031 | 21 +++------------------ tests/overlay/032 | 21 +++------------------ tests/overlay/033 | 21 +++------------------ tests/overlay/034 | 21 +++------------------ tests/overlay/035 | 17 ++++------------- tests/overlay/036 | 17 ++++------------- tests/overlay/037 | 22 +++------------------- tests/overlay/038 | 23 ++++------------------- tests/overlay/039 | 22 +++------------------- tests/overlay/040 | 17 ++++------------- tests/overlay/041 | 23 ++++------------------- tests/overlay/042 | 23 ++++------------------- tests/overlay/043 | 21 +++------------------ tests/overlay/044 | 19 +++---------------- tests/overlay/045 | 22 +++------------------- tests/overlay/046 | 22 +++------------------- tests/overlay/047 | 21 +++------------------ tests/overlay/048 | 21 +++------------------ tests/overlay/049 | 21 +++------------------ tests/overlay/050 | 19 +++---------------- tests/overlay/051 | 14 ++++---------- tests/overlay/052 | 19 +++---------------- tests/overlay/053 | 14 ++++---------- tests/overlay/054 | 19 +++---------------- tests/overlay/055 | 14 ++++---------- tests/overlay/056 | 22 +++------------------- tests/overlay/057 | 22 +++------------------- tests/overlay/058 | 14 ++++---------- tests/overlay/059 | 21 +++------------------ tests/overlay/060 | 22 +++------------------- tests/overlay/061 | 21 +++------------------ tests/overlay/062 | 14 ++++---------- tests/overlay/063 | 24 ++++-------------------- tests/overlay/064 | 22 +++------------------- tests/overlay/065 | 17 ++++------------- tests/overlay/066 | 23 +++-------------------- tests/overlay/067 | 23 ++++------------------- tests/overlay/068 | 14 ++++---------- tests/overlay/069 | 14 ++++---------- tests/overlay/070 | 16 ++++------------ tests/overlay/071 | 16 ++++------------ tests/overlay/072 | 21 +++------------------ tests/overlay/073 | 22 +++------------------- tests/overlay/074 | 21 +++------------------ tests/overlay/075 | 13 ++++--------- tests/overlay/076 | 17 ++++------------- tests/overlay/077 | 21 +++------------------ tests/overlay/100 | 16 ++++------------ tests/overlay/101 | 16 ++++------------ tests/overlay/102 | 16 ++++------------ tests/overlay/103 | 16 ++++------------ tests/overlay/104 | 16 ++++------------ tests/overlay/105 | 16 ++++------------ tests/overlay/106 | 16 ++++------------ tests/overlay/107 | 16 ++++------------ tests/overlay/108 | 16 ++++------------ tests/overlay/109 | 16 ++++------------ tests/overlay/110 | 16 ++++------------ tests/overlay/111 | 16 ++++------------ tests/overlay/112 | 16 ++++------------ tests/overlay/113 | 16 ++++------------ tests/overlay/114 | 16 ++++------------ tests/overlay/115 | 16 ++++------------ tests/overlay/116 | 16 ++++------------ tests/overlay/117 | 16 ++++------------ tests/perf/001 | 14 +++----------- tests/shared/002 | 16 ++++------------ tests/shared/032 | 14 +++----------- tests/shared/298 | 15 +++------------ tests/udf/102 | 14 ++++---------- tests/xfs/001 | 19 +++---------------- tests/xfs/002 | 23 ++++------------------- tests/xfs/003 | 11 +++-------- tests/xfs/004 | 14 ++++---------- tests/xfs/005 | 21 +++------------------ tests/xfs/006 | 17 ++++------------- tests/xfs/007 | 22 +++------------------- tests/xfs/008 | 14 ++++---------- tests/xfs/009 | 14 ++++---------- tests/xfs/010 | 16 ++++------------ tests/xfs/011 | 16 ++++------------ tests/xfs/012 | 14 ++++---------- tests/xfs/013 | 16 ++++------------ tests/xfs/014 | 16 ++++------------ tests/xfs/015 | 21 +++------------------ tests/xfs/016 | 17 ++++------------- tests/xfs/017 | 16 +++++----------- tests/xfs/018 | 15 ++++----------- tests/xfs/019 | 13 ++++--------- tests/xfs/020 | 14 ++++---------- tests/xfs/021 | 13 ++++--------- tests/xfs/022 | 10 +++------- tests/xfs/023 | 12 ++++-------- tests/xfs/024 | 12 ++++-------- tests/xfs/025 | 12 ++++-------- tests/xfs/026 | 12 ++++-------- tests/xfs/027 | 12 ++++-------- tests/xfs/028 | 12 ++++-------- tests/xfs/029 | 13 +++---------- tests/xfs/030 | 15 ++++----------- tests/xfs/031 | 14 +++----------- tests/xfs/032 | 13 +++---------- tests/xfs/033 | 15 ++++----------- tests/xfs/034 | 15 ++++----------- tests/xfs/035 | 14 ++++---------- tests/xfs/036 | 14 ++++---------- tests/xfs/037 | 14 ++++---------- tests/xfs/038 | 14 ++++---------- tests/xfs/039 | 14 ++++---------- tests/xfs/040 | 13 +++---------- tests/xfs/041 | 15 ++++----------- tests/xfs/042 | 15 ++++----------- tests/xfs/043 | 14 ++++---------- tests/xfs/044 | 13 +++---------- tests/xfs/045 | 13 +++---------- tests/xfs/046 | 14 ++++---------- tests/xfs/047 | 14 ++++---------- tests/xfs/048 | 19 +++---------------- tests/xfs/049 | 16 ++++------------ tests/xfs/050 | 14 ++++---------- tests/xfs/051 | 14 ++++---------- tests/xfs/052 | 16 ++++------------ tests/xfs/053 | 19 +++---------------- tests/xfs/054 | 22 +++------------------- tests/xfs/055 | 14 ++++---------- tests/xfs/056 | 12 ++++-------- tests/xfs/057 | 16 ++++------------ tests/xfs/058 | 19 +++---------------- tests/xfs/059 | 12 ++++-------- tests/xfs/060 | 12 ++++-------- tests/xfs/061 | 12 ++++-------- tests/xfs/062 | 21 +++------------------ tests/xfs/063 | 14 ++++---------- tests/xfs/064 | 14 ++++---------- tests/xfs/065 | 14 ++++---------- tests/xfs/066 | 14 ++++---------- tests/xfs/067 | 13 +++---------- tests/xfs/068 | 13 +++---------- tests/xfs/069 | 19 +++---------------- tests/xfs/070 | 16 ++++------------ tests/xfs/071 | 15 ++++----------- tests/xfs/072 | 15 ++++----------- tests/xfs/073 | 16 ++++------------ tests/xfs/074 | 16 ++++------------ tests/xfs/075 | 19 +++---------------- tests/xfs/076 | 16 ++++------------ tests/xfs/077 | 21 +++------------------ tests/xfs/078 | 17 +++++------------ tests/xfs/079 | 16 ++++------------ tests/xfs/080 | 14 ++++---------- tests/xfs/081 | 15 ++++----------- tests/xfs/082 | 15 ++++----------- tests/xfs/083 | 15 ++++----------- tests/xfs/084 | 13 +++---------- tests/xfs/085 | 15 ++++----------- tests/xfs/086 | 15 ++++----------- tests/xfs/087 | 15 ++++----------- tests/xfs/088 | 15 ++++----------- tests/xfs/089 | 15 ++++----------- tests/xfs/090 | 13 +++---------- tests/xfs/091 | 15 ++++----------- tests/xfs/092 | 19 +++---------------- tests/xfs/093 | 15 ++++----------- tests/xfs/094 | 19 +++---------------- tests/xfs/095 | 21 ++++----------------- tests/xfs/096 | 20 +++----------------- tests/xfs/097 | 15 ++++----------- tests/xfs/098 | 16 ++++------------ tests/xfs/099 | 16 ++++------------ tests/xfs/100 | 16 ++++------------ tests/xfs/101 | 16 ++++------------ tests/xfs/102 | 16 ++++------------ tests/xfs/103 | 13 +++---------- tests/xfs/104 | 14 +++----------- tests/xfs/105 | 16 ++++------------ tests/xfs/106 | 22 +++------------------- tests/xfs/107 | 13 +++---------- tests/xfs/108 | 13 +++---------- tests/xfs/109 | 14 +++----------- tests/xfs/110 | 13 +++---------- tests/xfs/111 | 15 +++------------ tests/xfs/112 | 16 ++++------------ tests/xfs/113 | 16 ++++------------ tests/xfs/114 | 19 +++---------------- tests/xfs/115 | 22 +++------------------- tests/xfs/116 | 19 +++---------------- tests/xfs/117 | 15 ++++----------- tests/xfs/118 | 22 +++------------------- tests/xfs/119 | 21 ++++----------------- tests/xfs/120 | 16 ++++------------ tests/xfs/121 | 14 +++----------- tests/xfs/122 | 13 ++----------- tests/xfs/123 | 16 ++++------------ tests/xfs/124 | 16 ++++------------ tests/xfs/125 | 16 ++++------------ tests/xfs/126 | 16 ++++------------ tests/xfs/127 | 21 ++++----------------- tests/xfs/128 | 21 ++++----------------- tests/xfs/129 | 16 ++++------------ tests/xfs/130 | 14 ++++---------- tests/xfs/131 | 16 ++++------------ tests/xfs/132 | 24 ++++-------------------- tests/xfs/133 | 18 +++--------------- tests/xfs/134 | 18 +++--------------- tests/xfs/135 | 21 +++------------------ tests/xfs/136 | 19 +++---------------- tests/xfs/137 | 21 +++------------------ tests/xfs/138 | 19 ++++--------------- tests/xfs/139 | 16 ++++------------ tests/xfs/140 | 16 ++++------------ tests/xfs/141 | 16 ++++------------ tests/xfs/142 | 23 ++++------------------- tests/xfs/143 | 21 +++------------------ tests/xfs/144 | 21 +++------------------ tests/xfs/145 | 21 +++------------------ tests/xfs/146 | 23 ++++------------------- tests/xfs/147 | 21 +++------------------ tests/xfs/148 | 16 ++++------------ tests/xfs/149 | 17 ++++------------- tests/xfs/150 | 21 ++++----------------- tests/xfs/151 | 19 +++---------------- tests/xfs/152 | 17 ++++------------- tests/xfs/153 | 14 ++++---------- tests/xfs/154 | 21 +++------------------ tests/xfs/155 | 21 +++------------------ tests/xfs/156 | 21 +++------------------ tests/xfs/157 | 16 ++++------------ tests/xfs/158 | 23 ++++------------------- tests/xfs/159 | 16 ++++------------ tests/xfs/160 | 23 ++++------------------- tests/xfs/161 | 23 ++++------------------- tests/xfs/162 | 21 ++++----------------- tests/xfs/163 | 14 +++----------- tests/xfs/164 | 20 +++----------------- tests/xfs/165 | 20 +++----------------- tests/xfs/166 | 14 +++----------- tests/xfs/167 | 15 ++++----------- tests/xfs/168 | 14 +++----------- tests/xfs/169 | 16 ++++------------ tests/xfs/170 | 20 +++----------------- tests/xfs/171 | 22 ++++------------------ tests/xfs/172 | 22 ++++------------------ tests/xfs/173 | 22 ++++------------------ tests/xfs/174 | 22 ++++------------------ tests/xfs/178 | 18 +++--------------- tests/xfs/179 | 21 +++------------------ tests/xfs/180 | 21 +++------------------ tests/xfs/181 | 14 ++++---------- tests/xfs/182 | 21 +++------------------ tests/xfs/183 | 19 +++---------------- tests/xfs/184 | 21 +++------------------ tests/xfs/186 | 21 +++------------------ tests/xfs/187 | 21 +++------------------ tests/xfs/188 | 14 ++++---------- tests/xfs/189 | 17 +++++------------ tests/xfs/190 | 11 +++-------- tests/xfs/191-input-validation | 20 ++++---------------- tests/xfs/192 | 21 +++------------------ tests/xfs/193 | 21 +++------------------ tests/xfs/194 | 16 ++++------------ tests/xfs/195 | 15 ++++----------- tests/xfs/196 | 20 +++----------------- tests/xfs/197 | 15 ++++----------- tests/xfs/198 | 21 +++------------------ tests/xfs/199 | 15 ++++----------- tests/xfs/200 | 21 +++------------------ tests/xfs/201 | 15 ++++----------- tests/xfs/202 | 13 +++---------- tests/xfs/203 | 16 ++++------------ tests/xfs/204 | 21 +++------------------ tests/xfs/205 | 14 +++----------- tests/xfs/206 | 16 ++++------------ tests/xfs/207 | 21 +++------------------ tests/xfs/208 | 23 ++++------------------- tests/xfs/209 | 21 +++------------------ tests/xfs/210 | 23 ++++------------------- tests/xfs/211 | 21 +++------------------ tests/xfs/212 | 21 +++------------------ tests/xfs/213 | 21 +++------------------ tests/xfs/214 | 21 +++------------------ tests/xfs/215 | 21 +++------------------ tests/xfs/216 | 19 +++---------------- tests/xfs/217 | 19 +++---------------- tests/xfs/218 | 21 +++------------------ tests/xfs/219 | 21 +++------------------ tests/xfs/220 | 14 ++++---------- tests/xfs/221 | 21 +++------------------ tests/xfs/222 | 19 +++---------------- tests/xfs/223 | 21 +++------------------ tests/xfs/224 | 21 +++------------------ tests/xfs/225 | 21 +++------------------ tests/xfs/226 | 21 +++------------------ tests/xfs/227 | 21 +++------------------ tests/xfs/228 | 21 +++------------------ tests/xfs/229 | 15 ++++----------- tests/xfs/230 | 21 +++------------------ tests/xfs/231 | 16 ++++------------ tests/xfs/232 | 16 ++++------------ tests/xfs/233 | 21 ++++----------------- tests/xfs/234 | 16 ++++------------ tests/xfs/235 | 21 +++------------------ tests/xfs/236 | 16 ++++------------ tests/xfs/237 | 17 ++++------------- tests/xfs/238 | 19 +++---------------- tests/xfs/239 | 17 ++++------------- tests/xfs/240 | 17 ++++------------- tests/xfs/241 | 17 ++++------------- tests/xfs/242 | 19 +++---------------- tests/xfs/243 | 21 +++------------------ tests/xfs/244 | 15 ++++----------- tests/xfs/245 | 21 +++------------------ tests/xfs/246 | 21 +++------------------ tests/xfs/247 | 21 +++------------------ tests/xfs/248 | 21 +++------------------ tests/xfs/249 | 21 +++------------------ tests/xfs/250 | 14 ++++---------- tests/xfs/251 | 21 +++------------------ tests/xfs/252 | 19 +++---------------- tests/xfs/253 | 16 ++++------------ tests/xfs/254 | 21 +++------------------ tests/xfs/255 | 21 +++------------------ tests/xfs/256 | 21 +++------------------ tests/xfs/257 | 21 +++------------------ tests/xfs/258 | 21 +++------------------ tests/xfs/259 | 13 ++++--------- tests/xfs/260 | 17 ++++------------- tests/xfs/261 | 16 ++++------------ tests/xfs/262 | 19 ++++--------------- tests/xfs/263 | 24 +++--------------------- tests/xfs/264 | 17 ++++------------- tests/xfs/265 | 16 ++++------------ tests/xfs/266 | 12 ++++-------- tests/xfs/267 | 12 ++++-------- tests/xfs/268 | 12 ++++-------- tests/xfs/269 | 14 ++++---------- tests/xfs/270 | 22 +++------------------- tests/xfs/271 | 14 ++++---------- tests/xfs/272 | 14 ++++---------- tests/xfs/273 | 14 ++++---------- tests/xfs/274 | 14 ++++---------- tests/xfs/275 | 14 ++++---------- tests/xfs/276 | 14 ++++---------- tests/xfs/277 | 14 ++++---------- tests/xfs/278 | 18 +++--------------- tests/xfs/279 | 16 ++++------------ tests/xfs/280 | 19 ++++--------------- tests/xfs/281 | 14 ++++---------- tests/xfs/282 | 14 ++++---------- tests/xfs/283 | 14 ++++---------- tests/xfs/284 | 17 ++++------------- tests/xfs/285 | 19 ++++--------------- tests/xfs/286 | 19 ++++--------------- tests/xfs/287 | 16 +++++----------- tests/xfs/288 | 22 +++------------------- tests/xfs/289 | 17 ++++------------- tests/xfs/290 | 13 +++---------- tests/xfs/291 | 22 ++++------------------ tests/xfs/292 | 21 ++++----------------- tests/xfs/293 | 21 ++++----------------- tests/xfs/294 | 22 +++------------------- tests/xfs/295 | 21 +++------------------ tests/xfs/296 | 16 ++++------------ tests/xfs/297 | 20 +++----------------- tests/xfs/298 | 20 +++----------------- tests/xfs/299 | 15 ++++----------- tests/xfs/300 | 21 +++------------------ tests/xfs/301 | 16 ++++------------ tests/xfs/302 | 16 ++++------------ tests/xfs/303 | 19 +++---------------- tests/xfs/304 | 20 +++----------------- tests/xfs/305 | 20 +++----------------- tests/xfs/306 | 21 +++------------------ tests/xfs/307 | 21 +++------------------ tests/xfs/308 | 21 +++------------------ tests/xfs/309 | 16 ++++------------ tests/xfs/310 | 16 ++++------------ tests/xfs/311 | 16 ++++------------ tests/xfs/312 | 16 ++++------------ tests/xfs/313 | 16 ++++------------ tests/xfs/314 | 16 ++++------------ tests/xfs/315 | 16 ++++------------ tests/xfs/316 | 16 ++++------------ tests/xfs/317 | 16 ++++------------ tests/xfs/318 | 16 ++++------------ tests/xfs/319 | 16 ++++------------ tests/xfs/320 | 16 ++++------------ tests/xfs/321 | 16 ++++------------ tests/xfs/322 | 16 ++++------------ tests/xfs/323 | 16 ++++------------ tests/xfs/324 | 16 ++++------------ tests/xfs/325 | 16 ++++------------ tests/xfs/326 | 16 ++++------------ tests/xfs/327 | 16 ++++------------ tests/xfs/328 | 19 +++---------------- tests/xfs/329 | 19 +++---------------- tests/xfs/330 | 19 +++---------------- tests/xfs/331 | 19 +++---------------- tests/xfs/332 | 19 +++---------------- tests/xfs/333 | 21 ++++----------------- tests/xfs/334 | 21 ++++----------------- tests/xfs/335 | 19 +++---------------- tests/xfs/336 | 14 ++++---------- tests/xfs/337 | 21 ++++----------------- tests/xfs/338 | 21 ++++----------------- tests/xfs/339 | 19 +++---------------- tests/xfs/340 | 19 +++---------------- tests/xfs/341 | 19 +++---------------- tests/xfs/342 | 19 +++---------------- tests/xfs/343 | 19 +++---------------- tests/xfs/344 | 21 +++------------------ tests/xfs/345 | 21 +++------------------ tests/xfs/346 | 21 +++------------------ tests/xfs/347 | 21 +++------------------ tests/xfs/348 | 19 +++---------------- tests/xfs/349 | 19 ++++--------------- tests/xfs/350 | 19 ++++--------------- tests/xfs/351 | 19 ++++--------------- tests/xfs/352 | 19 ++++--------------- tests/xfs/353 | 19 ++++--------------- tests/xfs/354 | 19 ++++--------------- tests/xfs/355 | 19 ++++--------------- tests/xfs/356 | 19 ++++--------------- tests/xfs/357 | 19 ++++--------------- tests/xfs/358 | 19 ++++--------------- tests/xfs/359 | 19 ++++--------------- tests/xfs/360 | 19 ++++--------------- tests/xfs/361 | 19 ++++--------------- tests/xfs/362 | 19 ++++--------------- tests/xfs/363 | 19 ++++--------------- tests/xfs/364 | 19 ++++--------------- tests/xfs/365 | 19 ++++--------------- tests/xfs/366 | 19 ++++--------------- tests/xfs/367 | 19 ++++--------------- tests/xfs/368 | 19 ++++--------------- tests/xfs/369 | 19 ++++--------------- tests/xfs/370 | 19 ++++--------------- tests/xfs/371 | 19 ++++--------------- tests/xfs/372 | 19 ++++--------------- tests/xfs/373 | 19 ++++--------------- tests/xfs/374 | 19 ++++--------------- tests/xfs/375 | 19 ++++--------------- tests/xfs/376 | 19 ++++--------------- tests/xfs/377 | 19 ++++--------------- tests/xfs/378 | 19 ++++--------------- tests/xfs/379 | 19 ++++--------------- tests/xfs/380 | 23 ++++++----------------- tests/xfs/381 | 23 ++++++----------------- tests/xfs/382 | 19 ++++--------------- tests/xfs/383 | 19 ++++--------------- tests/xfs/384 | 19 ++++--------------- tests/xfs/385 | 19 ++++--------------- tests/xfs/386 | 19 ++++--------------- tests/xfs/387 | 19 ++++--------------- tests/xfs/388 | 19 ++++--------------- tests/xfs/389 | 19 ++++--------------- tests/xfs/390 | 19 ++++--------------- tests/xfs/391 | 19 ++++--------------- tests/xfs/392 | 19 ++++--------------- tests/xfs/393 | 19 ++++--------------- tests/xfs/394 | 19 ++++--------------- tests/xfs/395 | 19 ++++--------------- tests/xfs/396 | 19 ++++--------------- tests/xfs/397 | 19 ++++--------------- tests/xfs/398 | 19 ++++--------------- tests/xfs/399 | 19 ++++--------------- tests/xfs/400 | 19 ++++--------------- tests/xfs/401 | 19 ++++--------------- tests/xfs/402 | 19 ++++--------------- tests/xfs/403 | 19 ++++--------------- tests/xfs/404 | 19 ++++--------------- tests/xfs/405 | 19 ++++--------------- tests/xfs/406 | 19 ++++--------------- tests/xfs/407 | 19 ++++--------------- tests/xfs/408 | 19 ++++--------------- tests/xfs/409 | 19 ++++--------------- tests/xfs/410 | 19 ++++--------------- tests/xfs/411 | 19 ++++--------------- tests/xfs/412 | 19 ++++--------------- tests/xfs/413 | 19 ++++--------------- tests/xfs/414 | 19 ++++--------------- tests/xfs/415 | 19 ++++--------------- tests/xfs/416 | 19 ++++--------------- tests/xfs/417 | 19 ++++--------------- tests/xfs/418 | 19 ++++--------------- tests/xfs/420 | 23 ++++------------------- tests/xfs/421 | 23 ++++------------------- tests/xfs/422 | 21 +++++---------------- tests/xfs/423 | 19 ++++--------------- tests/xfs/424 | 22 +++------------------- tests/xfs/425 | 19 ++++--------------- tests/xfs/426 | 19 ++++--------------- tests/xfs/427 | 19 ++++--------------- tests/xfs/428 | 19 ++++--------------- tests/xfs/429 | 19 ++++--------------- tests/xfs/430 | 19 ++++--------------- tests/xfs/431 | 22 +++------------------- tests/xfs/432 | 14 ++++---------- tests/xfs/433 | 22 +++------------------- tests/xfs/434 | 19 +++---------------- tests/xfs/435 | 19 +++---------------- tests/xfs/436 | 19 +++---------------- tests/xfs/437 | 13 +++---------- tests/xfs/438 | 16 ++++------------ tests/xfs/439 | 18 +++--------------- tests/xfs/440 | 21 +++------------------ tests/xfs/441 | 21 +++------------------ tests/xfs/442 | 16 ++++------------ tests/xfs/443 | 22 +++------------------- tests/xfs/444 | 21 ++++----------------- tests/xfs/445 | 22 +++------------------- tests/xfs/446 | 13 ++----------- tests/xfs/447 | 17 ++++------------- tests/xfs/448 | 19 +++---------------- tests/xfs/449 | 21 +++------------------ tests/xfs/450 | 20 +++----------------- tests/xfs/451 | 24 ++++-------------------- tests/xfs/452 | 22 +++------------------- tests/xfs/453 | 19 ++++--------------- tests/xfs/454 | 19 ++++--------------- tests/xfs/455 | 23 ++++++----------------- tests/xfs/456 | 19 ++++--------------- tests/xfs/457 | 19 ++++--------------- tests/xfs/458 | 19 ++++--------------- tests/xfs/459 | 19 ++++--------------- tests/xfs/460 | 19 ++++--------------- tests/xfs/461 | 19 ++++--------------- tests/xfs/462 | 19 ++++--------------- tests/xfs/463 | 19 ++++--------------- tests/xfs/464 | 19 ++++--------------- tests/xfs/465 | 23 ++++++----------------- tests/xfs/466 | 23 ++++++----------------- tests/xfs/467 | 23 ++++++----------------- tests/xfs/468 | 23 ++++++----------------- tests/xfs/469 | 23 ++++++----------------- tests/xfs/470 | 23 ++++++----------------- tests/xfs/471 | 23 ++++++----------------- tests/xfs/472 | 23 ++++++----------------- tests/xfs/473 | 23 ++++++----------------- tests/xfs/474 | 23 ++++++----------------- tests/xfs/475 | 23 ++++++----------------- tests/xfs/476 | 23 ++++++----------------- tests/xfs/477 | 23 ++++++----------------- tests/xfs/478 | 23 ++++++----------------- tests/xfs/479 | 23 ++++++----------------- tests/xfs/480 | 23 ++++++----------------- tests/xfs/481 | 23 ++++++----------------- tests/xfs/482 | 19 ++++--------------- tests/xfs/483 | 19 ++++--------------- tests/xfs/484 | 23 ++++++----------------- tests/xfs/485 | 23 ++++++----------------- tests/xfs/486 | 23 ++++++----------------- tests/xfs/487 | 19 ++++--------------- tests/xfs/488 | 19 ++++--------------- tests/xfs/489 | 19 ++++--------------- tests/xfs/490 | 22 +++------------------- tests/xfs/491 | 24 ++++-------------------- tests/xfs/492 | 24 ++++-------------------- tests/xfs/493 | 22 +++------------------- tests/xfs/494 | 19 +++---------------- tests/xfs/495 | 19 ++++--------------- tests/xfs/496 | 19 ++++--------------- tests/xfs/497 | 19 ++++--------------- tests/xfs/498 | 19 ++++--------------- tests/xfs/499 | 19 ++++--------------- tests/xfs/500 | 19 +++---------------- tests/xfs/501 | 13 ++++--------- tests/xfs/502 | 19 +++---------------- tests/xfs/503 | 14 +++++--------- tests/xfs/504 | 19 +++---------------- tests/xfs/505 | 21 ++++----------------- tests/xfs/506 | 21 +++------------------ tests/xfs/507 | 14 +++++--------- tests/xfs/508 | 22 +++------------------- tests/xfs/509 | 19 ++----------------- tests/xfs/510 | 21 +++------------------ tests/xfs/511 | 17 ++++------------- tests/xfs/512 | 14 ++++---------- tests/xfs/513 | 17 ++++------------- tests/xfs/514 | 14 ++++---------- tests/xfs/515 | 14 ++++---------- tests/xfs/516 | 16 ++++------------ tests/xfs/517 | 14 +++++--------- tests/xfs/518 | 21 +++------------------ tests/xfs/519 | 21 +++------------------ tests/xfs/520 | 17 ++++------------- tests/xfs/521 | 14 ++++---------- tests/xfs/522 | 17 ++++------------- tests/xfs/523 | 17 ++++------------- tests/xfs/524 | 17 ++++------------- tests/xfs/525 | 17 ++++------------- tests/xfs/526 | 17 ++++------------- tests/xfs/527 | 23 ++++------------------- tests/xfs/528 | 14 ++++---------- tests/xfs/529 | 24 ++++-------------------- tests/xfs/530 | 17 ++++------------- tests/xfs/531 | 24 ++++-------------------- tests/xfs/532 | 24 ++++-------------------- tests/xfs/533 | 24 ++++-------------------- tests/xfs/534 | 24 ++++-------------------- tests/xfs/535 | 24 ++++-------------------- tests/xfs/536 | 22 +++------------------- tests/xfs/537 | 24 ++++-------------------- tests/xfs/538 | 22 +++------------------- tests/xfs/539 | 23 +++-------------------- 1581 files changed, 5726 insertions(+), 22573 deletions(-) diff --git a/tests/btrfs/001 b/tests/btrfs/001 index fb051e8a..000aeb34 100755 --- a/tests/btrfs/001 +++ b/tests/btrfs/001 @@ -6,23 +6,10 @@ # # Test btrfs's subvolume and snapshot support # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick subvol snapshot -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs diff --git a/tests/btrfs/002 b/tests/btrfs/002 index 66775562..58f0cdcd 100755 --- a/tests/btrfs/002 +++ b/tests/btrfs/002 @@ -6,23 +6,10 @@ # # Extented btrfs snapshot test cases # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto snapshot -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs btrfs diff --git a/tests/btrfs/003 b/tests/btrfs/003 index fbb313fb..d241ec6e 100755 --- a/tests/btrfs/003 +++ b/tests/btrfs/003 @@ -6,16 +6,11 @@ # # btrfs vol tests # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto replace volume balance -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! dev_removed=0 removed_dev_htl="" -trap "_cleanup; exit \$status" 0 1 2 3 15 # Check if all scratch dev pools are deletable deletable_scratch_dev_pool() @@ -32,6 +27,7 @@ deletable_scratch_dev_pool() return 0 } +# Override the default cleanup function. _cleanup() { cd / @@ -42,8 +38,7 @@ _cleanup() fi } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs btrfs @@ -51,8 +46,6 @@ _require_scratch _require_scratch_dev_pool 4 _require_command "$WIPEFS_PROG" wipefs -rm -f $seqres.full - # Test cases related to raid in btrfs _test_raid0() { diff --git a/tests/btrfs/004 b/tests/btrfs/004 index 0458d2b6..4e767a2f 100755 --- a/tests/btrfs/004 +++ b/tests/btrfs/004 @@ -9,25 +9,20 @@ # run filefrag to get the extent mapping and follow the backrefs. # We check to end up back at the original file with the correct offset. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw metadata -here=`pwd` -tmp=/tmp/$$ -status=1 noise_pid=0 +# Override the default cleanup function. _cleanup() { rm $tmp.running wait rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,8 +33,6 @@ _require_btrfs_command inspect-internal logical-resolve _require_btrfs_command inspect-internal inode-resolve _require_command "$FILEFRAG_PROG" filefrag -rm -f $seqres.full - FILEFRAG_FILTER=' if (/blocks? of (\d+) bytes/) { $blocksize = $1; diff --git a/tests/btrfs/005 b/tests/btrfs/005 index ff20a638..878a8c7c 100755 --- a/tests/btrfs/005 +++ b/tests/btrfs/005 @@ -6,23 +6,11 @@ # # Btrfs Online defragmentation tests # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -here="`pwd`" -tmp=/tmp/$$ +. ./common/preamble +_begin_fstest auto defrag cnt=119 filesize=48000 -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - _create_file() { if [ $1 -ne 2 ]; then @@ -111,8 +99,7 @@ _rundefrag() _check_scratch_fs } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag @@ -120,8 +107,6 @@ _rundefrag() _supported_fs btrfs _require_scratch -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount _require_defrag diff --git a/tests/btrfs/006 b/tests/btrfs/006 index 8168992f..fd0f89e2 100755 --- a/tests/btrfs/006 +++ b/tests/btrfs/006 @@ -7,23 +7,10 @@ # run basic btrfs information commands in various ways # sanity tests: filesystem show, label, sync, and device stats # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter.btrfs # real QA test starts here @@ -33,8 +20,6 @@ _supported_fs btrfs _require_scratch _require_scratch_dev_pool -rm -f $seqres.full - FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'` LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'` TOTAL_DEVS=`echo $SCRATCH_DEV_POOL | wc -w` diff --git a/tests/btrfs/007 b/tests/btrfs/007 index 4d25dcc2..ed7d143a 100755 --- a/tests/btrfs/007 +++ b/tests/btrfs/007 @@ -12,23 +12,18 @@ # creator owner=list.btrfs@jan-o-sch.net -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 +. ./common/preamble +_begin_fstest auto quick rw metadata send seek +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* rm -fr $send_files_dir } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -39,7 +34,6 @@ _require_seek_data_hole send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/008 b/tests/btrfs/008 index 94e4fe09..438cec82 100755 --- a/tests/btrfs/008 +++ b/tests/btrfs/008 @@ -6,16 +6,12 @@ # # btrfs send ENOENT regression test, from a user report on linux-btrfs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send -here=`pwd` -tmp=/tmp/$$ tmp_dir=send_temp_$seq -status=1 # failure is the default! - +# Override the default cleanup function. _cleanup() { $BTRFS_UTIL_PROG subvolume delete $TEST_DIR/$tmp_dir/send/snapshots/backup2 > /dev/null 2>&1 @@ -25,10 +21,7 @@ _cleanup() rm -f $tmp.* } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/btrfs/009 b/tests/btrfs/009 index 964c8324..be7e2f02 100755 --- a/tests/btrfs/009 +++ b/tests/btrfs/009 @@ -6,32 +6,16 @@ # # Regression test to make sure we can't delete the default subvol # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick subvol -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs btrfs _require_scratch -rm -f $seqres.full - _scratch_mkfs > /dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/010 b/tests/btrfs/010 index d963311e..10693901 100755 --- a/tests/btrfs/010 +++ b/tests/btrfs/010 @@ -8,28 +8,20 @@ # Regression test for patch "Btrfs: fix delalloc accounting leak caused # by u32 overflow". # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto test_file="$TEST_DIR/$seq" +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* "$test_file" } -. ./common/rc . ./common/filter -rm -f $seqres.full - _supported_fs btrfs _require_test _require_btrfs_fs_sysfs diff --git a/tests/btrfs/011 b/tests/btrfs/011 index f96d11ce..f5d865ab 100755 --- a/tests/btrfs/011 +++ b/tests/btrfs/011 @@ -19,15 +19,12 @@ # To check the filesystems after replacing a device, a scrub run is # performed, a btrfsck run, and finally the filesystem is remounted. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto replace volume -here=`pwd` -tmp=/tmp/$$ -status=1 noise_pid=0 +# Override the default cleanup function. _cleanup() { if [ $noise_pid -ne 0 ] && ps -p $noise_pid | grep -q $noise_pid; then @@ -40,10 +37,8 @@ _cleanup() # needed by _require_scratch, and make it umounted. _scratch_unmount > /dev/null 2>&1 } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -54,7 +49,6 @@ _require_scratch_dev_pool_equal_size _require_scratch_size $((10 * 1024 * 1024)) #kB _require_command "$WIPEFS_PROG" wipefs -rm -f $seqres.full rm -f $tmp.* echo "*** test btrfs replace" diff --git a/tests/btrfs/012 b/tests/btrfs/012 index 0feca7d9..46341e98 100755 --- a/tests/btrfs/012 +++ b/tests/btrfs/012 @@ -13,23 +13,10 @@ # 5) roll back conversion to original ext4 # 6) verify rolled-back fs integrity & contents # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto convert + +# Import common functions. . ./common/filter.btrfs # real QA test starts here @@ -44,8 +31,6 @@ _require_command "$E2FSCK_PROG" e2fsck _require_fs_space $SCRATCH_MNT $(du -s /lib/modules/`uname -r` | ${AWK_PROG} '{print $1}') -rm -f $seqres.full - BLOCK_SIZE=`_get_block_size $TEST_DIR` # Create & populate an ext4 filesystem diff --git a/tests/btrfs/013 b/tests/btrfs/013 index 5e03ed4a..1335b8cb 100755 --- a/tests/btrfs/013 +++ b/tests/btrfs/013 @@ -10,24 +10,10 @@ # userspace doesn't get an error when reading the file back so we have to grok # dmesg to see if there was a csum error. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick balance -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,8 +21,6 @@ _supported_fs btrfs _require_scratch _require_xfs_io_command "falloc" -rm -f $seqres.full - _scratch_mkfs > /dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/014 b/tests/btrfs/014 index 97977198..9e236274 100755 --- a/tests/btrfs/014 +++ b/tests/btrfs/014 @@ -6,13 +6,8 @@ # # Btrfs balance tests # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here="`pwd`" -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto balance _create_snapshot() { @@ -32,7 +27,6 @@ _balance() } #get standard environment, filters and checks -. ./common/rc . ./common/filter # real QA test starts here diff --git a/tests/btrfs/015 b/tests/btrfs/015 index b51c39a0..7398f9bf 100755 --- a/tests/btrfs/015 +++ b/tests/btrfs/015 @@ -7,32 +7,16 @@ # Regression test to make sure we can create a snapshot after mounting with # readonly and remounting rw. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick snapshot -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs btrfs _require_scratch -rm -f $seqres.full - _scratch_mkfs > /dev/null 2>&1 _scratch_mount -o ro _scratch_mount -o rw,remount diff --git a/tests/btrfs/016 b/tests/btrfs/016 index 015ec17f..6d05da54 100755 --- a/tests/btrfs/016 +++ b/tests/btrfs/016 @@ -6,15 +6,13 @@ # # btrfs send hole punch test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send tmp=`mktemp -d` tmp_dir=send_temp_$seq -status=1 # failure is the default! - +# Override the default cleanup function. _cleanup() { $BTRFS_UTIL_PROG subvolume delete $TEST_DIR/$tmp_dir/snap > /dev/null 2>&1 @@ -24,10 +22,7 @@ _cleanup() rm -f $tmp.* } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/btrfs/017 b/tests/btrfs/017 index 1e886054..62207101 100755 --- a/tests/btrfs/017 +++ b/tests/btrfs/017 @@ -12,23 +12,10 @@ # The issue is fixed by https://patchwork.kernel.org/patch/5499981/ # "Btrfs: fix a warning of qgroup account on shared extents" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick qgroup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,8 +24,6 @@ _supported_fs btrfs _require_scratch _require_cloner -rm -f $seqres.full - # Currently in btrfs the node/leaf size can not be smaller than the page # size (but it can be greater than the page size). So use the largest # supported node/leaf size (64Kb) so that the test can run on any platform diff --git a/tests/btrfs/018 b/tests/btrfs/018 index 96ae46ed..c522e207 100755 --- a/tests/btrfs/018 +++ b/tests/btrfs/018 @@ -6,32 +6,16 @@ # # Regression test to make sure we can move a subvol into another subvol # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick subvol -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs btrfs _require_scratch -rm -f $seqres.full - _scratch_mkfs > /dev/null 2>&1 _scratch_mount $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/test1 >> $seqres.full 2>&1 \ diff --git a/tests/btrfs/019 b/tests/btrfs/019 index 817a6b1b..a5b590d3 100755 --- a/tests/btrfs/019 +++ b/tests/btrfs/019 @@ -6,16 +6,12 @@ # # btrfs send ENOENT regression test, kernel bugzilla 60673 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send -here=`pwd` -tmp=/tmp/$$ tmp_dir=send_temp_$seq -status=1 # failure is the default! - +# Override the default cleanup function. _cleanup() { $BTRFS_UTIL_PROG subvolume delete $TEST_DIR/$tmp_dir/snap1 > /dev/null 2>&1 @@ -25,10 +21,7 @@ _cleanup() rm -f $tmp.* } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/btrfs/020 b/tests/btrfs/020 index 769e1776..ac876ea3 100755 --- a/tests/btrfs/020 +++ b/tests/btrfs/020 @@ -9,15 +9,10 @@ # Regression test for commit: # bbb651e Btrfs: don't allow the replace procedure on read only filesystems # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick replace volume +# Override the default cleanup function. _cleanup() { cd / @@ -30,10 +25,7 @@ _cleanup() rm -f $fs_img1 $fs_img2 $fs_img3 } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -41,7 +33,6 @@ _supported_fs btrfs _require_test _require_loop -rm -f $seqres.full echo "Silence is golden" loop_mnt=$TEST_DIR/$seq.$$.mnt diff --git a/tests/btrfs/021 b/tests/btrfs/021 index 6362281c..5943da2f 100755 --- a/tests/btrfs/021 +++ b/tests/btrfs/021 @@ -9,23 +9,10 @@ # The test aims to trigger snapshot-aware defrag path in endio by # running balance, which is not expected and leads to a crash. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick balance defrag -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -45,8 +32,6 @@ run_test() _supported_fs btrfs _require_scratch -rm -f $seqres.full - _scratch_mkfs > /dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/022 b/tests/btrfs/022 index 5369cf85..bfd6ac7f 100755 --- a/tests/btrfs/022 +++ b/tests/btrfs/022 @@ -6,31 +6,16 @@ # # Test the basic functionality of qgroups # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto qgroup limit -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs btrfs _require_scratch _require_btrfs_qgroup_report -rm -f $seqres.full - # Test to make sure we can actually turn it on and it makes sense _basic_test() { diff --git a/tests/btrfs/023 b/tests/btrfs/023 index 847e26e6..f6c05b12 100755 --- a/tests/btrfs/023 +++ b/tests/btrfs/023 @@ -8,29 +8,15 @@ # # The test aims to create the raid and verify that its created # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs btrfs _require_scratch_dev_pool 4 -rm -f $seqres.full create_group_profile() { diff --git a/tests/btrfs/024 b/tests/btrfs/024 index 8a3e433f..95c734ec 100755 --- a/tests/btrfs/024 +++ b/tests/btrfs/024 @@ -8,24 +8,10 @@ # the oops will happen when the users write some data into the files whose # compress flag is set but the compression of the fs is disabled. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick compress -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/btrfs/025 b/tests/btrfs/025 index 5c814055..b9ffd8cc 100755 --- a/tests/btrfs/025 +++ b/tests/btrfs/025 @@ -10,22 +10,18 @@ # to the ioctl clone API, which would return -EINVAL errors to btrfs receive, # causing the receive command to abort immediately. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send clone tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +29,6 @@ _supported_fs btrfs _require_scratch _require_xfs_io_command "falloc" -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/026 b/tests/btrfs/026 index d8239d51..ddd093b8 100755 --- a/tests/btrfs/026 +++ b/tests/btrfs/026 @@ -7,21 +7,10 @@ # Test that doing a direct IO write against a file range that contains one # prealloc extent and one compressed extent works correctly. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick compress prealloc -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -29,8 +18,6 @@ _supported_fs btrfs _require_scratch _require_xfs_io_command "falloc" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount "-o compress" diff --git a/tests/btrfs/027 b/tests/btrfs/027 index 30f2437f..e8679248 100755 --- a/tests/btrfs/027 +++ b/tests/btrfs/027 @@ -6,28 +6,12 @@ # # Test replace of a missing device on various data and metadata profiles. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto replace volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs diff --git a/tests/btrfs/028 b/tests/btrfs/028 index c2ffee36..fe0678f8 100755 --- a/tests/btrfs/028 +++ b/tests/btrfs/028 @@ -10,28 +10,12 @@ # Although current qgroup can handle it, we still need to prevent any # regression which may break current qgroup. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto qgroup balance -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch diff --git a/tests/btrfs/029 b/tests/btrfs/029 index 0234a7f0..1bdbc951 100755 --- a/tests/btrfs/029 +++ b/tests/btrfs/029 @@ -14,23 +14,10 @@ # - Copy a file with the reflink=always option. Should result in # error. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -45,8 +32,6 @@ reflink_test_dir=$TEST_DIR/test-$seq rm -rf $reflink_test_dir mkdir $reflink_test_dir -rm -f $seqres.full - _scratch_mkfs > /dev/null 2>&1 _scratch_mount $XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/original >> $seqres.full diff --git a/tests/btrfs/030 b/tests/btrfs/030 index bb10a5d1..bce5ba1e 100755 --- a/tests/btrfs/030 +++ b/tests/btrfs/030 @@ -17,21 +17,18 @@ # used while building path strings until a krealloc was unable to allocate # more memory, which caused a warning dump in dmesg. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -39,12 +36,9 @@ _supported_fs btrfs _require_scratch _require_fssum -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount - mkdir -p $SCRATCH_MNT/a/b/c echo "hello" > $SCRATCH_MNT/a/b/c/file.txt mkdir $SCRATCH_MNT/a/b/c/d diff --git a/tests/btrfs/031 b/tests/btrfs/031 index d950c86d..b0796bae 100755 --- a/tests/btrfs/031 +++ b/tests/btrfs/031 @@ -11,23 +11,10 @@ # - Change one original and two reflinked files # - Move reflinked files between subvolumes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick subvol clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -54,8 +41,6 @@ subvol1=$SCRATCH_MNT/subvol-$seq-1 subvol2=$SCRATCH_MNT/subvol-$seq-2 cross_mount_test_dir=$TEST_DIR/test-$seq -rm -f $seqres.full - _scratch_mkfs > /dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/032 b/tests/btrfs/032 index 3665a2cd..502a523b 100755 --- a/tests/btrfs/032 +++ b/tests/btrfs/032 @@ -7,23 +7,10 @@ # Regression test for transaction abortion when remounting RW to RO # with flushoncommit option enabled. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick remount -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/btrfs/033 b/tests/btrfs/033 index d1f8a4db..50ec5856 100755 --- a/tests/btrfs/033 +++ b/tests/btrfs/033 @@ -6,28 +6,12 @@ # # Regression test for iterating backrefs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send snapshot -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch diff --git a/tests/btrfs/034 b/tests/btrfs/034 index 07c84c34..92ad5c38 100755 --- a/tests/btrfs/034 +++ b/tests/btrfs/034 @@ -7,22 +7,18 @@ # Test for a btrfs incremental send data corruption issue due to # bad detection of file holes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,8 +26,6 @@ _supported_fs btrfs _require_scratch _require_xfs_io_command "falloc" -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/035 b/tests/btrfs/035 index a772650f..4ddc5bf6 100755 --- a/tests/btrfs/035 +++ b/tests/btrfs/035 @@ -6,23 +6,10 @@ # # Regression test for overwriting clones # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs diff --git a/tests/btrfs/036 b/tests/btrfs/036 index 36b652fd..c3d13da2 100755 --- a/tests/btrfs/036 +++ b/tests/btrfs/036 @@ -6,15 +6,12 @@ # # Regression test for running snapshots and send concurrently. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send snapshot -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! snapshots_pid=0 +# Override the default cleanup function. _cleanup() { # kill backgroud snapshots @@ -43,15 +40,9 @@ do_snapshots() done } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch diff --git a/tests/btrfs/037 b/tests/btrfs/037 index 9ef199a9..9ea43358 100755 --- a/tests/btrfs/037 +++ b/tests/btrfs/037 @@ -14,22 +14,18 @@ # # Btrfs: fix data corruption when reading/updating compressed extents # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick compress tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,8 +33,6 @@ _supported_fs btrfs _require_scratch _require_xfs_io_command "falloc" -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount "-o compress-force=lzo" diff --git a/tests/btrfs/038 b/tests/btrfs/038 index 4e24f236..13e50701 100755 --- a/tests/btrfs/038 +++ b/tests/btrfs/038 @@ -13,21 +13,18 @@ # # Btrfs: use right clone root offset for compressed extents # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick compress send tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,8 +32,6 @@ _supported_fs btrfs _require_scratch _require_fssum -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount "-o compress-force=lzo" diff --git a/tests/btrfs/039 b/tests/btrfs/039 index 46d27037..c2d7c20c 100755 --- a/tests/btrfs/039 +++ b/tests/btrfs/039 @@ -16,21 +16,18 @@ # # Btrfs: incremental send, fix invalid path after dir rename # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,8 +35,6 @@ _supported_fs btrfs _require_scratch _require_fssum -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/040 b/tests/btrfs/040 index 90ecdbe3..35bd12cd 100755 --- a/tests/btrfs/040 +++ b/tests/btrfs/040 @@ -16,21 +16,18 @@ # # Btrfs: send, don't send rmdir for same target multiple times # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,8 +35,6 @@ _supported_fs btrfs _require_scratch _require_fssum -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/041 b/tests/btrfs/041 index 89ab4e1b..5b457764 100755 --- a/tests/btrfs/041 +++ b/tests/btrfs/041 @@ -12,25 +12,19 @@ # # Btrfs-progs: fix restore of files with compressed extents # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick compress restore_dir=$TEST_DIR/btrfs-test-$seq +# Override the default cleanup function. _cleanup() { rm -fr $tmp rm -fr $restore_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,7 +32,6 @@ _supported_fs btrfs _require_test _require_scratch -rm -f $seqres.full mkdir $restore_dir test_btrfs_restore() diff --git a/tests/btrfs/042 b/tests/btrfs/042 index 7569530a..230f8fc0 100755 --- a/tests/btrfs/042 +++ b/tests/btrfs/042 @@ -6,31 +6,16 @@ # # Test the basic functionality of Quota groups # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick qgroup limit -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs btrfs _require_scratch _require_btrfs_qgroup_report -rm -f $seqres.full - run_check _scratch_mkfs _scratch_mount diff --git a/tests/btrfs/043 b/tests/btrfs/043 index 2eddbde1..14b7cb71 100755 --- a/tests/btrfs/043 +++ b/tests/btrfs/043 @@ -12,21 +12,18 @@ # # Btrfs: fix send attempting to rmdir non-empty directories # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +31,6 @@ _supported_fs btrfs _require_scratch _require_fssum -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/044 b/tests/btrfs/044 index 069c3bdf..0864d040 100755 --- a/tests/btrfs/044 +++ b/tests/btrfs/044 @@ -17,21 +17,18 @@ # # Btrfs: fix send issuing outdated paths for utimes, chown and chmod # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -39,8 +36,6 @@ _supported_fs btrfs _require_scratch _require_fssum -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/045 b/tests/btrfs/045 index a929bf91..9b23730b 100755 --- a/tests/btrfs/045 +++ b/tests/btrfs/045 @@ -33,21 +33,18 @@ # Btrfs: send, fix more issues related to directory renames # Btrfs: send, account for orphan directories when building path strings # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -55,8 +52,6 @@ _supported_fs btrfs _require_scratch _require_fssum -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/046 b/tests/btrfs/046 index a1d82e1c..f654adae 100755 --- a/tests/btrfs/046 +++ b/tests/btrfs/046 @@ -13,24 +13,21 @@ # # Btrfs: send, fix data corruption due to incorrect hole detection # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 send_files_dir=$TEST_DIR/btrfs-test-$seq +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -40,7 +37,6 @@ _require_scratch _require_xfs_io_command "falloc" _require_fssum -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/047 b/tests/btrfs/047 index 099ec24f..ac79b9f1 100755 --- a/tests/btrfs/047 +++ b/tests/btrfs/047 @@ -7,29 +7,13 @@ # Test that we can't set xattrs on subvolume placeholder directories. # Regression test for Btrfs: disable xattr operations on subvolume directories. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick snapshot attr + +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs diff --git a/tests/btrfs/048 b/tests/btrfs/048 index 222d7026..93d4a171 100755 --- a/tests/btrfs/048 +++ b/tests/btrfs/048 @@ -10,24 +10,17 @@ # btrfs: fix vanished compression property after failed set # btrfs: fix zstd compression parameter # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs @@ -40,7 +33,6 @@ _require_btrfs_command inspect-internal dump-super send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/049 b/tests/btrfs/049 index e154a005..ad4ef122 100755 --- a/tests/btrfs/049 +++ b/tests/btrfs/049 @@ -9,24 +9,17 @@ # # Btrfs: fix inode caching vs tree log # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -rf $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -35,8 +28,6 @@ _supported_fs btrfs _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 SAVE_MOUNT_OPTIONS="$MOUNT_OPTIONS" diff --git a/tests/btrfs/050 b/tests/btrfs/050 index 50c12c55..ef1b3139 100755 --- a/tests/btrfs/050 +++ b/tests/btrfs/050 @@ -15,22 +15,17 @@ # # Btrfs: send, fix incorrect ref access when using extrefs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -41,7 +36,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/051 b/tests/btrfs/051 index df3875ff..f0ac86aa 100755 --- a/tests/btrfs/051 +++ b/tests/btrfs/051 @@ -12,22 +12,17 @@ # # Btrfs: send, fix corrupted path strings for long paths # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,7 +33,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/052 b/tests/btrfs/052 index 37643036..4408de21 100755 --- a/tests/btrfs/052 +++ b/tests/btrfs/052 @@ -8,21 +8,16 @@ # file as a source and target. That is, clone extents within the same # file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,8 +25,6 @@ _supported_fs btrfs _require_scratch _require_cloner -rm -f $seqres.full - test_btrfs_clone_same_file() { if [ -z $1 ]; then diff --git a/tests/btrfs/053 b/tests/btrfs/053 index 2bb0ea82..fbd2e7d9 100755 --- a/tests/btrfs/053 +++ b/tests/btrfs/053 @@ -13,22 +13,17 @@ # # Btrfs: send, use the right limits for xattr names and values # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -46,7 +41,6 @@ leaf_size=$(echo -e "16384\n`getconf PAGE_SIZE`" | sort -nr | head -1) send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/054 b/tests/btrfs/054 index 6f7a9999..f1b5b2c3 100755 --- a/tests/btrfs/054 +++ b/tests/btrfs/054 @@ -21,22 +21,17 @@ # Btrfs: send, don't error in the presence of subvols/snapshots # Btrfs: set dead flag on the right root when destroying snapshot # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -47,7 +42,6 @@ _require_scratch send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/055 b/tests/btrfs/055 index e3355da3..e538636d 100755 --- a/tests/btrfs/055 +++ b/tests/btrfs/055 @@ -12,21 +12,16 @@ # # Btrfs: fix clone to deal with holes when NO_HOLES feature is enabled # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,8 +31,6 @@ _require_cloner _require_btrfs_fs_feature "no_holes" _require_btrfs_mkfs_feature "no-holes" -rm -f $seqres.full - test_btrfs_clone_with_holes() { _scratch_mkfs "$1" >/dev/null 2>&1 diff --git a/tests/btrfs/056 b/tests/btrfs/056 index bcf34d8d..e5ac516d 100755 --- a/tests/btrfs/056 +++ b/tests/btrfs/056 @@ -14,22 +14,17 @@ # # Btrfs: make fsync work after cloning into a file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -41,8 +36,6 @@ _require_btrfs_fs_feature "no_holes" _require_btrfs_mkfs_feature "no-holes" _require_dm_target flakey -rm -f $seqres.full - test_btrfs_clone_fsync_log_recover() { _scratch_mkfs "$1" >/dev/null 2>&1 diff --git a/tests/btrfs/057 b/tests/btrfs/057 index bf9ab14a..074ac96a 100755 --- a/tests/btrfs/057 +++ b/tests/btrfs/057 @@ -6,31 +6,16 @@ # # Quota rescan stress test, we run fsstress and quota rescan concurrently # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 - -_cleanup() -{ - cd / - rm -f $tmp.* -} -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. . ./common/filter # real QA test starts here _supported_fs btrfs _require_scratch -rm -f $seqres.full - run_check _scratch_mkfs "-b 1g" _scratch_mount diff --git a/tests/btrfs/058 b/tests/btrfs/058 index 96349f5a..493f2c54 100755 --- a/tests/btrfs/058 +++ b/tests/btrfs/058 @@ -13,14 +13,10 @@ # # Btrfs: update commit root on snapshot creation after orphan cleanup # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send snapshot +# Override the default cleanup function. _cleanup() { if [ ! -z $XFS_IO_PID ]; then @@ -29,8 +25,7 @@ _cleanup() rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,8 +33,6 @@ _supported_fs btrfs _require_scratch _require_xfs_io_command "-T" -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/btrfs/059 b/tests/btrfs/059 index af84f971..d2ced0ae 100755 --- a/tests/btrfs/059 +++ b/tests/btrfs/059 @@ -10,23 +10,16 @@ # # Btrfs: add missing compression property remove in btrfs_ioctl_setflags # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs @@ -36,8 +29,6 @@ _require_test _require_scratch _require_btrfs_command "property" -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/btrfs/060 b/tests/btrfs/060 index 6e026a5d..26db8a9b 100755 --- a/tests/btrfs/060 +++ b/tests/btrfs/060 @@ -7,23 +7,10 @@ # Run btrfs balance and subvolume create/mount/umount/delete simultaneously, # with fsstress running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto balance subvol -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _require_scratch_nocheck _require_scratch_dev_pool 4 _btrfs_get_profile_configs -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/061 b/tests/btrfs/061 index 97420335..55f5625b 100755 --- a/tests/btrfs/061 +++ b/tests/btrfs/061 @@ -7,23 +7,10 @@ # Run btrfs balance and scrub operations simultaneously with fsstress # running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto balance scrub -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _require_scratch_nocheck _require_scratch_dev_pool 4 _btrfs_get_profile_configs -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/062 b/tests/btrfs/062 index f27f22ac..47b0b937 100755 --- a/tests/btrfs/062 +++ b/tests/btrfs/062 @@ -7,23 +7,10 @@ # Run btrfs balance and defrag operations simultaneously with fsstress # running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto balance defrag compress -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _require_scratch_nocheck _require_scratch_dev_pool 4 _btrfs_get_profile_configs -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/063 b/tests/btrfs/063 index e34d1b57..c96390b9 100755 --- a/tests/btrfs/063 +++ b/tests/btrfs/063 @@ -7,23 +7,10 @@ # Run btrfs balance and remount with different compress algorithms # simultaneously, with fsstress running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto balance remount compress -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _require_scratch_nocheck _require_scratch_dev_pool 4 _btrfs_get_profile_configs -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/064 b/tests/btrfs/064 index ce73acf7..74116188 100755 --- a/tests/btrfs/064 +++ b/tests/btrfs/064 @@ -9,23 +9,10 @@ # Balance and replace operations are mutually exclusive operations they can't # run simultaneously. One of them is expected to fail when the other is running. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto balance replace volume -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,8 +23,6 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _btrfs_get_profile_configs replace -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/065 b/tests/btrfs/065 index 6994b2c4..4ebf9326 100755 --- a/tests/btrfs/065 +++ b/tests/btrfs/065 @@ -7,23 +7,10 @@ # Run btrfs subvolume create/mount/umount/delete and device replace # operation simultaneously, with fsstress running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto subvol replace volume -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +21,6 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _btrfs_get_profile_configs replace -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/066 b/tests/btrfs/066 index cd9aad9c..8d12af61 100755 --- a/tests/btrfs/066 +++ b/tests/btrfs/066 @@ -7,23 +7,10 @@ # Run btrfs subvolume create/mount/umount/delete and btrfs scrub # operation simultaneously, with fsstress running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto subvol scrub -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _require_scratch_nocheck _require_scratch_dev_pool 4 _btrfs_get_profile_configs -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/067 b/tests/btrfs/067 index ed4cef91..44803f9f 100755 --- a/tests/btrfs/067 +++ b/tests/btrfs/067 @@ -7,23 +7,10 @@ # Run btrfs subvolume create/mount/umount/delete and btrfs defrag # operation simultaneously, with fsstress running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto subvol defrag compress -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _require_scratch_nocheck _require_scratch_dev_pool 4 _btrfs_get_profile_configs -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/068 b/tests/btrfs/068 index 600ba40e..e03a4891 100755 --- a/tests/btrfs/068 +++ b/tests/btrfs/068 @@ -8,23 +8,10 @@ # different compress algorithms simultaneously, with fsstress running # in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto subvol remount compress -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +21,6 @@ _require_scratch_nocheck _require_scratch_dev_pool 4 _btrfs_get_profile_configs -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/069 b/tests/btrfs/069 index 924e5b5d..6e798a2e 100755 --- a/tests/btrfs/069 +++ b/tests/btrfs/069 @@ -7,23 +7,10 @@ # Run btrfs replace operations and scrub simultaneously with fsstress # running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto replace scrub volume -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +21,6 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _btrfs_get_profile_configs replace -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/070 b/tests/btrfs/070 index 7c6215b1..dcf978b3 100755 --- a/tests/btrfs/070 +++ b/tests/btrfs/070 @@ -7,23 +7,10 @@ # Run btrfs replace operations and defrag simultaneously with fsstress # running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto replace defrag compress volume -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +21,6 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _btrfs_get_profile_configs replace -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/071 b/tests/btrfs/071 index 4f5d531b..cd1de264 100755 --- a/tests/btrfs/071 +++ b/tests/btrfs/071 @@ -7,23 +7,10 @@ # Run btrfs replace operations and remount with different compress # algorithms simultaneously with fsstress running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto replace remount compress volume -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +21,6 @@ _require_scratch_dev_pool 5 _require_scratch_dev_pool_equal_size _btrfs_get_profile_configs replace -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/072 b/tests/btrfs/072 index c96a0a7a..bcb0ea25 100755 --- a/tests/btrfs/072 +++ b/tests/btrfs/072 @@ -7,23 +7,10 @@ # Run btrfs scrub and defrag operations simultaneously with fsstress # running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto scrub defrag compress -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _require_scratch_nocheck _require_scratch_dev_pool 4 _btrfs_get_profile_configs -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/073 b/tests/btrfs/073 index 18e3d43a..26c5deb6 100755 --- a/tests/btrfs/073 +++ b/tests/btrfs/073 @@ -7,23 +7,10 @@ # Run btrfs scrub and remount with different compress algorithms # simultaneously with fsstress running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto scrub remount compress -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _require_scratch_nocheck _require_scratch_dev_pool 4 _btrfs_get_profile_configs -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/074 b/tests/btrfs/074 index c894e23a..dc26d8c0 100755 --- a/tests/btrfs/074 +++ b/tests/btrfs/074 @@ -7,23 +7,10 @@ # Run btrfs defrag operations and remount with different compress algorithms # simultaneously with fsstress running in background. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto defrag remount compress -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _require_scratch_nocheck _require_scratch_dev_pool 4 _btrfs_get_profile_configs -rm -f $seqres.full - run_test() { local mkfs_opts=$1 diff --git a/tests/btrfs/075 b/tests/btrfs/075 index 24c3c0f2..e10d6562 100755 --- a/tests/btrfs/075 +++ b/tests/btrfs/075 @@ -7,15 +7,10 @@ # If one subvolume was mounted with selinux context, other subvolumes # should be able to be mounted with the same selinux context too. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick subvol +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() $UMOUNT_PROG $subvol_mnt >/dev/null 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,7 +30,6 @@ if [ "$SELINUX_MOUNT_OPTIONS" == "" ]; then _notrun "Require selinux to be enabled" fi -rm -f $seqres.full echo "Silence is golden" # first mount default subvolume with selinux context set diff --git a/tests/btrfs/076 b/tests/btrfs/076 index 7bca7af3..89e9672d 100755 --- a/tests/btrfs/076 +++ b/tests/btrfs/076 @@ -9,24 +9,17 @@ # # Btrfs: fix incorrect compression ratio detection # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick compress +# Override the default cleanup function. _cleanup() { cd / rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag @@ -35,8 +28,6 @@ _supported_fs btrfs _require_test _require_scratch -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount "-o compress=lzo" diff --git a/tests/btrfs/077 b/tests/btrfs/077 index f2dbf4ab..4cfd6ed7 100755 --- a/tests/btrfs/077 +++ b/tests/btrfs/077 @@ -19,22 +19,19 @@ # # Btrfs: send, don't delay dir move if there's a new parent inode # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send snapshot tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -44,7 +41,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/078 b/tests/btrfs/078 index 43f3315e..bdd7e04e 100755 --- a/tests/btrfs/078 +++ b/tests/btrfs/078 @@ -13,29 +13,24 @@ # Btrfs: race free update of commit root for ro snapshots # 9c3b306e1c9e6be4be09e99a8fe2227d1005effc # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto snapshot tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs btrfs _require_scratch -rm -f $seqres.full - workout() { ops=$1 diff --git a/tests/btrfs/079 b/tests/btrfs/079 index 5b7d5668..1acd1855 100755 --- a/tests/btrfs/079 +++ b/tests/btrfs/079 @@ -17,14 +17,10 @@ # btrfs: Fix and enhance merge_extent_mapping() to insert best fitted extent map # btrfs: Fix the wrong condition judgment about subset extent map # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto rw metadata +# Override the default cleanup function. _cleanup() { kill $dd_pid &> /dev/null @@ -34,8 +30,7 @@ _cleanup() rm -fr $tmp.* $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -51,8 +46,6 @@ buffersize=$((1024 * 1024)) # 1M bs for dd count=$(($filesize / $buffersize)) testfile=$SCRATCH_MNT/testfile -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount _require_fs_space $SCRATCH_MNT $(($filesize / 1024)) diff --git a/tests/btrfs/080 b/tests/btrfs/080 index 94a133cb..45f5ad19 100755 --- a/tests/btrfs/080 +++ b/tests/btrfs/080 @@ -16,13 +16,10 @@ # # Btrfs: fix snapshot inconsistency after a file write followed by truncate # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto snapshot +# Override the default cleanup function. _cleanup() { for p in ${cpu_stress_pids[*]}; do @@ -31,16 +28,13 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs btrfs _require_scratch_nocheck -rm -f $seqres.full - create_snapshot() { local ts=`date +'%H_%M_%S_%N'` diff --git a/tests/btrfs/081 b/tests/btrfs/081 index 0a46f594..65fed9a7 100755 --- a/tests/btrfs/081 +++ b/tests/btrfs/081 @@ -16,20 +16,10 @@ # Btrfs: ensure readers see new data after a clone operation # (commit c125b8bff1d9f6c8c91ce4eb8bd5616058c7d510) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick clone -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,8 +27,6 @@ _supported_fs btrfs _require_scratch _require_cloner -rm -f $seqres.full - num_extents=100 extent_size=8192 diff --git a/tests/btrfs/082 b/tests/btrfs/082 index 8faa43ee..888464d3 100755 --- a/tests/btrfs/082 +++ b/tests/btrfs/082 @@ -15,23 +15,10 @@ # btrfs: fix crash in remount(thread_pool=) case # 800ee2247f483b6d05ed47ef3bbc90b56451746c # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick remount -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/btrfs/083 b/tests/btrfs/083 index 821266b6..e09769dd 100755 --- a/tests/btrfs/083 +++ b/tests/btrfs/083 @@ -13,22 +13,17 @@ # # Btrfs: incremental send, don't rename a directory too soon # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,7 +33,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/084 b/tests/btrfs/084 index d216b2b9..04ccbb91 100755 --- a/tests/btrfs/084 +++ b/tests/btrfs/084 @@ -12,22 +12,17 @@ # # Btrfs: incremental send, clear name from cache after orphanization # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,7 +32,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/085 b/tests/btrfs/085 index 4622f208..cef4da28 100755 --- a/tests/btrfs/085 +++ b/tests/btrfs/085 @@ -13,24 +13,17 @@ # (i.e. btrfs subvol set-default) # 3) Non-default subvolume lookup # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick metadata subvol +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -40,8 +33,6 @@ _require_scratch _require_dm_target flakey _require_btrfs_command inspect-internal dump-tree -rm -f $seqres.full - has_orphan_item() { INO=$1 diff --git a/tests/btrfs/086 b/tests/btrfs/086 index f67a06bf..8c1339ab 100755 --- a/tests/btrfs/086 +++ b/tests/btrfs/086 @@ -15,21 +15,10 @@ # # Btrfs: fix inode eviction infinite loop after cloning into it # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,8 +26,6 @@ _supported_fs btrfs _require_scratch _require_cloner -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/btrfs/087 b/tests/btrfs/087 index a78b5976..59a775ef 100755 --- a/tests/btrfs/087 +++ b/tests/btrfs/087 @@ -18,22 +18,17 @@ # # Btrfs: incremental send, don't delay directory renames unnecessarily # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -43,7 +38,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/088 b/tests/btrfs/088 index 42982ece..d9c5528b 100755 --- a/tests/btrfs/088 +++ b/tests/btrfs/088 @@ -13,21 +13,10 @@ # Btrfs: fix fs corruption on transaction abort if device supports discard # (commit 678886bdc6378c1cbd5072da2c5a3035000214e3) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metadata -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -52,8 +41,6 @@ disable_io_failure() echo 0 > $DEBUGFS_MNT/fail_make_request/times } -rm -f $seqres.full - # We will abort a btrfs transaction later, which always produces a warning in # dmesg. We do not want the test to fail because of this. _disable_dmesg_check diff --git a/tests/btrfs/089 b/tests/btrfs/089 index 468d6140..e0b61e8e 100755 --- a/tests/btrfs/089 +++ b/tests/btrfs/089 @@ -8,23 +8,10 @@ # not unmounted prematurely. This is a regression test for Linux commit "Btrfs: # don't invalidate root dentry when subvolume deletion fails". # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick subvol + +# Import common functions. . ./common/filter . ./common/filter.btrfs @@ -34,8 +21,6 @@ _cleanup() _supported_fs btrfs _require_scratch -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/btrfs/090 b/tests/btrfs/090 index 59567095..766c24cd 100755 --- a/tests/btrfs/090 +++ b/tests/btrfs/090 @@ -13,23 +13,10 @@ # btrfs-progs: Fix wrong return value when executing 'fi show' on # umounted device. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metadata -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter.btrfs # real QA test starts here @@ -39,8 +26,6 @@ _supported_fs btrfs _require_scratch _require_scratch_dev_pool -rm -f $seqres.full - FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'` TOTAL_DEVS=`echo $SCRATCH_DEV_POOL | wc -w` diff --git a/tests/btrfs/091 b/tests/btrfs/091 index b8104429..307289b1 100755 --- a/tests/btrfs/091 +++ b/tests/btrfs/091 @@ -7,22 +7,10 @@ # Test for incorrect exclusive reference count after cloning file # between subvolumes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick qgroup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -32,8 +20,6 @@ _supported_fs btrfs _require_scratch _require_cp_reflink -rm -f $seqres.full - # use largest node/leaf size (64K) to allow the test to be run on arch with # page size > 4k. NODESIZE=65536 diff --git a/tests/btrfs/092 b/tests/btrfs/092 index 4ab34681..f752f972 100755 --- a/tests/btrfs/092 +++ b/tests/btrfs/092 @@ -17,22 +17,17 @@ # # Btrfs: incremental send, check if orphanized dir inode needs delayed rename # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -42,7 +37,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/093 b/tests/btrfs/093 index d0e38f4c..f4ee873a 100755 --- a/tests/btrfs/093 +++ b/tests/btrfs/093 @@ -12,21 +12,10 @@ # # Btrfs: fix range cloning when same inode used as source and destination # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +23,6 @@ _supported_fs btrfs _require_scratch _require_cloner -rm -f $seqres.full - # Create a file with an extent layout that confused the btrfs clone ioctl # implementation. The first extent item that is cloned by the second call # to the cloner program will have only a trailing part of it referenced by diff --git a/tests/btrfs/094 b/tests/btrfs/094 index a0230e65..e94cf17b 100755 --- a/tests/btrfs/094 +++ b/tests/btrfs/094 @@ -17,22 +17,17 @@ # # Btrfs: incremental send, fix clone operations for compressed extents # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -42,7 +37,6 @@ _require_cloner send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir @@ -67,7 +61,6 @@ $XFS_IO_PROG -f -c "pwrite -S 0xaa $((16 * $BLOCK_SIZE)) $((32 * $BLOCK_SIZE))" $XFS_IO_PROG -c "pwrite -S 0xbb $((16 * $BLOCK_SIZE)) $((28 * $BLOCK_SIZE))" \ -c "fsync" $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified - # Now rewrite the block range [45, 48[. This will make the inode's # metadata continue to point the 32 block extent we created earlier, # with a single extent item that points to it with a start offset diff --git a/tests/btrfs/095 b/tests/btrfs/095 index 9e16073b..b3a5fc14 100755 --- a/tests/btrfs/095 +++ b/tests/btrfs/095 @@ -12,21 +12,17 @@ # # The regression was introduced in the 4.2-rc1 Linux kernel. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -37,8 +33,6 @@ _require_dm_target flakey _require_cloner _require_xfs_io_command "falloc" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey @@ -103,7 +97,6 @@ $XFS_IO_PROG -c "pwrite -S 0xbb $((768 * $BLOCK_SIZE)) $((25 * $BLOCK_SIZE))" \ # The 25 blocks extent has a single back reference and it relates to file offset # mapped by 768th block. - # Now clone our 25 block extent into offset mapped by 150th block. That offset # covers the last 5 blocks of the prealloc extent, the whole 10 block extent and # 10 blocks of the hole starting at offset mapped by 165th block. diff --git a/tests/btrfs/096 b/tests/btrfs/096 index 5fcbdd7a..80818682 100755 --- a/tests/btrfs/096 +++ b/tests/btrfs/096 @@ -6,20 +6,10 @@ # # Test that we can not clone an inline extent into a non-zero file offset. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs @@ -28,8 +18,6 @@ _supported_fs btrfs _require_scratch _require_cloner -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/btrfs/097 b/tests/btrfs/097 index 576c45d1..16ed7e00 100755 --- a/tests/btrfs/097 +++ b/tests/btrfs/097 @@ -7,22 +7,17 @@ # Test that an incremental send works after a file gets one of its extents # cloned/deduplicated into lower file offsets. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send clone +# Override the default cleanup function. _cleanup() { rm -fr $send_files_dir rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -32,7 +27,6 @@ _require_cloner send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/098 b/tests/btrfs/098 index b81daefb..d4e9f43d 100755 --- a/tests/btrfs/098 +++ b/tests/btrfs/098 @@ -8,21 +8,17 @@ # lower file offset, after a power failure our file has the same content it # had before the power failure and after the extent cloning operation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata clone log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -32,8 +28,6 @@ _require_scratch _require_dm_target flakey _require_cloner -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey @@ -51,7 +45,6 @@ $XFS_IO_PROG -f -c "pwrite -S 0xaa $((200 * $BLOCK_SIZE)) $((25 * $BLOCK_SIZE))" -c "fsync" \ $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified - # Now clone part of our extent into file offset mapped by 100th block. This adds # a file extent item to our inode's metadata that points to the 25 block extent # we created before, using a data offset of 5 blocks and a data length of 5 diff --git a/tests/btrfs/099 b/tests/btrfs/099 index dafc7c4d..375cc2b9 100755 --- a/tests/btrfs/099 +++ b/tests/btrfs/099 @@ -7,23 +7,10 @@ # Check for qgroup reserved space leaks caused by re-writing dirty ranges # This bug has been present in btrfs qgroup for a long time # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick qgroup limit -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,8 +24,6 @@ _require_btrfs_qgroup_report BLOCKSIZE=$(( 2 * 1024 * 1024 )) # 2M block size FILESIZE=$(( 128 * 1024 * 1024 )) # 128M file size -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount _require_fs_space $SCRATCH_MNT $(($FILESIZE * 2 / 1024)) diff --git a/tests/btrfs/100 b/tests/btrfs/100 index ea08b96e..9986a06e 100755 --- a/tests/btrfs/100 +++ b/tests/btrfs/100 @@ -7,25 +7,17 @@ # Test device replace works when the source device has EIO # # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - +. ./common/preamble +_begin_fstest auto replace volume eio +# Override the default cleanup function. _cleanup() { _dmerror_cleanup rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs . ./common/dmerror @@ -34,8 +26,6 @@ _supported_fs btrfs _require_scratch_dev_pool 3 _require_dm_target error -rm -f $seqres.full - dev1="`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'`" dev2="`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $3}'`" diff --git a/tests/btrfs/101 b/tests/btrfs/101 index 0791def2..f0436f9f 100755 --- a/tests/btrfs/101 +++ b/tests/btrfs/101 @@ -7,25 +7,17 @@ # Test device delete when the source device has EIO # # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - +. ./common/preamble +_begin_fstest auto replace volume eio +# Override the default cleanup function. _cleanup() { _dmerror_cleanup rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs . ./common/dmerror @@ -35,8 +27,6 @@ _require_scratch_dev_pool 3 _require_btrfs_dev_del_by_devid _require_dm_target error -rm -f $seqres.full - dev1="`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'`" dev2="`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $3}'`" diff --git a/tests/btrfs/102 b/tests/btrfs/102 index 2642eb9b..e5a1b068 100755 --- a/tests/btrfs/102 +++ b/tests/btrfs/102 @@ -7,28 +7,16 @@ # Regression test for an ENOSPC issue when attempting to write to a file in # a filesystem without any data block groups allocated. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick metadata enospc balance + +# Import common functions. . ./common/filter # real QA test starts here _supported_fs btrfs _require_scratch -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 # Mount our filesystem without space caches enabled so that we do not get any diff --git a/tests/btrfs/103 b/tests/btrfs/103 index f554a484..57309106 100755 --- a/tests/btrfs/103 +++ b/tests/btrfs/103 @@ -7,20 +7,10 @@ # Regression test for file read corruption when using compressed extents that # are shared by multiple consecutive ranges of the same file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick clone compress -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -28,8 +18,6 @@ _supported_fs btrfs _require_scratch _require_cloner -rm -f $seqres.full - test_clone_and_read_compressed_extent() { local mount_opts=$1 @@ -47,7 +35,6 @@ test_clone_and_read_compressed_extent() -c "pwrite -S 0xcc $((3 * $BLOCK_SIZE)) $((1 * $BLOCK_SIZE))" \ $SCRATCH_MNT/foo | _filter_xfs_io_blocks_modified - # Now clone our extent into an adjacent offset. $CLONER_PROG -s $((1 * $BLOCK_SIZE)) -d $((4 * $BLOCK_SIZE)) \ -l $((2 * $BLOCK_SIZE)) $SCRATCH_MNT/foo $SCRATCH_MNT/foo diff --git a/tests/btrfs/104 b/tests/btrfs/104 index b7269111..499de6bf 100755 --- a/tests/btrfs/104 +++ b/tests/btrfs/104 @@ -16,35 +16,17 @@ # Btrfs: keep dropped roots in cache until transaciton commit # btrfs: qgroup: account shared subtree during snapshot delete # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto qgroup -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch _require_btrfs_qgroup_report -rm -f $seqres.full - # Create an fs tree of a given height at a target location. This is # done by agressively creating inline extents to expand the number of # nodes required. We also add an traditional extent so that diff --git a/tests/btrfs/105 b/tests/btrfs/105 index 96f11e4c..b6cc23b9 100755 --- a/tests/btrfs/105 +++ b/tests/btrfs/105 @@ -9,14 +9,10 @@ # gets replaced in the send snapshot by another one at the same exact location, # with the same name and with the same inode number. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,7 +29,6 @@ _require_scratch send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/106 b/tests/btrfs/106 index b181c3f4..db295e70 100755 --- a/tests/btrfs/106 +++ b/tests/btrfs/106 @@ -8,21 +8,10 @@ # that represent file ranges with a length that is a multiple of 16 pages # and that are shared by multiple consecutive ranges of the same file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone compress -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,8 +19,6 @@ _supported_fs btrfs _require_scratch _require_cloner -rm -f $seqres.full - test_clone_and_read_compressed_extent() { local mount_opts=$1 diff --git a/tests/btrfs/107 b/tests/btrfs/107 index 80db5ab9..58ff6936 100755 --- a/tests/btrfs/107 +++ b/tests/btrfs/107 @@ -7,29 +7,13 @@ # Test that calling fallocate against a range which is already # allocated does not truncate beyond EOF # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs diff --git a/tests/btrfs/108 b/tests/btrfs/108 index bf13328b..0f734e9c 100755 --- a/tests/btrfs/108 +++ b/tests/btrfs/108 @@ -7,14 +7,10 @@ # Test that a send operation works correctly with reflinked files (cloned # extents which multiple files point to). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send clone punch +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,7 +30,6 @@ _require_xfs_io_command "fpunch" send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/109 b/tests/btrfs/109 index b2edeb96..c545733e 100755 --- a/tests/btrfs/109 +++ b/tests/btrfs/109 @@ -7,14 +7,10 @@ # Test that a send operation works correctly with reflinked files (cloned # extents which multiple files point to) that have compressed extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send clone compress +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,7 +29,6 @@ _require_cp_reflink send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/110 b/tests/btrfs/110 index 3e914736..86049233 100755 --- a/tests/btrfs/110 +++ b/tests/btrfs/110 @@ -7,14 +7,10 @@ # Test that sending and receiving snapshots across different filesystems works # for full and incremental send operations. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -32,7 +27,6 @@ _require_scratch send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/111 b/tests/btrfs/111 index 376bea10..f03555bb 100755 --- a/tests/btrfs/111 +++ b/tests/btrfs/111 @@ -7,14 +7,10 @@ # Test that resending snapshots from a different filesystem is possible for # both full and incremental send operations. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -32,7 +27,6 @@ _require_scratch send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/112 b/tests/btrfs/112 index 97361e93..dac6b5b0 100755 --- a/tests/btrfs/112 +++ b/tests/btrfs/112 @@ -7,21 +7,10 @@ # Test several cases of cloning inline extents that used to lead to file # corruption or data loss. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick clone -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs @@ -33,8 +22,6 @@ _require_btrfs_fs_feature "no_holes" _require_btrfs_mkfs_feature "no-holes" _require_xfs_io_command "falloc" -rm -f $seqres.full - test_cloning_inline_extents() { local mkfs_opts=$1 diff --git a/tests/btrfs/113 b/tests/btrfs/113 index cab47784..7c90c3b6 100755 --- a/tests/btrfs/113 +++ b/tests/btrfs/113 @@ -9,21 +9,10 @@ # does not result in leaking stale data (data past the truncation offset) nor # losing data in the clone operation's destination file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick compress clone -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs @@ -32,8 +21,6 @@ _supported_fs btrfs _require_scratch _require_cloner -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount "-o compress" diff --git a/tests/btrfs/114 b/tests/btrfs/114 index 2d9546a1..28e1ce34 100755 --- a/tests/btrfs/114 +++ b/tests/btrfs/114 @@ -7,28 +7,12 @@ # btrfs quota scan/unmount sanity test # Make sure that unmounting during a quota rescan doesn't crash # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto qgroup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch diff --git a/tests/btrfs/115 b/tests/btrfs/115 index 02ae4e1d..715f10b2 100755 --- a/tests/btrfs/115 +++ b/tests/btrfs/115 @@ -7,28 +7,12 @@ # btrfs quota scan/disable sanity test # Make sure that disabling quotas during a quota rescan doesn't crash # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto qgroup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch @@ -43,7 +27,6 @@ echo 3 > /proc/sys/vm/drop_caches $BTRFS_UTIL_PROG quota enable $SCRATCH_MNT $BTRFS_UTIL_PROG quota disable $SCRATCH_MNT - echo "Silence is golden" status=0 exit diff --git a/tests/btrfs/116 b/tests/btrfs/116 index 3ed097ec..14182e9c 100755 --- a/tests/btrfs/116 +++ b/tests/btrfs/116 @@ -9,29 +9,16 @@ # with the content they had before the fitrim operation. These regions of the # device are reserved for a boot loader to use at its will. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs btrfs _require_scratch -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 # Write to the [0, 64Kb[ and [68Kb, 1Mb[ ranges of the device. These ranges are diff --git a/tests/btrfs/117 b/tests/btrfs/117 index 0d3ab3cd..6539827b 100755 --- a/tests/btrfs/117 +++ b/tests/btrfs/117 @@ -8,22 +8,12 @@ # for files that have a full path containing more than one parent directory # component. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send clone tmp=`mktemp -d` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -32,8 +22,6 @@ _supported_fs btrfs _require_scratch _require_cp_reflink -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/btrfs/118 b/tests/btrfs/118 index 89fe4d11..bd47748d 100755 --- a/tests/btrfs/118 +++ b/tests/btrfs/118 @@ -8,13 +8,10 @@ # deleted and crash, the next time we mount the filesystem, the log replay # procedure will not fail and the snapshot is not present anymore. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick snapshot metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -32,8 +28,6 @@ _supported_fs btrfs _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/btrfs/119 b/tests/btrfs/119 index fd4d744b..d1926da9 100755 --- a/tests/btrfs/119 +++ b/tests/btrfs/119 @@ -7,13 +7,10 @@ # Test log tree replay when qgroups are enabled and orphan roots (deleted # snapshots) exist. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick snapshot metadata qgroup log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -21,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -31,8 +27,6 @@ _supported_fs btrfs _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/btrfs/120 b/tests/btrfs/120 index d52b1df9..ba297bbb 100755 --- a/tests/btrfs/120 +++ b/tests/btrfs/120 @@ -9,13 +9,10 @@ # the new directory or a file inside the new directory, the fsync succeeds, # the fsync log is replayable and produces a correct result. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick snapshot metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -33,8 +29,6 @@ _supported_fs btrfs _require_scratch _require_dm_target flakey -rm -f $seqres.full - populate_testdir() { _run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT \ diff --git a/tests/btrfs/121 b/tests/btrfs/121 index 92026929..f4d54962 100755 --- a/tests/btrfs/121 +++ b/tests/btrfs/121 @@ -11,34 +11,16 @@ # [PATCH] btrfs: handle non-fatal errors in btrfs_qgroup_inherit() # http://thread.gmane.org/gmane.comp.file-systems.btrfs/54755 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick snapshot qgroup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch -rm -f $seqres.full - _scratch_mkfs >/dev/null _scratch_mount _run_btrfs_util_prog quota enable $SCRATCH_MNT diff --git a/tests/btrfs/122 b/tests/btrfs/122 index 70d1ec4f..34531753 100755 --- a/tests/btrfs/122 +++ b/tests/btrfs/122 @@ -7,35 +7,17 @@ # Test that qgroup counts are valid after snapshot creation. This has # been broken in btrfs since Linux v4.1 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick snapshot qgroup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch _require_btrfs_qgroup_report -rm -f $seqres.full - # Force a small leaf size to make it easier to blow out our root # subvolume tree _scratch_mkfs "--nodesize 16384" >/dev/null @@ -62,7 +44,6 @@ _run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT "$SCRATCH_MNT/snaps/snap2" _scratch_unmount - # qgroup will be checked by fstest at _check_scratch_fs() status=0 exit diff --git a/tests/btrfs/123 b/tests/btrfs/123 index c37fa720..c179eeec 100755 --- a/tests/btrfs/123 +++ b/tests/btrfs/123 @@ -10,28 +10,12 @@ # non-standard extent reference update, qgroup can't handle it correctly, # and leads to corrupted qgroup numbers. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick qgroup balance -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/124 b/tests/btrfs/124 index 4588264c..3036cbf4 100755 --- a/tests/btrfs/124 +++ b/tests/btrfs/124 @@ -22,15 +22,10 @@ # # Verify if all three checkpoints match # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto replace volume balance +# Override the default cleanup function. _cleanup() { cd / @@ -38,14 +33,10 @@ _cleanup() _btrfs_rescan_devices } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/module -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs diff --git a/tests/btrfs/125 b/tests/btrfs/125 index d125b111..e46b194d 100755 --- a/tests/btrfs/125 +++ b/tests/btrfs/125 @@ -21,15 +21,10 @@ # # Verify if all three checkpoints match # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest replace volume balance +# Override the default cleanup function. _cleanup() { cd / @@ -37,14 +32,10 @@ _cleanup() _btrfs_rescan_devices } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/module -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs @@ -92,7 +83,6 @@ _run_btrfs_util_prog filesystem show _run_btrfs_util_prog filesystem df $SCRATCH_MNT count=$(( count-- )) - #-------------degraded-init------------------- echo >> $seqres.full echo "-----Write degraded mount fill upto $max_fs_sz bytes-----" >> $seqres.full diff --git a/tests/btrfs/126 b/tests/btrfs/126 index 08d6ed4e..a13a0a6e 100755 --- a/tests/btrfs/126 +++ b/tests/btrfs/126 @@ -6,27 +6,11 @@ # # Regression test for leaking data space after hitting EDQUOTA # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick qgroup limit -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here diff --git a/tests/btrfs/127 b/tests/btrfs/127 index c9068c04..f2153172 100755 --- a/tests/btrfs/127 +++ b/tests/btrfs/127 @@ -8,14 +8,10 @@ # in the directory hierarchy that involve switching the inode that directory # entries point to. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +30,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/128 b/tests/btrfs/128 index d7f8fb2d..baf194cf 100755 --- a/tests/btrfs/128 +++ b/tests/btrfs/128 @@ -7,14 +7,10 @@ # Test that, under a particular scenario, an incremental send operation does # not leak memory (which used to emit a warning in dmesg/syslog). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,7 +29,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/129 b/tests/btrfs/129 index d504c81a..4e3046f3 100755 --- a/tests/btrfs/129 +++ b/tests/btrfs/129 @@ -8,14 +8,10 @@ # operations under a particular scenario (the rmdir operation is sent before # the target directory is empty). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +30,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/130 b/tests/btrfs/130 index ba5cbc35..6d9ddd48 100755 --- a/tests/btrfs/130 +++ b/tests/btrfs/130 @@ -11,29 +11,13 @@ # And unfortunately, btrfs send is one of these operations, and will cause # softlock or OOM on systems with small memory(<4G). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone send -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/131 b/tests/btrfs/131 index 395b6cc5..81e5d9bc 100755 --- a/tests/btrfs/131 +++ b/tests/btrfs/131 @@ -6,28 +6,12 @@ # # Test free space tree mount options. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs diff --git a/tests/btrfs/132 b/tests/btrfs/132 index bd608bf6..f50420f5 100755 --- a/tests/btrfs/132 +++ b/tests/btrfs/132 @@ -9,15 +9,10 @@ # write whose max extent size is not 128M (including compression and in-band # dedupe). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto enospc +# Override the default cleanup function. _cleanup() { cd / @@ -26,13 +21,9 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/133 b/tests/btrfs/133 index 5968ef13..4f45d6e8 100755 --- a/tests/btrfs/133 +++ b/tests/btrfs/133 @@ -8,14 +8,10 @@ # replaces an old inode that has the same number but different generation, # and both are direct children of the subvolume/snapshot root. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +30,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/134 b/tests/btrfs/134 index d12dc73e..b16fbc74 100755 --- a/tests/btrfs/134 +++ b/tests/btrfs/134 @@ -8,14 +8,10 @@ # a new parent directory, deleting its previous parent directory and creating # a new inode that has the same inode number as the old parent. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +30,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/135 b/tests/btrfs/135 index 6f57e4cf..36270562 100755 --- a/tests/btrfs/135 +++ b/tests/btrfs/135 @@ -9,14 +9,10 @@ # have an entry with the same name that corresponds to different inodes in each # snapshot. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,7 +31,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/136 b/tests/btrfs/136 index 1ca793aa..896be18d 100755 --- a/tests/btrfs/136 +++ b/tests/btrfs/136 @@ -11,28 +11,12 @@ # 3) populate data. # 4) source has combination of non-extent and extent files. # 5) convert it to btrfs, mount and verify contents. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto convert -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. @@ -44,8 +28,6 @@ _require_command "$MKFS_EXT4_PROG" mkfs.ext4 _require_command "$E2FSCK_PROG" e2fsck _require_command "$TUNE2FS_PROG" tune2fs -rm -f $seqres.full - BLOCK_SIZE=`_get_block_size $TEST_DIR` EXT_MD5SUM="$tmp.ext43" BTRFS_MD5SUM="$tmp.btrfs" diff --git a/tests/btrfs/137 b/tests/btrfs/137 index 05f665f0..64ed2450 100755 --- a/tests/btrfs/137 +++ b/tests/btrfs/137 @@ -6,14 +6,10 @@ # # Test that both incremental and full send operations preserve file holes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -21,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch @@ -34,7 +29,6 @@ _require_xfs_io_command "fiemap" send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/138 b/tests/btrfs/138 index eac66caf..f99e58e7 100755 --- a/tests/btrfs/138 +++ b/tests/btrfs/138 @@ -7,28 +7,12 @@ # Test decompression in the middle of large extents. Regression test for Linux # kernel commit 6e78b3f7a193 ("Btrfs: fix btrfs_decompress_buf2page()"). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto compress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs diff --git a/tests/btrfs/139 b/tests/btrfs/139 index 047a41ca..7760182a 100755 --- a/tests/btrfs/139 +++ b/tests/btrfs/139 @@ -9,28 +9,12 @@ # # Finally we create files to exceed the quota. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto qgroup limit -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs btrfs # We at least need 2GB of free space on $SCRATCH_DEV _require_scratch_size $((2 * 1024 * 1024)) @@ -45,7 +29,6 @@ _run_btrfs_util_prog quota enable $SCRATCH_MNT _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT _run_btrfs_util_prog qgroup limit -e 1G $SUBVOL - # Write and delete files within 1G limits, multiple times for i in $(seq 1 5); do for j in $(seq 1 240); do diff --git a/tests/btrfs/140 b/tests/btrfs/140 index 86fb0d58..f3379cae 100755 --- a/tests/btrfs/140 +++ b/tests/btrfs/140 @@ -11,28 +11,12 @@ # The upstream fix is # commit 2e949b0a5592 ("Btrfs: fix invalid dereference in btrfs_retry_endio") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/141 b/tests/btrfs/141 index bc4ba52d..6f9a177a 100755 --- a/tests/btrfs/141 +++ b/tests/btrfs/141 @@ -12,28 +12,12 @@ # The upstream fix is # Commit 9d0d1c8b1c9d ("Btrfs: bring back repair during read") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/142 b/tests/btrfs/142 index c8660fd6..3caa37d1 100755 --- a/tests/btrfs/142 +++ b/tests/btrfs/142 @@ -12,29 +12,13 @@ # The upstream fix is # commit 97bf5a5589aa ("Btrfs: fix segmentation fault when doing dio read") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. . ./common/filter . ./common/dmdust -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/143 b/tests/btrfs/143 index 88fdbe60..f062f77b 100755 --- a/tests/btrfs/143 +++ b/tests/btrfs/143 @@ -19,29 +19,13 @@ # The upstream fix is # commit 9d0d1c8b1c9d ("Btrfs: bring back repair during read") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. . ./common/filter . ./common/dmdust -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/144 b/tests/btrfs/144 index c77e4cf1..d41ce7e3 100755 --- a/tests/btrfs/144 +++ b/tests/btrfs/144 @@ -8,14 +8,10 @@ # renamed, a new hard link added to it and some other inode B is renamed to # the old name of inode A. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +30,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/145 b/tests/btrfs/145 index 825b7bd5..ba97a2ad 100755 --- a/tests/btrfs/145 +++ b/tests/btrfs/145 @@ -8,14 +8,10 @@ # then rename some file inode B to the name inode A had, for the case where the # directory inode A is an ancestor of inode B in the parent snapshot. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +30,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/146 b/tests/btrfs/146 index c5feae83..64c3513f 100755 --- a/tests/btrfs/146 +++ b/tests/btrfs/146 @@ -9,15 +9,10 @@ # on all fds and fsync on all fds. Ensure that we get errors on all of them. # Then fsync on all one last time and verify that all return 0. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick eio +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +20,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror @@ -47,8 +41,6 @@ SCRATCH_DEV=$DMERROR_DEV _require_scratch _require_scratch_dev_pool -rm -f $seqres.full - echo "Format and mount" # Build a filesystem with 2 devices that stripes the data across diff --git a/tests/btrfs/147 b/tests/btrfs/147 index d58b53aa..74ead3d6 100755 --- a/tests/btrfs/147 +++ b/tests/btrfs/147 @@ -8,14 +8,10 @@ # some directory inode A, renaming a regular file inode B into the old name of # inode A and finally creating a new hard link for inode B at directory inode A. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +30,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/148 b/tests/btrfs/148 index 4bb99714..510e46dc 100755 --- a/tests/btrfs/148 +++ b/tests/btrfs/148 @@ -6,22 +6,10 @@ # # Test that direct IO writes work on RAID5 and RAID6 filesystems. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +21,6 @@ _require_btrfs_fs_feature raid56 _scratch_dev_pool_get 4 -rm -f $seqres.full - test_direct_io_write() { local mkfs_options=$1 diff --git a/tests/btrfs/149 b/tests/btrfs/149 index e42c760c..176d8ec5 100755 --- a/tests/btrfs/149 +++ b/tests/btrfs/149 @@ -9,14 +9,10 @@ # has an extent at a file offset 0 that is not compressed and that is # shared. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send compress +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -39,7 +34,6 @@ _require_btrfs_command inspect-internal dump-super send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/150 b/tests/btrfs/150 index 0840e0a0..56938b0f 100755 --- a/tests/btrfs/150 +++ b/tests/btrfs/150 @@ -10,28 +10,12 @@ # The patch to fix it is # Btrfs: fix kernel oops while reading compressed data # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dangerous -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/151 b/tests/btrfs/151 index cd18f895..3150fef0 100755 --- a/tests/btrfs/151 +++ b/tests/btrfs/151 @@ -10,28 +10,12 @@ # The fix is # Btrfs: avoid losing data raid profile when deleting a device # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/152 b/tests/btrfs/152 index 9cbd24cf..75f576c3 100755 --- a/tests/btrfs/152 +++ b/tests/btrfs/152 @@ -7,30 +7,16 @@ # Test that incremental send/receive operations don't corrupt metadata when # qgroups are enabled. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metadata qgroup send -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs btrfs _require_scratch -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/btrfs/153 b/tests/btrfs/153 index e802acc0..4c28a2b8 100755 --- a/tests/btrfs/153 +++ b/tests/btrfs/153 @@ -6,28 +6,12 @@ # # Test for leaking quota reservations on preallocated files. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick qgroup limit -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/154 b/tests/btrfs/154 index f5dfce4b..240c504c 100755 --- a/tests/btrfs/154 +++ b/tests/btrfs/154 @@ -11,23 +11,10 @@ # This bug is going to be fixed by a patch for kernel titled # "btrfs: correctly calculate item size used when item key collision happens" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,8 +23,6 @@ _supported_fs btrfs _require_scratch _require_command $PYTHON2_PROG python2 -rm -f $seqres.full - # Currently in btrfs the node/leaf size can not be smaller than the page # size (but it can be greater than the page size). So use the largest # supported node/leaf size (64Kb) so that the test can run on any platform diff --git a/tests/btrfs/155 b/tests/btrfs/155 index fcb73382..e99a1054 100755 --- a/tests/btrfs/155 +++ b/tests/btrfs/155 @@ -8,14 +8,10 @@ # hard links has some of its hard links renamed in the send snapshot, with one # of them getting the same path that some other inode had in the send snapshot. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +30,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/156 b/tests/btrfs/156 index 89c80e71..364135ab 100755 --- a/tests/btrfs/156 +++ b/tests/btrfs/156 @@ -14,27 +14,11 @@ # # Fixed by patch named "btrfs: Ensure btrfs_trim_fs can trim the whole fs". # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick trim balance -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here diff --git a/tests/btrfs/157 b/tests/btrfs/157 index e7118dbc..c08cebdc 100755 --- a/tests/btrfs/157 +++ b/tests/btrfs/157 @@ -20,28 +20,12 @@ # Btrfs: do not merge rbios if their fail stripe index are not identical # Btrfs: make raid6 rebuild retry more # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick raid -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/158 b/tests/btrfs/158 index 803d6b9e..4a642f52 100755 --- a/tests/btrfs/158 +++ b/tests/btrfs/158 @@ -12,28 +12,12 @@ # Btrfs: make raid6 rebuild retry more # Btrfs: fix scrub to repair raid6 corruption # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick raid scrub -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/159 b/tests/btrfs/159 index cf4f1f47..7641f65d 100755 --- a/tests/btrfs/159 +++ b/tests/btrfs/159 @@ -8,13 +8,10 @@ # layout, if we punch a hole and fsync the file, at replay time the whole # hole was preserved. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick punch log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _require_dm_target flakey _require_xfs_io_command "fpunch" _require_odirect -rm -f $seqres.full - run_test() { local punch_offset=$1 diff --git a/tests/btrfs/160 b/tests/btrfs/160 index ed3d9483..48c2133c 100755 --- a/tests/btrfs/160 +++ b/tests/btrfs/160 @@ -8,15 +8,10 @@ # errors, write to it again and call sync. Close the file, reopen it and # then call fsync on it. Is the error reported? # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick eio +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +19,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror @@ -35,8 +29,6 @@ _require_scratch_dev_pool _require_dm_target error -rm -f $seqres.full - # bring up dmerror device _dmerror_init diff --git a/tests/btrfs/161 b/tests/btrfs/161 index 078e570e..059b95ca 100755 --- a/tests/btrfs/161 +++ b/tests/btrfs/161 @@ -8,28 +8,12 @@ # Create a seed device, mount it and, add a new device to create a # sprout filesystem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick volume seed -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/162 b/tests/btrfs/162 index 83816ad0..ba37ef0c 100755 --- a/tests/btrfs/162 +++ b/tests/btrfs/162 @@ -9,29 +9,13 @@ # Create a sprout device # Make the sprout device a seed device and create a sprout device again # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick volume seed -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/163 b/tests/btrfs/163 index b6bd6906..1dc081f1 100755 --- a/tests/btrfs/163 +++ b/tests/btrfs/163 @@ -13,15 +13,10 @@ # Depends on the kernel patch # c6a5d954950c btrfs: fail replace of seed device -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick volume seed +# Override the default cleanup function. _cleanup() { cd / @@ -29,14 +24,10 @@ _cleanup() _btrfs_rescan_devices } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/164 b/tests/btrfs/164 index ad22b6a4..59a9c90e 100755 --- a/tests/btrfs/164 +++ b/tests/btrfs/164 @@ -9,15 +9,10 @@ # Create a sprout device # Remount RW # Run device delete on the seed device -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick volume +# Override the default cleanup function. _cleanup() { cd / @@ -25,13 +20,9 @@ _cleanup() _btrfs_rescan_devices } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/module -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/165 b/tests/btrfs/165 index 762409cf..c4a52a15 100755 --- a/tests/btrfs/165 +++ b/tests/btrfs/165 @@ -9,20 +9,8 @@ # This behavior has been restricted long time but becomes allowed by kernel # commit a79a464d5675 ("btrfs: Allow rmdir(2) to delete an empty subvolume") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick subvol create_subvol() { @@ -43,13 +31,9 @@ rm_r_subvol() { rm -r $1 >> $seqres.full 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch diff --git a/tests/btrfs/166 b/tests/btrfs/166 index a15f0cd8..47f7f9b3 100755 --- a/tests/btrfs/166 +++ b/tests/btrfs/166 @@ -8,13 +8,10 @@ # enabled while the quota rescan kernel thread is running, we will be able # to mount the filesystem after the power failure. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick qgroup +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -32,8 +28,6 @@ _supported_fs btrfs _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/btrfs/167 b/tests/btrfs/167 index 0b5e8937..fb271cfa 100755 --- a/tests/btrfs/167 +++ b/tests/btrfs/167 @@ -10,28 +10,12 @@ # This could be fixed by the following kernel commit: # ac0b4145d662 ("btrfs: scrub: Don't use inode pages for device replace") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick replace volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/168 b/tests/btrfs/168 index 1e461c0f..acc58b51 100755 --- a/tests/btrfs/168 +++ b/tests/btrfs/168 @@ -8,13 +8,10 @@ # (or subvolume) has a file that is deleted while there is still a open file # descriptor for that file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() rm -fr $send_files_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +31,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/169 b/tests/btrfs/169 index 1a9bbe33..a3f823fe 100755 --- a/tests/btrfs/169 +++ b/tests/btrfs/169 @@ -8,13 +8,10 @@ # that has a prealloc (unwritten) extent beyond its EOF gets a hole punched # in a section of that prealloc extent. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() rm -fr $send_files_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +31,6 @@ _require_xfs_io_command "falloc" "-k" send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/170 b/tests/btrfs/170 index 7ad28b3f..15382eb3 100755 --- a/tests/btrfs/170 +++ b/tests/btrfs/170 @@ -8,21 +8,10 @@ # more space left to allocate in the filesystem and then snapshot the file's # subvolume, after a clean shutdown the data was not lost. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick snapshot -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,8 +19,6 @@ _supported_fs btrfs _require_scratch _require_xfs_io_command "falloc" "-k" -rm -f $seqres.full - # Use a fixed size filesystem so that we can precisely fill the data block group # mkfs.btrfs creates and allocate all unused space for a new data block group. # It's important to not use the mixed block groups feature as well because we diff --git a/tests/btrfs/171 b/tests/btrfs/171 index 4199d1d2..461cdd0f 100755 --- a/tests/btrfs/171 +++ b/tests/btrfs/171 @@ -10,29 +10,13 @@ # Fixed by the following kernel patch: # "btrfs: qgroup: Dirty all qgroups before rescan" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick qgroup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch @@ -40,7 +24,6 @@ _require_scratch _scratch_mkfs > /dev/null 2>&1 _scratch_mount - # Populate the fs $BTRFS_UTIL_PROG subvolume create "$SCRATCH_MNT/subvol" > /dev/null _pwrite_byte 0xcdcd 0 1M "$SCRATCH_MNT/subvol/file1" > /dev/null @@ -51,7 +34,6 @@ sync $BTRFS_UTIL_PROG subvolume snapshot "$SCRATCH_MNT/subvol" \ "$SCRATCH_MNT/snapshot" > /dev/null - $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT" > /dev/null $BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null diff --git a/tests/btrfs/172 b/tests/btrfs/172 index 9cda7d60..4db54642 100755 --- a/tests/btrfs/172 +++ b/tests/btrfs/172 @@ -10,29 +10,13 @@ # btrfs: use the file extent tree infrastructure # btrfs: replace all uses of btrfs_ordered_update_i_size # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick log replay -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmlogwrites -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/173 b/tests/btrfs/173 index ecea1106..1252587c 100755 --- a/tests/btrfs/173 +++ b/tests/btrfs/173 @@ -7,26 +7,11 @@ # Test swap file activation restrictions specific to Btrfs, swap file can't be # CoW file nor compressed file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick swap -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -. ./common/rc . ./common/filter -rm -f $seqres.full - _supported_fs btrfs _require_scratch_swapfile diff --git a/tests/btrfs/174 b/tests/btrfs/174 index ec2c04b0..8bf856ae 100755 --- a/tests/btrfs/174 +++ b/tests/btrfs/174 @@ -7,26 +7,11 @@ # Test restrictions on operations that can be done on an active swap file # specific to Btrfs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick swap -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -. ./common/rc . ./common/filter -rm -f $seqres.full - _supported_fs btrfs _require_scratch_swapfile diff --git a/tests/btrfs/175 b/tests/btrfs/175 index 94f56284..8a9c0721 100755 --- a/tests/btrfs/175 +++ b/tests/btrfs/175 @@ -6,26 +6,11 @@ # # Test swap file activation on multiple devices. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick swap volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -. ./common/rc . ./common/filter -rm -f $seqres.full - _supported_fs btrfs _require_scratch_dev_pool 2 _require_scratch_swapfile diff --git a/tests/btrfs/176 b/tests/btrfs/176 index 838c25db..41b02eb6 100755 --- a/tests/btrfs/176 +++ b/tests/btrfs/176 @@ -6,28 +6,12 @@ # # Test device remove/replace with an active swap file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick swap volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/177 b/tests/btrfs/177 index bfcd07bf..966d29d7 100755 --- a/tests/btrfs/177 +++ b/tests/btrfs/177 @@ -6,27 +6,12 @@ # # Test relocation (balance and resize) with an active swap file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick swap balance -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -. ./common/rc . ./common/filter . ./common/btrfs -rm -f $seqres.full - # Modify as appropriate. _supported_fs btrfs _require_scratch_swapfile diff --git a/tests/btrfs/178 b/tests/btrfs/178 index a80d1eca..5e148615 100755 --- a/tests/btrfs/178 +++ b/tests/btrfs/178 @@ -10,14 +10,10 @@ # become descendents of multiple directories that used to be their ancestors in # the parent snapshot. This used to trigger an infinite loop in the kernel code. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +21,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,7 +32,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/179 b/tests/btrfs/179 index 8a12b012..9a3b36ab 100755 --- a/tests/btrfs/179 +++ b/tests/btrfs/179 @@ -9,28 +9,12 @@ # This bug is going to be fixed by a patch for the kernel titled # "btrfs: qgroup: Don't trigger backref walk at delayed ref insert time". # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto qgroup dangerous -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/180 b/tests/btrfs/180 index fe538fc5..68e382f6 100755 --- a/tests/btrfs/180 +++ b/tests/btrfs/180 @@ -10,27 +10,11 @@ # This bug is going to be fxied by a patch for kernel titled # "btrfs: qgroup: Make qgroup async transaction commit more aggressive" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick qgroup limit -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here diff --git a/tests/btrfs/181 b/tests/btrfs/181 index d27850f8..843413fc 100755 --- a/tests/btrfs/181 +++ b/tests/btrfs/181 @@ -10,28 +10,12 @@ # This bug is going to be fixed by a patch for kernel title # "btrfs: don't end the transaction for delayed refs in throttle" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick balance -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/182 b/tests/btrfs/182 index 34ee728f..1967469b 100755 --- a/tests/btrfs/182 +++ b/tests/btrfs/182 @@ -12,27 +12,11 @@ # There is one proposed patch for btrfs-progs to fix it, titled: # "btrfs-progs: balance: Sync the fs before balancing metadata chunks" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick balance -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here diff --git a/tests/btrfs/183 b/tests/btrfs/183 index 63703c08..e7afb058 100755 --- a/tests/btrfs/183 +++ b/tests/btrfs/183 @@ -7,21 +7,10 @@ # Regression test for read corruption of compressed and shared extents after # punching holes into a file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone compress punch -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -30,8 +19,6 @@ _supported_fs btrfs _require_scratch_reflink _require_xfs_io_command "fpunch" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount "-o compress" diff --git a/tests/btrfs/184 b/tests/btrfs/184 index 53277c7e..2efcfb64 100755 --- a/tests/btrfs/184 +++ b/tests/btrfs/184 @@ -7,27 +7,12 @@ # Verify that when a device is removed from a multi-device # filesystem its superblock copies are correctly deleted # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch diff --git a/tests/btrfs/185 b/tests/btrfs/185 index 86af0563..7850f1bc 100755 --- a/tests/btrfs/185 +++ b/tests/btrfs/185 @@ -8,16 +8,11 @@ # Could be fixed by # a9261d4125c9 ("btrfs: harden agaist duplicate fsid on scanned devices") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest volume mnt=$TEST_DIR/$seq.mnt +# Override the default cleanup function. _cleanup() { rm -rf $mnt > /dev/null 2>&1 @@ -25,13 +20,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch_dev_pool 2 diff --git a/tests/btrfs/186 b/tests/btrfs/186 index d8c970ea..b52d0b05 100755 --- a/tests/btrfs/186 +++ b/tests/btrfs/186 @@ -9,13 +9,10 @@ # readonly mode and then use it for send a operation, the send stream will # contain the delalloc data - that is, no data loss happens. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send volume +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() rm -fr $send_files_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +31,6 @@ _require_btrfs_command "property" send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/187 b/tests/btrfs/187 index 7da09abd..574636a6 100755 --- a/tests/btrfs/187 +++ b/tests/btrfs/187 @@ -12,21 +12,10 @@ # with large differences between the parent and send snapshots in order to hit # such issues with a good probability. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto send dedupe clone balance -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr . ./common/filter . ./common/reflink @@ -36,8 +25,6 @@ _supported_fs btrfs _require_scratch_dedupe _require_attrs -rm -f $seqres.full - # We at least need 8GB of free space on $SCRATCH_DEV _require_scratch_size $((8 * 1024 * 1024)) diff --git a/tests/btrfs/188 b/tests/btrfs/188 index bc655025..fcaf84b1 100755 --- a/tests/btrfs/188 +++ b/tests/btrfs/188 @@ -9,13 +9,10 @@ # start after its size and hole is punched (after the first snapshot is made) # that removes all extents from some offset up to the file's size. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send prealloc punch +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() rm -fr $send_files_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,7 +34,6 @@ _require_xfs_io_command "falloc" "-k" send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/189 b/tests/btrfs/189 index 9dbd31a6..ec6e56fa 100755 --- a/tests/btrfs/189 +++ b/tests/btrfs/189 @@ -11,13 +11,10 @@ # commit ac765f83f1397646 ("Btrfs: fix data corruption due to cloning of eof # block"), or cause silent data corruption for older kernels. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send clone +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +22,7 @@ _cleanup() rm -fr $send_files_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,7 +34,6 @@ _require_scratch_reflink send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/190 b/tests/btrfs/190 index 820b0a96..3aa718e2 100755 --- a/tests/btrfs/190 +++ b/tests/btrfs/190 @@ -7,29 +7,13 @@ # A general test to validate that balance and qgroups work correctly when # balance needs to be resumed on mount. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick replay balance qgroup + +# Import common functions. . ./common/filter . ./common/dmlogwrites -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/191 b/tests/btrfs/191 index 3fb35634..3c565d0a 100755 --- a/tests/btrfs/191 +++ b/tests/btrfs/191 @@ -7,14 +7,10 @@ # Test that an incremental send operation works after deduplicating into the # same file in both the parent and send snapshots. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send dedupe +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,7 +30,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/192 b/tests/btrfs/192 index 8d742119..dd197b6b 100755 --- a/tests/btrfs/192 +++ b/tests/btrfs/192 @@ -7,15 +7,10 @@ # Test btrfs consistency after each FUA for a workload with snapshot creation # and removal # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto replay snapshot stress +# Override the default cleanup function. _cleanup() { cd / @@ -27,15 +22,11 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/dmlogwrites -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/193 b/tests/btrfs/193 index f4a1b5c9..ae293f2e 100755 --- a/tests/btrfs/193 +++ b/tests/btrfs/193 @@ -9,28 +9,12 @@ # The fix is titled: # "btrfs: qgroup: Fix the wrong target io_tree when freeing reserved data space" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick qgroup enospc limit -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/194 b/tests/btrfs/194 index 16334a35..9a67e572 100755 --- a/tests/btrfs/194 +++ b/tests/btrfs/194 @@ -10,28 +10,12 @@ # tree-checker: Verify dev item"). # The fix is titled: "btrfs: tree-checker: Fix wrong check on max devid" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/195 b/tests/btrfs/195 index 8659e1db..59b97970 100755 --- a/tests/btrfs/195 +++ b/tests/btrfs/195 @@ -7,35 +7,18 @@ # Test raid profile conversion. It's sufficient to test all dest profiles as # source profiles just rely on being able to read the data and metadata. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto volume balance -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. _supported_fs btrfs _require_scratch_dev_pool 4 - declare -a TEST_VECTORS=( # $nr_dev_min:$data:$metadata:$data_convert:$metadata_convert "4:single:raid1" diff --git a/tests/btrfs/196 b/tests/btrfs/196 index 9c9eec9a..71b67ce2 100755 --- a/tests/btrfs/196 +++ b/tests/btrfs/196 @@ -11,16 +11,12 @@ # # Will do log replay and check the filesystem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto metadata log volume -here=`pwd` -tmp=/tmp/$$ fio_config=$tmp.fio -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -29,15 +25,11 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmthin . ./common/dmlogwrites -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/197 b/tests/btrfs/197 index 6f199352..f5baf5b6 100755 --- a/tests/btrfs/197 +++ b/tests/btrfs/197 @@ -9,15 +9,10 @@ # btrfs: include non-missing as a qualifier for the latest_bdev # btrfs: remove identified alien btrfs device in open_fs_devices # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick volume +# Override the default cleanup function. _cleanup() { $UMOUNT_PROG $TEST_DIR/$seq.mnt >/dev/null 2>&1 @@ -26,14 +21,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_test diff --git a/tests/btrfs/198 b/tests/btrfs/198 index 330fcee2..b3e175a2 100755 --- a/tests/btrfs/198 +++ b/tests/btrfs/198 @@ -8,29 +8,13 @@ # Bug fixed in: # btrfs: remove identified alien device in open_fs_devices # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest quick volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_command "$WIPEFS_PROG" wipefs diff --git a/tests/btrfs/199 b/tests/btrfs/199 index 5a0b4382..6aca62f4 100755 --- a/tests/btrfs/199 +++ b/tests/btrfs/199 @@ -15,15 +15,10 @@ # The fix is: "btrfs: extent-tree: Ensure we trim ranges across block group # boundary" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick trim +# Override the default cleanup function. _cleanup() { cd / @@ -32,13 +27,9 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. @@ -115,7 +106,6 @@ sync _pwrite_byte 0xcd 0 1M $loop_mnt/tail_padding > /dev/null sync - $XFS_IO_PROG -c "fiemap" $loop_mnt/cross_boundary >> $seqres.full # Ensure all extent are continuous # Btrfs fiemap will merge continuous results, so the output should be only diff --git a/tests/btrfs/200 b/tests/btrfs/200 index fd0d18d3..48cd7046 100755 --- a/tests/btrfs/200 +++ b/tests/btrfs/200 @@ -7,13 +7,10 @@ # Check that send operations (full and incremental) are able to issue clone # operations for extents that are shared between the same file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send clone +# Override the default cleanup function. _cleanup() { cd / @@ -21,8 +18,7 @@ _cleanup() rm -fr $send_files_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/punch @@ -36,7 +32,6 @@ _require_xfs_io_command "fiemap" send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/201 b/tests/btrfs/201 index 26d502cf..e61abb5e 100755 --- a/tests/btrfs/201 +++ b/tests/btrfs/201 @@ -8,13 +8,10 @@ # layout, if we punch a hole that starts at file offset 0 and fsync the file, # after replaying the log the hole exists. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick punch log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr . ./common/filter . ./common/dmflakey @@ -38,8 +34,6 @@ _require_btrfs_fs_feature "no_holes" _require_btrfs_mkfs_feature "no-holes" _require_odirect -rm -f $seqres.full - run_test_leading_hole() { # We create the filesystem with a node size of 64Kb because we need to @@ -163,7 +157,6 @@ run_test_middle_hole() _cleanup_flakey } - echo "Testing with hole offset 0 hole length 65536" run_test_leading_hole diff --git a/tests/btrfs/202 b/tests/btrfs/202 index e9bae375..c1fa3c3f 100755 --- a/tests/btrfs/202 +++ b/tests/btrfs/202 @@ -5,25 +5,10 @@ # # Regression test for fix "btrfs: fix invalid removal of root ref" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick subvol snapshot -rm -f $seqres.full +. ./common/filter _supported_fs btrfs diff --git a/tests/btrfs/203 b/tests/btrfs/203 index 899772f7..e506118e 100755 --- a/tests/btrfs/203 +++ b/tests/btrfs/203 @@ -8,13 +8,10 @@ # extents with itself in the send snapshot, with a hole between them, and the # file size has increased in the send snapshot. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send clone +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() rm -fr $send_files_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,7 +30,6 @@ _require_scratch_reflink send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/204 b/tests/btrfs/204 index add20e8b..ec751e42 100755 --- a/tests/btrfs/204 +++ b/tests/btrfs/204 @@ -7,28 +7,12 @@ # Test if the unaligned (by size and offset) punch hole is successful when FS # is at ENOSPC. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/205 b/tests/btrfs/205 index b53e0e52..dae8c68f 100755 --- a/tests/btrfs/205 +++ b/tests/btrfs/205 @@ -13,27 +13,13 @@ # # "Btrfs: implement full reflink support for inline extents" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick clone compress -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_scratch_reflink diff --git a/tests/btrfs/206 b/tests/btrfs/206 index d64718f4..c45b89e6 100755 --- a/tests/btrfs/206 +++ b/tests/btrfs/206 @@ -11,29 +11,13 @@ # btrfs: use the file extent tree infrastructure # btrfs: replace all uses of btrfs_ordered_update_i_size # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick log replay -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmlogwrites -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs _require_test diff --git a/tests/btrfs/207 b/tests/btrfs/207 index c8f6908d..dc35899b 100755 --- a/tests/btrfs/207 +++ b/tests/btrfs/207 @@ -7,28 +7,12 @@ # Test large DIO reads and writes with various profiles. Regression test for # patch "btrfs: fix RAID direct I/O reads with alternate csums". # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw raid -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs btrfs # we check scratch dev after each loop _require_scratch_nocheck diff --git a/tests/btrfs/208 b/tests/btrfs/208 index 0ab15b6a..909f9fa4 100755 --- a/tests/btrfs/208 +++ b/tests/btrfs/208 @@ -7,14 +7,10 @@ # Test subvolume deletion using the subvolume id, even when the subvolume in # question is in a different mount space. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick subvol -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs diff --git a/tests/btrfs/209 b/tests/btrfs/209 index df824d78..3094885f 100755 --- a/tests/btrfs/209 +++ b/tests/btrfs/209 @@ -9,13 +9,10 @@ # do not end up with a missing file extent representing a hole. This applies # only when not using the NO_HOLES feature. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr . ./common/filter . ./common/dmflakey @@ -37,8 +33,6 @@ _require_btrfs_fs_feature "no_holes" _require_btrfs_mkfs_feature "no-holes" _require_xfs_io_command "sync_range" -rm -f $seqres.full - _scratch_mkfs -O ^no-holes >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/btrfs/210 b/tests/btrfs/210 index 2d8d811a..383a307f 100755 --- a/tests/btrfs/210 +++ b/tests/btrfs/210 @@ -7,27 +7,11 @@ # Test that a new snapshot created with qgroup inherit passed should mark # qgroup numbers inconsistent. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick qgroup snapshot -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here diff --git a/tests/btrfs/211 b/tests/btrfs/211 index 3ae5e3fa..60ef3d1b 100755 --- a/tests/btrfs/211 +++ b/tests/btrfs/211 @@ -9,13 +9,10 @@ # and implicit file holes after a power failure. Test both without and with # the NO_HOLES feature. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log prealloc +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -38,8 +34,6 @@ _require_btrfs_fs_feature "no_holes" _require_btrfs_mkfs_feature "no-holes" _require_dm_target flakey -rm -f $seqres.full - run_test() { # Create our test file with 2 consecutive prealloc extents, each with a size diff --git a/tests/btrfs/212 b/tests/btrfs/212 index 30bacd66..a7df938b 100755 --- a/tests/btrfs/212 +++ b/tests/btrfs/212 @@ -7,15 +7,10 @@ # Test if unmounting a fs with balance canceled can lead to crash. # This needs CONFIG_BTRFS_DEBUG compiled, which adds extra unmount time self-test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto balance dangerous +# Override the default cleanup function. _cleanup() { cd / @@ -27,13 +22,9 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/213 b/tests/btrfs/213 index 58ca70c2..8a10355c 100755 --- a/tests/btrfs/213 +++ b/tests/btrfs/213 @@ -6,15 +6,10 @@ # # Test if canceling a running balance can lead to dead looping balance # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto balance dangerous +# Override the default cleanup function. _cleanup() { cd / @@ -22,13 +17,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs btrfs _require_scratch diff --git a/tests/btrfs/214 b/tests/btrfs/214 index 123c4cbf..2a728f7e 100755 --- a/tests/btrfs/214 +++ b/tests/btrfs/214 @@ -6,22 +6,14 @@ # # Test if the file capabilities aren't lost after full and incremental send # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick send snapshot -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs btrfs _require_scratch _require_command "$SETCAP_PROG" setcap diff --git a/tests/btrfs/215 b/tests/btrfs/215 index c4959061..b45bd520 100755 --- a/tests/btrfs/215 +++ b/tests/btrfs/215 @@ -8,28 +8,12 @@ # counters. This is fixed by the following linux kernel commit: # 814723e0a55a ("btrfs: increment device corruption error in case of checksum error") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here get_physical() { diff --git a/tests/btrfs/216 b/tests/btrfs/216 index da596663..38efa0f5 100755 --- a/tests/btrfs/216 +++ b/tests/btrfs/216 @@ -9,27 +9,11 @@ # Fixed in kernel patch: # btrfs: btrfs_show_devname don't traverse into the seed fsid -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick seed -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here _supported_fs btrfs diff --git a/tests/btrfs/217 b/tests/btrfs/217 index 8f2ce511..92bbba23 100755 --- a/tests/btrfs/217 +++ b/tests/btrfs/217 @@ -9,27 +9,11 @@ # - shrink device # - fstrim # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick trim dangerous -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here @@ -46,7 +30,6 @@ _scratch_mount $FSTRIM_PROG -v $SCRATCH_MNT >> $seqres.full 2>&1 || \ _notrun "FSTRIM not supported" - # Shrink the fs to 4G, so the existing CHUNK_TRIMMED bits are beyond # device boundary $BTRFS_UTIL_PROG filesystem resize 1:-1G "$SCRATCH_MNT" >> $seqres.full diff --git a/tests/btrfs/218 b/tests/btrfs/218 index d04d2b4e..5af54f3b 100755 --- a/tests/btrfs/218 +++ b/tests/btrfs/218 @@ -11,29 +11,13 @@ # Make a seed device, add a sprout to it, and then make sure we can still read # the device stats for both devices after we remount with the new sprout device. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filter.btrfs -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/219 b/tests/btrfs/219 index bff6003e..528175b8 100755 --- a/tests/btrfs/219 +++ b/tests/btrfs/219 @@ -14,15 +14,10 @@ # currently. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick volume +# Override the default cleanup function. _cleanup() { cd / @@ -38,13 +33,9 @@ _cleanup() _btrfs_rescan_devices } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs diff --git a/tests/btrfs/220 b/tests/btrfs/220 index c84c7065..9991e6eb 100755 --- a/tests/btrfs/220 +++ b/tests/btrfs/220 @@ -7,22 +7,14 @@ # Test all existent mount options of btrfs # * device= argument is already being test by btrfs/125 # * space cache test already covered by test btrfs/131 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs btrfs _require_scratch diff --git a/tests/btrfs/221 b/tests/btrfs/221 index a482d0c5..a3007587 100755 --- a/tests/btrfs/221 +++ b/tests/btrfs/221 @@ -10,14 +10,10 @@ # one file has its name and location swapped with a directory for which it used # to have a directory entry in it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +21,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,7 +32,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/222 b/tests/btrfs/222 index 51fd052a..f4524764 100755 --- a/tests/btrfs/222 +++ b/tests/btrfs/222 @@ -9,14 +9,10 @@ # two other inodes that correspond to different directories, and one of these # directories is the parent of the other directory. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,7 +31,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/223 b/tests/btrfs/223 index d8529262..af072ede 100755 --- a/tests/btrfs/223 +++ b/tests/btrfs/223 @@ -9,22 +9,10 @@ # allocated chunks in the new device were not trim/discarded by mounting the # new device only in degraded mode, as this is the easiest way to verify it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick replace trim -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -32,8 +20,6 @@ _supported_fs btrfs _require_scratch_dev_pool 3 _require_command "$WIPEFS_PROG" wipefs -rm -f $seqres.full - _scratch_dev_pool_get 2 _spare_dev_get dev1=$(echo $SCRATCH_DEV_POOL | $AWK_PROG '{ print $1 }') diff --git a/tests/btrfs/224 b/tests/btrfs/224 index ecf6a468..d7ec5736 100755 --- a/tests/btrfs/224 +++ b/tests/btrfs/224 @@ -6,29 +6,13 @@ # # Test the assign functionality of qgroups # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick qgroup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. @@ -102,7 +86,6 @@ snapshot_test() _check_scratch_fs } - assign_no_shared_test assign_shared_test diff --git a/tests/btrfs/225 b/tests/btrfs/225 index b745b536..408c03d2 100755 --- a/tests/btrfs/225 +++ b/tests/btrfs/225 @@ -12,15 +12,10 @@ # Create a seed FS. Add a RW device to make it sprout FS and then delete # the seed device. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick volume seed +# Override the default cleanup function. _cleanup() { cd / @@ -28,13 +23,9 @@ _cleanup() _btrfs_rescan_devices } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/226 b/tests/btrfs/226 index c523cf4a..7034fcc7 100755 --- a/tests/btrfs/226 +++ b/tests/btrfs/226 @@ -7,22 +7,10 @@ # Test several (btrfs specific) scenarios with RWF_NOWAIT writes, cases where # they should fail and cases where they should succeed. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick rw snapshot clone prealloc punch + +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +23,6 @@ _require_xfs_io_command pwrite -N _require_xfs_io_command falloc -k _require_xfs_io_command fpunch -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/btrfs/227 b/tests/btrfs/227 index 1cf63c85..c881ab98 100755 --- a/tests/btrfs/227 +++ b/tests/btrfs/227 @@ -9,14 +9,10 @@ # filesystem, mounting the filesystem again and creating a new file (or # directory). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,7 +31,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/228 b/tests/btrfs/228 index 346dca64..fde623fc 100755 --- a/tests/btrfs/228 +++ b/tests/btrfs/228 @@ -6,28 +6,12 @@ # # Test correct operation of free objectid related functionality # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick volume -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/btrfs/229 b/tests/btrfs/229 index 19026f2d..6c8c8193 100755 --- a/tests/btrfs/229 +++ b/tests/btrfs/229 @@ -9,14 +9,10 @@ # different offsets, and a large part of that extent was overwritten, so all the # reflinks only point to subranges of the extent. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send clone +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,7 +31,6 @@ _require_scratch_reflink send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/230 b/tests/btrfs/230 index 82b28ac1..2daacfbe 100755 --- a/tests/btrfs/230 +++ b/tests/btrfs/230 @@ -7,27 +7,11 @@ # Test if btrfs qgroup would crash if we're modifying the fs # after exceeding the limit # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick qgroup limit -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here diff --git a/tests/btrfs/231 b/tests/btrfs/231 index eb35e0e9..562f1fff 100755 --- a/tests/btrfs/231 +++ b/tests/btrfs/231 @@ -10,13 +10,10 @@ # and we do not get stale data corresponding to file extents that existed before # truncating the file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone log replay +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -24,8 +21,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -36,8 +32,6 @@ _require_btrfs_fs_feature "no_holes" _require_btrfs_mkfs_feature "no-holes" _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs -O no-holes >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/btrfs/232 b/tests/btrfs/232 index b9841410..8691a508 100755 --- a/tests/btrfs/232 +++ b/tests/btrfs/232 @@ -11,23 +11,10 @@ # reservation errors") # 4d14c5cde5c2 ("btrfs: don't flush from btrfs_delayed_inode_reserve_metadata") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick qgroup limit -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter writer() @@ -42,9 +29,6 @@ writer() done } -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs diff --git a/tests/btrfs/233 b/tests/btrfs/233 index 10e77358..f3e3762c 100755 --- a/tests/btrfs/233 +++ b/tests/btrfs/233 @@ -8,13 +8,10 @@ # on RO mounts and that after remounting a filesystem from RO to RW mode, it is # performed. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick subvolume +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -33,8 +29,6 @@ _require_scratch _require_dm_target flakey _require_btrfs_command inspect-internal dump-tree -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/btrfs/234 b/tests/btrfs/234 index df64e54e..c045ea6c 100755 --- a/tests/btrfs/234 +++ b/tests/btrfs/234 @@ -7,22 +7,10 @@ # Test cases where a direct IO write, with O_DSYNC, can not be done and has to # fallback to a buffered write. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick compress rw -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -32,8 +20,6 @@ _require_scratch _require_odirect _require_chattr c -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/btrfs/235 b/tests/btrfs/235 index 600dad95..cfa7603c 100755 --- a/tests/btrfs/235 +++ b/tests/btrfs/235 @@ -8,14 +8,10 @@ # send/receive operations only apply the capability to the first file, the one # for which we have set a capability. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,7 +31,6 @@ _require_command "$GETCAP_PROG" getcap send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/btrfs/236 b/tests/btrfs/236 index 58c86427..a16a1ce6 100755 --- a/tests/btrfs/236 +++ b/tests/btrfs/236 @@ -8,13 +8,10 @@ # previous fsync of another file, as well as that mtime and ctime are correct. # Test both with COW and NOCOW writes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -32,8 +28,6 @@ _supported_fs btrfs _require_scratch _require_dm_target flakey -rm -f $seqres.full - # The comments inside the function mentioning specific inode numbers and IDs # (transactions, log commits, etc) are for the case where the function is run # on a freshly created filesystem, but the logic and reasoning still applies diff --git a/tests/btrfs/237 b/tests/btrfs/237 index da0c2d6c..5994edf8 100755 --- a/tests/btrfs/237 +++ b/tests/btrfs/237 @@ -9,28 +9,12 @@ # old block group gets deleted. On block group deletion, the underlying device # zone also needs to be reset. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick zone balance -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs btrfs diff --git a/tests/btrfs/238 b/tests/btrfs/238 index bbb06d3f..2622f353 100755 --- a/tests/btrfs/238 +++ b/tests/btrfs/238 @@ -9,27 +9,11 @@ # Kernel bug is fixed by the commit: # btrfs: fix unmountable seed device after fstrim -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick seed trim -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here diff --git a/tests/btrfs/239 b/tests/btrfs/239 index 479205c0..3fbeaedd 100755 --- a/tests/btrfs/239 +++ b/tests/btrfs/239 @@ -10,13 +10,10 @@ # we are able to mount the filesystem and that the moved directory exists only # as a child of the directory we moved it into. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -24,8 +21,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _supported_fs btrfs _require_scratch _require_dm_target flakey -rm -f $seqres.full - # The test requires a very specific layout of keys and items in the fs/subvolume # btree to trigger a bug. So we want to make sure that on whatever platform we # are, we have the same leaf/node size. diff --git a/tests/btrfs/240 b/tests/btrfs/240 index c799848f..afc6aae0 100755 --- a/tests/btrfs/240 +++ b/tests/btrfs/240 @@ -10,13 +10,10 @@ # failure on the last fsync and turn the filesystem to RO mode because of a # transaction abort. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick prealloc log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -24,8 +21,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -35,14 +31,11 @@ _require_scratch _require_dm_target flakey _require_xfs_io_command "falloc" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey _mount_flakey - # Create our test file with 2 preallocated extents. Leave a 1M hole between them # to ensure that we get two file extent items that will never be merged into a # single one. The extents are contiguous on disk, which will later result in the diff --git a/tests/btrfs/241 b/tests/btrfs/241 index 96f2e190..d7348edf 100755 --- a/tests/btrfs/241 +++ b/tests/btrfs/241 @@ -10,14 +10,10 @@ # of a directory and another name (hardlink) with the old name and location of # another file that was located in that same directory. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick send +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +21,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,7 +32,6 @@ _require_fssum send_files_dir=$TEST_DIR/btrfs-test-$seq -rm -f $seqres.full rm -fr $send_files_dir mkdir $send_files_dir diff --git a/tests/ceph/001 b/tests/ceph/001 index 0515fff8..aca77168 100755 --- a/tests/ceph/001 +++ b/tests/ceph/001 @@ -10,23 +10,10 @@ # 1) the beginning (1st object) of dst file, 2) the end (last object) of dst # file and 3) the middle of the dst file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copy # get standard environment -. common/rc . common/filter . common/attr . common/reflink @@ -41,7 +28,6 @@ _require_test workdir=$TEST_DIR/test-$seq rm -rf $workdir mkdir $workdir -rm -f $seqres.full check_range() { diff --git a/tests/ceph/002 b/tests/ceph/002 index f0fd28a1..428f23a9 100755 --- a/tests/ceph/002 +++ b/tests/ceph/002 @@ -19,23 +19,10 @@ # ceph OSD: dcd6a99ef9f5 ("osd: add new 'copy-from2' operation") # linux kernel: 78beb0ff2fec ("ceph: use copy-from2 op in copy_file_range") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copy # get standard environment -. common/rc . common/filter . common/attr @@ -49,7 +36,6 @@ _require_test workdir=$TEST_DIR/test-$seq rm -rf $workdir mkdir $workdir -rm -f $seqres.full # Use 4M object size objsz=4194304 diff --git a/tests/ceph/003 b/tests/ceph/003 index 6a5a4ea4..9f8c6068 100755 --- a/tests/ceph/003 +++ b/tests/ceph/003 @@ -6,23 +6,10 @@ # # Test copy_file_range with infile = outfile # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copy # get standard environment -. common/rc . common/filter . common/attr . common/reflink @@ -37,7 +24,6 @@ _require_test workdir=$TEST_DIR/test-$seq rm -rf $workdir mkdir $workdir -rm -f $seqres.full check_range() { diff --git a/tests/ceph/004 b/tests/ceph/004 index 1de19b39..dbca713e 100755 --- a/tests/ceph/004 +++ b/tests/ceph/004 @@ -27,29 +27,13 @@ # # https://tracker.ceph.com/issues/48203 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ceph diff --git a/tests/cifs/001 b/tests/cifs/001 index 433281ed..e20108cb 100755 --- a/tests/cifs/001 +++ b/tests/cifs/001 @@ -6,24 +6,17 @@ # # Sanity test for server-side copies initiated via CIFS_IOC_COPYCHUNK_FILE # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { rm -f $tmp.* rm -rf $TEST_DIR/$$ } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/ext4/001 b/tests/ext4/001 index 9650303d..f1d1e829 100755 --- a/tests/ext4/001 +++ b/tests/ext4/001 @@ -7,23 +7,10 @@ # Test fallocate FALLOC_FL_ZERO_RANGE # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto prealloc quick zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch diff --git a/tests/ext4/002 b/tests/ext4/002 index 23fdc639..f09e9c1a 100755 --- a/tests/ext4/002 +++ b/tests/ext4/002 @@ -15,24 +15,18 @@ # https://lore.kernel.org/linux-ext4/20200717090605.2612-1-lczerner@redhat.com/ # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest shutdown mount auto quick +# Override the default cleanup function. _cleanup() { cd / blockdev --setrw $SCRATCH_LOGDEV blockdev --setrw $SCRATCH_DEV } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -96,7 +90,6 @@ _try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch echo "unmounting read-only filesystem" _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot - echo "mounting filesystem with -o norecovery with a read-only log device:" _try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount | _filter_scratch echo "unmounting read-only filesystem" @@ -134,5 +127,4 @@ _try_scratch_mount -o ro 2>&1 | _filter_scratch # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/ext4/003 b/tests/ext4/003 index 00ea9150..3c9a8486 100755 --- a/tests/ext4/003 +++ b/tests/ext4/003 @@ -8,19 +8,16 @@ # b5b6077 ext4: fix wrong assert in ext4_mb_normalize_request() # This testcase checks whether this bug has been fixed. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { _scratch_unmount } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -29,8 +26,6 @@ _supported_fs ext4 _require_scratch _require_scratch_ext4_feature "bigalloc" -rm -f $seqres.full - $MKFS_EXT4_PROG -F -O bigalloc -C 65536 -g 256 $SCRATCH_DEV 512m \ >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/004 b/tests/ext4/004 index 9adfc7e7..0c2ad897 100755 --- a/tests/ext4/004 +++ b/tests/ext4/004 @@ -6,15 +6,10 @@ # # Test "dump | restore"(as opposed to a tape) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto dump +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $restore_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter dump_dir=$SCRATCH_MNT/dump_restore_dir @@ -58,7 +52,6 @@ _require_scratch _require_command "$DUMP_PROG" dump _require_command "$RESTORE_PROG" restore -rm -f $seqres.full echo "Silence is golden" _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 diff --git a/tests/ext4/005 b/tests/ext4/005 index bd6eecf9..794caa17 100755 --- a/tests/ext4/005 +++ b/tests/ext4/005 @@ -11,23 +11,10 @@ # ext4: be more strict when migrating to non-extent based file # ext4: correctly migrate a file with a hole at the beginning # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metadata ioctl rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,8 +22,6 @@ _supported_fs ext4 _require_scratch _require_command "$CHATTR_PROG" chattr -rm -f $seqres.full - echo "Silence is golden" _scratch_mkfs >>$seqres.full 2>&1 diff --git a/tests/ext4/006 b/tests/ext4/006 index 29c474b9..17e77f86 100755 --- a/tests/ext4/006 +++ b/tests/ext4/006 @@ -8,23 +8,17 @@ # the kernel reacts, how e2fsck fares in fixing the mess, and then # try more kernel accesses to see if it really fixed things. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dangerous_fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -74,7 +68,6 @@ repair_scratch() { return 1 } -rm -f $seqres.full echo "See interesting results in $seqres.full" | sed -e "s,$RESULT_DIR,RESULT_DIR,g" SRCDIR=`pwd` test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-b 32 -v" diff --git a/tests/ext4/007 b/tests/ext4/007 index 0f09fe35..2e8b4d19 100755 --- a/tests/ext4/007 +++ b/tests/ext4/007 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt the primary superblock, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -34,7 +28,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/008 b/tests/ext4/008 index 66ddbd20..9509ed92 100755 --- a/tests/ext4/008 +++ b/tests/ext4/008 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt a group descriptor, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -34,7 +28,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/009 b/tests/ext4/009 index 26f2efd2..096eb036 100755 --- a/tests/ext4/009 +++ b/tests/ext4/009 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt a block bitmap, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -35,7 +29,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/010 b/tests/ext4/010 index e815e0f5..e2cc5489 100755 --- a/tests/ext4/010 +++ b/tests/ext4/010 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt an inode bitmap, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -36,7 +30,6 @@ test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs _require_command "$RESIZE2FS_PROG" resize2fs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/011 b/tests/ext4/011 index 0dfb4a99..15703f61 100755 --- a/tests/ext4/011 +++ b/tests/ext4/011 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt the MMP block, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -34,7 +28,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/012 b/tests/ext4/012 index 0fa8b3f1..c49e8ef4 100755 --- a/tests/ext4/012 +++ b/tests/ext4/012 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt the journal, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -34,7 +28,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/013 b/tests/ext4/013 index b5088261..1d33e564 100755 --- a/tests/ext4/013 +++ b/tests/ext4/013 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt an inode, then see how # the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -34,7 +28,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/014 b/tests/ext4/014 index 499cf33a..ad87c781 100755 --- a/tests/ext4/014 +++ b/tests/ext4/014 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt root directory, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -34,7 +28,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/015 b/tests/ext4/015 index 2fda98df..ec7f4159 100755 --- a/tests/ext4/015 +++ b/tests/ext4/015 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt an extent tree block, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers punch +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -36,7 +30,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/016 b/tests/ext4/016 index 139cc198..cee7eadf 100755 --- a/tests/ext4/016 +++ b/tests/ext4/016 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt a dirent block, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -34,7 +28,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/017 b/tests/ext4/017 index e7bb32d3..b07964ec 100755 --- a/tests/ext4/017 +++ b/tests/ext4/017 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt a htree block, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -34,7 +28,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/018 b/tests/ext4/018 index 589ae374..92df4cf5 100755 --- a/tests/ext4/018 +++ b/tests/ext4/018 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt a xattr block, then # see how the kernel and e2fsck deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -34,7 +28,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/019 b/tests/ext4/019 index 42c64933..ab5f50c6 100755 --- a/tests/ext4/019 +++ b/tests/ext4/019 @@ -7,23 +7,17 @@ # Create and populate an ext4 filesystem, corrupt a big symlink, then # see how the kernel and e2fsck deal with it. (They won't) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -34,7 +28,6 @@ _require_scratch test -n "${FORCE_FUZZ}" || _require_scratch_ext4_crc _require_attrs -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/ext4/020 b/tests/ext4/020 index 91c7afbf..110a0fd0 100755 --- a/tests/ext4/020 +++ b/tests/ext4/020 @@ -10,29 +10,13 @@ # size is smaller than page size would cause integrity issue on the # partial-blocksize part when copying data between orign file and donor file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick ioctl rw defrag -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 _require_scratch diff --git a/tests/ext4/021 b/tests/ext4/021 index c51e0ceb..62768c60 100755 --- a/tests/ext4/021 +++ b/tests/ext4/021 @@ -7,26 +7,10 @@ # Regression test for commit: # 688f869 ext4: Initialize fsync transaction ids in ext4_new_inode() # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here _supported_fs ext4 diff --git a/tests/ext4/022 b/tests/ext4/022 index 3de7619a..fdc19d93 100755 --- a/tests/ext4/022 +++ b/tests/ext4/022 @@ -6,34 +6,18 @@ # # Test extending of i_extra_isize code # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick attr dangerous do_setfattr() { $SETFATTR_PROG $@ 2>&1 | _filter_scratch } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 _require_scratch diff --git a/tests/ext4/023 b/tests/ext4/023 index d33b0a7b..ebc5ffe3 100755 --- a/tests/ext4/023 +++ b/tests/ext4/023 @@ -8,23 +8,12 @@ # filesystem with all types of metadata and create an image of the # metadata. Check that fsck is happy with the resulting fs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick scrub -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/ext4/024 b/tests/ext4/024 index 3e25e4e0..116adca9 100755 --- a/tests/ext4/024 +++ b/tests/ext4/024 @@ -7,28 +7,12 @@ # Regression test for 0d06863f903a ("ext4: don't BUG when truncating encrypted # inodes on the orphan list"). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick encrypt dangerous # get standard environment and checks -. ./common/rc . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 _require_scratch_encryption diff --git a/tests/ext4/025 b/tests/ext4/025 index d6ee1265..4299e4b2 100755 --- a/tests/ext4/025 +++ b/tests/ext4/025 @@ -7,26 +7,12 @@ # Regression test for commit: # 3a4b77c ("ext4: validate s_first_meta_bg at mount time"). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick fuzzers dangerous # get standard environment and checks -. ./common/rc . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 _require_scratch_nocheck diff --git a/tests/ext4/026 b/tests/ext4/026 index 694b9340..782fdca6 100755 --- a/tests/ext4/026 +++ b/tests/ext4/026 @@ -9,27 +9,13 @@ # allows storing xattr values in external inodes and so raises xattr value # size limit to 64k. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick attr -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 _require_scratch diff --git a/tests/ext4/027 b/tests/ext4/027 index 97c14cf5..84e11a29 100755 --- a/tests/ext4/027 +++ b/tests/ext4/027 @@ -6,23 +6,17 @@ # # Check that getfsmap reports the BG metadata we're expecting. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick fsmap +# Override the default cleanup function. _cleanup() { cd / rm -f "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/ext4/028 b/tests/ext4/028 index a573f4e5..3e18baf9 100755 --- a/tests/ext4/028 +++ b/tests/ext4/028 @@ -6,23 +6,17 @@ # # Populate filesystem, check that fsmap -n10000 matches fsmap -n1. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick fsmap +# Override the default cleanup function. _cleanup() { cd / rm -f "$tmp".* $TEST_DIR/a $TEST_DIR/b } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate diff --git a/tests/ext4/029 b/tests/ext4/029 index 0afae5cf..9d6c4504 100755 --- a/tests/ext4/029 +++ b/tests/ext4/029 @@ -6,23 +6,17 @@ # # Check that getfsmap reports external log devices # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick fsmap +# Override the default cleanup function. _cleanup() { cd / rm -f "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/ext4/030 b/tests/ext4/030 index 39711952..4b51edd2 100755 --- a/tests/ext4/030 +++ b/tests/ext4/030 @@ -8,28 +8,12 @@ # ext4: prevent data corruption with journaling + DAX # created by Ross Zwisler # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dax -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs ext4 _require_scratch_dax_mountopt "dax" diff --git a/tests/ext4/031 b/tests/ext4/031 index f5d24411..ac16786f 100755 --- a/tests/ext4/031 +++ b/tests/ext4/031 @@ -8,28 +8,12 @@ # ext4: prevent data corruption with inline data + DAX # created by Ross Zwisler # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dax -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # DAX needs to be off so we can create an inode with inline data SAVE_MOUNT_OPTIONS="$MOUNT_OPTIONS" MOUNT_OPTIONS="" diff --git a/tests/ext4/032 b/tests/ext4/032 index 4e8dac42..3d91db22 100755 --- a/tests/ext4/032 +++ b/tests/ext4/032 @@ -7,14 +7,8 @@ # Ext4 online resize tests of small and crucial resizes with bigalloc # feature. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick ioctl resize BLK_SIZ=4096 CLUSTER_SIZ=4096 @@ -74,6 +68,7 @@ ext4_online_resize() _destroy_loop_device $LOOP_DEVICE && LOOP_DEVICE= } +# Override the default cleanup function. _cleanup() { cd / @@ -84,10 +79,6 @@ _cleanup() } # get standard environment and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full # real QA test starts here _supported_fs ext4 @@ -102,8 +93,6 @@ _require_command "$RESIZE2FS_PROG" resize2fs _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount -rm -f $seqres.full - mkdir -p $IMG_MNT || _fail "cannot create loopback mount point" # Check if online resizing with bigalloc is supported by the kernel diff --git a/tests/ext4/033 b/tests/ext4/033 index 71052acd..1bc14c03 100755 --- a/tests/ext4/033 +++ b/tests/ext4/033 @@ -7,15 +7,10 @@ # Test s_inodes_count overflow for huge filesystems. This bug was fixed # by commit "ext4: Forbid overflowing inode count when resizing". # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto ioctl resize +# Override the default cleanup function. _cleanup() { umount $SCRATCH_MNT >/dev/null 2>&1 @@ -24,14 +19,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmhugedisk -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 _require_scratch_nocheck diff --git a/tests/ext4/034 b/tests/ext4/034 index c561a60e..223c964f 100755 --- a/tests/ext4/034 +++ b/tests/ext4/034 @@ -10,29 +10,13 @@ # The bug was fixed by commit # "ext4: make sure enough credits are reserved for dioread_nolock writes" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/ext4/035 b/tests/ext4/035 index e29dc92e..cad3595b 100755 --- a/tests/ext4/035 +++ b/tests/ext4/035 @@ -13,23 +13,10 @@ # lower than current size and leads to a BUG_ON in in ext4_alloc_group_tables() # hitting on flex_gd->count == 0. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick resize -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,8 +25,6 @@ _require_scratch _exclude_scratch_mount_option dax _require_command "$RESIZE2FS_PROG" resize2fs -rm -f $seqres.full - $MKFS_EXT4_PROG -F -b 1024 -E "resize=262144" $SCRATCH_DEV 32768 >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/036 b/tests/ext4/036 index f9a59693..60ab0b90 100755 --- a/tests/ext4/036 +++ b/tests/ext4/036 @@ -9,30 +9,16 @@ # # 721e3eb ext4: lock i_mutex when truncating orphan inodes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. . ./common/filter # real QA test starts here _supported_fs ext3 ext4 _require_scratch -rm -f $seqres.full echo "Silence is golden" _scratch_mkfs_sized $((16*1024*1024)) >>$seqres.full 2>&1 diff --git a/tests/ext4/037 b/tests/ext4/037 index a6022a2c..5ecb9f83 100755 --- a/tests/ext4/037 +++ b/tests/ext4/037 @@ -9,23 +9,10 @@ # # 744692d ext4: use ext4_get_block_write in buffer write # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +21,6 @@ _supported_fs ext3 ext4 # nofsck as we modify sb via debugfs _require_scratch_nocheck -# remove previous $seqres.full before test -rm -f $seqres.full echo "Silence is golden" _scratch_mkfs >>$seqres.full 2>&1 diff --git a/tests/ext4/038 b/tests/ext4/038 index cad2ff03..596de65b 100755 --- a/tests/ext4/038 +++ b/tests/ext4/038 @@ -7,30 +7,16 @@ # Regression test for commit: # c9eb13a ext4: fix hang when processing corrupted orphaned inode list # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs ext3 ext4 _require_scratch _require_command "$DEBUGFS_PROG" debugfs -# remove previous $seqres.full before test -rm -f $seqres.full echo "Silence is golden" # Although the bug only happens when last_orphan is set to 5 diff --git a/tests/ext4/039 b/tests/ext4/039 index 8aa5bc27..4ca4058a 100755 --- a/tests/ext4/039 +++ b/tests/ext4/039 @@ -6,20 +6,13 @@ # # Test data journaling flag switch for a single file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto enospc rw # ext3 and ext4 don't support direct IO in journalling mode write_opt_list="iflag=noatime conv=notrunc conv=fsync" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _workout() { @@ -68,7 +61,6 @@ _supported_fs ext3 ext4 _require_scratch _exclude_scratch_mount_option dax -rm -f $seqres.full _scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/040 b/tests/ext4/040 index fde9473e..a20d5897 100755 --- a/tests/ext4/040 +++ b/tests/ext4/040 @@ -13,22 +13,12 @@ # So, create this malformed inode and try a buffered append to make # sure we catch this situation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers PIDS="" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,8 +27,6 @@ _require_scratch_nocheck _disable_dmesg_check _require_command "$DEBUGFS_PROG" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/041 b/tests/ext4/041 index 0e4c84c1..941cd26b 100755 --- a/tests/ext4/041 +++ b/tests/ext4/041 @@ -13,22 +13,12 @@ # So, create this malformed inode and try a dio append to make sure we # catch this situation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers PIDS="" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,8 +27,6 @@ _require_scratch_nocheck _disable_dmesg_check _require_command "$DEBUGFS_PROG" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/042 b/tests/ext4/042 index 22366e90..9e5ef22d 100755 --- a/tests/ext4/042 +++ b/tests/ext4/042 @@ -6,23 +6,10 @@ # # Test overhead & df output for extN filesystems # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -31,8 +18,6 @@ _cleanup() _supported_fs ext2 ext3 ext4 _require_scratch -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 # Get the honest truth about block counts straight from metadata on disk diff --git a/tests/ext4/043 b/tests/ext4/043 index 872578ea..de0ddf7f 100755 --- a/tests/ext4/043 +++ b/tests/ext4/043 @@ -6,27 +6,11 @@ # # Test file timestamps are only precise to seconds with 128-byte inodes." # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here _supported_fs ext3 ext4 diff --git a/tests/ext4/044 b/tests/ext4/044 index b19a3d15..46e44053 100755 --- a/tests/ext4/044 +++ b/tests/ext4/044 @@ -6,28 +6,12 @@ # # Test file timestamps are precise to nanoseconds with 256-byte inodes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 _require_scratch diff --git a/tests/ext4/045 b/tests/ext4/045 index 52fe891c..ee7c0de3 100755 --- a/tests/ext4/045 +++ b/tests/ext4/045 @@ -7,31 +7,15 @@ # Test subdirectory limit of ext4. # We create more than 65000 subdirectories on the ext4 filesystem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto dir SHORT_DIR=1 LONG_DIR=2 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 diff --git a/tests/ext4/046 b/tests/ext4/046 index c6f7a051..5c2100ce 100755 --- a/tests/ext4/046 +++ b/tests/ext4/046 @@ -9,28 +9,12 @@ # This test is to check whether unwritten extents gets properly converted # to written extent on a filesystem with bs < ps with dioread_nolock. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto prealloc quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _require_check_dmesg _supported_fs ext4 _require_scratch diff --git a/tests/ext4/047 b/tests/ext4/047 index 116158f5..7e0c8438 100755 --- a/tests/ext4/047 +++ b/tests/ext4/047 @@ -7,27 +7,11 @@ # This is a regression test for kernel patch: # commit aa2f77920b74 ("ext4: disallow modifying DAX inode flag if inline_data has been set") -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick dax -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here _supported_fs ext4 diff --git a/tests/ext4/048 b/tests/ext4/048 index 51189618..3f077b00 100755 --- a/tests/ext4/048 +++ b/tests/ext4/048 @@ -7,19 +7,12 @@ # Test wiping of ext4_dir_entry2 data upon file removal, conversion # to htree, and splitting of htree nodes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dir -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 diff --git a/tests/ext4/049 b/tests/ext4/049 index 72ebd91d..f6ec1d6d 100755 --- a/tests/ext4/049 +++ b/tests/ext4/049 @@ -7,28 +7,12 @@ # Regression test for kernel commit a149d2a5cabb (ext4: fix check to prevent # false positive report of incorrect used inodes) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 _require_scratch diff --git a/tests/ext4/050 b/tests/ext4/050 index c56623a3..79961957 100755 --- a/tests/ext4/050 +++ b/tests/ext4/050 @@ -7,19 +7,12 @@ # Test checkpoint and zeroout of journal via ioctl EXT4_IOC_CHECKPOINT # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto ioctl quick -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs ext4 @@ -44,7 +37,6 @@ get_journal_extents() { echo "$get_extents" } - # checks all extents are zero'd out except for the superblock # arg 1: extents (output of get_journal_extents()) check_extents() { diff --git a/tests/ext4/271 b/tests/ext4/271 index 5afe1b2d..8d9bd7dc 100755 --- a/tests/ext4/271 +++ b/tests/ext4/271 @@ -6,17 +6,10 @@ # # Regression testcase for d583fb87a3ff0 (ext4 extent corruption) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -27,7 +20,6 @@ _require_scratch _exclude_scratch_mount_option "data" "commit" "journal_checksum" \ "journal_async_commit" -rm -f $seqres.full _scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seqres.full 2>&1 # -onoload and EXT4_SYNC_FL on file is important becase result in diff --git a/tests/ext4/301 b/tests/ext4/301 index 143c4752..7c3dc720 100755 --- a/tests/ext4/301 +++ b/tests/ext4/301 @@ -6,18 +6,12 @@ # # Ext4 defragmentation stress test # Defragment file while other task does direct io -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest aio auto ioctl rw stress defrag -here=`pwd` -tmp=/tmp/$$ fio_config=$tmp.fio -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag @@ -91,7 +85,6 @@ _workout() _require_fio $fio_config -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/302 b/tests/ext4/302 index a89d8ecb..e2f4b4e4 100755 --- a/tests/ext4/302 +++ b/tests/ext4/302 @@ -7,18 +7,12 @@ # Ext4 defragmentation stress test # Perform defragmentation on file under buffered io # while third task does direct io to donor file -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest aio auto ioctl rw stress defrag -here=`pwd` -tmp=/tmp/$$ fio_config=$tmp.fio -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag @@ -109,7 +103,6 @@ _workout() _require_fio $fio_config -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/303 b/tests/ext4/303 index 81f54327..db25ea1f 100755 --- a/tests/ext4/303 +++ b/tests/ext4/303 @@ -7,18 +7,12 @@ # Ext4 defragmentation stress test # Two defrag tasks use common donor file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest aio auto ioctl rw stress defrag -here=`pwd` -tmp=/tmp/$$ fio_config=$tmp.fio -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag @@ -119,7 +113,6 @@ _workout() _require_fio $fio_config -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/304 b/tests/ext4/304 index 2d44332e..ce5c53aa 100755 --- a/tests/ext4/304 +++ b/tests/ext4/304 @@ -8,18 +8,12 @@ # Several threads perform defragmentation at random position # using 'inplace' mode (allocate and free blocks inside defrag event) # which significantly improve load pressure on block allocator. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest aio auto ioctl rw stress defrag -here=`pwd` -tmp=/tmp/$$ fio_config=$tmp.fio -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag @@ -96,7 +90,6 @@ _workout() _require_fio $fio_config -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/305 b/tests/ext4/305 index 13785837..2c89a583 100755 --- a/tests/ext4/305 +++ b/tests/ext4/305 @@ -7,22 +7,19 @@ # Regression test for commit: # 9559996 ext4: remove mb_groups before tearing down the buddy_cache # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto PIDS="" -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / kill $PIDS >/dev/null 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,7 +27,6 @@ _supported_fs ext4 _require_scratch -rm -f $seqres.full echo "Silence is golden" DEV_BASENAME=$(_short_dev $SCRATCH_DEV) diff --git a/tests/ext4/306 b/tests/ext4/306 index 146fdb39..4a339570 100755 --- a/tests/ext4/306 +++ b/tests/ext4/306 @@ -8,21 +8,18 @@ # Regression test for commit: # c5c72d8 ext4: fix online resizing for ext3-compat file systems # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw resize quick PIDS="" -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _scratch_unmount } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -31,8 +28,6 @@ _supported_fs ext4 _require_scratch _require_command "$RESIZE2FS_PROG" resize2fs -rm -f $seqres.full - # Make a small ext4 fs with extents disabled & mount it features="^extents" if grep -q 64bit /etc/mke2fs.conf ; then diff --git a/tests/ext4/307 b/tests/ext4/307 index 91cc45e1..a249213e 100755 --- a/tests/ext4/307 +++ b/tests/ext4/307 @@ -6,17 +6,10 @@ # # Check data integrity during defrag compacting # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto ioctl rw defrag -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag # Disable all sync operations to get higher load @@ -48,7 +41,6 @@ _require_scratch _require_defrag _require_xfs_io_command "falloc" -rm -f $seqres.full _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/ext4/308 b/tests/ext4/308 index b30919e1..b88ea056 100755 --- a/tests/ext4/308 +++ b/tests/ext4/308 @@ -8,22 +8,12 @@ # EXT4_IOC_MOVE_EXT simply swap extents between target and donor inode. # So if ioctl was performed twice then inode's layout should not change. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto ioctl rw prealloc quick defrag PIDS="" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag @@ -32,8 +22,6 @@ _require_scratch _require_defrag _require_xfs_io_command "falloc" -rm -f $seqres.full - _workout() { nr=$1 diff --git a/tests/f2fs/001 b/tests/f2fs/001 index 0753a09b..e2429e46 100755 --- a/tests/f2fs/001 +++ b/tests/f2fs/001 @@ -15,23 +15,10 @@ # In ext4, up to 132 bytes of data can be stored in 256 bytes-sized inode. # In f2fs, up to 3.4KB of data can be embedded into 4KB-sized inode block. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs f2fs diff --git a/tests/f2fs/002 b/tests/f2fs/002 index 9e6cb102..59ca2a2d 100755 --- a/tests/f2fs/002 +++ b/tests/f2fs/002 @@ -39,28 +39,13 @@ # algorithm shouldn't make a difference for the purpose of this test. So we # just test LZ4. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw encrypt compress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -. ./common/rc . ./common/filter . ./common/f2fs . ./common/encrypt -rm -f $seqres.full - _supported_fs f2fs # Prerequisites to create a file that is both encrypted and LZ4-compressed diff --git a/tests/generic/001 b/tests/generic/001 index 20a81cf3..c59344e4 100755 --- a/tests/generic/001 +++ b/tests/generic/001 @@ -15,19 +15,15 @@ # config has one line per file with filename and byte size, else use # the default one below. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw dir udf auto quick -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -tmp=/tmp/$$ -here=`pwd` status=1 done_cleanup=false -trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 +_register_cleanup "_cleanup; rm -f $tmp.*" # real QA test starts here _supported_fs generic @@ -259,6 +255,7 @@ _check() $verbose && echo } +# Override the default cleanup function. _cleanup() { # cleanup @@ -275,7 +272,6 @@ _cleanup() fi } -rm -f $seqres.full status=0 _cleanup status=1 diff --git a/tests/generic/002 b/tests/generic/002 index 58a33f71..3974ef0e 100755 --- a/tests/generic/002 +++ b/tests/generic/002 @@ -6,31 +6,19 @@ # # simple inode link count test for a regular file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest metadata udf auto quick -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -tmp=/tmp/$$ -here=`pwd` status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} # real QA test starts here _supported_fs generic _require_test _require_hardlinks -rm -f $seqres.full - echo "Silence is goodness ..." # ensure target directory exists diff --git a/tests/generic/003 b/tests/generic/003 index b2a3db39..999aed14 100755 --- a/tests/generic/003 +++ b/tests/generic/003 @@ -9,23 +9,10 @@ # never updated on read-only subvolumes. (Regression test for bug fixed # with commit 93fd63c2f001ca6797c6b15b696a484b165b4800) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest atime auto quick -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,8 +22,6 @@ _require_scratch _require_atime _require_relatime -rm -f $seqres.full - if [ "$FSTYP" = "exfat" ]; then # exfat's timestamp for access_time has double seconds granularity access_delay=2.1 diff --git a/tests/generic/004 b/tests/generic/004 index fd51295b..a575c2ef 100755 --- a/tests/generic/004 +++ b/tests/generic/004 @@ -6,23 +6,17 @@ # # Test O_TMPFILE opens, and linking them back into the namespace. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / rm -f ${testfile} } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -32,8 +26,6 @@ _require_test _require_xfs_io_command "-T" _require_xfs_io_command "flink" -rm -f $seqres.full - testfile="${TEST_DIR}/tst-tmpfile-flink" # test creating a r/w tmpfile, do I/O and link it into the namespace diff --git a/tests/generic/005 b/tests/generic/005 index 0c3947f8..e497b33c 100755 --- a/tests/generic/005 +++ b/tests/generic/005 @@ -15,15 +15,12 @@ # limit point is unimportant, just checking that we do hit it). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dir udf auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd $TEST_DIR @@ -41,8 +38,7 @@ _touch() fi } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -50,7 +46,6 @@ _supported_fs generic _require_test _require_symlinks - cd $TEST_DIR o=empty_file diff --git a/tests/generic/006 b/tests/generic/006 index 1a3bb5ac..bc532920 100755 --- a/tests/generic/006 +++ b/tests/generic/006 @@ -6,15 +6,12 @@ # # permname # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dir udf auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -31,8 +28,7 @@ _count() ' } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/007 b/tests/generic/007 index 5aa7ea81..5183816b 100755 --- a/tests/generic/007 +++ b/tests/generic/007 @@ -9,15 +9,12 @@ # and checks that error codes make sense with its # memory of the files created. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dir udf auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -25,15 +22,13 @@ _cleanup() rm -rf $TEST_DIR/$seq } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs generic _require_test -status=1 # default failure sourcefile=$tmp.nametest seed=1 iterations=100000 diff --git a/tests/generic/008 b/tests/generic/008 index 79f1a976..7ddb2c65 100755 --- a/tests/generic/008 +++ b/tests/generic/008 @@ -9,17 +9,10 @@ # Primarily tests page boundries and boundries that are # off-by-one to ensure we're only tossing what's expected # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch diff --git a/tests/generic/009 b/tests/generic/009 index 3fbd3001..3b362943 100755 --- a/tests/generic/009 +++ b/tests/generic/009 @@ -6,23 +6,10 @@ # # Test fallocate FALLOC_FL_ZERO_RANGE # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch diff --git a/tests/generic/010 b/tests/generic/010 index 31eb5b1e..ac9689af 100755 --- a/tests/generic/010 +++ b/tests/generic/010 @@ -6,15 +6,12 @@ # # dbtest # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other udf auto -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -31,8 +28,7 @@ _filter_dbtest() -e '/using [0-9][0-9]* as seed/s//using BLEEP as seed/' } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _require_test_program "dbtest" @@ -41,8 +37,6 @@ _require_test_program "dbtest" _supported_fs generic _require_test -rm -f $seqres.full - cd $TEST_DIR $here/src/dbtest -l 5 -n 1000 2>&1 | tee -a $seqres.full | _filter_dbtest diff --git a/tests/generic/011 b/tests/generic/011 index cc787d0f..f4c795ae 100755 --- a/tests/generic/011 +++ b/tests/generic/011 @@ -6,16 +6,13 @@ # # dirstress # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dir udf auto quick out="" -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() [ -n "$out" ] && rm -rf $out } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +29,6 @@ _require_test out=$TEST_DIR/dirstress.$$ -rm -f $seqres.full - _test() { test="$1" diff --git a/tests/generic/012 b/tests/generic/012 index 3dc05c98..4b3c69f4 100755 --- a/tests/generic/012 +++ b/tests/generic/012 @@ -10,24 +10,11 @@ # type of extents. These tests are based on generic/255 test case. # For the type of tests, check the description of _test_generic_punch # in common/rc. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc punch collapse -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks +# Import common functions. # we need to include common/punch to get defination fo filter functions -. ./common/rc . ./common/filter . ./common/punch diff --git a/tests/generic/013 b/tests/generic/013 index b130608c..24b69517 100755 --- a/tests/generic/013 +++ b/tests/generic/013 @@ -6,15 +6,12 @@ # # fsstress # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other ioctl udf auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +21,7 @@ _cleanup() rm -rf $TEST_DIR/fsstress.$$.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _do_test() @@ -67,7 +63,6 @@ _do_test() _supported_fs generic _require_test -rm -f $seqres.full echo "brevity is wit..." count=1000 @@ -88,7 +83,6 @@ _do_test 2 "-p $procs -r" $count _do_test 3 "-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20" $count # if all ok by here then probably don't need $seqres.full -rm -f $seqres.full exit diff --git a/tests/generic/014 b/tests/generic/014 index d744daff..cff3622b 100755 --- a/tests/generic/014 +++ b/tests/generic/014 @@ -6,15 +6,12 @@ # # truncfile # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw udf auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() rm -rf $TEST_DIR/truncfile.$$.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic diff --git a/tests/generic/015 b/tests/generic/015 index 3d0c14c0..10423a29 100755 --- a/tests/generic/015 +++ b/tests/generic/015 @@ -6,25 +6,18 @@ # # check out-of-space behaviour # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other auto quick enospc -here=`pwd` -tmp=/tmp/$$ -status=1 # success is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter +# Override the default cleanup function. _cleanup() { _scratch_unmount } -trap "_cleanup; exit \$status" 0 1 2 3 15 - _free() { _df_dir $SCRATCH_MNT | $AWK_PROG '{ print $5 }' @@ -42,7 +35,6 @@ _scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \ || _fail "mkfs failed" _scratch_mount out=$SCRATCH_MNT/fillup.$$ -rm -f $seqres.full free0=`_free` if [ -z "$free0" ] diff --git a/tests/generic/016 b/tests/generic/016 index 050ecd18..59cb8085 100755 --- a/tests/generic/016 +++ b/tests/generic/016 @@ -10,24 +10,11 @@ # type of extents. These tests are based on generic/255 test case. # For the type of tests, check the description of _test_generic_punch # in common/rc. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc punch collapse -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks +# Import common functions. # we need to include common/punch to get defination fo filter functions -. ./common/rc . ./common/filter . ./common/punch diff --git a/tests/generic/017 b/tests/generic/017 index 276cf5c9..4b6acace 100755 --- a/tests/generic/017 +++ b/tests/generic/017 @@ -9,17 +9,10 @@ # until the file is left with 80 blocks and as much number of extents. # Also check for file system consistency after completing this operation # for each blocksize. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto prealloc collapse -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/018 b/tests/generic/018 index 8c7dfcd7..4ffc91d5 100755 --- a/tests/generic/018 +++ b/tests/generic/018 @@ -6,23 +6,10 @@ # # Basic defragmentation sanity tests # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto fsr quick defrag -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag @@ -79,6 +66,5 @@ for i in `seq 0 2 31`; do done _defrag --before 16 --after 16 $fragfile -rm -f $seqres.full status=0 exit diff --git a/tests/generic/019 b/tests/generic/019 index 46cd2b75..640c96ae 100755 --- a/tests/generic/019 +++ b/tests/generic/019 @@ -7,17 +7,12 @@ # Run fsstress and fio(dio/aio and mmap) and simulate disk failure # check filesystem consistency at the end. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest aio dangerous enospc rw stress -here=`pwd` -tmp=/tmp/$$ fio_config=$tmp.fio -status=1 # failure is the default! -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic _require_scratch @@ -55,13 +50,13 @@ stop_fail_scratch_dev() echo 0 > $SYSFS_BDEV/make-it-fail } +# Override the default cleanup function. _cleanup() { poweron_scratch_dev disallow_fail_make_request rm -f $tmp.* } -trap "_cleanup; exit \$status" 1 2 3 15 RUN_TIME=$((20+10*$TIME_FACTOR)) NUM_JOBS=$((4*LOAD_FACTOR)) @@ -156,7 +151,6 @@ _workout() # real QA test starts here -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount allow_fail_make_request diff --git a/tests/generic/020 b/tests/generic/020 index 72a1c8aa..29ef853c 100755 --- a/tests/generic/020 +++ b/tests/generic/020 @@ -6,17 +6,12 @@ # # extended attributes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest metadata attr udf auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.* $testfile; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -62,8 +57,6 @@ _supported_fs generic _require_test _require_attrs -rm -f $seqres.full - testfile=$TEST_DIR/attribute_$$ echo "*** list non-existant file" diff --git a/tests/generic/021 b/tests/generic/021 index b307b61c..7407bf03 100755 --- a/tests/generic/021 +++ b/tests/generic/021 @@ -10,24 +10,11 @@ # type of extents. These tests are based on generic/255 test case. # For the type of tests, check the description of _test_generic_punch # in common/rc. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc punch collapse -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks +# Import common functions. # we need to include common/punch to get defination fo filter functions -. ./common/rc . ./common/filter . ./common/punch diff --git a/tests/generic/022 b/tests/generic/022 index 917fab60..b983c5d0 100755 --- a/tests/generic/022 +++ b/tests/generic/022 @@ -10,24 +10,11 @@ # type of extents. These tests are based on generic/255 test case. # For the type of tests, check the description of _test_generic_punch # in common/rc. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc punch collapse -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks +# Import common functions. # we need to include common/punch to get defination fo filter functions -. ./common/rc . ./common/filter . ./common/punch diff --git a/tests/generic/023 b/tests/generic/023 index 987fcad1..2b1973c3 100755 --- a/tests/generic/023 +++ b/tests/generic/023 @@ -6,23 +6,10 @@ # # Check renameat2 syscall without flags # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/renameat2 _supported_fs generic diff --git a/tests/generic/024 b/tests/generic/024 index 9d663448..84eecb9b 100755 --- a/tests/generic/024 +++ b/tests/generic/024 @@ -6,23 +6,10 @@ # # Check renameat2 syscall with RENAME_NOREPLACE flag # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/renameat2 _supported_fs generic diff --git a/tests/generic/025 b/tests/generic/025 index 3c57e118..d3c79370 100755 --- a/tests/generic/025 +++ b/tests/generic/025 @@ -6,23 +6,10 @@ # # Check renameat2 syscall with RENAME_EXCHANGE flag # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/renameat2 _supported_fs generic diff --git a/tests/generic/026 b/tests/generic/026 index a2ba1cf4..43b7b0b7 100755 --- a/tests/generic/026 +++ b/tests/generic/026 @@ -7,20 +7,14 @@ # # Test out ACL count limits # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest acl quick auto -here=`pwd` -tmp=/tmp/$$ -status=1 # FAILure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr +# Override the default cleanup function. _cleanup() { cd / @@ -35,8 +29,6 @@ _acl_setup_ids _require_acls _require_acl_get_max -rm -f $seqres.full - # get dir cd $TEST_DIR rm -rf $seq.dir1 @@ -74,7 +66,6 @@ check_acls() fi } - echo "" echo "=== Test out large ACLs ===" touch largeaclfile diff --git a/tests/generic/027 b/tests/generic/027 index 6cf5e35f..47f1981d 100755 --- a/tests/generic/027 +++ b/tests/generic/027 @@ -10,20 +10,8 @@ # Regression test for # 34cf865 ext4: fix deadlock when writing in ENOSPC conditions # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto enospc create_file() { @@ -37,8 +25,7 @@ create_file() done } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -46,7 +33,6 @@ _supported_fs generic _require_scratch -rm -f $seqres.full echo "Silence is golden" _scratch_mkfs_sized $((256 * 1024 * 1024)) >>$seqres.full 2>&1 diff --git a/tests/generic/028 b/tests/generic/028 index 8d055e6d..9d646c55 100755 --- a/tests/generic/028 +++ b/tests/generic/028 @@ -13,23 +13,10 @@ # ede4ceb prepend_path() needs to reinitialize dentry/vfsmount/mnt on restarts # f650080 __dentry_path() fixes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/029 b/tests/generic/029 index 906b8d4b..751e4f65 100755 --- a/tests/generic/029 +++ b/tests/generic/029 @@ -8,23 +8,10 @@ # correctly written. This can expose data corruption bugs on filesystems where # the block size is smaller than the page size. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/030 b/tests/generic/030 index 69ca9944..7c263702 100755 --- a/tests/generic/030 +++ b/tests/generic/030 @@ -8,23 +8,10 @@ # correctly written. This can expose data corruption bugs on filesystems where # the block size is smaller than the page size. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/031 b/tests/generic/031 index db84031b..313ce9ff 100755 --- a/tests/generic/031 +++ b/tests/generic/031 @@ -8,23 +8,10 @@ # correctly written and aren't left behind causing invalidation or data # corruption issues. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick prealloc rw collapse + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/032 b/tests/generic/032 index 8e8dea3d..b3d13896 100755 --- a/tests/generic/032 +++ b/tests/generic/032 @@ -10,15 +10,10 @@ # extents on I/O completion. This causes data corruption as unwritten extents # are always read back as zeroes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw +# Override the default cleanup function. _cleanup() { cd / @@ -27,12 +22,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/punch # real QA test starts here -rm -f $seqres.full _syncloop() { diff --git a/tests/generic/033 b/tests/generic/033 index 233b69fa..9dd854f2 100755 --- a/tests/generic/033 +++ b/tests/generic/033 @@ -12,26 +12,12 @@ # without any indirect block reservation whatsoever. This leads to assert # failures and possibly other problems in XFS. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here -rm -f $seqres.full # Modify as appropriate. _supported_fs generic diff --git a/tests/generic/034 b/tests/generic/034 index 889c540a..3f422993 100755 --- a/tests/generic/034 +++ b/tests/generic/034 @@ -13,21 +13,16 @@ # # Btrfs: fix directory recovery from fsync log # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -36,8 +31,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/035 b/tests/generic/035 index 3c90cd25..a2135d7f 100755 --- a/tests/generic/035 +++ b/tests/generic/035 @@ -7,23 +7,10 @@ # Check overwriting rename system call # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. _supported_fs generic diff --git a/tests/generic/036 b/tests/generic/036 index 9956db98..1bc762dd 100755 --- a/tests/generic/036 +++ b/tests/generic/036 @@ -7,23 +7,10 @@ # CVE-2014-8086 # Run aio-dio-fcntl-race - test aio write race with O_DIRECT toggle # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto aio rw stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/037 b/tests/generic/037 index 8f9f8157..55beddb4 100755 --- a/tests/generic/037 +++ b/tests/generic/037 @@ -15,21 +15,17 @@ # # Btrfs: make xattr replace operations atomic # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick attr metadata +# Override the default cleanup function. _cleanup() { kill $setter_pid rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -38,8 +34,6 @@ _supported_fs generic _require_scratch _require_attrs -rm -f $seqres.full - xattr_name="user.something" xattr_value1="foobar" xattr_value2="rabbit_hole" diff --git a/tests/generic/038 b/tests/generic/038 index 239b5e88..c6cea94e 100755 --- a/tests/generic/038 +++ b/tests/generic/038 @@ -30,21 +30,16 @@ # scsi-hd devices with discard support enabled (that means hole punching in the # disk's image file is performed by the host). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto stress trim +# Override the default cleanup function. _cleanup() { rm -fr $tmp } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -52,8 +47,6 @@ _supported_fs generic _require_scratch _require_xfs_io_command "falloc" -rm -f $seqres.full - # Keep allocating and deallocating 1G of data space with the goal of creating # and deleting 1 block group constantly. The intention is to race with the # fstrim loop below. diff --git a/tests/generic/039 b/tests/generic/039 index 6b991609..72eb6fa7 100755 --- a/tests/generic/039 +++ b/tests/generic/039 @@ -16,22 +16,16 @@ # # Btrfs: fix directory inconsistency after fsync log replay # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest metadata auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -41,8 +35,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/040 b/tests/generic/040 index c434b28f..62e3468b 100755 --- a/tests/generic/040 +++ b/tests/generic/040 @@ -21,22 +21,16 @@ # This issue was present in btrfs since the extrefs (extend references) # feature was added (2012). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest metadata auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -46,8 +40,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - # If the test filesystem is btrfs, make sure we create a filesystem with # the extend references (extrefs) feature enabled (it's enabled by default # in recent versions of btrfs-progs). diff --git a/tests/generic/041 b/tests/generic/041 index 7a23df63..ccf002c0 100755 --- a/tests/generic/041 +++ b/tests/generic/041 @@ -25,22 +25,16 @@ # This issue was present in btrfs since the extrefs (extend references) # feature was added (2012). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest metadata auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -50,8 +44,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - # If the test filesystem is btrfs, make sure we create a filesystem with # the extend references (extrefs) feature enabled (it's enabled by default # in recent versions of btrfs-progs). diff --git a/tests/generic/042 b/tests/generic/042 index ee0e4b40..88cc2098 100755 --- a/tests/generic/042 +++ b/tests/generic/042 @@ -12,28 +12,14 @@ # occurs for dirty pages within the extent but outside of the fallocated range, # stale data exposure can occur. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown rw punch zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch # real QA test starts here -rm -f $seqres.full _crashtest() { diff --git a/tests/generic/043 b/tests/generic/043 index 6992ad43..b1432e25 100755 --- a/tests/generic/043 +++ b/tests/generic/043 @@ -6,17 +6,10 @@ # # Test for NULL files problem # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown metadata log auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/044 b/tests/generic/044 index 4f4e09f8..56c50548 100755 --- a/tests/generic/044 +++ b/tests/generic/044 @@ -6,17 +6,10 @@ # # Test for NULL files problem # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown metadata log auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/045 b/tests/generic/045 index b85d4204..f5f36a7a 100755 --- a/tests/generic/045 +++ b/tests/generic/045 @@ -6,17 +6,10 @@ # # Test for NULL files problem # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown metadata log auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/046 b/tests/generic/046 index 3e443dca..5dbb8fa5 100755 --- a/tests/generic/046 +++ b/tests/generic/046 @@ -6,17 +6,10 @@ # # Test for NULL files problem # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown metadata log auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/047 b/tests/generic/047 index d1db1b4f..770e7f1b 100755 --- a/tests/generic/047 +++ b/tests/generic/047 @@ -7,17 +7,10 @@ # Test for NULL files problem # test inode size is on disk after fsync # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown metadata rw auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/048 b/tests/generic/048 index 89e44a9c..10c87f3b 100755 --- a/tests/generic/048 +++ b/tests/generic/048 @@ -7,17 +7,10 @@ # Test for NULL files problem # test inode size is on disk after sync # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown metadata rw auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/049 b/tests/generic/049 index 208a5eac..4effc4a6 100755 --- a/tests/generic/049 +++ b/tests/generic/049 @@ -7,17 +7,10 @@ # Test for NULL files problem # test inode size is on disk after sync - expose log replay bug # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown metadata rw auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/050 b/tests/generic/050 index c1a03439..0664f8c0 100755 --- a/tests/generic/050 +++ b/tests/generic/050 @@ -7,23 +7,17 @@ # Check out various mount/remount/unmount scenarious on a read-only blockdev. # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest shutdown mount auto quick +# Override the default cleanup function. _cleanup() { cd / blockdev --setrw $SCRATCH_DEV } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -120,5 +114,4 @@ _try_scratch_mount -o ro 2>&1 | _filter_scratch # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/generic/051 b/tests/generic/051 index a9b2bb28..afde8e26 100755 --- a/tests/generic/051 +++ b/tests/generic/051 @@ -8,25 +8,19 @@ # it and check that recovery runs to completion and everything can be # successfully removed afterwards.. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown auto stress log metadata repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs generic @@ -35,8 +29,6 @@ _require_scratch _require_scratch_shutdown _require_command "$KILLALL_PROG" killall -rm -f $seqres.full - _scratch_mkfs > $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _scratch_mount diff --git a/tests/generic/052 b/tests/generic/052 index b3de72b9..9771575c 100755 --- a/tests/generic/052 +++ b/tests/generic/052 @@ -9,24 +9,16 @@ # the goingdown ioctl is working and recovery of # create transactions is working. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown log auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/log # real QA test starts here _supported_fs generic -rm -f $seqres.full rm -f $tmp.log _require_scratch diff --git a/tests/generic/053 b/tests/generic/053 index 1eb48578..d7a2ffbd 100755 --- a/tests/generic/053 +++ b/tests/generic/053 @@ -6,17 +6,10 @@ # # xfs_repair breaks acls # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest acl repair auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/generic/054 b/tests/generic/054 index 87e9d71d..806117d6 100755 --- a/tests/generic/054 +++ b/tests/generic/054 @@ -8,24 +8,16 @@ # Initially keep this simple with just creates. # In another qa test we can do more e.g. use fsstress. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown log v2log auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/log # real QA test starts here _supported_fs generic -rm -f $seqres.full $tmp.* _require_scratch _require_scratch_shutdown _require_logstate diff --git a/tests/generic/055 b/tests/generic/055 index 51f2a0c9..935691e1 100755 --- a/tests/generic/055 +++ b/tests/generic/055 @@ -8,17 +8,10 @@ # and so will use fsstress # * also can interrupt metadata with godown # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown log v2log auto quota stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/log . ./common/quota @@ -52,7 +45,6 @@ _get_quota_option() # real QA test starts here _supported_fs generic -rm -f $seqres.full $tmp.* _require_scratch _require_scratch_shutdown _require_logstate diff --git a/tests/generic/056 b/tests/generic/056 index a76b7218..99d5e325 100755 --- a/tests/generic/056 +++ b/tests/generic/056 @@ -13,23 +13,17 @@ # # Btrfs: fix fsync data loss after adding hard link to inode # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest metadata auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -39,8 +33,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/057 b/tests/generic/057 index b7405808..7e4e305e 100755 --- a/tests/generic/057 +++ b/tests/generic/057 @@ -13,23 +13,17 @@ # # Btrfs: fix fsync data loss after adding hard link to inode # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest metadata auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -39,8 +33,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/058 b/tests/generic/058 index 46db63d3..cb685ffb 100755 --- a/tests/generic/058 +++ b/tests/generic/058 @@ -10,24 +10,11 @@ # type of extents. These tests are based on generic/255 test case. # For the type of tests, check the description of _test_generic_punch # in common/rc. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc punch insert -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks +# Import common functions. # we need to include common/punch to get defination fo filter functions -. ./common/rc . ./common/filter . ./common/punch diff --git a/tests/generic/059 b/tests/generic/059 index e495eff8..00c0f7b0 100755 --- a/tests/generic/059 +++ b/tests/generic/059 @@ -21,23 +21,17 @@ # Also test the mtime and ctime properties of the file change after punching # holes with ranges that operate only on a single block of the file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest metadata auto quick punch log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -47,8 +41,6 @@ _require_scratch _require_dm_target flakey _require_xfs_io_command "fpunch" -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/060 b/tests/generic/060 index 6024216d..0fd42785 100755 --- a/tests/generic/060 +++ b/tests/generic/060 @@ -10,24 +10,11 @@ # type of extents. These tests are based on generic/255 test case. # For the type of tests, check the description of _test_generic_punch # in common/rc. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc punch insert -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks +# Import common functions. # we need to include common/punch to get defination fo filter functions -. ./common/rc . ./common/filter . ./common/punch diff --git a/tests/generic/061 b/tests/generic/061 index bab3f05f..c4998b93 100755 --- a/tests/generic/061 +++ b/tests/generic/061 @@ -10,24 +10,11 @@ # type of extents. These tests are based on generic/255 test case. # For the type of tests, check the description of _test_generic_punch # in common/rc. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc punch insert -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks +# Import common functions. # we need to include common/punch to get defination fo filter functions -. ./common/rc . ./common/filter . ./common/punch diff --git a/tests/generic/062 b/tests/generic/062 index d7efedf0..6e5ad049 100755 --- a/tests/generic/062 +++ b/tests/generic/062 @@ -7,19 +7,14 @@ # Exercises the getfattr/setfattr tools # Derived from tests originally written by Andreas Gruenbacher for ext2 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest attr udf auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr +# Override the default cleanup function. _cleanup() { cd / @@ -27,7 +22,6 @@ _cleanup() _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 getfattr() { @@ -84,7 +78,6 @@ fi _require_attrs $ATTR_MODES - for nsp in $ATTR_MODES; do for inode in reg dir lnk dev/b dev/c dev/p; do diff --git a/tests/generic/063 b/tests/generic/063 index c60b502c..60a5f242 100755 --- a/tests/generic/063 +++ b/tests/generic/063 @@ -10,24 +10,11 @@ # type of extents. These tests are based on generic/255 test case. # For the type of tests, check the description of _test_generic_punch # in common/rc. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc punch insert -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks +# Import common functions. # we need to include common/punch to get defination fo filter functions -. ./common/rc . ./common/filter . ./common/punch diff --git a/tests/generic/064 b/tests/generic/064 index 7098fcd3..b7d7fa4b 100755 --- a/tests/generic/064 +++ b/tests/generic/064 @@ -9,17 +9,10 @@ # is left with 50 extents and as many holes. Then call collapse range # on the previously inserted ranges to test merge code of collapse # range. Also check for data integrity and file system consistency. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc collapse insert -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,8 +23,6 @@ _require_xfs_io_command "fiemap" _require_xfs_io_command "finsert" _require_xfs_io_command "fcollapse" -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed" _scratch_mount diff --git a/tests/generic/065 b/tests/generic/065 index 0c8cb835..7f974fea 100755 --- a/tests/generic/065 +++ b/tests/generic/065 @@ -14,23 +14,17 @@ # counts were incorrect after the fsync log was replayed and the hardlinks for # new inodes were not logged. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest metadata auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -40,8 +34,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/066 b/tests/generic/066 index 9e8b936f..105a7acd 100755 --- a/tests/generic/066 +++ b/tests/generic/066 @@ -17,23 +17,17 @@ # # Btrfs: remove deleted xattrs on fsync log replay # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick attr metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey . ./common/attr @@ -44,8 +38,6 @@ _require_scratch _require_dm_target flakey _require_attrs -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/067 b/tests/generic/067 index ead1b9ae..cb466e0c 100755 --- a/tests/generic/067 +++ b/tests/generic/067 @@ -13,23 +13,10 @@ # - umount a path with too long name # - lazy umount a symlink # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick mount -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -42,8 +29,6 @@ _require_scratch _require_loop _require_block_device $SCRATCH_DEV -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 # kernel should not hang nor oops when mounting fs to nonexistent mount point diff --git a/tests/generic/068 b/tests/generic/068 index 573fbd45..56262cd7 100755 --- a/tests/generic/068 +++ b/tests/generic/068 @@ -7,16 +7,14 @@ # Test case to reproduce xfs_freeze hang under filsystem load. # The fail case for this test is a hang on an xfs_freeze. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other auto freeze stress -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! ITERATIONS=10 +# Override the default cleanup function. _cleanup() { cd / @@ -24,10 +22,7 @@ _cleanup() trap 0 1 2 3 15 } -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,7 +33,6 @@ _require_freeze echo "*** init FS" -rm -f $seqres.full _scratch_unmount >/dev/null 2>&1 echo "*** MKFS ***" >>$seqres.full echo "" >>$seqres.full diff --git a/tests/generic/069 b/tests/generic/069 index 386ed770..5579bff2 100755 --- a/tests/generic/069 +++ b/tests/generic/069 @@ -6,24 +6,19 @@ # # Test out writes with O_APPEND flag sets. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw udf auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15 +_register_cleanup "rm -rf $tmp.*" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs generic _require_scratch -rm -f $seqres.full _scratch_unmount >/dev/null 2>&1 diff --git a/tests/generic/070 b/tests/generic/070 index c12b1165..678344fa 100755 --- a/tests/generic/070 +++ b/tests/generic/070 @@ -6,15 +6,10 @@ # # fsstress incarnation testing extended attributes writes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest attr udf auto quick stress +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/generic/071 b/tests/generic/071 index 9f0c56fe..205d8315 100755 --- a/tests/generic/071 +++ b/tests/generic/071 @@ -8,22 +8,10 @@ # pre-allocated extent that ends beyond the file's size. Verify that if the fs # is unmounted immediately after, the file's size and content are not lost. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick prealloc + +# Import common functions. . ./common/filter # real QA test starts here @@ -31,8 +19,6 @@ _supported_fs generic _require_scratch _require_xfs_io_command "falloc" "-k" -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/072 b/tests/generic/072 index 952900e8..59b49fac 100755 --- a/tests/generic/072 +++ b/tests/generic/072 @@ -9,23 +9,10 @@ # fs: move falloc collapse range check into the filesystem methods # If the race occurs, it will trigger a BUG_ON(). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto metadata stress collapse -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/073 b/tests/generic/073 index f5316ca2..f28a0838 100755 --- a/tests/generic/073 +++ b/tests/generic/073 @@ -14,23 +14,17 @@ # # Btrfs: fix data loss in the fast fsync path # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest metadata auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -39,8 +33,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/074 b/tests/generic/074 index 8e600f49..ec63c50f 100755 --- a/tests/generic/074 +++ b/tests/generic/074 @@ -6,30 +6,24 @@ # # fstest # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw udf auto -here=`pwd` -tmp=/tmp/$$ fstest_dir=$TEST_DIR/fstest status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -rf $fstest_dir.* $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic _require_test -rm -f $seqres.full - _do_test() { _n="$1" diff --git a/tests/generic/075 b/tests/generic/075 index 7467bb76..9f24ad41 100755 --- a/tests/generic/075 +++ b/tests/generic/075 @@ -6,23 +6,19 @@ # # fsx (non-AIO variant) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw udf auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / rm -rf $TEST_DIR/fsx.* $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _do_test() @@ -120,7 +116,6 @@ _process_args "$@" echo "Params are for $param_type" >>$seqres.full echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full -rm -f $seqres.full echo "brevity is wit..." _check_test_fs diff --git a/tests/generic/076 b/tests/generic/076 index dfba5e5b..c024fadd 100755 --- a/tests/generic/076 +++ b/tests/generic/076 @@ -6,13 +6,8 @@ # # Test blockdev reads in parallel with filesystem reads/writes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 +. ./common/preamble +_begin_fstest metadata rw udf auto quick stress _lets_get_pidst() { @@ -23,16 +18,16 @@ _lets_get_pidst() fi } +# Override the default cleanup function. _cleanup() { echo "*** unmount" _scratch_unmount 2>/dev/null _lets_get_pidst } -trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 +_register_cleanup "_cleanup; rm -f $tmp.*" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -43,7 +38,6 @@ _require_local_device $SCRATCH_DEV echo "*** init fs" -rm -f $seqres.full _scratch_unmount >/dev/null 2>&1 echo "*** MKFS ***" >>$seqres.full echo "" >>$seqres.full diff --git a/tests/generic/077 b/tests/generic/077 index 178e8341..94d89fae 100755 --- a/tests/generic/077 +++ b/tests/generic/077 @@ -6,13 +6,8 @@ # # Check use of ACLs (extended attributes) on a full filesystem # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 +. ./common/preamble +_begin_fstest acl attr auto enospc # Something w/ enough data to fill 256M of fs... filler="" @@ -26,16 +21,16 @@ filler="" [ $(( $(du -h -m /usr | tail -1| cut -f1) * 2 )) -ge 256 ] && \ filler=/usr +# Override the default cleanup function. _cleanup() { cd / echo "*** unmount" _scratch_unmount 2>/dev/null } -trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 +_register_cleanup "_cleanup; rm -f $tmp.*" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -51,7 +46,6 @@ _require_user echo "*** create filesystem" -rm -f $seqres.full _scratch_unmount >/dev/null 2>&1 echo "*** MKFS ***" >>$seqres.full echo "" >>$seqres.full diff --git a/tests/generic/078 b/tests/generic/078 index 0430f50c..fe0fb44a 100755 --- a/tests/generic/078 +++ b/tests/generic/078 @@ -6,23 +6,10 @@ # # Check renameat2 syscall with RENAME_WHITEOUT flag # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metadata -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/renameat2 _supported_fs generic diff --git a/tests/generic/079 b/tests/generic/079 index e69d05d4..829275db 100755 --- a/tests/generic/079 +++ b/tests/generic/079 @@ -6,16 +6,12 @@ # # Run the t_immutable test program for immutable/append-only files. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick ioctl metadata -here=`pwd` timmutable=$here/src/t_immutable -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +19,7 @@ _cleanup() $timmutable -r $SCRATCH_MNT/$seq } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/generic/080 b/tests/generic/080 index 9d57ea74..1bfc6d72 100755 --- a/tests/generic/080 +++ b/tests/generic/080 @@ -6,15 +6,12 @@ # # Verify that mtime is updated when writing to mmap-ed pages # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ status=0 -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() rm -f $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -31,7 +27,6 @@ _supported_fs generic _require_test echo "Silence is golden." -rm -f $seqres.full # pattern the file. testfile=$TEST_DIR/mmap_mtime_testfile diff --git a/tests/generic/081 b/tests/generic/081 index 5dff0798..f795b2c1 100755 --- a/tests/generic/081 +++ b/tests/generic/081 @@ -6,15 +6,10 @@ # # Test I/O error path by fully filling an dm snapshot. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -44,8 +39,7 @@ _cleanup() done } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -56,7 +50,6 @@ _require_dm_target snapshot _require_command $LVM_PROG lvm echo "Silence is golden" -rm -f $seqres.full vgname=vg_$seq lvname=base_$seq diff --git a/tests/generic/082 b/tests/generic/082 index 8a6266f5..ddf48f63 100755 --- a/tests/generic/082 +++ b/tests/generic/082 @@ -6,28 +6,15 @@ # # Test quota handling on remount ro failure # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick quota filter_project_quota_line() { grep -v "^project quota on" } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -37,8 +24,6 @@ _require_test _require_scratch _require_quota -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount "-o usrquota,grpquota" diff --git a/tests/generic/083 b/tests/generic/083 index 057ae822..2a5af3cc 100755 --- a/tests/generic/083 +++ b/tests/generic/083 @@ -15,24 +15,18 @@ # dksc0d1s4: Process [fsstress] ran out of disk space # dksc0d1s4: Process [fsstress] ran out of disk space # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 +. ./common/preamble +_begin_fstest rw auto enospc stress +# Override the default cleanup function. _cleanup() { echo "*** unmount" _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -41,8 +35,6 @@ _supported_fs generic _require_scratch _require_no_large_scratch_dev -rm -f $seqres.full - workout() { fsz=$1 diff --git a/tests/generic/084 b/tests/generic/084 index 3bd2701e..942ee400 100755 --- a/tests/generic/084 +++ b/tests/generic/084 @@ -9,23 +9,10 @@ # Regression test for commit: # aae8a97 fs: Don't allow to create hardlink for deleted file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto metadata quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -45,7 +32,6 @@ link_unlink_storm() done } -rm -f $seqres.full nr_cpu=`$here/src/feature -o` echo "Silence is golden" diff --git a/tests/generic/085 b/tests/generic/085 index 86f8b9da..20cf875a 100755 --- a/tests/generic/085 +++ b/tests/generic/085 @@ -10,15 +10,10 @@ # This commit fixed the issue: # 1494583 fix get_active_super()/umount() race # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto freeze mount +# Override the default cleanup function. _cleanup() { cd / @@ -34,8 +29,7 @@ cleanup_dmdev() _dmsetup_remove $node } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -52,7 +46,6 @@ setup_dmdev() _fail "setup dm device failed" } -rm -f $seqres.full echo "Silence is golden" size=$((256 * 1024 * 1024)) diff --git a/tests/generic/086 b/tests/generic/086 index eb46c83a..c5023081 100755 --- a/tests/generic/086 +++ b/tests/generic/086 @@ -13,23 +13,10 @@ # This tests excercises the problem fixed in kernel with commit # "ext4: Fix data corruption caused by unwritten and delayed extents" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto prealloc preallocrw quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/087 b/tests/generic/087 index c3576117..160b32de 100755 --- a/tests/generic/087 +++ b/tests/generic/087 @@ -16,22 +16,16 @@ # For NFSv3+, that test will wrongly succeed until kernel commit # "Disable NFSv2 timestamp workaround for NFSv3+". # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest perms auto quick +# Override the default cleanup function. _cleanup() { cd / } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/088 b/tests/generic/088 index ad99bd7e..1c17b82f 100755 --- a/tests/generic/088 +++ b/tests/generic/088 @@ -8,17 +8,10 @@ # xfs_iaccess(ip,mode,cr) # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest perms auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _filter() diff --git a/tests/generic/089 b/tests/generic/089 index 3114125d..1bbd1507 100755 --- a/tests/generic/089 +++ b/tests/generic/089 @@ -7,18 +7,12 @@ # Emulate the way Linux mount manipulates /etc/mtab to attempt to # reproduce a possible bug in rename (see src/t_mtab.c). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest metadata auto mtab_output=$TEST_DIR/mtab_output -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter addentries() @@ -37,7 +31,6 @@ _supported_fs generic _require_test _require_hardlinks -rm -f $seqres.full [ "X$TEST_DIR" = "X" ] && exit 1 cd $TEST_DIR rm -fr test diff --git a/tests/generic/090 b/tests/generic/090 index 0f276f78..c0fdd2b2 100755 --- a/tests/generic/090 +++ b/tests/generic/090 @@ -12,23 +12,17 @@ # # This test is motivated by a bug found in btrfs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest metadata auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -38,8 +32,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/091 b/tests/generic/091 index a8d5d5e6..9c02e36d 100755 --- a/tests/generic/091 +++ b/tests/generic/091 @@ -6,17 +6,10 @@ # # fsx exercising direct IO -- sub-block sizes and concurrent buffered IO # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -24,8 +17,6 @@ _supported_fs generic _require_test _require_odirect -rm -f $seqres.full - psize=`$here/src/feature -s` bsize=`_min_dio_alignment $TEST_DEV` diff --git a/tests/generic/092 b/tests/generic/092 index f555fa8b..505e0ec8 100755 --- a/tests/generic/092 +++ b/tests/generic/092 @@ -11,23 +11,12 @@ # This also verifies that truncat'ing up past i_size doesn't remove the # preallocated space. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch diff --git a/tests/generic/093 b/tests/generic/093 index 48ffec5c..d7ddfd1b 100755 --- a/tests/generic/093 +++ b/tests/generic/093 @@ -7,19 +7,14 @@ # # Test clearing of capabilities on write. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq +. ./common/preamble +_begin_fstest attr cap auto -here=`pwd` -tmp=/tmp/$$ -status=1 # FAILure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr +# Override the default cleanup function. _cleanup() { [ -n "$TEST_DIR" ] && rm -f $file @@ -40,9 +35,6 @@ _require_test_program "writemod" _require_command "$SETCAP_PROG" "setcap" _require_command "$GETCAP_PROG" "getcap" -rm -f $seqres.full - -echo "QA output created by $seq" echo "" file=$TEST_DIR/$seq.file diff --git a/tests/generic/094 b/tests/generic/094 index 20ef158e..7a078a88 100755 --- a/tests/generic/094 +++ b/tests/generic/094 @@ -6,23 +6,10 @@ # # Run the fiemap (file extent mapping) tester with preallocation enabled # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick prealloc + +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +22,6 @@ _require_xfs_io_command "falloc" _scratch_mkfs > /dev/null 2>&1 _scratch_mount > /dev/null 2>&1 -rm -f $seqres.full fiemapfile=$SCRATCH_MNT/$seq.fiemap _require_test_program "fiemap-tester" diff --git a/tests/generic/095 b/tests/generic/095 index b702a397..c4693917 100755 --- a/tests/generic/095 +++ b/tests/generic/095 @@ -6,23 +6,10 @@ # # Concurrent mixed I/O (buffer I/O, aiodio, mmap, splice) on the same files # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -95,7 +82,6 @@ EOF # which is a fio built-in var. echo 'bs=$pagesize' >> $fio_config -rm -f $seqres.full _require_fio $fio_config _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/096 b/tests/generic/096 index 36fdcf7d..41b646c0 100755 --- a/tests/generic/096 +++ b/tests/generic/096 @@ -9,23 +9,10 @@ # past the isize but still in the same block. This particular problem # has only been seen on systems with page_size > block_size. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto prealloc quick zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,7 +20,6 @@ _supported_fs generic _require_scratch _require_xfs_io_command "fzero" -rm -f $seqres.full echo "Silence is golden" # Use smaller scratch fs to shorten the test time diff --git a/tests/generic/097 b/tests/generic/097 index ef9cc1e2..613aabaa 100755 --- a/tests/generic/097 +++ b/tests/generic/097 @@ -12,17 +12,12 @@ # - remove # Basic testing. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest attr auto quick file=$TEST_DIR/foo +# Override the default cleanup function. _cleanup() { rm -f $tmp.* $file @@ -38,8 +33,7 @@ setfattr() $SETFATTR_PROG "$@" |& _filter_test_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr . ./common/filter diff --git a/tests/generic/098 b/tests/generic/098 index 68641e12..b947fb25 100755 --- a/tests/generic/098 +++ b/tests/generic/098 @@ -12,20 +12,10 @@ # # This test is motivated by an issue found in btrfs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -41,8 +31,6 @@ if [ $FSTYP == "btrfs" ]; then MKFS_OPTIONS="$MKFS_OPTIONS -O no-holes" fi -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/099 b/tests/generic/099 index 9a364a7e..6ba04dd8 100755 --- a/tests/generic/099 +++ b/tests/generic/099 @@ -7,19 +7,14 @@ # Test out ACLs. # #!/bin/bash -seq=`basename $0` -seqres=$RESULT_DIR/$seq +. ./common/preamble +_begin_fstest acl auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # FAILure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr +# Override the default cleanup function. _cleanup() { cd / @@ -56,8 +51,6 @@ _supported_fs generic _require_test _require_runas -rm -f $seqres.full - _acl_setup_ids _require_acls @@ -67,7 +60,6 @@ rm -rf $seq.dir1 mkdir $seq.dir1 cd $seq.dir1 -echo "QA output created by $seq" echo "" echo "=== Test minimal ACE ===" diff --git a/tests/generic/100 b/tests/generic/100 index 4d5eac47..cec47a0c 100755 --- a/tests/generic/100 +++ b/tests/generic/100 @@ -7,19 +7,13 @@ # Test whether a tarred directory structure can be untarred onto # a UDF file system. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest udf auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter +# Override the default cleanup function. _cleanup() { rm -f $tmp.* $TEMP_DIR/$TAR_FILE @@ -39,8 +33,6 @@ DEPTH=5 POPULATED_DIR=$TEMP_DIR/populate_root SIZE=10 -rm -f $seqres.full - # Clean up if file exist from prevous run rm -rf $POPULATED_DIR rm -f $TEMP_DIR/$TAR_FILE diff --git a/tests/generic/101 b/tests/generic/101 index 03718a6a..76750c33 100755 --- a/tests/generic/101 +++ b/tests/generic/101 @@ -11,21 +11,17 @@ # # This test is motivated by a bug found in btrfs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -43,8 +39,6 @@ if [ $FSTYP == "btrfs" ]; then MKFS_OPTIONS="$MKFS_OPTIONS -O no-holes" fi -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/102 b/tests/generic/102 index 996bd733..3536ebf7 100755 --- a/tests/generic/102 +++ b/tests/generic/102 @@ -12,24 +12,16 @@ # # btrfs: Fix no_space on dd and rm loop < from zhaolei@cn.fujitsu.com > # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw -tmp=/tmp/$$ -status=1 -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs generic _require_scratch -rm -f $seqres.full - dev_size=$((1024 * 1024 * 1024)) # 1GB filesystem _scratch_mkfs_sized $dev_size >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/103 b/tests/generic/103 index b22b0159..795f851d 100755 --- a/tests/generic/103 +++ b/tests/generic/103 @@ -10,23 +10,12 @@ # attempting to set larger attribute values on a filesystem that is at or near # ENOSPC. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick attr enospc -_cleanup() -{ - cd / - rm -f $tmp.* -} +_register_cleanup "_cleanup" 25 -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 25 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr # real QA test starts here @@ -35,8 +24,6 @@ _require_scratch _require_attrs _require_xfs_io_command "falloc" -rm -f $seqres.full - _consume_freesp() { file=$1 diff --git a/tests/generic/104 b/tests/generic/104 index 9693d3be..955185fa 100755 --- a/tests/generic/104 +++ b/tests/generic/104 @@ -9,21 +9,17 @@ # links exist and the filesystem metadata (directory and file inodes) is in a # consistent state. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -33,8 +29,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/105 b/tests/generic/105 index 93c88630..b422ea34 100755 --- a/tests/generic/105 +++ b/tests/generic/105 @@ -9,22 +9,16 @@ # and breaks CAPP evaluation # which pulls out an earlier mod # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest acl auto quick +# Override the default cleanup function. _cleanup() { cd / } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -33,8 +27,6 @@ _supported_fs generic # real QA test starts here -rm -f $seqres.full - _require_scratch _require_acls diff --git a/tests/generic/106 b/tests/generic/106 index aeadffd0..b8869236 100755 --- a/tests/generic/106 +++ b/tests/generic/106 @@ -8,21 +8,17 @@ # inode, power fail and then mount the filesystem, the hard link we removed does # not exists anymore and the filesystem metadata is in a consistent state. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -32,8 +28,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/107 b/tests/generic/107 index ceeb41c0..623c30a9 100755 --- a/tests/generic/107 +++ b/tests/generic/107 @@ -11,21 +11,17 @@ # hard link we removed is not available anymore and all the filesystem metadata # is in a consistent state. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -35,8 +31,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/108 b/tests/generic/108 index 6fb194f4..7dd426c1 100755 --- a/tests/generic/108 +++ b/tests/generic/108 @@ -10,15 +10,10 @@ # Test motivated by an XFS bug, and this commit fixed the issue # xfs: return errors from partial I/O failures to files # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw +# Override the default cleanup function. _cleanup() { cd / @@ -30,8 +25,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/scsi_debug @@ -44,7 +38,6 @@ _require_command "$LVM_PROG" lvm lvname=lv_$seq vgname=vg_$seq -rm -f $seqres.full # _get_scsi_debug_dev returns a scsi debug device with 128M in size by default SCSI_DEBUG_DEV=`_get_scsi_debug_dev 512 512 0 300` diff --git a/tests/generic/109 b/tests/generic/109 index e1b29131..b0bc1709 100755 --- a/tests/generic/109 +++ b/tests/generic/109 @@ -7,31 +7,16 @@ # Test rename for various sizes of directories. This is motivated by a bug # in XFS where directory entry file type was not updated properly on rename. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto metadata dir -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic _require_scratch _require_symlinks -rm -f $seqres.full - echo "Silence is golden" filldir() diff --git a/tests/generic/110 b/tests/generic/110 index 795d4ee5..5d6d6ecb 100755 --- a/tests/generic/110 +++ b/tests/generic/110 @@ -10,23 +10,17 @@ # - Modify the original file # - Modify the reflinked file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $testdir } -# get standard environment, filters and checks -. common/rc +# Import common functions. . common/filter . common/reflink @@ -48,8 +42,6 @@ _checksum_files() { done } -rm -f $seqres.full - echo "Create the original file and reflink to copy1, copy2" $XFS_IO_PROG -f -c 'pwrite -S 0x61 0 9000' $testdir1/original \ >> $seqres.full 2>&1 diff --git a/tests/generic/111 b/tests/generic/111 index 4eb53556..3e376096 100755 --- a/tests/generic/111 +++ b/tests/generic/111 @@ -11,23 +11,17 @@ # - Modify the original files # - Modify one of the copies # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $testdir } -# get standard environment, filters and checks -. common/rc +# Import common functions. . common/filter . common/reflink @@ -51,8 +45,6 @@ _checksum_files() { done } -rm -f $seqres.full - mkdir $testdir1/original mkdir $testdir1/original/subdir diff --git a/tests/generic/112 b/tests/generic/112 index 33ca9cae..971d0467 100755 --- a/tests/generic/112 +++ b/tests/generic/112 @@ -6,23 +6,19 @@ # # fsx (AIO variant, based on 075) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw aio auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / rm -rf $TEST_DIR/fsx.* $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _do_test() @@ -120,7 +116,6 @@ _process_args "$@" echo "Params are for $param_type" >>$seqres.full echo "Params: n = $numops1 N = $numops2 l = $filelen" >>$seqres.full -rm -f $seqres.full echo "brevity is wit..." _check_test_fs diff --git a/tests/generic/113 b/tests/generic/113 index ee89fcdd..cacb2425 100755 --- a/tests/generic/113 +++ b/tests/generic/113 @@ -6,23 +6,19 @@ # # aio-stress # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw aio auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / rm -f $TEST_DIR/aio-stress.$$.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _do_test() diff --git a/tests/generic/114 b/tests/generic/114 index 16cdc98c..a5ad4fab 100755 --- a/tests/generic/114 +++ b/tests/generic/114 @@ -6,23 +6,17 @@ # # Test races while extending past EOF via sub-block AIO writes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest rw aio auto quick +# Override the default cleanup function. _cleanup() { cd / rm -f $TEST_DIR/tst-aio-dio-eof-race } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic diff --git a/tests/generic/115 b/tests/generic/115 index 0bdf91d9..daaca523 100755 --- a/tests/generic/115 +++ b/tests/generic/115 @@ -9,23 +9,17 @@ # - Move both to a directory # - Delete the original (moved) file, check that the copy still exists. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +30,6 @@ _require_xfs_io_command "fiemap" _require_cp_reflink _require_test -rm -f $seqres.full - testdir1=$TEST_DIR/test-$seq rm -rf $testdir1 mkdir $testdir1 diff --git a/tests/generic/116 b/tests/generic/116 index b7bce436..b8816e31 100755 --- a/tests/generic/116 +++ b/tests/generic/116 @@ -8,31 +8,23 @@ # - Reflink identical parts of two identical files # - Check that we still have identical contents # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink # real QA test starts here _require_test_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/117 b/tests/generic/117 index 5ff2ef03..e23c0508 100755 --- a/tests/generic/117 +++ b/tests/generic/117 @@ -7,14 +7,8 @@ # Attempt to cause filesystem corruption with serial fsstresses doing # extended attributes writes - pv 940655 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest attr auto quick # seed and options for fsstress known to cause curruptions seed=1122413794 @@ -47,14 +41,7 @@ fss_ops=" -z \ ITERATIONS=10 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -64,7 +51,6 @@ _supported_fs generic _require_scratch _require_attrs -rm -f $seqres.full _scratch_unmount >/dev/null 2>&1 echo "*** MKFS ***" >>$seqres.full echo "" >>$seqres.full diff --git a/tests/generic/118 b/tests/generic/118 index a10ae8a6..4fa2e1e3 100755 --- a/tests/generic/118 +++ b/tests/generic/118 @@ -9,31 +9,23 @@ # - Check that the non-linked ranges still do not match # - Check that we end up with identical contents in the linked ranges # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink # real QA test starts here _require_test_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/119 b/tests/generic/119 index 94ff5796..fd4c3661 100755 --- a/tests/generic/119 +++ b/tests/generic/119 @@ -10,23 +10,17 @@ # - Reflink identical parts of all four files # - Check that we end up with identical contents # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _cleanup() _require_test_reflink _require_arbitrary_fileset_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/120 b/tests/generic/120 index 4f96e094..5a67ed0d 100755 --- a/tests/generic/120 +++ b/tests/generic/120 @@ -6,17 +6,10 @@ # # Test noatime mount option. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other atime auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/121 b/tests/generic/121 index af48693d..43137469 100755 --- a/tests/generic/121 +++ b/tests/generic/121 @@ -8,31 +8,23 @@ # - Dedupe identical parts of two identical files # - Check that still have identical contents # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone dedupe +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink # real QA test starts here _require_test_dedupe -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/122 b/tests/generic/122 index 299205df..fbf3f1f2 100755 --- a/tests/generic/122 +++ b/tests/generic/122 @@ -8,31 +8,23 @@ # - Fail to dedupe non-identical parts of two different files # - Check that nothing changes in either file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone dedupe +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink # real QA test starts here _require_test_dedupe -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/123 b/tests/generic/123 index d2362e72..f9b28abb 100755 --- a/tests/generic/123 +++ b/tests/generic/123 @@ -7,16 +7,12 @@ # Make sure user cannot overwrite, append, delete or move a file created by # root. Modified CXFSQA test 940960 and 940558. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest perms auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - +# Override the default cleanup function. _cleanup() { cd $TEST_DIR @@ -24,8 +20,7 @@ _cleanup() cd / } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/124 b/tests/generic/124 index 7cd49352..2d567160 100755 --- a/tests/generic/124 +++ b/tests/generic/124 @@ -10,22 +10,16 @@ # second is 1, ..., until last 8 bytes (1048568-1048575) contain 131071. # patw preallocates the file and then writes the pattern, patr checks it # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest pattern auto quick +# Override the default cleanup function. _cleanup() { cd / } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/125 b/tests/generic/125 index 8c8f5cd7..077895d4 100755 --- a/tests/generic/125 +++ b/tests/generic/125 @@ -6,17 +6,10 @@ # # ftruncate test, modified from CXFSQA tests cxfs_ftrunc and cxfs_trunc # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other pnfs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/126 b/tests/generic/126 index 636ca00d..04fbd4c6 100755 --- a/tests/generic/126 +++ b/tests/generic/126 @@ -6,22 +6,16 @@ # # tests various file permission options modified from CXFSQA test fs_perms # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest perms auto quick +# Override the default cleanup function. _cleanup() { cd / } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/127 b/tests/generic/127 index de8cc1ab..f931badd 100755 --- a/tests/generic/127 +++ b/tests/generic/127 @@ -10,22 +10,16 @@ # - fsx_10_std, # - fsx_15_std_mmap # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest rw auto +# Override the default cleanup function. _cleanup() { rm -f $tmp.output } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter FSX_FILE_SIZE=262144 diff --git a/tests/generic/128 b/tests/generic/128 index c1eae77a..dfc67fd5 100755 --- a/tests/generic/128 +++ b/tests/generic/128 @@ -6,17 +6,10 @@ # # Test nosuid mount option modified from CXFSQA test mount_option_nosuid # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest perms auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/129 b/tests/generic/129 index 20bef7d8..3d3a42a2 100755 --- a/tests/generic/129 +++ b/tests/generic/129 @@ -6,17 +6,10 @@ # # looptests created from CXFSQA test looptest # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter echo_and_run() diff --git a/tests/generic/130 b/tests/generic/130 index be92ac3c..39a848c2 100755 --- a/tests/generic/130 +++ b/tests/generic/130 @@ -15,17 +15,10 @@ # - unixfile_small_vector_async_rw # - unixfile_small_vector_sync_rw # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest pattern auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/131 b/tests/generic/131 index 045b55b9..5472ffe4 100755 --- a/tests/generic/131 +++ b/tests/generic/131 @@ -6,21 +6,13 @@ # # lock test created from CXFSQA test lockfile_simple # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest perms auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/locktest -trap "_cleanup; exit \$status" 0 1 2 3 15 - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/132 b/tests/generic/132 index 2a28b7ee..db7a1bf7 100755 --- a/tests/generic/132 +++ b/tests/generic/132 @@ -7,17 +7,10 @@ # xfs_io aligned vector rw created from CXFSQA test # unixfile_vector_aligned_rw # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest pattern auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/133 b/tests/generic/133 index 815cd317..c1c7c34a 100755 --- a/tests/generic/133 +++ b/tests/generic/133 @@ -6,17 +6,10 @@ # # Concurrent I/O to same file to ensure no deadlocks # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/134 b/tests/generic/134 index e706c731..ab76f046 100755 --- a/tests/generic/134 +++ b/tests/generic/134 @@ -12,31 +12,23 @@ # - Check that files 1-2 match, 3-4 don't match, and that nothing matches 3. # - Check that the ends of 1-3 match, and 1-3 do not match the end of file4. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink # real QA test starts here _require_test_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/135 b/tests/generic/135 index 708d9e1f..dc7593d5 100755 --- a/tests/generic/135 +++ b/tests/generic/135 @@ -6,17 +6,10 @@ # # Concurrent I/O to same file to ensure no deadlocks # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest metadata auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/136 b/tests/generic/136 index 383ae046..98ebb0da 100755 --- a/tests/generic/136 +++ b/tests/generic/136 @@ -12,31 +12,23 @@ # - Check that files 1-2 match, and that 3-4 match. # - Check that the ends of 1-2 and 3-4 match, and that 1-3 don't match. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone dedupe +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink # real QA test starts here _require_test_dedupe -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/137 b/tests/generic/137 index 6a480fcc..fb0071b1 100755 --- a/tests/generic/137 +++ b/tests/generic/137 @@ -12,23 +12,17 @@ # - Check that we successfully avoid deduping with holes, unwritten # extents, and non-matches; but actually dedupe real matches. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone dedupe +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +31,6 @@ _require_test_reflink _require_test_dedupe _require_xfs_io_command "falloc" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/138 b/tests/generic/138 index aa2fc8dd..1037ed3e 100755 --- a/tests/generic/138 +++ b/tests/generic/138 @@ -9,23 +9,17 @@ # - Write to the beginning, middle, and end # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,8 +27,6 @@ _cleanup() _require_test_reflink _require_cp_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir @@ -106,7 +98,6 @@ _compare_range $testdir/file1 18 $testdir/file2 18 17 \ _compare_range $testdir/file2 18 $testdir/file3 18 17 \ || echo "Start sections of 2-3 do not match" - _compare_range $testdir/file1 $((blksz * 16 - 17)) \ $testdir/file2 $((blksz * 16 - 17)) 82 \ || echo "Middle sections of 1-2 do not match" @@ -123,7 +114,6 @@ _compare_range $testdir/file2 $((blksz * 48 - 108)) \ $testdir/file3 $((blksz * 48 - 108)) 100 \ || echo "End sections of 2-3 do not match" - _compare_range $testdir/file1 $((blksz * 14)) \ $testdir/file2 $((blksz * 14)) $blksz \ || echo "Untouched sections of 1-2 do not match" diff --git a/tests/generic/139 b/tests/generic/139 index 09df061f..6422f66a 100755 --- a/tests/generic/139 +++ b/tests/generic/139 @@ -9,23 +9,17 @@ # - Write to the beginning, middle, and end in direct-io mode # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _require_test_reflink _require_cp_reflink _require_odirect -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir @@ -106,7 +98,6 @@ _compare_range $testdir/file1 $blksz $testdir/file2 $blksz 512 \ _compare_range $testdir/file2 $blksz $testdir/file3 $blksz 512 \ || echo "Start sections of 2-3 do not match" - _compare_range $testdir/file1 $((blksz * 16 - 1024)) \ $testdir/file2 $((blksz * 16 - 1024)) 512 \ || echo "Middle sections of 1-2 do not match" @@ -123,7 +114,6 @@ _compare_range $testdir/file2 $((blksz * 48 - 1024)) \ $testdir/file3 $((blksz * 48 - 1024)) 512 \ || echo "End sections of 2-3 do not match" - _compare_range $testdir/file1 $((blksz * 16)) \ $testdir/file2 $((blksz * 16)) 512 \ || echo "Untouched sections of 1-2 do not match" diff --git a/tests/generic/140 b/tests/generic/140 index 60e493e2..6cba5791 100755 --- a/tests/generic/140 +++ b/tests/generic/140 @@ -9,23 +9,17 @@ # - Write to the beginning, middle, and end # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,8 +27,6 @@ _cleanup() _require_test_reflink _require_cp_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir @@ -106,7 +98,6 @@ _compare_range $testdir/file1 18 $testdir/file2 18 17 \ _compare_range $testdir/file2 18 $testdir/file3 18 17 \ || echo "Start sections of 2-3 do not match" - _compare_range $testdir/file1 $((blksz * 16 - 17)) \ $testdir/file2 $((blksz * 16 - 17)) 82 \ || echo "Middle sections of 1-2 do not match" @@ -123,7 +114,6 @@ _compare_range $testdir/file2 $((blksz * 48 - 120)) \ $testdir/file3 $((blksz * 48 - 120)) 100 \ || echo "End sections of 2-3 do not match" - _compare_range $testdir/file1 $((blksz * 14)) \ $testdir/file2 $((blksz * 14)) $blksz \ || echo "Untouched sections of 1-2 do not match" diff --git a/tests/generic/141 b/tests/generic/141 index 6659df60..206ccca9 100755 --- a/tests/generic/141 +++ b/tests/generic/141 @@ -6,17 +6,10 @@ # # Test for xfs_io mmap read problem # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/142 b/tests/generic/142 index d3efa981..17d6b792 100755 --- a/tests/generic/142 +++ b/tests/generic/142 @@ -11,23 +11,17 @@ # - Rewrite all the reflink copies # - Compare the contents of the original file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _cleanup() _require_test_reflink _require_cp_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/143 b/tests/generic/143 index 0f1cd732..f9be9afe 100755 --- a/tests/generic/143 +++ b/tests/generic/143 @@ -11,23 +11,17 @@ # - Rewrite all the reflink copies w/ directio # - Compare the contents of the original file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +30,6 @@ _require_test_reflink _require_cp_reflink _require_odirect -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/144 b/tests/generic/144 index b3e4397a..842d51f3 100755 --- a/tests/generic/144 +++ b/tests/generic/144 @@ -9,23 +9,17 @@ # - Fallocate all the other sparse space. # - Check that the reflinked areas are still there. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _require_cp_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "truncate" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/145 b/tests/generic/145 index e3d67638..0d545438 100755 --- a/tests/generic/145 +++ b/tests/generic/145 @@ -10,23 +10,17 @@ # of the three files, respectively # - Check that the reflinked areas are still there. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone collapse +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +30,6 @@ _require_cp_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "fcollapse" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/146 b/tests/generic/146 index 7a484d82..d0953fda 100755 --- a/tests/generic/146 +++ b/tests/generic/146 @@ -10,23 +10,17 @@ # of the three files, respectively # - Check that the reflinked areas are still there. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone punch +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fpunch" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/147 b/tests/generic/147 index 8805da8c..11380094 100755 --- a/tests/generic/147 +++ b/tests/generic/147 @@ -10,23 +10,17 @@ # of the three files, respectively # - Check that the reflinked areas are still there. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone insert +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "finsert" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/148 b/tests/generic/148 index e145700f..1b321821 100755 --- a/tests/generic/148 +++ b/tests/generic/148 @@ -11,23 +11,17 @@ # - Lengthen the other clone with truncate # - Check that the reflinked areas are still there. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +30,6 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "truncate" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/149 b/tests/generic/149 index 7f9162bc..5343a139 100755 --- a/tests/generic/149 +++ b/tests/generic/149 @@ -10,23 +10,17 @@ # of the three files, respectively # - Check that the reflinked areas are still there. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone zero +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fzero" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/150 b/tests/generic/150 index cf21b5c0..2830dd26 100755 --- a/tests/generic/150 +++ b/tests/generic/150 @@ -9,23 +9,17 @@ # - Create some reflink copies # - Compare fs block usage to before # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,8 +27,6 @@ _cleanup() _require_test_reflink _require_cp_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/151 b/tests/generic/151 index 627c8564..dd5bd64e 100755 --- a/tests/generic/151 +++ b/tests/generic/151 @@ -13,23 +13,17 @@ # - Delete all copies of the file # - Compare fs block usage to (2), (1), and (0) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +31,6 @@ _cleanup() _require_test_reflink _require_cp_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/152 b/tests/generic/152 index f87e5fd4..8ee353c5 100755 --- a/tests/generic/152 +++ b/tests/generic/152 @@ -13,23 +13,17 @@ # - Punch all blocks of the copies # - Compare fs block usage to (2), (1), and (0) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone punch +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +32,6 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fpunch" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/153 b/tests/generic/153 index 03773bc2..40877266 100755 --- a/tests/generic/153 +++ b/tests/generic/153 @@ -13,23 +13,17 @@ # - Truncate all blocks of the copies # - Compare fs block usage to (2), (1), and (0) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone collapse +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +32,6 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fcollapse" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/154 b/tests/generic/154 index 585055c6..41d63863 100755 --- a/tests/generic/154 +++ b/tests/generic/154 @@ -13,23 +13,17 @@ # - CoW all the rest of the blocks of the copies # - Compare fs block usage to (2), (1), and (0) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +31,6 @@ _cleanup() _require_test_reflink _require_cp_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/155 b/tests/generic/155 index d177b69b..2fe7894a 100755 --- a/tests/generic/155 +++ b/tests/generic/155 @@ -16,23 +16,17 @@ # The main difference from 834 is that we use zero range, directio, and # mmap to mix things up a bit. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone zero +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -42,8 +36,6 @@ _require_cp_reflink _require_xfs_io_command "fzero" _require_odirect -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/156 b/tests/generic/156 index af3cce4d..18f5208c 100755 --- a/tests/generic/156 +++ b/tests/generic/156 @@ -19,23 +19,17 @@ # # "funshare" refers to fallocate copy-on-writing the shared blocks # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink @@ -45,8 +39,6 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "funshare" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/157 b/tests/generic/157 index 379c38b9..4d5e3cfe 100755 --- a/tests/generic/157 +++ b/tests/generic/157 @@ -6,23 +6,17 @@ # # Check that various invalid reflink scenarios are rejected. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink @@ -32,8 +26,6 @@ _require_test_reflink _require_scratch_reflink _require_mknod -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/158 b/tests/generic/158 index 92237e3d..649c75db 100755 --- a/tests/generic/158 +++ b/tests/generic/158 @@ -6,23 +6,17 @@ # # Check that various invalid dedupe scenarios are rejected. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone dedupe +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink @@ -32,8 +26,6 @@ _require_test_dedupe _require_scratch_dedupe _require_mknod -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/159 b/tests/generic/159 index 62a3a57a..725671ff 100755 --- a/tests/generic/159 +++ b/tests/generic/159 @@ -6,23 +6,17 @@ # # Check that we can't reflink immutable files # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink @@ -31,8 +25,6 @@ _cleanup() _require_chattr i _require_test_reflink -rm -f $seqres.full - echo "Format and mount" testdir1="$TEST_DIR/test-$seq" rm -rf $testdir1 diff --git a/tests/generic/160 b/tests/generic/160 index 960cee8e..f83c815d 100755 --- a/tests/generic/160 +++ b/tests/generic/160 @@ -6,23 +6,17 @@ # # Check that we can't dedupe immutable files # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone dedupe +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink @@ -31,8 +25,6 @@ _cleanup() _require_chattr i _require_test_dedupe -rm -f $seqres.full - echo "Format and mount" testdir1="$TEST_DIR/test-$seq" rm -rf $testdir1 diff --git a/tests/generic/161 b/tests/generic/161 index aa5f3926..44d3d8f0 100755 --- a/tests/generic/161 +++ b/tests/generic/161 @@ -6,15 +6,12 @@ # # Test for race between delete a file while rewriting its reflinked twin # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/162 b/tests/generic/162 index cfd5eebb..0dc17f75 100755 --- a/tests/generic/162 +++ b/tests/generic/162 @@ -6,15 +6,12 @@ # # Test for race between dedupe and writing the dest file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone dedupe -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/163 b/tests/generic/163 index 5e3fe9db..4a6c341e 100755 --- a/tests/generic/163 +++ b/tests/generic/163 @@ -6,15 +6,12 @@ # # Test for race between dedupe and writing the source file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone dedupe -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/164 b/tests/generic/164 index d7a60c69..8e0b630b 100755 --- a/tests/generic/164 +++ b/tests/generic/164 @@ -7,15 +7,12 @@ # Test for races or FS corruption between reflink and buffered I/O reading the # target file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/165 b/tests/generic/165 index fe66722f..d9e6a6e9 100755 --- a/tests/generic/165 +++ b/tests/generic/165 @@ -7,15 +7,12 @@ # Test for races or FS corruption between reflink and direct I/O reading the # target file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/166 b/tests/generic/166 index b7e5aa0f..0eb2ec9c 100755 --- a/tests/generic/166 +++ b/tests/generic/166 @@ -7,15 +7,12 @@ # Test for races or FS corruption when DIO writing to a file that's also # the source of a reflink operation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/167 b/tests/generic/167 index ccf506c0..ae5fa5eb 100755 --- a/tests/generic/167 +++ b/tests/generic/167 @@ -7,15 +7,12 @@ # Test for races or FS corruption when writing to a file that's also # the source of a reflink operation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/168 b/tests/generic/168 index cb7d4184..575ff08c 100755 --- a/tests/generic/168 +++ b/tests/generic/168 @@ -7,15 +7,12 @@ # Test for races or FS corruption when writing to a file that's also # the target of a reflink operation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/169 b/tests/generic/169 index c8963f17..ea4c4d09 100755 --- a/tests/generic/169 +++ b/tests/generic/169 @@ -6,21 +6,8 @@ # # Test for file size consistency with append followed by umount/mount # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -rm -f $seqres.full -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest rw metadata auto quick _show_wrote_and_stat_only() { @@ -31,8 +18,7 @@ _show_wrote_and_stat_only() ' } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/170 b/tests/generic/170 index 90222d5a..d323ab8f 100755 --- a/tests/generic/170 +++ b/tests/generic/170 @@ -7,15 +7,12 @@ # Test for races or FS corruption when DIO writing to a file that's also # the target of a reflink operation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/171 b/tests/generic/171 index 313cd083..fb2a6f14 100755 --- a/tests/generic/171 +++ b/tests/generic/171 @@ -7,23 +7,17 @@ # Reflink a file, use up the rest of the space, then try to observe ENOSPC # while copy-on-writing the file via the page cache. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/populate . ./common/filter . ./common/attr @@ -33,8 +27,6 @@ _cleanup() _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/172 b/tests/generic/172 index 0e5aa994..ab5122fa 100755 --- a/tests/generic/172 +++ b/tests/generic/172 @@ -7,23 +7,17 @@ # Reflink a file that uses more than half of the space, then try to observe # ENOSPC while copy-on-writing the file via the page cache. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/populate . ./common/filter . ./common/attr @@ -33,8 +27,6 @@ _cleanup() _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/173 b/tests/generic/173 index dc0cc0a4..0eb313e2 100755 --- a/tests/generic/173 +++ b/tests/generic/173 @@ -7,23 +7,17 @@ # Reflink a file, use up the rest of the space, then try to observe ENOSPC # while copy-on-writing the file via mmap. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/populate . ./common/filter . ./common/attr @@ -33,8 +27,6 @@ _cleanup() _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/174 b/tests/generic/174 index 00581473..1505453e 100755 --- a/tests/generic/174 +++ b/tests/generic/174 @@ -7,23 +7,17 @@ # Reflink a file, use up the rest of the space, then try to observe ENOSPC # while copy-on-writing the file via direct-io. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/populate . ./common/filter . ./common/attr @@ -34,8 +28,6 @@ _require_scratch_reflink _require_cp_reflink _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/175 b/tests/generic/175 index 436d2cca..07af2199 100755 --- a/tests/generic/175 +++ b/tests/generic/175 @@ -6,23 +6,10 @@ # # See how well reflink handles reflinking the same block a million times. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink diff --git a/tests/generic/176 b/tests/generic/176 index f957900e..8d02c875 100755 --- a/tests/generic/176 +++ b/tests/generic/176 @@ -6,23 +6,10 @@ # # See how well reflink handles reflinking a file with a million extents. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink diff --git a/tests/generic/177 b/tests/generic/177 index 0fb558d0..8ad3f966 100755 --- a/tests/generic/177 +++ b/tests/generic/177 @@ -10,13 +10,10 @@ # # This test is motivated by a bug found in btrfs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick prealloc metadata punch log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -24,8 +21,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch . ./common/dmflakey @@ -37,8 +33,6 @@ _require_xfs_io_command "fpunch" _require_xfs_io_command "fiemap" _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/178 b/tests/generic/178 index 4261b1a6..9efb79aa 100755 --- a/tests/generic/178 +++ b/tests/generic/178 @@ -6,23 +6,17 @@ # # Ensure that punch-hole doesn't clobber CoW. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone punch +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -31,8 +25,6 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fpunch" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/179 b/tests/generic/179 index 8cd7ad57..d22eb714 100755 --- a/tests/generic/179 +++ b/tests/generic/179 @@ -9,23 +9,17 @@ # - Perform an unaligned punch in the middle of the file. # - Check that the reflinked areas are still there. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone punch +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fpunch" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/180 b/tests/generic/180 index 3b2b6f0b..b271ef3e 100755 --- a/tests/generic/180 +++ b/tests/generic/180 @@ -9,23 +9,17 @@ # - Perform an unaligned zero-range in the middle of the file. # - Check that the reflinked areas are still there. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone zero +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _require_test_reflink _require_cp_reflink _require_xfs_io_command "fzero" -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/181 b/tests/generic/181 index ddcfc150..2b4617be 100755 --- a/tests/generic/181 +++ b/tests/generic/181 @@ -9,23 +9,17 @@ # - Try to reflink "zero" bytes. # - Check that the reflink happened. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,8 +27,6 @@ _cleanup() _require_test_reflink _require_cp_reflink -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/182 b/tests/generic/182 index 05d43d4f..172f644a 100755 --- a/tests/generic/182 +++ b/tests/generic/182 @@ -9,31 +9,23 @@ # - Try to dedupe "zero" bytes. # - Check that the dedupe happened and nothing changed. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone dedupe +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink # real QA test starts here _require_test_dedupe -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/183 b/tests/generic/183 index 225d1a21..77bfcfcb 100755 --- a/tests/generic/183 +++ b/tests/generic/183 @@ -12,23 +12,17 @@ # - directio CoW across the halfway mark. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +30,6 @@ _cleanup() _require_scratch_reflink _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/184 b/tests/generic/184 index e9169244..9e8263e8 100755 --- a/tests/generic/184 +++ b/tests/generic/184 @@ -6,23 +6,10 @@ # # check mknod makes working nodes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest metadata auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/185 b/tests/generic/185 index 1346c4a5..09469924 100755 --- a/tests/generic/185 +++ b/tests/generic/185 @@ -12,31 +12,23 @@ # - CoW across the halfway mark. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink # real QA test starts here _require_scratch_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/186 b/tests/generic/186 index ec75c05b..37d88440 100755 --- a/tests/generic/186 +++ b/tests/generic/186 @@ -14,23 +14,17 @@ # - CoW across the halfway mark. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone punch +# Override the default cleanup function. _cleanup() { cd / # rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -41,8 +35,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" test $FSTYP = "btrfs" && _notrun "Can't fragment free space on btrfs." -rm -f $seqres.full - _fragment_freesp() { file=$1 diff --git a/tests/generic/187 b/tests/generic/187 index 319904f1..152e3cc2 100755 --- a/tests/generic/187 +++ b/tests/generic/187 @@ -14,23 +14,17 @@ # - CoW across the halfway mark. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone punch +# Override the default cleanup function. _cleanup() { cd / # rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -42,8 +36,6 @@ _require_xfs_io_command "fpunch" test $FSTYP = "btrfs" && _notrun "Can't fragment free space on btrfs." _require_odirect -rm -f $seqres.full - _fragment_freesp() { file=$1 diff --git a/tests/generic/188 b/tests/generic/188 index d84939da..eab77b39 100755 --- a/tests/generic/188 +++ b/tests/generic/188 @@ -11,23 +11,17 @@ # - directio CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +30,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/189 b/tests/generic/189 index a8c91e17..75cca42a 100755 --- a/tests/generic/189 +++ b/tests/generic/189 @@ -11,23 +11,17 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/190 b/tests/generic/190 index 0f6742db..9e220740 100755 --- a/tests/generic/190 +++ b/tests/generic/190 @@ -11,23 +11,17 @@ # - directio CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +30,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/191 b/tests/generic/191 index 958e84cc..78b9a3f0 100755 --- a/tests/generic/191 +++ b/tests/generic/191 @@ -11,23 +11,17 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/192 b/tests/generic/192 index 2bc8835f..0d3cd03b 100755 --- a/tests/generic/192 +++ b/tests/generic/192 @@ -8,22 +8,15 @@ # - ensure it is persistent after unmount # - check updated time by correct amount # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest atime auto _access_time() { stat -c %X $1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +28,6 @@ delay=5 testfile=$TEST_DIR/testfile rm -f $testfile -rm -f $seqres.full echo test >$testfile time1=`_access_time $testfile | tee -a $seqres.full` diff --git a/tests/generic/193 b/tests/generic/193 index fd0ebbf6..ddaff69b 100755 --- a/tests/generic/193 +++ b/tests/generic/193 @@ -6,14 +6,10 @@ # # Test permission checks in ->setattr # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup_files; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest metadata auto quick + +_register_cleanup "_cleanup_files" tag="added by qa $seq" # @@ -47,8 +43,7 @@ _filter_files() sed -e "s,$test_root,test.root,g" -e "s,$test_user,test.user,g" } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -274,5 +269,4 @@ _cleanup_files # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/generic/194 b/tests/generic/194 index 2787b264..ce8c31ac 100755 --- a/tests/generic/194 +++ b/tests/generic/194 @@ -12,23 +12,17 @@ # - directio CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +31,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/195 b/tests/generic/195 index cc3eab6c..da502c39 100755 --- a/tests/generic/195 +++ b/tests/generic/195 @@ -12,23 +12,17 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +30,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/196 b/tests/generic/196 index 95c935e1..e2ae0410 100755 --- a/tests/generic/196 +++ b/tests/generic/196 @@ -11,23 +11,17 @@ # - directio CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +30,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/197 b/tests/generic/197 index 3d45d422..c5f80207 100755 --- a/tests/generic/197 +++ b/tests/generic/197 @@ -11,23 +11,17 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/198 b/tests/generic/198 index 049a8951..3c216c5d 100755 --- a/tests/generic/198 +++ b/tests/generic/198 @@ -7,23 +7,10 @@ # Test that aio+dio into holes does completion at the proper offsets # See also https://bugzilla.redhat.com/show_bug.cgi?id=217098 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto aio quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic @@ -33,7 +20,6 @@ _require_test echo "Silence is golden." # real QA test starts here -rm -f $seqres.full rm -f "$TEST_DIR/aiodio_sparse*" $AIO_TEST "$TEST_DIR/aiodio_sparse" diff --git a/tests/generic/199 b/tests/generic/199 index b0adad84..ab13f58e 100755 --- a/tests/generic/199 +++ b/tests/generic/199 @@ -15,23 +15,17 @@ # - directio CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone punch +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -42,8 +36,6 @@ _require_xfs_io_command "fpunch" _require_cp_reflink _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/200 b/tests/generic/200 index 6d66df8e..deadfeaa 100755 --- a/tests/generic/200 +++ b/tests/generic/200 @@ -15,23 +15,17 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone punch +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -42,8 +36,6 @@ _require_xfs_io_command "fpunch" _require_cp_reflink _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/201 b/tests/generic/201 index d75c8d4d..9b65445a 100755 --- a/tests/generic/201 +++ b/tests/generic/201 @@ -7,23 +7,17 @@ # See what happens if we dirty a lot of pages via CoW and immediately # unlink the file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -31,8 +25,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/202 b/tests/generic/202 index 87089c2f..05354450 100755 --- a/tests/generic/202 +++ b/tests/generic/202 @@ -6,23 +6,17 @@ # # See what happens if we CoW across not-block-aligned EOF. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -30,8 +24,6 @@ _cleanup() _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/203 b/tests/generic/203 index 44318687..b51969c8 100755 --- a/tests/generic/203 +++ b/tests/generic/203 @@ -6,23 +6,17 @@ # # See what happens if we DIO CoW across not-block-aligned EOF. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -31,8 +25,6 @@ _require_scratch_reflink _require_cp_reflink _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/204 b/tests/generic/204 index beea7f4d..a3dabb71 100755 --- a/tests/generic/204 +++ b/tests/generic/204 @@ -6,23 +6,17 @@ # # Test out ENOSPC flushing on small filesystems. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest metadata rw auto +# Override the default cleanup function. _cleanup() { rm -f $tmp.* sync } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,8 +24,6 @@ _supported_fs generic _require_scratch -rm -f $seqres.full - # get the block size first _scratch_mkfs 2> /dev/null | _filter_mkfs 2> $tmp.mkfs > /dev/null . $tmp.mkfs diff --git a/tests/generic/205 b/tests/generic/205 index 90c89a4a..0412110c 100755 --- a/tests/generic/205 +++ b/tests/generic/205 @@ -10,31 +10,23 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink # real QA test starts here _require_scratch_reflink -rm -f $seqres.full - pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) diff --git a/tests/generic/206 b/tests/generic/206 index cac7c155..073fe48e 100755 --- a/tests/generic/206 +++ b/tests/generic/206 @@ -10,23 +10,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _cleanup() _require_scratch_reflink _require_odirect -rm -f $seqres.full - pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) diff --git a/tests/generic/207 b/tests/generic/207 index 8d92a41c..a939d0be 100755 --- a/tests/generic/207 +++ b/tests/generic/207 @@ -6,23 +6,10 @@ # # Run aio-dio-extend-stat - test race in dio aio completion # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto aio quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/208 b/tests/generic/208 index 7996c87e..c5c171fa 100755 --- a/tests/generic/208 +++ b/tests/generic/208 @@ -6,23 +6,10 @@ # # Run aio-dio-invalidate-failure - test race in read cache invalidation # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto aio -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,8 +17,6 @@ _cleanup() _supported_fs generic _require_test -rm -f $seqres.full - _run_aiodio aio-dio-invalidate-failure _check_dmesg _filter_aiodio_dmesg diff --git a/tests/generic/209 b/tests/generic/209 index 2d9a8d94..6625a28c 100755 --- a/tests/generic/209 +++ b/tests/generic/209 @@ -6,23 +6,10 @@ # # Run aio-dio-invalidate-readahead - test sync DIO invalidation of readahead # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto aio -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/210 b/tests/generic/210 index 5ed197ef..1504809d 100755 --- a/tests/generic/210 +++ b/tests/generic/210 @@ -6,23 +6,10 @@ # # Run aio-dio-subblock-eof-read - test AIO read of last block of DIO file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto aio quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/211 b/tests/generic/211 index 468241f7..02edd22e 100755 --- a/tests/generic/211 +++ b/tests/generic/211 @@ -6,23 +6,10 @@ # # Run aio-free-ring-with-bogus-nr-pages - test aio_setup_ring with bad nr_pages # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto aio quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/212 b/tests/generic/212 index d421d2cf..71e2724e 100755 --- a/tests/generic/212 +++ b/tests/generic/212 @@ -7,23 +7,10 @@ # Run aio-io-setup-with-nonwritable-context-pointer - # Test what happens when a non-writable context pointer is passed to io_setup # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto aio quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/213 b/tests/generic/213 index 7d6aeaa8..ad52fbb1 100755 --- a/tests/generic/213 +++ b/tests/generic/213 @@ -9,23 +9,12 @@ # # Based on xfs-specific test 072 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto prealloc quick enospc -_cleanup() -{ - cd / - rm -f $tmp.* -} - -here=`pwd` tmp=$TEST_DIR/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,8 +24,6 @@ _supported_fs generic [ -n "$XFS_IO_PROG" ] || _notrun "xfs_io executable not found" -rm -f $seqres.full - _require_test _require_xfs_io_command "falloc" diff --git a/tests/generic/214 b/tests/generic/214 index b3e2444c..34aa3a49 100755 --- a/tests/generic/214 +++ b/tests/generic/214 @@ -6,10 +6,10 @@ # # Basic unwritten extent sanity checks # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto prealloc quick +# Override the default cleanup function. _cleanup() { rm -f $TEST_DIR/ouch* @@ -17,13 +17,9 @@ _cleanup() rm -f $tmp.* } -here=`pwd` tmp=$TEST_DIR/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,7 +30,6 @@ _require_test [ -n "$XFS_IO_PROG" ] || _notrun "xfs_io executable not found" -rm -f $seqres.full rm -f $TEST_DIR/ouch* _require_xfs_io_command "falloc" diff --git a/tests/generic/215 b/tests/generic/215 index 591a0bc9..fc3b8cef 100755 --- a/tests/generic/215 +++ b/tests/generic/215 @@ -8,23 +8,17 @@ # # Based on the testcase in http://bugzilla.kernel.org/show_bug.cgi?id=2645 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto metadata quick +# Override the default cleanup function. _cleanup() { cd / rm -f $testfile } -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -65,5 +59,4 @@ fi # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/generic/216 b/tests/generic/216 index 00bb6627..aa2939b3 100755 --- a/tests/generic/216 +++ b/tests/generic/216 @@ -10,23 +10,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) diff --git a/tests/generic/217 b/tests/generic/217 index 6c107726..3c49662b 100755 --- a/tests/generic/217 +++ b/tests/generic/217 @@ -10,23 +10,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) diff --git a/tests/generic/218 b/tests/generic/218 index 0bf1c584..00d6af05 100755 --- a/tests/generic/218 +++ b/tests/generic/218 @@ -10,23 +10,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) diff --git a/tests/generic/219 b/tests/generic/219 index 9d59dd39..d3d257f1 100755 --- a/tests/generic/219 +++ b/tests/generic/219 @@ -7,17 +7,10 @@ # # Simple quota accounting test for direct/buffered/mmap IO. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -85,7 +78,6 @@ test_accounting() } # real QA test starts here -rm -f $seqres.full _scratch_unmount 2>/dev/null _scratch_mkfs >> $seqres.full 2>&1 diff --git a/tests/generic/220 b/tests/generic/220 index 325b4954..ae979b7c 100755 --- a/tests/generic/220 +++ b/tests/generic/220 @@ -10,23 +10,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) diff --git a/tests/generic/221 b/tests/generic/221 index 196635c6..1fb44273 100755 --- a/tests/generic/221 +++ b/tests/generic/221 @@ -9,16 +9,10 @@ # # Based on a bug report and testcase from Eric Blake . # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto metadata quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic diff --git a/tests/generic/222 b/tests/generic/222 index ac97cdfd..409cfe0d 100755 --- a/tests/generic/222 +++ b/tests/generic/222 @@ -10,23 +10,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) diff --git a/tests/generic/223 b/tests/generic/223 index 078fd725..2a581124 100755 --- a/tests/generic/223 +++ b/tests/generic/223 @@ -6,23 +6,10 @@ # # File alignment tests # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -31,8 +18,6 @@ _supported_fs generic _require_scratch _require_xfs_io_command "falloc" -rm -f $seqres.full - BLOCKSIZE=4096 for SUNIT_K in 8 16 32 64 128; do diff --git a/tests/generic/224 b/tests/generic/224 index 149b8201..26055ea2 100755 --- a/tests/generic/224 +++ b/tests/generic/224 @@ -11,24 +11,17 @@ # focus, the test can to run on any filesystem to exercise ENOSPC # behaviour. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto +# Override the default cleanup function. _cleanup() { rm -f $tmp.* rm -f $SCRATCH_MNT/testfile.* } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/225 b/tests/generic/225 index 1a7963e8..26156c9b 100755 --- a/tests/generic/225 +++ b/tests/generic/225 @@ -6,23 +6,10 @@ # # Run the fiemap (file extent mapping) tester # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,7 +21,6 @@ _require_xfs_io_command "fiemap" _scratch_mkfs > /dev/null 2>&1 _scratch_mount > /dev/null 2>&1 -rm -f $seqres.full fiemapfile=$SCRATCH_MNT/$seq.fiemap fiemaplog=$SCRATCH_MNT/$seq.log diff --git a/tests/generic/226 b/tests/generic/226 index 7e62d6aa..34434730 100755 --- a/tests/generic/226 +++ b/tests/generic/226 @@ -6,24 +6,16 @@ # # Test for prealloc space leaks by rewriting the same file in a loop # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto enospc -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. _supported_fs generic _require_scratch _require_odirect # real QA test starts here -rm -f $seqres.full _scratch_unmount 2>/dev/null echo "--> mkfs 256m filesystem" diff --git a/tests/generic/227 b/tests/generic/227 index fe8a9627..ce81e58c 100755 --- a/tests/generic/227 +++ b/tests/generic/227 @@ -10,23 +10,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) diff --git a/tests/generic/228 b/tests/generic/228 index d5a75ea1..121d43cc 100755 --- a/tests/generic/228 +++ b/tests/generic/228 @@ -6,10 +6,10 @@ # # Check if fallocate respects RLIMIT_FSIZE # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto prealloc quick +# Override the default cleanup function. _cleanup() { cd / @@ -18,13 +18,10 @@ _cleanup() ulimit -c $ulimit_c } -here=`pwd` tmp=$TEST_DIR/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 25 +_register_cleanup "_cleanup" 25 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here # generic, but xfs_io's fallocate must work @@ -34,8 +31,6 @@ _require_test [ -n "$XFS_IO_PROG" ] || _notrun "xfs_io executable not found" -rm -f $seqres.full - # Sanity check to see if fallocate works _require_xfs_io_command "falloc" diff --git a/tests/generic/229 b/tests/generic/229 index f6901b64..82abf25f 100755 --- a/tests/generic/229 +++ b/tests/generic/229 @@ -10,23 +10,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) @@ -75,8 +67,6 @@ runtest() { ;; esac - - case $b4 in "regular") _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2 >> $seqres.full diff --git a/tests/generic/230 b/tests/generic/230 index 6e35c18e..e49e0da2 100755 --- a/tests/generic/230 +++ b/tests/generic/230 @@ -7,17 +7,10 @@ # # Simple quota enforcement test. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -102,7 +95,6 @@ cleanup_files() } # real QA test starts here -rm -f $seqres.full grace=2 diff --git a/tests/generic/231 b/tests/generic/231 index fe6c9399..c2216659 100755 --- a/tests/generic/231 +++ b/tests/generic/231 @@ -7,17 +7,10 @@ # Run fsx with quotas enabled and verify accounted quotas in the end # # Derived from test 127 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -53,7 +46,6 @@ _require_scratch _require_quota _require_user -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount "-o usrquota,grpquota" chmod 777 $SCRATCH_MNT diff --git a/tests/generic/232 b/tests/generic/232 index e1725438..4789de1e 100755 --- a/tests/generic/232 +++ b/tests/generic/232 @@ -7,17 +7,10 @@ # Run fsstress with quotas enabled and verify accounted quotas in the end # # Derived from test 231 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota diff --git a/tests/generic/233 b/tests/generic/233 index cc794c79..358439d0 100755 --- a/tests/generic/233 +++ b/tests/generic/233 @@ -8,17 +8,10 @@ # quotas in the end # # Derived from test 231 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota diff --git a/tests/generic/234 b/tests/generic/234 index d3b88b56..8f127bb5 100755 --- a/tests/generic/234 +++ b/tests/generic/234 @@ -7,17 +7,10 @@ # # Stress setquota and setinfo handling. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -74,7 +67,6 @@ _require_scratch _require_quota # real QA test starts here -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount "-o usrquota,grpquota" diff --git a/tests/generic/235 b/tests/generic/235 index 7cb58ade..813f268a 100755 --- a/tests/generic/235 +++ b/tests/generic/235 @@ -7,17 +7,10 @@ # # Test whether quota gets properly reenabled after remount read-write # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -33,7 +26,6 @@ do_repquota() } # real QA test starts here -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount "-o usrquota,grpquota" diff --git a/tests/generic/236 b/tests/generic/236 index 7f10595b..76e2810c 100755 --- a/tests/generic/236 +++ b/tests/generic/236 @@ -7,21 +7,16 @@ # Check ctime updated or not if file linked # See also http://marc.info/?l=linux-btrfs&m=127434439020230&w=2 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metadata +# Override the default cleanup function. _cleanup() { rm -f $TEST_DIR/ouch* } -here=`pwd` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic diff --git a/tests/generic/237 b/tests/generic/237 index 6d76344f..93eafd84 100755 --- a/tests/generic/237 +++ b/tests/generic/237 @@ -7,20 +7,14 @@ # Check user B can setfacl a file which belongs to user A # See also http://marc.info/?l=linux-btrfs&m=127434445620298&w=2 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick acl -here=`pwd` -tmp=/tmp/$$ -status=1 # FAILure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr +# Override the default cleanup function. _cleanup() { cd / @@ -34,8 +28,6 @@ _supported_fs generic _require_test _require_runas -rm -f $seqres.full - _acl_setup_ids _require_acls diff --git a/tests/generic/238 b/tests/generic/238 index d96c0588..410dbc0e 100755 --- a/tests/generic/238 +++ b/tests/generic/238 @@ -10,23 +10,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - pagesz=$(getconf PAGE_SIZE) blksz=$((pagesz / 4)) @@ -76,8 +68,6 @@ runtest() { ;; esac - - case $b4 in "regular") _pwrite_byte 0x61 $((blksz * 3)) $blksz $dir/file2 >> $seqres.full diff --git a/tests/generic/239 b/tests/generic/239 index 0018d0f2..dca2e16a 100755 --- a/tests/generic/239 +++ b/tests/generic/239 @@ -7,23 +7,17 @@ # Read from a sparse file immedialy after filling a hole to test for races # in unwritten extent conversion. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto aio rw +# Override the default cleanup function. _cleanup() { cd / rm -f $TEST_DIR/tst-aio-dio-sparse-unwritten } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic diff --git a/tests/generic/240 b/tests/generic/240 index 91ab55e7..27b5119e 100755 --- a/tests/generic/240 +++ b/tests/generic/240 @@ -13,23 +13,10 @@ # This test need only be run in the case where the logical block size # of the device can be smaller than the file system block size. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto aio quick rw + +# Import common functions. . ./common/filter _supported_fs generic @@ -41,7 +28,6 @@ _require_aiodio aiodio_sparse2 echo "Silence is golden." # real QA test starts here -rm -f $seqres.full rm -f $TEST_DIR/aiodio_sparse diff --git a/tests/generic/241 b/tests/generic/241 index efb1847b..8abb525e 100755 --- a/tests/generic/241 +++ b/tests/generic/241 @@ -8,23 +8,10 @@ # This corrupted ext4 inode bitmaps due to races at one point # # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto + +# Import common functions. . ./common/filter _supported_fs generic @@ -35,7 +22,6 @@ _require_test echo "Silence is golden." # real QA test starts here -rm -f $seqres.full rm -rf $TEST_DIR/dbench mkdir $TEST_DIR/dbench diff --git a/tests/generic/242 b/tests/generic/242 index 52bf250f..b6fd2490 100755 --- a/tests/generic/242 +++ b/tests/generic/242 @@ -9,23 +9,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,9 +27,6 @@ _cleanup() _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/243 b/tests/generic/243 index 46a8c7b5..ca548e40 100755 --- a/tests/generic/243 +++ b/tests/generic/243 @@ -9,23 +9,17 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,9 +28,6 @@ _require_scratch_reflink _require_cp_reflink _require_odirect -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/244 b/tests/generic/244 index b6b46141..50415077 100755 --- a/tests/generic/244 +++ b/tests/generic/244 @@ -8,15 +8,10 @@ # # Designed to use the new Q_GETNEXTQUOTA quotactl # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick quota +# Override the default cleanup function. _cleanup() { cat $tmp.IDs >> $seqres.full @@ -24,14 +19,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/245 b/tests/generic/245 index f0173cc5..e2d5c926 100755 --- a/tests/generic/245 +++ b/tests/generic/245 @@ -8,16 +8,10 @@ # # Based on a bug report and testcase from Vlado Plaga # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dir -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -26,6 +20,7 @@ _require_test dir=$TEST_DIR/test-mv +# Override the default cleanup function. _cleanup() { rm -rf $dir @@ -39,7 +34,6 @@ _filter_directory_not_empty() sed -e "s,Directory not empty,File exists,g" } -trap "_cleanup ; exit \$status" 0 1 2 3 15 mkdir $dir diff --git a/tests/generic/246 b/tests/generic/246 index 48725496..4d474cd2 100755 --- a/tests/generic/246 +++ b/tests/generic/246 @@ -9,16 +9,10 @@ # Based on a bug report and testcase from # Marius Tolzmann # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -27,14 +21,13 @@ _require_test file=$TEST_DIR/mmap-writev +# Override the default cleanup function. _cleanup() { rm -rf $file rm -rf $file.NEW } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - echo -n "cccccccccc" > $file $here/src/t_mmap_writev $file $file.NEW od -t x2 $file.NEW diff --git a/tests/generic/247 b/tests/generic/247 index 9ee54be0..becc89e7 100755 --- a/tests/generic/247 +++ b/tests/generic/247 @@ -6,15 +6,12 @@ # # Test for race between direct I/O and mmap # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/248 b/tests/generic/248 index 92555eb0..3c127a87 100755 --- a/tests/generic/248 +++ b/tests/generic/248 @@ -6,23 +6,17 @@ # # Test for pwrite hang problem when writing from mmaped buffer of the same page # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $TESTFILE } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/249 b/tests/generic/249 index c39a757f..61fcaf90 100755 --- a/tests/generic/249 +++ b/tests/generic/249 @@ -6,15 +6,10 @@ # # simple splice(2) test. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() rm -f $SRC $DST } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,7 +28,6 @@ echo "Feel the serenity." SRC=$TEST_DIR/$seq.src DST=$TEST_DIR/$seq.dst -rm -f $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0xa5a55a5a 0 32768k" -c fsync $SRC >> $seqres.full 2>&1 [ $? -ne 0 ] && _fail "xfs_io pwrite failed" diff --git a/tests/generic/250 b/tests/generic/250 index 102bf500..97e9522f 100755 --- a/tests/generic/250 +++ b/tests/generic/250 @@ -7,15 +7,10 @@ # Create an unwritten extent, set up dm-error, try a DIO write, then # make sure we can't read back old disk contents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick prealloc rw eio +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror @@ -34,8 +28,6 @@ _require_dm_target error _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - # Disable the scratch rt device to avoid test failures relating to the rt # bitmap consuming all the free space in our small data device. unset SCRATCH_RTDEV diff --git a/tests/generic/251 b/tests/generic/251 index 0dec22fd..192ab5cc 100755 --- a/tests/generic/251 +++ b/tests/generic/251 @@ -9,20 +9,16 @@ # does not change after copied into SCRATCH_MNT test if FITRIM implementation # corrupts the filesystem (data/metadata). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest ioctl trim -here=`pwd` tmp=`mktemp -d` -status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 3 trap "_destroy; exit \$status" 2 15 chpid=0 mypid=$$ -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -32,6 +28,7 @@ _scratch_mkfs >/dev/null 2>&1 _scratch_mount _require_batched_discard $SCRATCH_MNT +# Override the default cleanup function. _cleanup() { rm -rf $tmp diff --git a/tests/generic/252 b/tests/generic/252 index 809e8020..8c5adb53 100755 --- a/tests/generic/252 +++ b/tests/generic/252 @@ -7,15 +7,10 @@ # Create an unwritten extent, set up dm-error, try an AIO DIO write, then # make sure we can't read back old disk contents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick prealloc rw eio +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror @@ -35,8 +29,6 @@ _require_xfs_io_command "falloc" _require_aiodio "aiocp" AIO_TEST="$here/src/aio-dio-regress/aiocp" -rm -f $seqres.full - # Disable the scratch rt device to avoid test failures relating to the rt # bitmap consuming all the free space in our small data device. unset SCRATCH_RTDEV diff --git a/tests/generic/253 b/tests/generic/253 index bf7938b0..7d09dd06 100755 --- a/tests/generic/253 +++ b/tests/generic/253 @@ -9,23 +9,10 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,9 +21,6 @@ _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "truncate" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/254 b/tests/generic/254 index 91285c08..e0e29da6 100755 --- a/tests/generic/254 +++ b/tests/generic/254 @@ -9,23 +9,10 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,9 +21,6 @@ _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "fpunch" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/255 b/tests/generic/255 index d6609314..307d5287 100755 --- a/tests/generic/255 +++ b/tests/generic/255 @@ -6,23 +6,10 @@ # # Test Generic fallocate hole punching # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch diff --git a/tests/generic/256 b/tests/generic/256 index 0fcb9452..808a730f 100755 --- a/tests/generic/256 +++ b/tests/generic/256 @@ -6,23 +6,10 @@ # # Test Full File System Hole Punching # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/populate . ./common/filter . ./common/punch diff --git a/tests/generic/257 b/tests/generic/257 index e619d4cc..4faa2594 100755 --- a/tests/generic/257 +++ b/tests/generic/257 @@ -6,22 +6,16 @@ # Check that no duplicate d_off values are returned and that those # values are seekable. Most work is done by the C program here. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest dir auto quick +# Override the default cleanup function. _cleanup() { rm -rf $TEST_DIR/ttt } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,5 +30,4 @@ $here/src/t_dir_offset2 $TEST_DIR/ttt # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/generic/258 b/tests/generic/258 index ce9f0622..979889e2 100755 --- a/tests/generic/258 +++ b/tests/generic/258 @@ -8,23 +8,10 @@ # On 64-bit, ext2/3/4 was sign-extending when read from disk # See also commit 4d7bf11d649c72621ca31b8ea12b9c94af380e63 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick bigtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic diff --git a/tests/generic/259 b/tests/generic/259 index 1d7e5cb9..46746c9f 100755 --- a/tests/generic/259 +++ b/tests/generic/259 @@ -9,23 +9,10 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,9 +21,6 @@ _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "fzero" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/260 b/tests/generic/260 index 8021aa68..8d6d6c79 100755 --- a/tests/generic/260 +++ b/tests/generic/260 @@ -7,19 +7,14 @@ # Purpose of this test is to check FITRIM argument handling to make sure # that the argument processing is right and that it does not overflow. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick trim -here=`pwd` -tmp=/tmp/$$ status=0 -trap "exit \$status" 0 1 2 3 15 chpid=0 mypid=$$ -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/261 b/tests/generic/261 index 60df5b22..93c1c349 100755 --- a/tests/generic/261 +++ b/tests/generic/261 @@ -9,23 +9,10 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone collapse -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,9 +21,6 @@ _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "fcollapse" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/262 b/tests/generic/262 index d1f2e1d3..46e88f87 100755 --- a/tests/generic/262 +++ b/tests/generic/262 @@ -9,23 +9,10 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone insert -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,9 +21,6 @@ _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "finsert" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/263 b/tests/generic/263 index d9b55db6..f4d29055 100755 --- a/tests/generic/263 +++ b/tests/generic/263 @@ -6,17 +6,10 @@ # # fsx exercising direct IO vs sub-block buffered I/O # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -24,8 +17,6 @@ _supported_fs generic _require_test _require_odirect -rm -f $seqres.full - psize=`$here/src/feature -s` bsize=`_min_dio_alignment $TEST_DEV` diff --git a/tests/generic/264 b/tests/generic/264 index 8646d3b9..83538319 100755 --- a/tests/generic/264 +++ b/tests/generic/264 @@ -9,23 +9,10 @@ # This test is dependent on the system page size, so we cannot use md5 in # the golden output; we can only compare to a check file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,9 +21,6 @@ _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "funshare" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/265 b/tests/generic/265 index d22b918f..8d0aab9a 100755 --- a/tests/generic/265 +++ b/tests/generic/265 @@ -6,15 +6,10 @@ # # Test CoW behavior when the write temporarily fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -33,9 +27,6 @@ _require_scratch_reflink _require_cp_reflink _require_dm_target error -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/266 b/tests/generic/266 index 35a9eb46..5438f0d4 100755 --- a/tests/generic/266 +++ b/tests/generic/266 @@ -6,15 +6,10 @@ # # Test CoW behavior when the write permanently fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -33,9 +27,6 @@ _require_scratch_reflink _require_cp_reflink _require_dm_target error -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/267 b/tests/generic/267 index 8e831ea6..5a03957d 100755 --- a/tests/generic/267 +++ b/tests/generic/267 @@ -6,15 +6,10 @@ # # Test CoW behavior when the write temporarily fails and we unmount. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -33,9 +27,6 @@ _require_scratch_reflink _require_cp_reflink _require_dm_target error -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/268 b/tests/generic/268 index b76c7cf0..659fb80a 100755 --- a/tests/generic/268 +++ b/tests/generic/268 @@ -7,15 +7,10 @@ # Test CoW behavior when the write temporarily fails but the userspace # program writes again. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -34,9 +28,6 @@ _require_scratch_reflink _require_cp_reflink _require_dm_target error -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/269 b/tests/generic/269 index aec573c0..d78b7463 100755 --- a/tests/generic/269 +++ b/tests/generic/269 @@ -6,17 +6,10 @@ # # Run fsstress and ENSPC hitters in parallel, check fs consistency an the end # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw prealloc ioctl enospc stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # Disable all sync operations to get higher load FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0" @@ -49,7 +42,6 @@ _workout() _supported_fs generic _require_scratch -rm -f $seqres.full _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/270 b/tests/generic/270 index e93940ef..1fb5795a 100755 --- a/tests/generic/270 +++ b/tests/generic/270 @@ -7,17 +7,10 @@ # Run fsstress and ENSPC hitters in parallel, check quota and # fs consistency an the end # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota rw prealloc ioctl enospc stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -66,7 +59,6 @@ _require_scratch _require_command "$KILLALL_PROG" killall _require_command "$SETCAP_PROG" setcap -rm -f $seqres.full _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1 _scratch_mount "-o usrquota,grpquota" chmod 777 $SCRATCH_MNT diff --git a/tests/generic/271 b/tests/generic/271 index d26cb849..b77eed91 100755 --- a/tests/generic/271 +++ b/tests/generic/271 @@ -6,15 +6,10 @@ # # Test DIO CoW behavior when the write temporarily fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -34,9 +28,6 @@ _require_cp_reflink _require_dm_target error _require_odirect -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/272 b/tests/generic/272 index 31a3a278..3b817cd8 100755 --- a/tests/generic/272 +++ b/tests/generic/272 @@ -6,15 +6,10 @@ # # Test DIO CoW behavior when the write permanently fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -34,9 +28,6 @@ _require_cp_reflink _require_dm_target error _require_odirect -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/273 b/tests/generic/273 index 0099ada5..b5458a77 100755 --- a/tests/generic/273 +++ b/tests/generic/273 @@ -8,15 +8,12 @@ # #creator -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -24,7 +21,6 @@ _cleanup() _scratch_unmount } -. ./common/rc . ./common/filter threads=50 @@ -116,8 +112,6 @@ echo "------------------------------" echo "start the workload" echo "------------------------------" -rm -f $seqres.full - _scratch_unmount 2>/dev/null _scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/274 b/tests/generic/274 index 451d8197..43fc2d3e 100755 --- a/tests/generic/274 +++ b/tests/generic/274 @@ -10,15 +10,12 @@ # #creator -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw prealloc enospc -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -26,7 +23,6 @@ _cleanup() _scratch_unmount } -. ./common/rc . ./common/filter # real QA test starts here @@ -38,8 +34,6 @@ echo "------------------------------" echo "preallocation test" echo "------------------------------" -rm -f $seqres.full - _scratch_unmount 2>/dev/null _scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/275 b/tests/generic/275 index 3a016037..bf0aa2b3 100755 --- a/tests/generic/275 +++ b/tests/generic/275 @@ -9,22 +9,16 @@ # #creator -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto rw enospc +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount } -. ./common/rc . ./common/filter # real QA test starts here @@ -35,8 +29,6 @@ echo "------------------------------" echo "write until ENOSPC test" echo "------------------------------" -rm -f $seqres.full - _scratch_unmount 2>/dev/null _scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/276 b/tests/generic/276 index 610be02e..e304b3f1 100755 --- a/tests/generic/276 +++ b/tests/generic/276 @@ -6,15 +6,10 @@ # # Test DIO CoW behavior when the write temporarily fails and we unmount. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -34,9 +28,6 @@ _require_cp_reflink _require_dm_target error _require_odirect -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/277 b/tests/generic/277 index 11c69e98..79203327 100755 --- a/tests/generic/277 +++ b/tests/generic/277 @@ -6,21 +6,16 @@ # # Check if ctime update caused by chattr is written to disk # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto ioctl quick metadata +# Override the default cleanup function. _cleanup() { rm -f $SCRATCH_MNT/tmp* } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/generic/278 b/tests/generic/278 index 8d023424..8de74bf7 100755 --- a/tests/generic/278 +++ b/tests/generic/278 @@ -7,15 +7,10 @@ # Test DIO CoW behavior when the write temporarily fails but the userspace # program writes again. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -35,9 +29,6 @@ _require_cp_reflink _require_dm_target error _require_odirect -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/279 b/tests/generic/279 index 0f1de67b..6d1ab0f2 100755 --- a/tests/generic/279 +++ b/tests/generic/279 @@ -6,15 +6,10 @@ # # Test mmap CoW behavior when the write temporarily fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -33,9 +27,6 @@ _require_scratch_reflink _require_cp_reflink _require_dm_target error -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/280 b/tests/generic/280 index 03b47de7..07144555 100755 --- a/tests/generic/280 +++ b/tests/generic/280 @@ -7,23 +7,10 @@ # Test quota vs. suspend/freeze deadlock, # dcdbed85 quota: Fix deadlock with suspend and quotas # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota freeze -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -36,8 +23,6 @@ _require_freeze # Modify as appropriate. _supported_fs generic -rm -f $seqres.full - _scratch_unmount 2>/dev/null _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount "-o usrquota,grpquota" diff --git a/tests/generic/281 b/tests/generic/281 index c99a7b0f..f5a00de6 100755 --- a/tests/generic/281 +++ b/tests/generic/281 @@ -6,15 +6,10 @@ # # Test mmap CoW behavior when the write permanently fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -33,9 +27,6 @@ _require_scratch_reflink _require_cp_reflink _require_dm_target error -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/282 b/tests/generic/282 index 712e95ec..f085a97e 100755 --- a/tests/generic/282 +++ b/tests/generic/282 @@ -6,15 +6,10 @@ # # Test mmap CoW behavior when the write temporarily fails and we unmount. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -33,9 +27,6 @@ _require_scratch_reflink _require_cp_reflink _require_dm_target error -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/283 b/tests/generic/283 index 8385f115..ed41c31b 100755 --- a/tests/generic/283 +++ b/tests/generic/283 @@ -7,15 +7,10 @@ # Test mmap CoW behavior when the write temporarily fails but the userspace # program writes again. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -34,9 +28,6 @@ _require_scratch_reflink _require_cp_reflink _require_dm_target error -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/284 b/tests/generic/284 index 47133645..729da77a 100755 --- a/tests/generic/284 +++ b/tests/generic/284 @@ -12,23 +12,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +23,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/285 b/tests/generic/285 index b01a0f50..6c755b5f 100755 --- a/tests/generic/285 +++ b/tests/generic/285 @@ -10,16 +10,10 @@ # Improved by Jeff.liu@oracle.com # Creater: josef@redhat.com # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw seek -here=`pwd` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic @@ -31,6 +25,7 @@ BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile _require_test_program "seek_sanity_test" +# Override the default cleanup function. _cleanup() { eval "rm -f $BASE_TEST_FILE.*" diff --git a/tests/generic/286 b/tests/generic/286 index 59fc8c16..73581245 100755 --- a/tests/generic/286 +++ b/tests/generic/286 @@ -6,16 +6,10 @@ # # SEEK_DATA/SEEK_HOLE copy tests. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick other seek -here=`pwd` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,6 +24,7 @@ dest=$TEST_DIR/seek_copy_testfile.dest _require_test_program "seek_copy_test" +# Override the default cleanup function. _cleanup() { rm -f $src $dest @@ -175,7 +170,6 @@ test04() cmp $src $dest || _fail "TEST04: file bytes check failed" } -rm -f $seqres.full test01 test02 test03 diff --git a/tests/generic/287 b/tests/generic/287 index 79549afd..76ea26ba 100755 --- a/tests/generic/287 +++ b/tests/generic/287 @@ -12,23 +12,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +24,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/288 b/tests/generic/288 index 39f75131..41eeb216 100755 --- a/tests/generic/288 +++ b/tests/generic/288 @@ -7,15 +7,12 @@ # This check the FITRIM argument handling in the corner case where length is # smaller than block size or zero. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick ioctl trim status=0 -trap "exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/289 b/tests/generic/289 index 2c78d31f..ed4f3268 100755 --- a/tests/generic/289 +++ b/tests/generic/289 @@ -14,23 +14,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/290 b/tests/generic/290 index d13319a8..534fb24f 100755 --- a/tests/generic/290 +++ b/tests/generic/290 @@ -14,23 +14,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -39,8 +26,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/291 b/tests/generic/291 index 9c40670c..50119c03 100755 --- a/tests/generic/291 +++ b/tests/generic/291 @@ -14,23 +14,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/292 b/tests/generic/292 index f2be658a..24cdab53 100755 --- a/tests/generic/292 +++ b/tests/generic/292 @@ -14,23 +14,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -39,8 +26,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/293 b/tests/generic/293 index 7a8c82ff..74231b4d 100755 --- a/tests/generic/293 +++ b/tests/generic/293 @@ -15,23 +15,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -39,8 +26,6 @@ _cleanup() _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/294 b/tests/generic/294 index 55b24e12..406b1b39 100755 --- a/tests/generic/294 +++ b/tests/generic/294 @@ -7,23 +7,10 @@ # Tests for EEXIST (not EROFS) for inode creations, if # we ask to create an already-existing entity on an RO filesystem # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,7 +21,6 @@ _require_scratch _require_symlinks _require_mknod -rm -f $seqres.full _scratch_mkfs > $seqres.full 2>&1 || _fail "Could not mkfs scratch device" THIS_TEST_DIR=$SCRATCH_MNT/$seq.test diff --git a/tests/generic/295 b/tests/generic/295 index 5abe61f0..b921c79b 100755 --- a/tests/generic/295 +++ b/tests/generic/295 @@ -15,23 +15,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -40,8 +27,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/296 b/tests/generic/296 index 37a0a7e6..ab348acf 100755 --- a/tests/generic/296 +++ b/tests/generic/296 @@ -7,23 +7,10 @@ # - Create two reflinked files a byte longer than a block. # - Rewrite the whole file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -31,8 +18,6 @@ _cleanup() _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/297 b/tests/generic/297 index d58432c3..6bdc3e1c 100755 --- a/tests/generic/297 +++ b/tests/generic/297 @@ -6,23 +6,17 @@ # # See how well reflink handles ^C in the middle of a slow reflink. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $TEST_DIR/before $TEST_DIR/after } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink @@ -34,8 +28,6 @@ _require_command "$TIMEOUT_PROG" "timeout" test $FSTYP == "nfs" && _notrun "NFS can't interrupt clone operations" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/298 b/tests/generic/298 index 2e8b71c2..95d4c02b 100755 --- a/tests/generic/298 +++ b/tests/generic/298 @@ -6,23 +6,17 @@ # # See how well reflink handles SIGKILL in the middle of a slow reflink. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $TEST_DIR/before $TEST_DIR/after } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink @@ -34,8 +28,6 @@ _require_command "$TIMEOUT_PROG" "timeout" test $FSTYP == "nfs" && _notrun "NFS can't interrupt clone operations" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/299 b/tests/generic/299 index 6380e350..8e1a112c 100755 --- a/tests/generic/299 +++ b/tests/generic/299 @@ -8,25 +8,13 @@ # Run random AIO/DIO activity and fallocate/truncate simultaneously # Test will operate on huge sparsed files so ENOSPC is expected. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto aio enospc rw stress -here=`pwd` -tmp=/tmp/$$ fio_config=$tmp.fio fio_out=$tmp.fio.out -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -107,8 +95,6 @@ rw=randrw filename=buffered-aio-verifier EOF -rm -f $seqres.full - _require_fio $fio_config _require_xfs_io_command "falloc" diff --git a/tests/generic/300 b/tests/generic/300 index fed6862b..5ff141d3 100755 --- a/tests/generic/300 +++ b/tests/generic/300 @@ -8,25 +8,13 @@ # Run random AIO/DIO activity and fallocate/punch_hole simultaneously # Test will operate on huge sparsed file so ENOSPC is expected. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto aio enospc preallocrw stress punch -here=`pwd` -tmp=/tmp/$$ fio_config=$tmp.fio fio_out=$tmp.fio.out -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -41,8 +29,6 @@ _require_block_device $SCRATCH_DEV _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" -rm -f $seqres.full - NUM_JOBS=$((4*LOAD_FACTOR)) BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` if [ $((BLK_DEV_SIZE)) -gt 1048576 ]; then diff --git a/tests/generic/301 b/tests/generic/301 index c73b99f5..faf982f5 100755 --- a/tests/generic/301 +++ b/tests/generic/301 @@ -9,23 +9,10 @@ # - Buffered write to random offsets to scatter CoW reservations. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +21,6 @@ _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "fiemap" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/302 b/tests/generic/302 index 28a607b8..01177602 100755 --- a/tests/generic/302 +++ b/tests/generic/302 @@ -9,23 +9,10 @@ # - Directio write to random offsets to scatter CoW reservations. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +22,6 @@ _require_cp_reflink _require_xfs_io_command "fiemap" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/303 b/tests/generic/303 index 6d1c0542..95679569 100755 --- a/tests/generic/303 +++ b/tests/generic/303 @@ -6,23 +6,17 @@ # # Check that high-offset reflinks work. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink @@ -31,8 +25,6 @@ _cleanup() _require_test_reflink _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" testdir=$TEST_DIR/test-$seq mkdir $testdir diff --git a/tests/generic/304 b/tests/generic/304 index bc67a934..2261f214 100755 --- a/tests/generic/304 +++ b/tests/generic/304 @@ -6,23 +6,17 @@ # # Check that high-offset dedupes work. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone dedupe +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink @@ -31,8 +25,6 @@ _cleanup() _require_test_dedupe _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" testdir=$TEST_DIR/test-$seq mkdir $testdir diff --git a/tests/generic/305 b/tests/generic/305 index 678cdcfa..3b0ff698 100755 --- a/tests/generic/305 +++ b/tests/generic/305 @@ -7,23 +7,10 @@ # Ensure that quota charges us for reflinking a file and that we're not # charged for buffered copy on write. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/quota @@ -36,8 +23,6 @@ _require_quota _require_nobody _require_user -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" diff --git a/tests/generic/306 b/tests/generic/306 index 8f9e9256..d67185e8 100755 --- a/tests/generic/306 +++ b/tests/generic/306 @@ -6,15 +6,10 @@ # # Test RW open of a device on a RO fs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw +# Override the default cleanup function. _cleanup() { umount $BINDFILE @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -41,7 +35,6 @@ SYMLINK=$SCRATCH_MNT/symlink BINDFILE=$SCRATCH_MNT/bindfile TARGET=$TEST_DIR/target -rm -f $seqres.full _scratch_mkfs > $seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/307 b/tests/generic/307 index 976b0488..c4e213e1 100755 --- a/tests/generic/307 +++ b/tests/generic/307 @@ -13,21 +13,17 @@ # # Based on test 277 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick acl +# Override the default cleanup function. _cleanup() { cd / rm -f $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/generic/308 b/tests/generic/308 index 1d8cb59c..6466d332 100755 --- a/tests/generic/308 +++ b/tests/generic/308 @@ -7,21 +7,17 @@ # Regression test for commit: # f17722f ext4: Fix max file size and logical block counting of extent format file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / rm -f $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter testfile=$TEST_DIR/testfile.$seq @@ -30,7 +26,6 @@ testfile=$TEST_DIR/testfile.$seq _supported_fs generic _require_test -rm -f $seqres.full echo "Silence is golden" block_size=`_get_block_size $TEST_DIR` diff --git a/tests/generic/309 b/tests/generic/309 index 73295543..bfd3e04f 100755 --- a/tests/generic/309 +++ b/tests/generic/309 @@ -10,13 +10,12 @@ # Regression test for commit: # 0b23076 ext3: fix update of mtime and ctime on rename # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +23,7 @@ _cleanup() rm -f $TEST_DIR/testfile.$seq } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/310 b/tests/generic/310 index eea15a1d..a71d0ba7 100755 --- a/tests/generic/310 +++ b/tests/generic/310 @@ -23,21 +23,16 @@ # # http://marc.info/?l=linux-kernel&m=136123703211869&w=2 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto +# Override the default cleanup function. _cleanup() { rm -rf $TEST_DIR/tmp } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/311 b/tests/generic/311 index b631f5ed..23f37a0d 100755 --- a/tests/generic/311 +++ b/tests/generic/311 @@ -17,21 +17,16 @@ # tests that were handcrafted to reproduce bugs in btrfs, so it's also a # regression test of sorts. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -47,7 +42,6 @@ _require_xfs_io_command "falloc" _require_test_program "fsync-tester" -rm -f $seqres.full SEED=1 testfile=$SCRATCH_MNT/$seq.fsync diff --git a/tests/generic/312 b/tests/generic/312 index 1d3d8e4f..1926deb8 100755 --- a/tests/generic/312 +++ b/tests/generic/312 @@ -9,23 +9,10 @@ # Regression test for commit # 29ae07b ext4: Fix overflow caused by missing cast in ext4_fallocate() # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc enospc -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,7 +23,6 @@ _require_scratch # 5G in byte fssize=$((2**30 * 5)) -rm -f $seqres.full _scratch_mkfs_sized $fssize >>$seqres.full 2>&1 _scratch_mount >>$seqres.full 2>&1 diff --git a/tests/generic/313 b/tests/generic/313 index 41bf2809..d4b1256d 100755 --- a/tests/generic/313 +++ b/tests/generic/313 @@ -9,22 +9,17 @@ # Regression test for commit: # 3972f26 btrfs: update timestamps on truncate() # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / rm -f $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/314 b/tests/generic/314 index 540f0feb..68a2f716 100755 --- a/tests/generic/314 +++ b/tests/generic/314 @@ -6,23 +6,10 @@ # # Test SGID inheritance on subdirectories # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/315 b/tests/generic/315 index 7234271c..3a87d330 100755 --- a/tests/generic/315 +++ b/tests/generic/315 @@ -9,23 +9,12 @@ # to the old smaller size. Before Linux 3.10, Btrfs/OCFS2 are test # failed in this case. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw prealloc -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,8 +24,6 @@ _supported_fs generic _require_test _require_xfs_io_command "falloc" "-k" -rm -f $seqres.full - echo "Slience is golden" # Check the current avaliable disk space on $TEST_DIR. diff --git a/tests/generic/316 b/tests/generic/316 index 342d8b01..5bc9c1d9 100755 --- a/tests/generic/316 +++ b/tests/generic/316 @@ -6,23 +6,10 @@ # # Test Generic fallocate hole punching w/o unwritten extent # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick punch + +# Import common functions. . ./common/filter . ./common/punch diff --git a/tests/generic/317 b/tests/generic/317 index 289dfabe..134d5e3f 100755 --- a/tests/generic/317 +++ b/tests/generic/317 @@ -11,23 +11,17 @@ # uid/gid from both inside the userns and from init_user_ns to show # that the correct uid was flushed and brought back from disk. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto metadata quick +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount >/dev/null 2>&1 } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -39,8 +33,6 @@ _supported_fs generic [ -x $lstat64 ] || _notrun "$lstat64 executable not found" -rm -f $seqres.full - _require_scratch _require_user _require_ugid_map diff --git a/tests/generic/318 b/tests/generic/318 index a138f6d5..5edc9f35 100755 --- a/tests/generic/318 +++ b/tests/generic/318 @@ -12,23 +12,17 @@ # userns and from init_user_ns to show that the correct uid/gid in # the ACL was flushed and brought back from disk. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest acl attr auto quick +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount >/dev/null 2>&1 } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -39,8 +33,6 @@ file=$SCRATCH_MNT/file1 _supported_fs generic # only Linux supports user namespace -rm -f $seqres.full - _require_scratch _acl_setup_ids _require_acls diff --git a/tests/generic/319 b/tests/generic/319 index 192c3fd5..082d93bc 100755 --- a/tests/generic/319 +++ b/tests/generic/319 @@ -11,23 +11,10 @@ # # https://patchwork.kernel.org/patch/3046931/ # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest acl auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # FAILure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -36,8 +23,6 @@ _supported_fs generic _require_acls _require_scratch -rm -f $seqres.full - _scratch_mkfs > /dev/null 2>&1 _scratch_mount diff --git a/tests/generic/320 b/tests/generic/320 index 91c690f2..ea65537f 100755 --- a/tests/generic/320 +++ b/tests/generic/320 @@ -12,23 +12,10 @@ # # Based on generic/273 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -92,8 +79,6 @@ do_workload() echo "Silence is golden" -rm -f $seqres.full - _scratch_mkfs_sized $fs_size >>$seqres.full 2>&1 _scratch_mount >>$seqres.full 2>&1 diff --git a/tests/generic/321 b/tests/generic/321 index 789baedc..e9fc6483 100755 --- a/tests/generic/321 +++ b/tests/generic/321 @@ -6,21 +6,16 @@ # # Runs various dir fsync tests to cover fsync'ing directory corner cases. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -29,8 +24,6 @@ _supported_fs generic _require_scratch_nocheck _require_dm_target flakey -rm -f $seqres.full - _clean_working_dir() { _mount_flakey diff --git a/tests/generic/322 b/tests/generic/322 index d4af0d95..bcdb4882 100755 --- a/tests/generic/322 +++ b/tests/generic/322 @@ -6,21 +6,16 @@ # # Runs various rename fsync tests to cover some rename fsync corner cases. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -29,8 +24,6 @@ _supported_fs generic _require_scratch_nocheck _require_dm_target flakey -rm -f $seqres.full - _clean_working_dir() { _mount_flakey diff --git a/tests/generic/323 b/tests/generic/323 index 13f8027a..ffeeae40 100755 --- a/tests/generic/323 +++ b/tests/generic/323 @@ -9,23 +9,10 @@ # last reference to an ioctx be held by the IO (instead of the # process) would cause problems (hung system, crashes). -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto aio stress + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/324 b/tests/generic/324 index 70bfed3c..2d185021 100755 --- a/tests/generic/324 +++ b/tests/generic/324 @@ -6,22 +6,12 @@ # # Sanity check for defrag utility. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto fsr quick defrag PIDS="" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/defrag @@ -30,8 +20,6 @@ _require_scratch _require_defrag _require_xfs_io_command "falloc" -rm -f $seqres.full - _workout() { nr=$1 @@ -56,7 +44,6 @@ _workout() --min_after 1 $SCRATCH_MNT/test.$nr } - # Actual testing starting from here _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/325 b/tests/generic/325 index fba28cd3..0b2d5c6f 100755 --- a/tests/generic/325 +++ b/tests/generic/325 @@ -15,21 +15,16 @@ # # Btrfs: fix fsync data loss after a ranged fsync # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick data log +# Override the default cleanup function. _cleanup() { _cleanup_flakey } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -38,8 +33,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/326 b/tests/generic/326 index 0e1a537a..3e9332ac 100755 --- a/tests/generic/326 +++ b/tests/generic/326 @@ -7,23 +7,10 @@ # Ensure that quota charges us for reflinking a file and that we're not # charged for directio copy on write. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/quota @@ -37,8 +24,6 @@ _require_nobody _require_odirect _require_user -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" diff --git a/tests/generic/327 b/tests/generic/327 index 289f3bc5..95a22461 100755 --- a/tests/generic/327 +++ b/tests/generic/327 @@ -6,23 +6,10 @@ # # Ensure that we can't go over the hard block limit when reflinking. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/quota @@ -35,8 +22,6 @@ _require_quota _require_nobody _require_user -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" diff --git a/tests/generic/328 b/tests/generic/328 index d95f0c5a..2b589211 100755 --- a/tests/generic/328 +++ b/tests/generic/328 @@ -6,23 +6,10 @@ # # Ensure that we can't go over the hard block limit when CoWing a file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/quota @@ -36,8 +23,6 @@ _require_nobody _require_odirect _require_user -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" diff --git a/tests/generic/329 b/tests/generic/329 index dd433322..c2ba3108 100755 --- a/tests/generic/329 +++ b/tests/generic/329 @@ -6,15 +6,10 @@ # # Test AIO DIO CoW behavior when the write temporarily fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -34,9 +28,6 @@ _require_cp_reflink _require_dm_target error _require_aiodio "aiocp" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/330 b/tests/generic/330 index bd803986..9cd7b8b1 100755 --- a/tests/generic/330 +++ b/tests/generic/330 @@ -6,23 +6,17 @@ # # Test AIO DIO CoW behavior. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $TEST_DIR/moo } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -31,9 +25,6 @@ _require_scratch_reflink _require_cp_reflink _require_aiodio "aiocp" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/331 b/tests/generic/331 index b2070f37..492abedf 100755 --- a/tests/generic/331 +++ b/tests/generic/331 @@ -6,15 +6,10 @@ # # Test AIO CoW behavior when the write temporarily fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -35,9 +29,6 @@ _require_dm_target error _require_aiodio "aiocp" AIO_TEST="$here/src/aio-dio-regress/aiocp" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/generic/332 b/tests/generic/332 index 8cd3f674..61147590 100755 --- a/tests/generic/332 +++ b/tests/generic/332 @@ -6,23 +6,17 @@ # # Test AIO CoW behavior. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $TEST_DIR/moo } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -32,9 +26,6 @@ _require_cp_reflink _require_aiodio "aiocp" AIO_TEST="$here/src/aio-dio-regress/aiocp" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/333 b/tests/generic/333 index 02455768..bf1967ce 100755 --- a/tests/generic/333 +++ b/tests/generic/333 @@ -7,15 +7,12 @@ # Test for races or FS corruption when trying to hit ENOSPC while DIO writing # to a file that's also the source of a reflink operation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/334 b/tests/generic/334 index 107654d3..b9c14b87 100755 --- a/tests/generic/334 +++ b/tests/generic/334 @@ -7,15 +7,12 @@ # Test for races or FS corruption when trying to hit ENOSPC while writing # to a file that's also the source of a reflink operation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/335 b/tests/generic/335 index 7c8dfc12..e04f7a5f 100755 --- a/tests/generic/335 +++ b/tests/generic/335 @@ -8,13 +8,10 @@ # of the old directory, power fail and remount the filesystem, the file is not # lost and it's located at the destination directory. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -32,8 +28,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/336 b/tests/generic/336 index 745473af..ec9629ec 100755 --- a/tests/generic/336 +++ b/tests/generic/336 @@ -9,13 +9,10 @@ # file F2 from directory B into directory C, fsync inode F1, power fail and # remount the filesystem, file F2 exists and is located only in directory C. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/337 b/tests/generic/337 index 0087d3e1..d0dffcb9 100755 --- a/tests/generic/337 +++ b/tests/generic/337 @@ -7,21 +7,10 @@ # Test that the filesystem's implementation of the listxattrs system call lists # all the xattrs an inode has. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick attr metadata -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -30,8 +19,6 @@ _supported_fs generic _require_scratch _require_attrs -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/338 b/tests/generic/338 index cfffae37..a75577f2 100755 --- a/tests/generic/338 +++ b/tests/generic/338 @@ -9,15 +9,10 @@ # Motivated by an ext4 bug that crashes kernel on error path when trying to # update atime. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw eio +# Override the default cleanup function. _cleanup() { cd / @@ -25,14 +20,10 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_nocheck # fs went down with a dirty log, don't check it diff --git a/tests/generic/339 b/tests/generic/339 index 9173cdb3..4da10c55 100755 --- a/tests/generic/339 +++ b/tests/generic/339 @@ -8,23 +8,10 @@ # commit f5ea110 ("xfs: add CRCs to dir2/da node blocks") left the # directory with incorrect hash ordering. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto dir + +# Import common functions. . ./common/filter # real QA test starts here @@ -32,7 +19,6 @@ _supported_fs generic _require_scratch _require_test_program "dirhash_collide" -rm -f $seqres.full _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/340 b/tests/generic/340 index b58ad0f8..e4e3b5de 100755 --- a/tests/generic/340 +++ b/tests/generic/340 @@ -6,29 +6,16 @@ # # Test mmap writing races from racing threads # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto # get standard environment and checks -. ./common/rc # real QA test starts here _supported_fs generic _require_scratch _require_test_program "holetest" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/341 b/tests/generic/341 index 003a7a54..a25835ec 100755 --- a/tests/generic/341 +++ b/tests/generic/341 @@ -9,13 +9,10 @@ # directory, fsync the new inode, power fail and mount the filesystem, we see # our first directory with the new name and no files under it were lost. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -33,8 +29,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/342 b/tests/generic/342 index 18e62498..676b876b 100755 --- a/tests/generic/342 +++ b/tests/generic/342 @@ -9,13 +9,10 @@ # power fail and mount the filesystem, we do not lose the first file and that # file has the name it was renamed to. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -33,8 +29,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/343 b/tests/generic/343 index bf607927..9e21763a 100755 --- a/tests/generic/343 +++ b/tests/generic/343 @@ -9,13 +9,10 @@ # file F, power fail and mount the filesystem, the directory/file B is located # only at directory A and both links for file F exist. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/344 b/tests/generic/344 index 0f2e9792..7a8aa852 100755 --- a/tests/generic/344 +++ b/tests/generic/344 @@ -7,31 +7,16 @@ # Test races between mmap from racing threads when pages are prefaulted, # Test races between mmap and buffered writes when pages are prefaulted. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto # get standard environment and checks -. ./common/rc # real QA test starts here _supported_fs generic _require_scratch _require_test_program "holetest" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/345 b/tests/generic/345 index 649f1321..def39998 100755 --- a/tests/generic/345 +++ b/tests/generic/345 @@ -6,31 +6,16 @@ # # Test races between mmap from racing processes with and without prefaulting. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto # get standard environment and checks -. ./common/rc # real QA test starts here _supported_fs generic _require_scratch _require_test_program "holetest" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/346 b/tests/generic/346 index 6571d636..009db54f 100755 --- a/tests/generic/346 +++ b/tests/generic/346 @@ -6,31 +6,16 @@ # # Test races between mmap and normal writes from racing threads # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick rw # get standard environment and checks -. ./common/rc # real QA test starts here _supported_fs generic _require_scratch _require_test_program "holetest" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/347 b/tests/generic/347 index e970ac10..6799b8da 100755 --- a/tests/generic/347 +++ b/tests/generic/347 @@ -7,20 +7,14 @@ # Test very basic thin device usage, exhaustion, and growth # # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw thin BACKING_SIZE=$((500 * 1024 * 1024 / 512)) # 500M VIRTUAL_SIZE=$((10 * $BACKING_SIZE)) # 5000M GROW_SIZE=$((100 * 1024 * 1024 / 512)) # 100M +# Override the default cleanup function. _cleanup() { _dmthin_cleanup @@ -52,8 +46,7 @@ _workout() done } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dmthin _supported_fs generic diff --git a/tests/generic/348 b/tests/generic/348 index 248de393..e938f817 100755 --- a/tests/generic/348 +++ b/tests/generic/348 @@ -9,13 +9,10 @@ # content must match what we specified when we created it (must not be empty # or point to something else). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _require_scratch _require_symlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/349 b/tests/generic/349 index 51deb40d..da331b95 100755 --- a/tests/generic/349 +++ b/tests/generic/349 @@ -7,23 +7,12 @@ # Test fallocate(ZERO_RANGE) on a block device, which should be able to # WRITE SAME (or equivalent) the range. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest blockdev rw zero + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/scsi_debug diff --git a/tests/generic/350 b/tests/generic/350 index df57c7ee..d8b2f272 100755 --- a/tests/generic/350 +++ b/tests/generic/350 @@ -7,23 +7,12 @@ # Test fallocate(PUNCH_HOLE) on a block device, which should be able to # zero-TRIM (or equivalent) the range. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest blockdev rw punch + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/scsi_debug diff --git a/tests/generic/351 b/tests/generic/351 index feaa7c2a..fb16da16 100755 --- a/tests/generic/351 +++ b/tests/generic/351 @@ -10,23 +10,12 @@ # with the logicalsector size, and make sure the fallbacks work for # devices that don't support write_same or discard. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest blockdev rw punch collapse insert zero + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/scsi_debug @@ -38,7 +27,6 @@ _require_xfs_io_command "fcollapse" _require_xfs_io_command "fzero" _require_xfs_io_command "fpunch" - echo "Create and format" dev=$(_get_scsi_debug_dev 4096 4096 0 4 "lbpws=1 lbpws10=1") _pwrite_byte 0x62 0 4m $dev >> $seqres.full diff --git a/tests/generic/352 b/tests/generic/352 index f0d2cdc0..3f504a29 100755 --- a/tests/generic/352 +++ b/tests/generic/352 @@ -10,30 +10,14 @@ # without problem and return correct SHARED flag. # Which btrfs will soft lock up and return wrong shared flag. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/punch -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/353 b/tests/generic/353 index c783dee2..1ce6ce6d 100755 --- a/tests/generic/353 +++ b/tests/generic/353 @@ -11,30 +11,14 @@ # already committed to disk, but not delayed extent tree modification. # This caused SHARED flag only occurs after sync. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/punch -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/354 b/tests/generic/354 index 79676ab5..425a2f9d 100755 --- a/tests/generic/354 +++ b/tests/generic/354 @@ -7,29 +7,16 @@ # Test races between private file mapping faults from racing processes or # threads # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto # get standard environment and checks -. ./common/rc # real QA test starts here _supported_fs generic _require_scratch _require_test_program "holetest" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/355 b/tests/generic/355 index 74fba0f9..4bc69eeb 100755 --- a/tests/generic/355 +++ b/tests/generic/355 @@ -6,27 +6,12 @@ # # Test clear of suid/sgid on direct write. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/356 b/tests/generic/356 index 70714016..fa6c0585 100755 --- a/tests/generic/356 +++ b/tests/generic/356 @@ -6,15 +6,12 @@ # # Check that we can't reflink a swapfile. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone swap -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/357 b/tests/generic/357 index 0adc7380..dc9a91a4 100755 --- a/tests/generic/357 +++ b/tests/generic/357 @@ -6,15 +6,12 @@ # # Check that we can't swapon a reflinked file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone swap -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/358 b/tests/generic/358 index 8d60cead..8c73ba36 100755 --- a/tests/generic/358 +++ b/tests/generic/358 @@ -10,15 +10,12 @@ # by 32 files. At block 1, change one of the owners. At block 2, # change 2 of the owners, and so on. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -26,8 +23,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/359 b/tests/generic/359 index df9a6dcb..25692058 100755 --- a/tests/generic/359 +++ b/tests/generic/359 @@ -12,15 +12,12 @@ # we handle the case where a refcount extent record doesn't coincide # exactly with the block mapping records. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -28,8 +25,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/360 b/tests/generic/360 index 2615a602..5fb227ff 100755 --- a/tests/generic/360 +++ b/tests/generic/360 @@ -6,27 +6,12 @@ # # Test symlink to very long path, check symlink file contains correct path. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metadata -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/361 b/tests/generic/361 index b8832eee..173a1a51 100755 --- a/tests/generic/361 +++ b/tests/generic/361 @@ -10,15 +10,10 @@ # the issue. # 5cb13dc cancel the setfilesize transation when io error happen # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { $UMOUNT_PROG $fs_mnt @@ -27,12 +22,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch diff --git a/tests/generic/362 b/tests/generic/362 index 63e50f04..dcd0a27b 100755 --- a/tests/generic/362 +++ b/tests/generic/362 @@ -6,26 +6,10 @@ # # RichACL apply-masks test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +. ./common/preamble +_begin_fstest auto quick richacl + +# Import common functions. # real QA test starts here diff --git a/tests/generic/363 b/tests/generic/363 index e6b387e1..8a441869 100755 --- a/tests/generic/363 +++ b/tests/generic/363 @@ -6,26 +6,10 @@ # # RichACL auto-inheritance test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +. ./common/preamble +_begin_fstest auto quick richacl + +# Import common functions. # real QA test starts here diff --git a/tests/generic/364 b/tests/generic/364 index ba3f662f..538c0eb1 100755 --- a/tests/generic/364 +++ b/tests/generic/364 @@ -6,27 +6,11 @@ # # RichACL basic test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/attr +. ./common/preamble +_begin_fstest auto quick richacl -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/attr # real QA test starts here diff --git a/tests/generic/365 b/tests/generic/365 index 1ca14ac2..21f31b86 100755 --- a/tests/generic/365 +++ b/tests/generic/365 @@ -6,26 +6,10 @@ # # RichACL chmod test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick richacl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here diff --git a/tests/generic/366 b/tests/generic/366 index ac067e9b..e5969114 100755 --- a/tests/generic/366 +++ b/tests/generic/366 @@ -6,26 +6,10 @@ # # RichACL chown test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick richacl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here diff --git a/tests/generic/367 b/tests/generic/367 index 4a6d532a..bed45215 100755 --- a/tests/generic/367 +++ b/tests/generic/367 @@ -6,26 +6,10 @@ # # RichACL create test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick richacl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here diff --git a/tests/generic/368 b/tests/generic/368 index 26fb0598..4b18e9f0 100755 --- a/tests/generic/368 +++ b/tests/generic/368 @@ -6,26 +6,10 @@ # # RichACL ctime test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick richacl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here diff --git a/tests/generic/369 b/tests/generic/369 index 4f44e057..dbd20105 100755 --- a/tests/generic/369 +++ b/tests/generic/369 @@ -6,26 +6,10 @@ # # RichACL delete test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick richacl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here diff --git a/tests/generic/370 b/tests/generic/370 index 69c95ac0..acb0f424 100755 --- a/tests/generic/370 +++ b/tests/generic/370 @@ -6,26 +6,10 @@ # # RichACL write-vs-append test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick richacl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here diff --git a/tests/generic/371 b/tests/generic/371 index a5fdfea9..c94fa85e 100755 --- a/tests/generic/371 +++ b/tests/generic/371 @@ -8,28 +8,12 @@ # for these operations don't exceed whole fs free data space, to see whether # we will get any unexpected ENOSPC error. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick enospc prealloc -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_scratch diff --git a/tests/generic/372 b/tests/generic/372 index f34c312a..b83aa598 100755 --- a/tests/generic/372 +++ b/tests/generic/372 @@ -6,15 +6,12 @@ # # Check that bmap/fiemap accurately report shared extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/373 b/tests/generic/373 index a8c0a9db..2f68b24f 100755 --- a/tests/generic/373 +++ b/tests/generic/373 @@ -6,15 +6,12 @@ # # Check that cross-mountpoint reflink doesn't work. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/374 b/tests/generic/374 index 34dae0e1..d9f33bc3 100755 --- a/tests/generic/374 +++ b/tests/generic/374 @@ -6,15 +6,12 @@ # # Check that cross-mountpoint dedupe doesn't work. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone dedupe -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/375 b/tests/generic/375 index 06c3e963..746cdd55 100755 --- a/tests/generic/375 +++ b/tests/generic/375 @@ -7,23 +7,10 @@ # Check if SGID is cleared upon chmod / setfacl when the owner is not in the # owning group. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick acl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/generic/376 b/tests/generic/376 index 09747afe..70491d2f 100755 --- a/tests/generic/376 +++ b/tests/generic/376 @@ -9,13 +9,10 @@ # against the file we renamed works correctly and after a power failure both # files exists. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -33,8 +29,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/377 b/tests/generic/377 index 956efa44..720ecf73 100755 --- a/tests/generic/377 +++ b/tests/generic/377 @@ -6,21 +6,10 @@ # # Test listxattr syscall behaviour with different buffer sizes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest attr auto quick metadata -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -32,8 +21,6 @@ _require_test_program "listxattr" listxattr="$here/src/listxattr" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/378 b/tests/generic/378 index 2f9cc37b..2caff94f 100755 --- a/tests/generic/378 +++ b/tests/generic/378 @@ -12,28 +12,12 @@ # # 51f7e52 ovl: share inode for hard link # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metadata -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/379 b/tests/generic/379 index f36bbe56..007fc0d9 100755 --- a/tests/generic/379 +++ b/tests/generic/379 @@ -7,25 +7,19 @@ # Check behavior of chown with both user and group quota enabled, # and changing both user and group together via chown(2). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest quota auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota +# Override the default cleanup function. _cleanup() { _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs generic diff --git a/tests/generic/380 b/tests/generic/380 index b43a9250..4993dad0 100755 --- a/tests/generic/380 +++ b/tests/generic/380 @@ -8,23 +8,10 @@ # Without the fix, this will create an ASSERT failure in debug kernels # and crash a non-debug kernel. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest quota auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota diff --git a/tests/generic/381 b/tests/generic/381 index 0cca1bd1..7519491c 100755 --- a/tests/generic/381 +++ b/tests/generic/381 @@ -8,29 +8,13 @@ # For example, create a 'limit' for a user or group named # '12345678-abcd', then query this user and group. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch diff --git a/tests/generic/382 b/tests/generic/382 index 18bfa7bb..49775917 100755 --- a/tests/generic/382 +++ b/tests/generic/382 @@ -13,29 +13,13 @@ # # [PATCH] xfs: Split default quota limits by quota type V4 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch diff --git a/tests/generic/383 b/tests/generic/383 index 1667ef13..91e27840 100755 --- a/tests/generic/383 +++ b/tests/generic/383 @@ -6,30 +6,15 @@ # # Test xfs_quota when project names beginning with digits. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota qa_user="" -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch diff --git a/tests/generic/384 b/tests/generic/384 index a9cd6748..8d93b781 100755 --- a/tests/generic/384 +++ b/tests/generic/384 @@ -7,26 +7,20 @@ # test to reproduce PV951636: # project quotas not updated if a file is mv'd into that directory # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest quota auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs generic diff --git a/tests/generic/385 b/tests/generic/385 index 1bdce9b0..bbbf8816 100755 --- a/tests/generic/385 +++ b/tests/generic/385 @@ -9,24 +9,18 @@ # # Based on a report and testcase from Arkadiusz Miskiewicz # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest quota auto quick +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -81,5 +75,4 @@ done # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/generic/386 b/tests/generic/386 index 3b68fa08..0d902702 100755 --- a/tests/generic/386 +++ b/tests/generic/386 @@ -11,15 +11,9 @@ # # SGI PV 1015651 # -seq=$(basename $0) -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=$(pwd) - -rm -f $seqres.full - -tmp=/tmp/$$ my_projects=$tmp.projects my_projid=$tmp.projid proj_name=test_project @@ -27,17 +21,7 @@ proj_num=1 qlimit_meg=500 # 500M limit imposed = 500 * 1024 * 1024 bytes -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota diff --git a/tests/generic/387 b/tests/generic/387 index f416d944..25ca86bb 100755 --- a/tests/generic/387 +++ b/tests/generic/387 @@ -7,29 +7,13 @@ # Create a heavily reflinked file, then check whether we can truncate # it correctly. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_scratch_reflink diff --git a/tests/generic/388 b/tests/generic/388 index 2f97f266..e41712af 100755 --- a/tests/generic/388 +++ b/tests/generic/388 @@ -14,15 +14,10 @@ # Ensure that log recovery does not recover stale modifications and cause # spurious corruption reports and/or mount failures. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest shutdown auto log metadata +# Override the default cleanup function. _cleanup() { cd / @@ -31,8 +26,7 @@ _cleanup() _scratch_unmount > /dev/null 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # Modify as appropriate. _supported_fs generic @@ -42,8 +36,6 @@ _require_local_device $SCRATCH_DEV _require_scratch_shutdown _require_command "$KILLALL_PROG" "killall" -rm -f $seqres.full - echo "Silence is golden." _scratch_mkfs >> $seqres.full 2>&1 diff --git a/tests/generic/389 b/tests/generic/389 index 7284a899..e59446f3 100755 --- a/tests/generic/389 +++ b/tests/generic/389 @@ -7,23 +7,10 @@ # Test if O_TMPFILE files inherit POSIX Default ACLs when they are linked into # the namespace. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick acl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr . ./common/filter @@ -35,9 +22,6 @@ _require_xfs_io_command "-T" _require_xfs_io_command "flink" _require_acls -# remove previous $seqres.full before test -rm -f $seqres.full - testdir="${TEST_DIR}/d.$seq" testfile="${testdir}/tst-tmpfile-flink" diff --git a/tests/generic/390 b/tests/generic/390 index d989de84..20c66e22 100755 --- a/tests/generic/390 +++ b/tests/generic/390 @@ -7,15 +7,10 @@ # Multi-threads freeze/unfreeze testing. This's a stress test case, # it won't do functional check. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto freeze stress +# Override the default cleanup function. _cleanup() { cd / @@ -24,13 +19,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here echo "Silence is golden" diff --git a/tests/generic/391 b/tests/generic/391 index a11cfddd..748af9d8 100755 --- a/tests/generic/391 +++ b/tests/generic/391 @@ -8,15 +8,10 @@ # Motivated by a bug in Btrfs' direct I/O get_block function which would lead # to spurious -EEXIST failures from direct I/O reads. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw +# Override the default cleanup function. _cleanup() { cd / @@ -24,13 +19,9 @@ _cleanup() rm -f "$testfile" } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/392 b/tests/generic/392 index ce09b938..ac4014ab 100755 --- a/tests/generic/392 +++ b/tests/generic/392 @@ -8,30 +8,18 @@ # In the case of fsync, filesystem should recover all the inode metadata, while # recovering i_blocks and i_size at least for fdatasync. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown auto quick metadata punch -here=`pwd` -tmp=/tmp/$$ status=0 # failure will be detected in runtime! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch # real QA test starts here _supported_fs generic -rm -f $seqres.full _require_scratch _require_scratch_shutdown _require_xfs_io_command "fpunch" diff --git a/tests/generic/393 b/tests/generic/393 index 34997b01..206dee00 100755 --- a/tests/generic/393 +++ b/tests/generic/393 @@ -16,23 +16,10 @@ # In ext4, up to 132 bytes of data can be stored in 256 bytes-sized inode. # In f2fs, up to 3.4KB of data can be embedded into 4KB-sized inode block. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic diff --git a/tests/generic/394 b/tests/generic/394 index 7d863dd9..fc03e2f3 100755 --- a/tests/generic/394 +++ b/tests/generic/394 @@ -6,15 +6,10 @@ # # Make sure fs honors file size resource limit. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -22,13 +17,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # need a wrapper function so "File size limit exceeded" message can be filtered do_truncate() { diff --git a/tests/generic/395 b/tests/generic/395 index 34121dd9..ab2ad612 100755 --- a/tests/generic/395 +++ b/tests/generic/395 @@ -6,29 +6,13 @@ # # Test setting and getting encryption policies. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption diff --git a/tests/generic/396 b/tests/generic/396 index d2e9a273..caa1d677 100755 --- a/tests/generic/396 +++ b/tests/generic/396 @@ -7,29 +7,13 @@ # Test that FS_IOC_SET_ENCRYPTION_POLICY correctly validates the fscrypt_policy # structure that userspace passes to it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick encrypt + +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption diff --git a/tests/generic/397 b/tests/generic/397 index bb4de31c..56771a76 100755 --- a/tests/generic/397 +++ b/tests/generic/397 @@ -10,29 +10,13 @@ # need to run all the xfstests with encryption enabled. Access without the # encryption key, on the other hand, should result in some particular behaviors. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_symlinks diff --git a/tests/generic/398 b/tests/generic/398 index 3046c398..506513c1 100755 --- a/tests/generic/398 +++ b/tests/generic/398 @@ -11,30 +11,14 @@ # not test enforcement of this constraint on lookup, which is still needed to # detect offline changes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick encrypt + +# Import common functions. . ./common/filter . ./common/encrypt . ./common/renameat2 -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption @@ -58,7 +42,6 @@ touch $edir1/efile1 touch $edir2/efile2 touch $udir/ufile - # Test linking and renaming an encrypted file into an encrypted directory with a # different encryption policy. Should fail with EXDEV. @@ -68,7 +51,6 @@ ln $edir1/efile1 $edir2/efile1 |& _filter_scratch echo -e "\n*** Rename encrypted => encrypted ***" $here/src/renameat2 $edir1/efile1 $edir2/efile1 - # Test linking and renaming an unencrypted file into an encrypted directory. # Should fail with EXDEV. @@ -78,7 +60,6 @@ ln $udir/ufile $edir1/ufile |& _filter_scratch echo -e "\n*** Rename unencrypted => encrypted ***" $here/src/renameat2 $udir/ufile $edir1/ufile - # Test linking and renaming an encrypted file into an unencrypted directory. # Should succeed. @@ -90,7 +71,6 @@ echo -e "\n*** Rename encrypted => unencrypted ***" $here/src/renameat2 $edir1/efile1 $udir/efile1 $here/src/renameat2 $udir/efile1 $edir1/efile1 # undo - # Test renaming a forbidden (unencrypted, or encrypted with a different # encryption policy) file into an encrypted directory via an exchange (cross # rename) operation. Should fail with EXDEV. @@ -104,7 +84,6 @@ $here/src/renameat2 -x $udir/ufile $edir1/efile1 echo -e "\n*** Exchange encrypted <=> unencrypted ***" $here/src/renameat2 -x $edir1/efile1 $udir/ufile - # Test a file with a special type, i.e. not regular, directory, or symlink. # Since such files are not subject to encryption, there should be no # restrictions on linking or renaming them into encrypted directories. @@ -119,7 +98,6 @@ $here/src/renameat2 -x $udir/fifo $edir1/fifo ln -v $edir1/fifo $edir2/fifo | _filter_scratch rm $edir1/fifo $edir2/fifo $udir/fifo - # Now test that *without* access to the encrypted key, we cannot use an exchange # (cross rename) operation to move a forbidden file into an encrypted directory. diff --git a/tests/generic/399 b/tests/generic/399 index 3bc97690..55f07ae5 100755 --- a/tests/generic/399 +++ b/tests/generic/399 @@ -16,29 +16,13 @@ # initialization vector reuse bug fixed in commit 02fc59a0d28f ("f2fs/crypto: # fix xts_tweak initialization"). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto encrypt + +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption diff --git a/tests/generic/400 b/tests/generic/400 index 8ebee6af..f9ec84cd 100755 --- a/tests/generic/400 +++ b/tests/generic/400 @@ -9,29 +9,13 @@ # # Designed to use the new Q_GETNEXTQUOTA quotactl # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/401 b/tests/generic/401 index 754ceb8d..dc8e9fa6 100755 --- a/tests/generic/401 +++ b/tests/generic/401 @@ -15,22 +15,10 @@ # For fs for which we know how to test the filetype feature (xfs|ext*) # verify getting DT_UNKNOWN IFF feature is disabled. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -40,8 +28,6 @@ _require_symlinks _require_mknod _require_test_program "t_dir_type" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/402 b/tests/generic/402 index ddaadf6d..89afb959 100755 --- a/tests/generic/402 +++ b/tests/generic/402 @@ -9,29 +9,13 @@ # Exit status 1: test failed. # Exit status 0: test passed. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick rw bigtime # Get standard environment, filters and checks. -. ./common/rc . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # Prerequisites for the test run. _supported_fs generic _require_scratch diff --git a/tests/generic/403 b/tests/generic/403 index 94fbe290..6b07ccb0 100755 --- a/tests/generic/403 +++ b/tests/generic/403 @@ -8,28 +8,12 @@ # reproduces a bug on XFS where a getxattr of an existing attribute spuriously # returned failure due to races with attribute fork conversion. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick attr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/404 b/tests/generic/404 index 83419236..f1e8b0a8 100755 --- a/tests/generic/404 +++ b/tests/generic/404 @@ -44,18 +44,13 @@ # writes unique block content and checks md5sum of a result file after # each block insert. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick insert testfile=$TEST_DIR/$seq.file pattern=$tmp.pattern +# Override the default cleanup function. _cleanup() { cd / @@ -63,13 +58,9 @@ _cleanup() rm -f $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/405 b/tests/generic/405 index 88407f7a..ab5a5523 100755 --- a/tests/generic/405 +++ b/tests/generic/405 @@ -7,20 +7,15 @@ # Test mkfs against thin provision device, which has very small backing size, # mkfs should return error when it hits EIO. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto mkfs thin # Initialize dmthin device with very small backing size & very big virtual # size, with the hope that mkfs hit EIO at mkfs time BACKING_SIZE=$((1 * 1024 * 1024 / 512)) # 1M VIRTUAL_SIZE=$((1 * 1024 * 1024 * 1024 * 1024 / 512)) # 1T +# Override the default cleanup function. _cleanup() { _dmthin_cleanup @@ -28,14 +23,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmthin -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic # $SCRATCH_DEV won't be directly created filesystem on, so fsck isn't required diff --git a/tests/generic/406 b/tests/generic/406 index 4f810425..49279a00 100755 --- a/tests/generic/406 +++ b/tests/generic/406 @@ -10,27 +10,11 @@ # Regression test for # Btrfs: adjust outstanding_extents counter properly when dio write is split # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here diff --git a/tests/generic/407 b/tests/generic/407 index 123ee525..90ccaef0 100755 --- a/tests/generic/407 +++ b/tests/generic/407 @@ -6,14 +6,12 @@ # # Verify that mtime is updated when cloning files # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone metadata -here=`pwd` status=0 -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -21,8 +19,7 @@ _cleanup() rm -f $destfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,7 +30,6 @@ _require_test _require_test_reflink echo "Silence is golden." -rm -f $seqres.full # pattern the files. sourcefile=$TEST_DIR/clone_mtime_sourcefile diff --git a/tests/generic/408 b/tests/generic/408 index 778d8ee4..c5e6e413 100755 --- a/tests/generic/408 +++ b/tests/generic/408 @@ -6,14 +6,12 @@ # # Verify that mtime is not updated when deduping files. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone dedupe metadata -here=`pwd` status=0 -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -21,8 +19,7 @@ _cleanup() rm -f $destfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,7 +30,6 @@ _require_test _require_test_dedupe echo "Silence is golden." -rm -f $seqres.full # pattern the files. sourcefile=$TEST_DIR/dedup_mtime_sourcefile diff --git a/tests/generic/409 b/tests/generic/409 index 49a973c9..7a5004ed 100755 --- a/tests/generic/409 +++ b/tests/generic/409 @@ -19,15 +19,10 @@ # |non-shared| shared | private | slave | invalid | # *************************************************************************** # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mount +# Override the default cleanup function. _cleanup() { cd / @@ -37,13 +32,9 @@ _cleanup() rm -rf $MNTHEAD } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/410 b/tests/generic/410 index 47c55cd9..f35f2f4a 100755 --- a/tests/generic/410 +++ b/tests/generic/410 @@ -27,15 +27,10 @@ # |unbindable |shared |**unbindable | private | unbindable | # ------------------------------------------------------------------------ # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mount +# Override the default cleanup function. _cleanup() { cd / @@ -45,13 +40,9 @@ _cleanup() rm -rf $MNTHEAD } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/411 b/tests/generic/411 index 11dd9c9f..9852a49d 100755 --- a/tests/generic/411 +++ b/tests/generic/411 @@ -8,15 +8,10 @@ # (no peer)vfsmount as peers. It case kernel dereference a NULL # address. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mount +# Override the default cleanup function. _cleanup() { cd / @@ -26,13 +21,9 @@ _cleanup() rm -rf $MNTHEAD } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/412 b/tests/generic/412 index 6b730f4f..f1778cf8 100755 --- a/tests/generic/412 +++ b/tests/generic/412 @@ -9,20 +9,10 @@ # hole, after unmounting and mounting again the filesystem, the file has a # correct size and no data loss happened. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,8 +20,6 @@ _supported_fs generic _require_scratch _require_odirect -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/413 b/tests/generic/413 index 503c7c99..4f9e1fe0 100755 --- a/tests/generic/413 +++ b/tests/generic/413 @@ -6,28 +6,12 @@ # # mmap direct/buffered io between DAX and non-DAX mountpoints. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dax -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs generic _require_test _require_scratch_dax_mountopt "dax" diff --git a/tests/generic/414 b/tests/generic/414 index bbf66cd8..01b9da8e 100755 --- a/tests/generic/414 +++ b/tests/generic/414 @@ -7,15 +7,12 @@ # Check that reflinking adjacent blocks in a file produces a single # block mapping extent. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/generic/415 b/tests/generic/415 index 2bad07b3..c435e626 100755 --- a/tests/generic/415 +++ b/tests/generic/415 @@ -7,28 +7,14 @@ # test for races between write or fpunch operations on reflinked files # to read operations on the target file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto clone punch -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/reflink -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_reflink diff --git a/tests/generic/416 b/tests/generic/416 index 9150c5c4..deb05f07 100755 --- a/tests/generic/416 +++ b/tests/generic/416 @@ -9,28 +9,12 @@ # Inspired by a bug in a btrfs fix, which doesn't get exposed by current test # cases # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto enospc -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/417 b/tests/generic/417 index 9c85e6db..8923a695 100755 --- a/tests/generic/417 +++ b/tests/generic/417 @@ -9,28 +9,12 @@ # A filesystem that crashes with open but unlinked inodes should # be consistent after a ro, ro->rw, or rw mount cycle. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick shutdown log -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch @@ -38,7 +22,6 @@ _require_scratch_shutdown _require_metadata_journaling $SCRATCH_DEV _require_test_program "multi_open_unlink" - function create_dirty_orphans() { _scratch_mount diff --git a/tests/generic/418 b/tests/generic/418 index 20c22a32..501b2912 100755 --- a/tests/generic/418 +++ b/tests/generic/418 @@ -14,28 +14,12 @@ # Regression test for commit c771c14baa33 ("iomap: invalidate page caches # should be after iomap_dio_complete() in direct write") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/419 b/tests/generic/419 index a59494fe..cb55a5bb 100755 --- a/tests/generic/419 +++ b/tests/generic/419 @@ -10,30 +10,14 @@ # 173b8439e1ba ("ext4: don't allow encrypted operations without keys") # 363fa4e078cb ("f2fs: don't allow encrypted operations without keys") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt . ./common/renameat2 -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption diff --git a/tests/generic/420 b/tests/generic/420 index 30d134c8..5c67490d 100755 --- a/tests/generic/420 +++ b/tests/generic/420 @@ -7,28 +7,12 @@ # Verify fallocate(mode=FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE) does # not alter the file size. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/421 b/tests/generic/421 index 8b0cc13e..1080e577 100755 --- a/tests/generic/421 +++ b/tests/generic/421 @@ -8,29 +8,13 @@ # 1b53cf9815bb ("fscrypt: remove broken support for detecting keyring key # revocation"). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt dangerous -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption diff --git a/tests/generic/422 b/tests/generic/422 index a5a0dbf8..96dbe11b 100755 --- a/tests/generic/422 +++ b/tests/generic/422 @@ -8,22 +8,10 @@ # correct values for the number of blocks allocated for a file when there are # delayed allocations. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +21,6 @@ _require_scratch _require_xfs_io_command "falloc" "-k" _require_odirect -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/423 b/tests/generic/423 index 4ae07a05..3de2f30c 100755 --- a/tests/generic/423 +++ b/tests/generic/423 @@ -6,15 +6,10 @@ # # Test the statx system call # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -22,13 +17,9 @@ _cleanup() rm -rf $TEST_DIR/$seq-* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/424 b/tests/generic/424 index f5ac154e..0ed0e4aa 100755 --- a/tests/generic/424 +++ b/tests/generic/424 @@ -6,15 +6,10 @@ # # Test the statx stx_attribute flags that can be set with chattr # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -23,13 +18,9 @@ _cleanup() rm -f $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/425 b/tests/generic/425 index be2bc1b0..13a76563 100755 --- a/tests/generic/425 +++ b/tests/generic/425 @@ -7,15 +7,12 @@ # Check that FIEMAP produces some output when we require an external # block to hold extended attributes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick attr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +20,7 @@ _cleanup() wait } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/generic/426 b/tests/generic/426 index 0bb75f81..45e4a6d8 100755 --- a/tests/generic/426 +++ b/tests/generic/426 @@ -7,23 +7,10 @@ # Check stale handles pointing to unlinked files # and non-stale handles pointing to linked files # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick exportfs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/427 b/tests/generic/427 index d13487ec..0f99c1b2 100755 --- a/tests/generic/427 +++ b/tests/generic/427 @@ -8,28 +8,12 @@ # A known bug of XFS has been fixed by "e4229d6 xfs: fix eofblocks race # with file extending async dio writes" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick aio rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/428 b/tests/generic/428 index 7e12e41e..4073afc4 100755 --- a/tests/generic/428 +++ b/tests/generic/428 @@ -8,28 +8,12 @@ # dax: fix data corruption due to stale mmap reads # created by Ross Zwisler # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dax -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_test diff --git a/tests/generic/429 b/tests/generic/429 index b33400b5..034063d9 100755 --- a/tests/generic/429 +++ b/tests/generic/429 @@ -19,29 +19,13 @@ # well, though we don't test for it because it's very difficult to reproduce: # 3d43bcfef5f0 ("ext4 crypto: use dget_parent() in ext4_d_revalidate()") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption diff --git a/tests/generic/430 b/tests/generic/430 index d46b9de6..697c83ce 100755 --- a/tests/generic/430 +++ b/tests/generic/430 @@ -10,23 +10,10 @@ # - Copy middle of original to a new file # - Copy end of original to new file # - Copy middle of original to a new file, creating a hole -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copy_range # get standard environment -. common/rc . common/filter # real QA test starts here @@ -38,7 +25,6 @@ _require_test testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir -rm -f $seqres.full echo "Create the original file and then copy" $XFS_IO_PROG -f -c 'pwrite -S 0x61 0 1000' $testdir/file >> $seqres.full 2>&1 diff --git a/tests/generic/431 b/tests/generic/431 index bb397358..0ec398c7 100755 --- a/tests/generic/431 +++ b/tests/generic/431 @@ -7,23 +7,10 @@ # Tests vfs_copy_file_range(): # - Copy a small file # - Small copies from various points in the original file -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copy_range # get standard environment -. common/rc . common/filter # real QA test starts here @@ -35,7 +22,6 @@ _require_test testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir -rm -f $seqres.full echo "Create the original file and then copy" echo -n "abcde" > $testdir/file diff --git a/tests/generic/432 b/tests/generic/432 index b590d9a3..402c5f23 100755 --- a/tests/generic/432 +++ b/tests/generic/432 @@ -9,23 +9,10 @@ # - Use copy to swap data at beginning and end # - Use copy to swap data in the middle # - Use copy to simultaneously overwrite and append to destination file -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copy_range # get standard environment -. common/rc . common/filter # real QA test starts here @@ -37,7 +24,6 @@ _require_test testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir -rm -f $seqres.full echo "Create the original file and then copy" $XFS_IO_PROG -f -c 'pwrite -S 0x61 0 1000' $testdir/file >> $seqres.full 2>&1 diff --git a/tests/generic/433 b/tests/generic/433 index 7fd7a2a7..0d26a64c 100755 --- a/tests/generic/433 +++ b/tests/generic/433 @@ -9,23 +9,10 @@ # - Use copy to swap data at beginning and end # - Use copy to swap data in the middle # - Use copy to swap data in a small file -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copy_range # get standard environment -. common/rc . common/filter # real QA test starts here @@ -37,7 +24,6 @@ _require_test testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir -rm -f $seqres.full echo "Create the original file and then copy" echo -n "abcde" > $testdir/file diff --git a/tests/generic/434 b/tests/generic/434 index 6ea0140e..fbd9e408 100755 --- a/tests/generic/434 +++ b/tests/generic/434 @@ -5,23 +5,10 @@ # FS QA Test No. 434 # # Tests vfs_copy_file_range() error checking -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copy_range # get standard environment -. common/rc . common/filter # real QA test starts here @@ -34,7 +21,6 @@ _require_mknod testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir -rm -f $seqres.full echo "Create the original files" $XFS_IO_PROG -f -c 'pwrite -S 0x61 0 1000' $testdir/file >> $seqres.full 2>&1 diff --git a/tests/generic/435 b/tests/generic/435 index 71c5a3f0..031e43cc 100755 --- a/tests/generic/435 +++ b/tests/generic/435 @@ -15,29 +15,13 @@ # Even with these two fixes it's still possible to create intentional # collisions. For now this test covers "accidental" collisions only. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption diff --git a/tests/generic/436 b/tests/generic/436 index 4e7d1a95..7fb24b41 100755 --- a/tests/generic/436 +++ b/tests/generic/436 @@ -6,24 +6,20 @@ # # More SEEK_DATA/SEEK_HOLE sanity tests. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw seek prealloc -here=`pwd` tmp=$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile +# Override the default cleanup function. _cleanup() { rm -f $tmp.* $BASE_TEST_FILE.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic diff --git a/tests/generic/437 b/tests/generic/437 index 360a8e89..1bfc6dbc 100755 --- a/tests/generic/437 +++ b/tests/generic/437 @@ -9,28 +9,12 @@ # dax: Fix race between colliding PMD & PTE entries # created by Ross Zwisler # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dax -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_test diff --git a/tests/generic/438 b/tests/generic/438 index 2c6ff85e..60a76eae 100755 --- a/tests/generic/438 +++ b/tests/generic/438 @@ -13,15 +13,10 @@ # # Based on test program by Michael Zimmer # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto +# Override the default cleanup function. _cleanup() { cd / @@ -29,13 +24,9 @@ _cleanup() rm -f $FILE } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_test diff --git a/tests/generic/439 b/tests/generic/439 index 8ff7ea2d..4a4f821f 100755 --- a/tests/generic/439 +++ b/tests/generic/439 @@ -10,22 +10,10 @@ # hole, no warnings are emmitted in syslog/dmesg and the file's content is # correct after remounting the filesystem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick punch + +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +22,6 @@ _require_test _require_scratch _require_xfs_io_command "fpunch" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/440 b/tests/generic/440 index 8a81d60a..f445a386 100755 --- a/tests/generic/440 +++ b/tests/generic/440 @@ -11,29 +11,13 @@ # from the keyring. Regression test for: # 272f98f68462 ("fscrypt: fix context consistency check when key(s) unavailable") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption diff --git a/tests/generic/441 b/tests/generic/441 index 814387b2..0ec751da 100755 --- a/tests/generic/441 +++ b/tests/generic/441 @@ -9,15 +9,10 @@ # on all fds and fsync on all fds. Ensure that we get errors on all of them. # Then fsync on all one last time and verify that all return 0. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick eio +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +20,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror @@ -52,8 +46,6 @@ _require_dm_target error _require_test_program fsync-err _require_test_program dmerror -rm -f $seqres.full - # Disable the scratch rt device to avoid test failures relating to the rt # bitmap consuming all the free space in our small data device. unset SCRATCH_RTDEV diff --git a/tests/generic/442 b/tests/generic/442 index 0db2c003..c57a0567 100755 --- a/tests/generic/442 +++ b/tests/generic/442 @@ -7,15 +7,10 @@ # Test writeback error handling when writing to block devices via pagecache. # See src/fsync-err.c for details of what test actually does. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest blockdev eio +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror @@ -34,8 +28,6 @@ _require_dm_target error _require_test_program fsync-err _require_test_program dmerror -rm -f $seqres.full - _dmerror_init $here/src/fsync-err -d $here/src/dmerror $DMERROR_DEV diff --git a/tests/generic/443 b/tests/generic/443 index 702dece9..16baf14d 100755 --- a/tests/generic/443 +++ b/tests/generic/443 @@ -6,28 +6,12 @@ # # Takes page fault while writev is iterating over the vectors in the IOV # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/444 b/tests/generic/444 index 452f1bce..8f6b7c2c 100755 --- a/tests/generic/444 +++ b/tests/generic/444 @@ -7,23 +7,10 @@ # Check if SGID is inherited when creating a subdirectory when the owner is not # in the owning group and directory has default ACLs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick acl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/generic/445 b/tests/generic/445 index 6c01d824..05d1c5b3 100755 --- a/tests/generic/445 +++ b/tests/generic/445 @@ -6,24 +6,20 @@ # # Another SEEK_DATA/SEEK_HOLE sanity test. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw seek prealloc -here=`pwd` tmp=$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile +# Override the default cleanup function. _cleanup() { rm -f $tmp.* $BASE_TEST_FILE.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic diff --git a/tests/generic/446 b/tests/generic/446 index 474ce0b2..5f2d2edd 100755 --- a/tests/generic/446 +++ b/tests/generic/446 @@ -11,22 +11,10 @@ # mapped write to a hole in a file. On xfs filesystem, it # will trigger a BUG_ON(). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick rw punch # get standard environment and checks -. ./common/rc . ./common/filter # real QA test starts here @@ -34,8 +22,6 @@ _require_scratch _require_xfs_io_command "truncate" _require_xfs_io_command "fpunch" -rm -f $seqres.full - # format and mount _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/447 b/tests/generic/447 index 6975443c..16b814ee 100755 --- a/tests/generic/447 +++ b/tests/generic/447 @@ -6,23 +6,17 @@ # # See how well we handle deleting a file with a million refcount extents. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone punch +# Override the default cleanup function. _cleanup() { cd / rm -f "$tmp".* $testdir/file1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink diff --git a/tests/generic/448 b/tests/generic/448 index 080676c4..d66967bc 100755 --- a/tests/generic/448 +++ b/tests/generic/448 @@ -6,25 +6,19 @@ # # Check what happens when SEEK_HOLE/SEEK_DATA are fed negative offsets. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw seek BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile_$seq +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $BASE_TEST_FILE } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic diff --git a/tests/generic/449 b/tests/generic/449 index 2a5065f6..2b77a6a4 100755 --- a/tests/generic/449 +++ b/tests/generic/449 @@ -8,29 +8,13 @@ # possible. Then call setfacl on it and, if this fails for lack of # space, test that the permissions remain the same. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick acl attr enospc -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/450 b/tests/generic/450 index a24d0677..160097cf 100755 --- a/tests/generic/450 +++ b/tests/generic/450 @@ -14,15 +14,10 @@ # 2d4594acbf6d fix the regression from "direct-io: Fix negative return # from dio read beyond eof" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw +# Override the default cleanup function. _cleanup() { cd / @@ -30,11 +25,7 @@ _cleanup() rm -f $tfile } -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here _supported_fs generic diff --git a/tests/generic/451 b/tests/generic/451 index 53213449..1792383a 100755 --- a/tests/generic/451 +++ b/tests/generic/451 @@ -7,26 +7,10 @@ # Test data integrity when mixing buffered reads and asynchronous # direct writes a file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw aio -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here _supported_fs generic diff --git a/tests/generic/452 b/tests/generic/452 index a47a55be..ee4dfe9e 100755 --- a/tests/generic/452 +++ b/tests/generic/452 @@ -8,27 +8,11 @@ # commit fd96b8da68d3 ("ext4: fix fault handling when mounted with -o dax,ro") # created by Ross Zwisler # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick dax -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # Modify as appropriate. _supported_fs generic diff --git a/tests/generic/453 b/tests/generic/453 index d997736c..55ddcc01 100755 --- a/tests/generic/453 +++ b/tests/generic/453 @@ -9,22 +9,10 @@ # Linux filesystems should allow this (filenames are a sequence of # arbitrary bytes) even if the user implications are horrifying. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick dir -# get standard environment, filters and checks -. ./common/rc +# Import common functions. _require_scratch diff --git a/tests/generic/454 b/tests/generic/454 index a2846abb..3aefa9f0 100755 --- a/tests/generic/454 +++ b/tests/generic/454 @@ -9,22 +9,10 @@ # Linux filesystems should allow this (filenames are a sequence of # arbitrary bytes) even if the user implications are horrifying. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick attr -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr _require_scratch diff --git a/tests/generic/455 b/tests/generic/455 index 5b4b242e..62788798 100755 --- a/tests/generic/455 +++ b/tests/generic/455 @@ -6,22 +6,17 @@ # # Run fsx with log writes to verify power fail safeness. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto log replay +# Override the default cleanup function. _cleanup() { _log_writes_cleanup _dmthin_cleanup } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmthin . ./common/dmlogwrites @@ -33,8 +28,6 @@ _require_scratch_nocheck _require_log_writes _require_dm_target thin-pool -rm -f $seqres.full - check_files() { local name=$1 diff --git a/tests/generic/456 b/tests/generic/456 index 65667d44..a77ff4e8 100755 --- a/tests/generic/456 +++ b/tests/generic/456 @@ -14,24 +14,18 @@ # i_disksize and fixed by commit 801674f34ecf ("ext4: do not zeroout extents # beyond i_disksize"). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick metadata collapse zero prealloc +# Override the default cleanup function. _cleanup() { _cleanup_flakey cd / rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -44,8 +38,6 @@ _require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fzero" _require_xfs_io_command "fcollapse" -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV diff --git a/tests/generic/457 b/tests/generic/457 index ddbd90cf..d9e38268 100755 --- a/tests/generic/457 +++ b/tests/generic/457 @@ -6,22 +6,17 @@ # # Run fsx with log writes on cloned files to verify power fail safeness. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto log replay clone +# Override the default cleanup function. _cleanup() { _log_writes_cleanup _dmthin_cleanup } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmthin @@ -35,8 +30,6 @@ _require_cp_reflink _require_log_writes _require_dm_target thin-pool -rm -f $seqres.full - check_files() { local name=$1 diff --git a/tests/generic/458 b/tests/generic/458 index 362669c2..5a6a7e10 100755 --- a/tests/generic/458 +++ b/tests/generic/458 @@ -10,23 +10,10 @@ # Fixed by commit 3af423b03435 ("xfs: evict CoW fork extents when performing # finsert/fcollapse") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone collapse insert zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - cd / - rm -f $tmp.* -} -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -39,8 +26,6 @@ _require_xfs_io_command "fcollapse" _require_xfs_io_command "finsert" _require_xfs_io_command "truncate" -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/generic/459 b/tests/generic/459 index a0b1507c..7fd7a6fa 100755 --- a/tests/generic/459 +++ b/tests/generic/459 @@ -18,15 +18,10 @@ # # This test might hang the filesystem when ran on an unpatched kernel # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto freeze thin +# Override the default cleanup function. _cleanup() { cd / @@ -36,8 +31,7 @@ _cleanup() $LVM_PROG pvremove -ff $SCRATCH_DEV >>$seqres.full 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here @@ -51,9 +45,6 @@ _require_command $LVM_PROG lvm _require_command "$THIN_CHECK_PROG" thin_check _require_freeze -# remove previous $seqres.full before test -rm -f $seqres.full - vgname=vg_$seq lvname=lv_$seq poolname=pool_$seq @@ -80,7 +71,6 @@ $LVM_PROG lvcreate --virtualsize $virtsize \ _mkfs_dev /dev/mapper/$vgname-$lvname >>$seqres.full 2>&1 - # Running the test over the original volume doesn't reproduce the problem # reliably, while, running it over a snapshot, makes the problem 100% # reproducible, so, create a snapshot and run the test over it. diff --git a/tests/generic/460 b/tests/generic/460 index 08c9ac6c..68720d3a 100755 --- a/tests/generic/460 +++ b/tests/generic/460 @@ -14,16 +14,11 @@ # This was only seen on XFS with rmapbt feature enabled, but nothing prevents # the test from being a generic test. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! testfile=$SCRATCH_MNT/1G_file.$seq file_size=$((1024 * 1024 * 1024)) -trap "_cleanup; exit \$status" 0 1 2 3 15 saved_dirty_background_ratio=0 saved_dirty_ratio=0 @@ -50,6 +45,7 @@ restore_dirty_ratio() fi } +# Override the default cleanup function. _cleanup() { cd / @@ -57,13 +53,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic # test with scratch device, because test is known to corrupt fs, we don't want diff --git a/tests/generic/461 b/tests/generic/461 index 7946a679..24d4ae2e 100755 --- a/tests/generic/461 +++ b/tests/generic/461 @@ -8,25 +8,19 @@ # Shutdown stress test - exercise shutdown codepath with fsstress, # make sure we don't BUG/WARN. Coverage for all fs with shutdown. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto shutdown stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs generic @@ -35,8 +29,6 @@ _require_scratch_nocheck _require_scratch_shutdown _require_command "$KILLALL_PROG" killall -rm -f $seqres.full - _scratch_mkfs > $seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/462 b/tests/generic/462 index 284e5c2c..eb44553b 100755 --- a/tests/generic/462 +++ b/tests/generic/462 @@ -11,28 +11,12 @@ # This is reproducible only when testing on pmem device # which is configured in "memory mode", not in "raw mode". # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dax -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_test diff --git a/tests/generic/463 b/tests/generic/463 index fcde9f4e..719e98c5 100755 --- a/tests/generic/463 +++ b/tests/generic/463 @@ -6,15 +6,10 @@ # # Test racy COW AIO write completions. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -22,14 +17,10 @@ _cleanup() rm -f $TEST_DIR/file $TEST_DIR/clone } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs generic _require_test diff --git a/tests/generic/464 b/tests/generic/464 index 21678957..cf9caac2 100755 --- a/tests/generic/464 +++ b/tests/generic/464 @@ -7,23 +7,10 @@ # Run delalloc writes & append writes & non-data-integrity syncs concurrently # to test the race between block map change vs writeback. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter MAXFILES=200 @@ -68,9 +55,6 @@ do_writeback() $XFS_IO_PROG -c "sync_range -w 0 0" `getfile` >/dev/null 2>&1 } -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic # do fsck after each iteration in test diff --git a/tests/generic/465 b/tests/generic/465 index 92624b54..73fdfb55 100755 --- a/tests/generic/465 +++ b/tests/generic/465 @@ -7,23 +7,17 @@ # # Test i_size is updated properly under dio read/write # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto rw quick aio +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $testfile.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,8 +30,6 @@ testfile=$TEST_DIR/$seq.$$ min_dio_align=`_min_dio_alignment $TEST_DEV` page_size=`$here/src/feature -s` -rm -f $seqres.full - echo "non-aio dio test" align=$min_dio_align while [ $align -le $page_size ]; do diff --git a/tests/generic/466 b/tests/generic/466 index 95a3b05c..4059c9ea 100755 --- a/tests/generic/466 +++ b/tests/generic/466 @@ -6,23 +6,10 @@ # # Check that high-offset reads and writes work. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,8 +17,6 @@ _supported_fs generic _require_scratch_nocheck _require_block_device $SCRATCH_DEV -rm -f $seqres.full - echo "Silence is golden" # clear MKFS_OPTIONS which may contain user specified block size value, and diff --git a/tests/generic/467 b/tests/generic/467 index d0f036ab..2a86ea76 100755 --- a/tests/generic/467 +++ b/tests/generic/467 @@ -12,23 +12,10 @@ # - open by file handle of unlinked open files # - open by file handle of renamed files # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick exportfs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/468 b/tests/generic/468 index 96d58eee..95752d3b 100755 --- a/tests/generic/468 +++ b/tests/generic/468 @@ -17,28 +17,12 @@ # recovering i_blocks and i_size at least for fdatasync, so this testcase excepts # that inode metadata will be unchanged after recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown auto quick metadata -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/469 b/tests/generic/469 index d30780f5..42f6a4af 100755 --- a/tests/generic/469 +++ b/tests/generic/469 @@ -13,29 +13,21 @@ # Patch "xfs: truncate pagecache before writeback in xfs_setattr_size()" fixed # the bug on XFS. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick punch zero -here=`pwd` -tmp=/tmp/$$ file=$TEST_DIR/$seq.fsx -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / rm -f $file $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/470 b/tests/generic/470 index d925affe..dd8525d7 100755 --- a/tests/generic/470 +++ b/tests/generic/470 @@ -7,15 +7,10 @@ # Use dm-log-writes to verify that MAP_SYNC actually syncs metadata during # page faults. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -here=`pwd` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick dax +# Override the default cleanup function. _cleanup() { cd / @@ -24,15 +19,11 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmthin . ./common/dmlogwrites -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_nocheck diff --git a/tests/generic/471 b/tests/generic/471 index 79659fad..dab06f3a 100755 --- a/tests/generic/471 +++ b/tests/generic/471 @@ -9,16 +9,10 @@ # using RWF_NOWAIT. I/O should finish within 50 microsecods since # block allocations are already performed. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/populate . ./common/filter . ./common/attr diff --git a/tests/generic/472 b/tests/generic/472 index 68d5c13b..a64735ca 100755 --- a/tests/generic/472 +++ b/tests/generic/472 @@ -6,15 +6,10 @@ # # Test various swapfile activation oddities. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick swap +# Override the default cleanup function. _cleanup() { cd / @@ -22,20 +17,15 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_swapfile _require_test_program mkswap _require_test_program swapon -rm -f $seqres.full _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount >>$seqres.full 2>&1 diff --git a/tests/generic/473 b/tests/generic/473 index 5c19703e..89241770 100755 --- a/tests/generic/473 +++ b/tests/generic/473 @@ -8,27 +8,11 @@ # This tests various combinations of hole + data layout being printed. # Also the test used 16k holes to be compatible with 16k block filesystems # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/punch +. ./common/preamble +_begin_fstest broken -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/punch # real QA test starts here diff --git a/tests/generic/474 b/tests/generic/474 index b01d1fac..69fb49b5 100755 --- a/tests/generic/474 +++ b/tests/generic/474 @@ -13,28 +13,14 @@ # Test will be skipped if filesystem(or underlying filesystem of overlayfs) # does not support shutdown. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick shutdown metadata -here=`pwd` -tmp=/tmp/$$ status=0 -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/475 b/tests/generic/475 index 4a94fba7..62894491 100755 --- a/tests/generic/475 +++ b/tests/generic/475 @@ -11,15 +11,10 @@ # is a Good Enough (tm) simulation of our internal multipath failure # testing efforts. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest shutdown auto log metadata eio +# Override the default cleanup function. _cleanup() { cd / @@ -29,8 +24,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dmerror # Modify as appropriate. @@ -40,8 +34,6 @@ _require_scratch _require_dm_target error _require_command "$KILLALL_PROG" "killall" -rm -f $seqres.full - echo "Silence is golden." _scratch_mkfs >> $seqres.full 2>&1 diff --git a/tests/generic/476 b/tests/generic/476 index 2bb3d724..212373d1 100755 --- a/tests/generic/476 +++ b/tests/generic/476 @@ -7,15 +7,10 @@ # Run an all-writes fsstress run with multiple threads to shake out # bugs in the write path. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto rw +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() $KILLALL_PROG -9 fsstress > /dev/null 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # Modify as appropriate. _supported_fs generic @@ -32,8 +26,6 @@ _supported_fs generic _require_scratch _require_command "$KILLALL_PROG" "killall" -rm -f $seqres.full - echo "Silence is golden." _scratch_mkfs > $seqres.full 2>&1 diff --git a/tests/generic/477 b/tests/generic/477 index 030bbcc6..d1fce7ed 100755 --- a/tests/generic/477 +++ b/tests/generic/477 @@ -9,23 +9,10 @@ # This test uses load and store of file handles from a temp file to test # decoding file handles after cycle mount and after directory renames. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick exportfs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/478 b/tests/generic/478 index ef8d320d..480762d2 100755 --- a/tests/generic/478 +++ b/tests/generic/478 @@ -83,28 +83,12 @@ # + clone with CLONE_FILES or not # + dup and close newfd # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_test diff --git a/tests/generic/479 b/tests/generic/479 index 06258754..9322a33a 100755 --- a/tests/generic/479 +++ b/tests/generic/479 @@ -9,13 +9,10 @@ # commit the journal/log, if a power loss happens the filesystem will not fail # to replay the journal/log when it is mounted the next time. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -35,8 +31,6 @@ _require_symlinks _require_mknod _require_dm_target flakey -rm -f $seqres.full - run_test() { local file_type=$1 diff --git a/tests/generic/480 b/tests/generic/480 index 86afee67..2805a3ac 100755 --- a/tests/generic/480 +++ b/tests/generic/480 @@ -9,13 +9,10 @@ # with the name of the link removed, fsync the new file and have a power loss, # mounting the filesystem succeeds. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick metadata log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/481 b/tests/generic/481 index 5dc9ab0a..11d4da6e 100755 --- a/tests/generic/481 +++ b/tests/generic/481 @@ -10,13 +10,10 @@ # The kernel fix is # Btrfs: fix unexpected -EEXIST when creating new inode # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log metadata +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -24,8 +21,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/482 b/tests/generic/482 index 86941e84..f26e6fc4 100755 --- a/tests/generic/482 +++ b/tests/generic/482 @@ -8,15 +8,10 @@ # # Will do log replay and check the filesystem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto metadata replay thin +# Override the default cleanup function. _cleanup() { cd / @@ -26,15 +21,11 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmthin . ./common/dmlogwrites -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. @@ -47,7 +38,6 @@ _require_scratch_nocheck _require_log_writes _require_dm_target thin-pool - nr_cpus=$("$here/src/feature" -o) # cap nr_cpus to 8 to avoid spending too much time on hosts with many cpus if [ $nr_cpus -gt 8 ]; then diff --git a/tests/generic/483 b/tests/generic/483 index a2412007..e7120362 100755 --- a/tests/generic/483 +++ b/tests/generic/483 @@ -7,13 +7,10 @@ # Test that fsync operations preserve extents allocated with fallocate(2) that # are placed beyond a file's size. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log metadata +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -21,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey . ./common/punch @@ -34,8 +30,6 @@ _require_dm_target flakey _require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fiemap" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/484 b/tests/generic/484 index 331cd1ad..40e83cbd 100755 --- a/tests/generic/484 +++ b/tests/generic/484 @@ -14,15 +14,10 @@ # vfs: track per-sb writeback errors and report them to syncfs # buffer: record blockdev write errors in super_block that it backs -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -30,8 +25,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror @@ -40,8 +34,6 @@ _require_scratch_nocheck _require_dm_target error _require_xfs_io_command "syncfs" -rm -f $seqres.full - # Disable the scratch rt device to avoid test failures relating to the rt # bitmap consuming all the free space in our small data device. unset SCRATCH_RTDEV @@ -51,7 +43,6 @@ _scratch_mkfs > $seqres.full 2>&1 _dmerror_init _dmerror_mount - # create file testfile=$SCRATCH_MNT/syncfs-reports-errors touch $testfile diff --git a/tests/generic/485 b/tests/generic/485 index ba482b4b..2e0bc612 100755 --- a/tests/generic/485 +++ b/tests/generic/485 @@ -8,26 +8,19 @@ # 349fa7d6e193 ("ext4: prevent right-shifting extents beyond EXT_MAX_BLOCKS") # 7d83fb14258b ("xfs: prevent creating negative-sized file via INSERT_RANGE") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick insert +# Override the default cleanup function. _cleanup() { cd / rm -f $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/486 b/tests/generic/486 index 3ee7ecd1..7de198f9 100755 --- a/tests/generic/486 +++ b/tests/generic/486 @@ -13,35 +13,26 @@ # Commit 7b38460dc8e4 ("xfs: don't fail when converting shortform attr to long # form during ATTR_REPLACE") fixed the xfs bug. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick attr +# Override the default cleanup function. _cleanup() { cd / rm -f $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test_program "attr_replace_test" _require_attrs _require_scratch -rm -f $seqres.full _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount >>$seqres.full 2>&1 diff --git a/tests/generic/487 b/tests/generic/487 index 1aa97ada..fda8828d 100755 --- a/tests/generic/487 +++ b/tests/generic/487 @@ -9,15 +9,10 @@ # on all fds and fsync on all fds. Ensure that we get errors on all of them. # Then fsync on all one last time and verify that all return 0. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick eio +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +20,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror @@ -45,8 +39,6 @@ esac _require_logdev _require_dm_target error -rm -f $seqres.full - # Disable the scratch rt device to avoid test failures relating to the rt # bitmap consuming all the free space in our small data device. unset SCRATCH_RTDEV diff --git a/tests/generic/488 b/tests/generic/488 index e8855271..7b9dcc18 100755 --- a/tests/generic/488 +++ b/tests/generic/488 @@ -7,26 +7,11 @@ # Test having many file descriptors referring to deleted files open. Regression # test for patch "Btrfs: fix ENOSPC caused by orphan items reservations". # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -. ./common/rc . ./common/filter -rm -f $seqres.full - _supported_fs generic _require_scratch _require_test_program "multi_open_unlink" diff --git a/tests/generic/489 b/tests/generic/489 index 7220e198..ec42950c 100755 --- a/tests/generic/489 +++ b/tests/generic/489 @@ -7,13 +7,10 @@ # Test that xattrs are not lost after calling fsync multiple times with a # filesystem commit in between the fsync calls. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick attr log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -21,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey . ./common/attr @@ -33,8 +29,6 @@ _require_scratch _require_dm_target flakey _require_attrs -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/490 b/tests/generic/490 index 876b3895..f4fb67be 100755 --- a/tests/generic/490 +++ b/tests/generic/490 @@ -9,17 +9,10 @@ # for that. The problem has been fixed by commit 2ee3ee06a8fd79 "ext4: fix hole # length detection in ext4_ind_map_blocks()" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw seek -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs generic @@ -31,6 +24,7 @@ base_test_file=$TEST_DIR/seek_sanity_testfile.$seq _require_test_program "seek_sanity_test" +# Override the default cleanup function. _cleanup() { cd / diff --git a/tests/generic/491 b/tests/generic/491 index 240555af..e6e57dcd 100755 --- a/tests/generic/491 +++ b/tests/generic/491 @@ -9,23 +9,10 @@ # With ext4, this leads to freeze proection bypass WARN_ON in # ext4_journal_check_start. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick freeze mount + +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +21,6 @@ _require_scratch _require_freeze _require_command "$TIMEOUT_PROG" "timeout" -rm -f $seqres.full - testfile=$SCRATCH_MNT/foo # Create a filesystem with a file diff --git a/tests/generic/492 b/tests/generic/492 index 403d014c..c488c8ba 100755 --- a/tests/generic/492 +++ b/tests/generic/492 @@ -6,28 +6,12 @@ # # Test the online filesystem label set/get ioctls # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/493 b/tests/generic/493 index 4bf44e88..a26a908d 100755 --- a/tests/generic/493 +++ b/tests/generic/493 @@ -6,27 +6,12 @@ # # Check that we can't dedupe a swapfile. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -. ./common/rc +. ./common/preamble +_begin_fstest auto quick swap dedupe + . ./common/filter . ./common/reflink -rm -f $seqres.full - _supported_fs generic _require_scratch_swapfile _require_scratch_dedupe diff --git a/tests/generic/494 b/tests/generic/494 index 09034ba4..2e14fab8 100755 --- a/tests/generic/494 +++ b/tests/generic/494 @@ -6,25 +6,10 @@ # # Test truncation/hole punching of an active swapfile. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick swap punch -rm -f $seqres.full +. ./common/filter _supported_fs generic _require_scratch_swapfile diff --git a/tests/generic/495 b/tests/generic/495 index f1a8a619..608f1715 100755 --- a/tests/generic/495 +++ b/tests/generic/495 @@ -6,28 +6,12 @@ # # Test invalid swap file (with holes) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick swap -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs generic _require_scratch_swapfile _require_test_program mkswap diff --git a/tests/generic/496 b/tests/generic/496 index 1bfd1641..4aeaffd3 100755 --- a/tests/generic/496 +++ b/tests/generic/496 @@ -7,15 +7,10 @@ # Test various swapfile activation oddities on filesystems that support # fallocated swapfiles (for given fs ext4/xfs) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick swap prealloc +# Override the default cleanup function. _cleanup() { cd / @@ -23,13 +18,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_swapfile @@ -37,7 +28,6 @@ _require_test_program mkswap _require_test_program swapon _require_xfs_io_command "falloc" -rm -f $seqres.full _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount >>$seqres.full 2>&1 diff --git a/tests/generic/497 b/tests/generic/497 index 51155610..6188e385 100755 --- a/tests/generic/497 +++ b/tests/generic/497 @@ -7,15 +7,10 @@ # Test various swapfile activation oddities, having used fcollapse to # create discontiguous ranges in the file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick swap collapse +# Override the default cleanup function. _cleanup() { cd / @@ -23,13 +18,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_swapfile @@ -37,7 +28,6 @@ _require_test_program mkswap _require_test_program swapon _require_xfs_io_command "fcollapse" -rm -f $seqres.full _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount >>$seqres.full 2>&1 diff --git a/tests/generic/498 b/tests/generic/498 index 450ebc34..5ba21399 100755 --- a/tests/generic/498 +++ b/tests/generic/498 @@ -8,13 +8,10 @@ # fsync'ed, fsync a parent directory of the new hard link and power fail, # the parent directory exists after mounting the filesystem again. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -33,8 +29,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/499 b/tests/generic/499 index 47f5e595..7159871f 100755 --- a/tests/generic/499 +++ b/tests/generic/499 @@ -7,21 +7,10 @@ # Test a specific sequence of fsx operations that causes an mmap read past # eof to return nonzero contents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw collapse zero -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/punch # real QA test starts here @@ -31,8 +20,6 @@ _require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fcollapse" _require_xfs_io_command "fzero" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/500 b/tests/generic/500 index 5ab2f78c..0be59934 100755 --- a/tests/generic/500 +++ b/tests/generic/500 @@ -19,15 +19,10 @@ # (XFS) shutdown. (Fixed by 8c81dd46ef3c Force log to disk before reading # the AGF during a fstrim) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto thin trim +# Override the default cleanup function. _cleanup() { cd / @@ -35,14 +30,10 @@ _cleanup() _dmthin_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmthin -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_nocheck diff --git a/tests/generic/501 b/tests/generic/501 index 67b9f856..8c3f627b 100755 --- a/tests/generic/501 +++ b/tests/generic/501 @@ -9,13 +9,10 @@ # the file again and then power fail, after we mount again the filesystem, no # file data was lost or corrupted. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmflakey @@ -34,8 +30,6 @@ _supported_fs generic _require_scratch_reflink _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/502 b/tests/generic/502 index f3e0f019..b0f9077f 100755 --- a/tests/generic/502 +++ b/tests/generic/502 @@ -11,13 +11,10 @@ # fsync this new file and power fail, we will be able to mount again the # filesystem and the new file and all hard links exist. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -25,8 +22,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -36,8 +32,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/503 b/tests/generic/503 index 4937e6b2..a6971e63 100755 --- a/tests/generic/503 +++ b/tests/generic/503 @@ -13,28 +13,12 @@ # DAX setup, but the test runs fine with or without DAX and with XFS so we # don't require the DAX mount option or a specific filesystem for the test. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dax punch collapse zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_test diff --git a/tests/generic/504 b/tests/generic/504 index fcc467e8..038ab0f2 100755 --- a/tests/generic/504 +++ b/tests/generic/504 @@ -10,15 +10,10 @@ # Open new fd by exec shell built-in, then require exclusive lock # by flock(1) command. Checking /proc/locks for the lock info. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick locks +# Override the default cleanup function. _cleanup() { exec {test_fd}<&- @@ -26,13 +21,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/505 b/tests/generic/505 index 44399513..5b6a9b90 100755 --- a/tests/generic/505 +++ b/tests/generic/505 @@ -17,28 +17,12 @@ # 7. mount; # 8. check uid/gid # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown auto quick metadata -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/506 b/tests/generic/506 index d5b28cad..25a5b0f8 100755 --- a/tests/generic/506 +++ b/tests/generic/506 @@ -16,29 +16,13 @@ # 6. mount; # 7. check project id # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown auto quick metadata quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/507 b/tests/generic/507 index cf975845..6a4a3833 100755 --- a/tests/generic/507 +++ b/tests/generic/507 @@ -22,15 +22,10 @@ # 12. mount; # 13. check i_flags # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest shutdown auto quick metadata +# Override the default cleanup function. _cleanup() { cd / @@ -38,13 +33,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/508 b/tests/generic/508 index 97e0893d..46649340 100755 --- a/tests/generic/508 +++ b/tests/generic/508 @@ -17,28 +17,12 @@ # 5. mount; # 6. check creation time # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown auto quick metadata -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/509 b/tests/generic/509 index 55ec7879..26010de3 100755 --- a/tests/generic/509 +++ b/tests/generic/509 @@ -8,13 +8,10 @@ # power fail, we will be able to mount the filesystem without triggering any # crashes, warnings or corruptions. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -33,8 +29,6 @@ _require_scratch _require_xfs_io_command "-T" _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/510 b/tests/generic/510 index d9c83051..20bd87ee 100755 --- a/tests/generic/510 +++ b/tests/generic/510 @@ -9,13 +9,10 @@ # mounting the filesystem the file has a single parent, named B and there # is no longer any directory with the name A. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -33,8 +29,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/511 b/tests/generic/511 index f8be3182..058d8401 100755 --- a/tests/generic/511 +++ b/tests/generic/511 @@ -7,21 +7,10 @@ # Test a specific sequence of fsx operations that causes an mmap read past # eof to return nonzero contents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw zero -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/punch # real QA test starts here @@ -30,8 +19,6 @@ _require_scratch _require_xfs_io_command "falloc" "-k" _require_xfs_io_command "fzero" -rm -f $seqres.full - _scratch_mkfs_sized $((1024 * 1024 * 256)) >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/512 b/tests/generic/512 index 5125b488..ec367405 100755 --- a/tests/generic/512 +++ b/tests/generic/512 @@ -9,13 +9,10 @@ # file's current size, fsync the file and then power fail, after mounting the # filesystem all the file data is there and the file size is correct. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log prealloc +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _require_scratch _require_xfs_io_command "falloc" _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/513 b/tests/generic/513 index 70687877..dc082787 100755 --- a/tests/generic/513 +++ b/tests/generic/513 @@ -6,21 +6,10 @@ # # Ensure that ctime is updated and capabilities are cleared when reflinking. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick clone + +# Import common functions. . ./common/filter . ./common/reflink @@ -30,8 +19,6 @@ _require_scratch_reflink _require_command "$GETCAP_PROG" getcap _require_command "$SETCAP_PROG" setcap -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/514 b/tests/generic/514 index a1a50fa3..5b837718 100755 --- a/tests/generic/514 +++ b/tests/generic/514 @@ -6,21 +6,10 @@ # # Ensure that file size resource limits are respected when reflinking. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -29,8 +18,6 @@ _supported_fs generic _require_scratch_reflink _require_user -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/515 b/tests/generic/515 index 2918baac..2f3bd400 100755 --- a/tests/generic/515 +++ b/tests/generic/515 @@ -9,21 +9,10 @@ # of a reproducer script that Eric Sandeen formulated from a stale data # exposure bug uncovered by shared/010. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -32,8 +21,6 @@ _supported_fs generic _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - # Fill disk with a well known pattern so that stale data exposure becomes much # more obvious. $XFS_IO_PROG -c "pwrite -S 0x58 -b 1m 0 300m" $SCRATCH_DEV >> $seqres.full diff --git a/tests/generic/516 b/tests/generic/516 index 9a80ab77..790ad532 100755 --- a/tests/generic/516 +++ b/tests/generic/516 @@ -8,31 +8,23 @@ # - Fail to dedupe non-identical parts of two different files # - Check that nothing changes in either file # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick dedupe clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink # real QA test starts here _require_test_dedupe -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/517 b/tests/generic/517 index e960e4c2..cf3031ed 100755 --- a/tests/generic/517 +++ b/tests/generic/517 @@ -8,21 +8,10 @@ # to the filesystem's block size into the middle of a different file does not # corrupt the destination's file data by reflinking the last (eof) block. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick dedupe clone + +# Import common functions. . ./common/filter . ./common/reflink @@ -30,8 +19,6 @@ _cleanup() _supported_fs generic _require_scratch_dedupe -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/518 b/tests/generic/518 index f9e7cfa5..f3cb5868 100755 --- a/tests/generic/518 +++ b/tests/generic/518 @@ -10,21 +10,10 @@ # data corruption since the data between EOF and the end of its block is # undefined. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick clone + +# Import common functions. . ./common/filter . ./common/reflink @@ -32,8 +21,6 @@ _cleanup() _supported_fs generic _require_scratch_reflink -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/519 b/tests/generic/519 index 930cc5c5..28747c21 100755 --- a/tests/generic/519 +++ b/tests/generic/519 @@ -7,28 +7,12 @@ # Verify if there's physical address overlap returned by FIBMAP, cover: # 79b3dbe4adb3 fs: fix iomap_bmap position calculation # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch diff --git a/tests/generic/520 b/tests/generic/520 index 57a2ac72..ad6764c7 100755 --- a/tests/generic/520 +++ b/tests/generic/520 @@ -9,15 +9,10 @@ # Test if we create a hard link to a file and persist either of the files, all # the names persist. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -25,17 +20,13 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey # 256MB in byte fssize=$((2**20 * 256)) -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_nocheck @@ -50,7 +41,6 @@ stat_opt='-c "blocks: %b size: %s inode: %i links: %h"' before="" after="" - # Using _scratch_mkfs instead of cleaning up the working directory, # adds about 10 seconds of delay in total for the 37 tests. clean_dir() @@ -144,7 +134,6 @@ test_link_sync() clean_dir } - # Create different combinations to run the link test # Group 0: Both files within root directory file_names[0]="foo bar" diff --git a/tests/generic/521 b/tests/generic/521 index b4d107cb..cde9d447 100755 --- a/tests/generic/521 +++ b/tests/generic/521 @@ -6,28 +6,12 @@ # # Long-soak directio fsx test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest soak long_rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/522 b/tests/generic/522 index f87ccae6..ae84fe04 100755 --- a/tests/generic/522 +++ b/tests/generic/522 @@ -6,28 +6,12 @@ # # Long-soak buffered fsx test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest soak long_rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/523 b/tests/generic/523 index 78bd4928..0792a39f 100755 --- a/tests/generic/523 +++ b/tests/generic/523 @@ -6,21 +6,10 @@ # # Check that xattrs can have slashes in their name. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick attr -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr . ./common/filter @@ -29,8 +18,6 @@ _supported_fs generic _require_scratch _require_attrs -rm -f $seqres.full - _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/524 b/tests/generic/524 index da0cd812..80907a4c 100755 --- a/tests/generic/524 +++ b/tests/generic/524 @@ -13,26 +13,10 @@ # partly stale mapping and potentially leaving delalloc blocks in the current # mapping unconverted. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here diff --git a/tests/generic/525 b/tests/generic/525 index af752ec6..431ba2cd 100755 --- a/tests/generic/525 +++ b/tests/generic/525 @@ -11,31 +11,16 @@ # This is a variant of test generic/466 for filesystems that # do not support mkfs_sized. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick rw + +# Import common functions. . ./common/filter # real QA test starts here _supported_fs generic _require_scratch -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/526 b/tests/generic/526 index b91aac30..dc7cb36c 100755 --- a/tests/generic/526 +++ b/tests/generic/526 @@ -9,13 +9,10 @@ # failure we are able to mount the filesystem and all file names correspond to # the correct inodes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/527 b/tests/generic/527 index 840911c1..40cd1c6a 100755 --- a/tests/generic/527 +++ b/tests/generic/527 @@ -9,13 +9,10 @@ # after a power failure we are able to mount the filesystem and all file names # correspond to the correct inodes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _require_scratch _require_hardlinks _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/528 b/tests/generic/528 index aeab5909..24d1ee0e 100755 --- a/tests/generic/528 +++ b/tests/generic/528 @@ -8,22 +8,18 @@ # we created a file. A bug caught during code review of xfs patches revealed # that there weren't any sanity checks of the btime values. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick testfile=$TEST_DIR/$seq.txt -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr . ./common/filter @@ -33,7 +29,6 @@ _require_test _require_xfs_io_command "statx" "-r" _require_btime -rm -f $seqres.full rm -f $testfile # Create a file and the time we created it diff --git a/tests/generic/529 b/tests/generic/529 index cfe33e51..05be2c4f 100755 --- a/tests/generic/529 +++ b/tests/generic/529 @@ -7,21 +7,10 @@ # Regression test for a bug where XFS corrupts memory if the listxattr buffer # is a particularly well crafted size on a filesystem that supports posix acls. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick acl attr -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr # real QA test starts here @@ -30,7 +19,6 @@ _require_acls _require_scratch _require_test_program "t_attr_corruption" -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/530 b/tests/generic/530 index b6a5cad7..692a813e 100755 --- a/tests/generic/530 +++ b/tests/generic/530 @@ -11,22 +11,11 @@ # # Use only a single CPU to test the single threaded situation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick shutdown unlink testfile=$TEST_DIR/$seq.txt -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic @@ -35,7 +24,6 @@ _require_scratch_shutdown _require_metadata_journaling _require_test_program "t_open_tmpfiles" -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/531 b/tests/generic/531 index e76418ca..5e84ca97 100755 --- a/tests/generic/531 +++ b/tests/generic/531 @@ -11,29 +11,17 @@ # # Use every CPU possible to stress the filesystem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick unlink testfile=$TEST_DIR/$seq.txt -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic _require_scratch _require_test_program "t_open_tmpfiles" -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/532 b/tests/generic/532 index c149f288..d356b0da 100755 --- a/tests/generic/532 +++ b/tests/generic/532 @@ -8,21 +8,17 @@ # sets attribute flags anyway, which is fixed by commit 1b9598c8fb99 ("xfs: fix # reporting supported extra file attributes for statx()") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic @@ -47,7 +43,6 @@ check_statx_attributes() test $(( attrs & ~(mask) )) -ne 0 && echo "attributes $attrs do not appear in mask $mask" } -rm -f $seqres.full echo "Silence is golden" # Create file, check for incorrect mask diff --git a/tests/generic/533 b/tests/generic/533 index ebcf3bf2..85b39fb1 100755 --- a/tests/generic/533 +++ b/tests/generic/533 @@ -8,23 +8,11 @@ # # Simple attr smoke tests for user EAs, dereived from generic/097. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick attr file=$TEST_DIR/foo.$seq -_cleanup() -{ - cd / - rm -f $tmp.* -} - getfattr() { _getfattr --absolute-names "$@" |& _filter_test_dir @@ -35,8 +23,7 @@ setfattr() $SETFATTR_PROG "$@" |& _filter_test_dir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr . ./common/filter @@ -46,9 +33,6 @@ _supported_fs generic _require_test _require_attrs -# remove previous $seqres.full before test -rm -f $seqres.full - echo -e "\ncreate file foo.$seq" rm -f $file touch $file diff --git a/tests/generic/534 b/tests/generic/534 index 40e2415d..1e569419 100755 --- a/tests/generic/534 +++ b/tests/generic/534 @@ -7,13 +7,10 @@ # Test that if we truncate a file to reduce its size, rename it and then fsync # it, after a power failure the file has a correct size and name. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -21,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -31,8 +27,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/535 b/tests/generic/535 index edf749d7..3b734742 100755 --- a/tests/generic/535 +++ b/tests/generic/535 @@ -17,15 +17,10 @@ # 8. remount # 9. check i_mode # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -33,14 +28,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/536 b/tests/generic/536 index 5e626d5a..c3b1d38f 100755 --- a/tests/generic/536 +++ b/tests/generic/536 @@ -8,26 +8,10 @@ # historically susceptible to this problem in the window between delalloc to # physical extent conversion and writeback completion. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw shutdown -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. # real QA test starts here diff --git a/tests/generic/537 b/tests/generic/537 index 02968fec..f90a2a34 100755 --- a/tests/generic/537 +++ b/tests/generic/537 @@ -13,23 +13,10 @@ # xfs: prohibit fstrim in norecovery mode # Btrfs: do not allow trimming when a fs is mounted with the nologreplay option -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick trim -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,8 +24,6 @@ _supported_fs generic _require_scratch _require_fstrim -rm -f $seqres.full - _scratch_mkfs > $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV diff --git a/tests/generic/538 b/tests/generic/538 index cbc3ef61..f6f5496b 100755 --- a/tests/generic/538 +++ b/tests/generic/538 @@ -18,28 +18,12 @@ # the potential of corrupting the previous unaligned write to the same # block.) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick aio -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/539 b/tests/generic/539 index c7f6cbd6..f6feda11 100755 --- a/tests/generic/539 +++ b/tests/generic/539 @@ -6,17 +6,10 @@ # # Check that SEEK_HOLE can find a punched hole. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick punch seek -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. _supported_fs generic @@ -28,6 +21,7 @@ base_test_file=$TEST_DIR/seek_sanity_testfile.$seq _require_test_program "seek_sanity_test" +# Override the default cleanup function. _cleanup() { cd / diff --git a/tests/generic/540 b/tests/generic/540 index 7839542b..69cf635f 100755 --- a/tests/generic/540 +++ b/tests/generic/540 @@ -16,23 +16,10 @@ # - reflink across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -41,8 +28,6 @@ _supported_fs generic _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/541 b/tests/generic/541 index a3b79b63..925f346e 100755 --- a/tests/generic/541 +++ b/tests/generic/541 @@ -16,23 +16,10 @@ # - reflink across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -41,8 +28,6 @@ _supported_fs generic _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/542 b/tests/generic/542 index fc7834c3..e3e627a8 100755 --- a/tests/generic/542 +++ b/tests/generic/542 @@ -16,23 +16,10 @@ # - reflink across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -41,8 +28,6 @@ _supported_fs generic _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/543 b/tests/generic/543 index 2f3edc5f..047bedd5 100755 --- a/tests/generic/543 +++ b/tests/generic/543 @@ -16,23 +16,10 @@ # - reflink across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -41,8 +28,6 @@ _supported_fs generic _require_scratch_reflink _require_xfs_io_command "falloc" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/544 b/tests/generic/544 index 4bdd5895..4a9f4852 100755 --- a/tests/generic/544 +++ b/tests/generic/544 @@ -10,23 +10,10 @@ # double-inode locking order correctness as well as stressing things like ocfs2 # which have per-inode sharing groups and therefore have to check that we don't # try to link data between disjoint sharing groups. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick clone -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +22,6 @@ _supported_fs generic _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/545 b/tests/generic/545 index 8bf572dd..6f6dcd26 100755 --- a/tests/generic/545 +++ b/tests/generic/545 @@ -7,15 +7,10 @@ # Check that we can't set the FS_APPEND_FL and FS_IMMUTABLE_FL inode # flags without capbility CAP_LINUX_IMMUTABLE # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick cap +# Override the default cleanup function. _cleanup() { # Cleanup of flags on both file in case test is aborted @@ -27,8 +22,7 @@ _cleanup() rm -rf $tmp.* $workdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/generic/546 b/tests/generic/546 index db18d2d3..7723b980 100755 --- a/tests/generic/546 +++ b/tests/generic/546 @@ -11,15 +11,10 @@ # - No data loss even power loss happens after fsync # All operations above should not fail. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone enospc log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -27,15 +22,11 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmflakey -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/547 b/tests/generic/547 index 4f5eb18b..e8ccab52 100755 --- a/tests/generic/547 +++ b/tests/generic/547 @@ -8,13 +8,10 @@ # then verify that all files and directories exist, with the same data and # metadata they had before the power failure. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -34,8 +30,6 @@ _require_scratch _require_fssum _require_dm_target flakey -rm -f $seqres.full - fssum_files_dir=$TEST_DIR/generic-test-$seq rm -fr $fssum_files_dir mkdir $fssum_files_dir diff --git a/tests/generic/548 b/tests/generic/548 index 43f70422..638c5c76 100755 --- a/tests/generic/548 +++ b/tests/generic/548 @@ -7,29 +7,13 @@ # Verify ciphertext for v1 encryption policies that use AES-256-XTS to encrypt # file contents and AES-256-CTS-CBC to encrypt file names. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/549 b/tests/generic/549 index 237cf017..f8faf11b 100755 --- a/tests/generic/549 +++ b/tests/generic/549 @@ -7,29 +7,13 @@ # Verify ciphertext for v1 encryption policies that use AES-128-CBC-ESSIV to # encrypt file contents and AES-128-CTS-CBC to encrypt file names. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/550 b/tests/generic/550 index 992276ec..aa792089 100755 --- a/tests/generic/550 +++ b/tests/generic/550 @@ -7,29 +7,13 @@ # Verify ciphertext for v1 encryption policies that use Adiantum to encrypt file # contents and file names. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/551 b/tests/generic/551 index 5a071849..2689270a 100755 --- a/tests/generic/551 +++ b/tests/generic/551 @@ -6,28 +6,12 @@ # # Randomly direct AIO write&verify stress test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto stress aio -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch diff --git a/tests/generic/552 b/tests/generic/552 index a99147e2..727bec85 100755 --- a/tests/generic/552 +++ b/tests/generic/552 @@ -8,13 +8,10 @@ # parent directory's inode is not evicted due to being in use), then we rename # the file and fsync it, after a power failure the file data is not lost. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -33,8 +29,6 @@ _require_scratch _require_odirect _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/553 b/tests/generic/553 index 9cc21bb7..4a3d3953 100755 --- a/tests/generic/553 +++ b/tests/generic/553 @@ -9,16 +9,13 @@ # This is a regression test for kernel commit: # 96e6e8f4a68d ("vfs: add missing checks to copy_file_range") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copy_range -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS workdir="$TEST_DIR/test-$seq" +# Override the default cleanup function. _cleanup() { $XFS_IO_PROG -f -r -c "chattr -i" $workdir/immutable >/dev/null 2>&1 @@ -26,15 +23,12 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs generic -rm -f $seqres.full - _require_test _require_xfs_io_command "copy_range" _require_xfs_io_command "chattr" "i" @@ -42,8 +36,6 @@ _require_xfs_io_command "chattr" "i" rm -rf $workdir mkdir $workdir -rm -f $seqres.full - $XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $workdir/file >> $seqres.full 2>&1 # we have to open the file to be immutable rw and hold it open over the diff --git a/tests/generic/554 b/tests/generic/554 index da9bfce5..c1984285 100755 --- a/tests/generic/554 +++ b/tests/generic/554 @@ -9,30 +9,17 @@ # This is a regression test for kernel commit: # 96e6e8f4a68d ("vfs: add missing checks to copy_file_range") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick copy_range swap + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter # real QA test starts here _supported_fs generic -rm -f $seqres.full - _require_scratch _require_xfs_io_command "copy_range" _require_scratch_swapfile @@ -40,8 +27,6 @@ _require_scratch_swapfile _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount -rm -f $seqres.full - $XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $SCRATCH_MNT/file >> $seqres.full 2>&1 echo swap files return ETXTBUSY diff --git a/tests/generic/555 b/tests/generic/555 index e9be9deb..d243dccf 100755 --- a/tests/generic/555 +++ b/tests/generic/555 @@ -10,15 +10,10 @@ # This test uses xfs_io chattr, rather than the (e2fsprogs) chattr # program to exercise the FS_IOC_FSSETXATTR ioctl. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick cap +# Override the default cleanup function. _cleanup() { # Cleanup of flags on both file in case test is aborted @@ -30,8 +25,7 @@ _cleanup() rm -rf $tmp.* $workdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/generic/556 b/tests/generic/556 index 3145188c..7ef2f6f4 100755 --- a/tests/generic/556 +++ b/tests/generic/556 @@ -5,12 +5,9 @@ # Test the basic functionality of filesystems with case-insensitive # support. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -status=1 # failure is thea default +. ./common/preamble +_begin_fstest auto quick casefold -. ./common/rc . ./common/filter . ./common/casefold . ./common/attr diff --git a/tests/generic/557 b/tests/generic/557 index 35ba1ccd..c547d537 100755 --- a/tests/generic/557 +++ b/tests/generic/557 @@ -7,13 +7,10 @@ # Test that if we fsync a file, evict its inode, unlink it and then fsync its # parent directory, after a power failure the file does not exists. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -21,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmflakey @@ -31,8 +27,6 @@ _supported_fs generic _require_scratch _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/558 b/tests/generic/558 index 4bed90e2..4e22ce65 100755 --- a/tests/generic/558 +++ b/tests/generic/558 @@ -9,20 +9,8 @@ # Also a regression test for xfsprogs commit # d586858 xfs_repair: fix sibling pointer tests in verify_dir2_path() # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto enospc create_file() { @@ -37,8 +25,7 @@ create_file() done } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -46,7 +33,6 @@ _supported_fs generic _require_inode_limits _require_scratch -rm -f $seqres.full echo "Silence is golden" _scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1 diff --git a/tests/generic/559 b/tests/generic/559 index 955b512d..98ab4474 100755 --- a/tests/generic/559 +++ b/tests/generic/559 @@ -6,29 +6,13 @@ # # Dedupe a single big file and verify integrity # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto stress dedupe -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_duperemove diff --git a/tests/generic/560 b/tests/generic/560 index 9a371c0e..e3f28667 100755 --- a/tests/generic/560 +++ b/tests/generic/560 @@ -8,29 +8,13 @@ # times (d0 -> d1, d1 -> d2, ... dn-1 -> dn), dedupe dataN everytime # before copy. At last, verify dataN same with data0. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto stress dedupe -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_duperemove diff --git a/tests/generic/561 b/tests/generic/561 index ca2e5181..bfd4443d 100755 --- a/tests/generic/561 +++ b/tests/generic/561 @@ -7,15 +7,10 @@ # Dedup & random I/O race test, do multi-threads fsstress and dedupe on # same directory/files # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto stress dedupe +# Override the default cleanup function. _cleanup() { cd / @@ -23,14 +18,10 @@ _cleanup() end_test } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_duperemove diff --git a/tests/generic/562 b/tests/generic/562 index e32ebb9b..7d98e569 100755 --- a/tests/generic/562 +++ b/tests/generic/562 @@ -8,21 +8,10 @@ # many small extents, when the fs is nearly full, the clone operation does # not fail and produces the correct result. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone punch -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -32,8 +21,6 @@ _require_scratch_reflink _require_test_program "punch-alternating" _require_xfs_io_command "fpunch" -rm -f $seqres.full - _scratch_mkfs_sized $((512 * 1024 * 1024)) >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/563 b/tests/generic/563 index 550fd30f..f98c6e42 100755 --- a/tests/generic/563 +++ b/tests/generic/563 @@ -10,15 +10,10 @@ # them into cache. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -30,14 +25,10 @@ _cleanup() _destroy_loop_device $LOOP_DEV > /dev/null 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/cgroup2 -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/564 b/tests/generic/564 index 04719561..7ed5ccc1 100755 --- a/tests/generic/564 +++ b/tests/generic/564 @@ -9,15 +9,12 @@ # This is a regression test for kernel commit: # 96e6e8f4a68d ("vfs: add missing checks to copy_file_range") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copy_range -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -25,15 +22,12 @@ _cleanup() [ -z "$loopdev" ] || _destroy_loop_device $loopdev } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs generic -rm -f $seqres.full - _require_test _require_loop # for mkfifo @@ -59,8 +53,6 @@ testdir="$TEST_DIR/test-$seq" rm -rf $testdir mkdir $testdir -rm -f $seqres.full - $XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $testdir/file >> $seqres.full 2>&1 echo source range overlaps destination range in same file returns EINVAL diff --git a/tests/generic/565 b/tests/generic/565 index 8a7798dc..fd71d1e3 100755 --- a/tests/generic/565 +++ b/tests/generic/565 @@ -9,30 +9,17 @@ # # 5dae222a5ff0 vfs: allow copy_file_range to copy across devices # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick copy_range + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter # real QA test starts here _supported_fs generic -rm -f $seqres.full - _require_test _require_scratch _require_xfs_io_command "copy_range" @@ -40,11 +27,9 @@ _require_xfs_io_command "copy_range" _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir -rm -f $seqres.full $XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $testdir/file >> $seqres.full 2>&1 diff --git a/tests/generic/566 b/tests/generic/566 index d929c3cc..52b01f6d 100755 --- a/tests/generic/566 +++ b/tests/generic/566 @@ -10,22 +10,16 @@ # This test goes with commit 1fb254aa983bf ("xfs: fix missing ILOCK unlock when # xfs_setattr_nonsize fails due to EDQUOT") -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick quota metadata +# Override the default cleanup function. _cleanup() { cd / } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/quota . ./common/filter @@ -36,8 +30,6 @@ _require_quota _require_xfs_quota_foreign _require_user -rm -f $seqres.full - _qmount_option "grpquota" _scratch_mkfs > $seqres.full _qmount diff --git a/tests/generic/567 b/tests/generic/567 index 0b88ce08..3f5907c3 100755 --- a/tests/generic/567 +++ b/tests/generic/567 @@ -10,23 +10,10 @@ # # (generic/029 is a similar test but for truncate.) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick rw punch + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/568 b/tests/generic/568 index c403a826..958e5e94 100755 --- a/tests/generic/568 +++ b/tests/generic/568 @@ -7,15 +7,10 @@ # Test that fallocating an unaligned range allocates all blocks # touched by that range # -seq=$(basename $0) -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=$PWD -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw prealloc +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -f "$TEST_DIR/falloctest-$seq" } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/generic/569 b/tests/generic/569 index 3f615d2b..1dc54da8 100755 --- a/tests/generic/569 +++ b/tests/generic/569 @@ -6,15 +6,10 @@ # # Check that we can't modify a file that's an active swap file. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw swap prealloc +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() rm -rf $tmp.* $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -32,8 +26,6 @@ _require_xfs_io_command "falloc" _require_test_program swapon _require_scratch_swapfile -rm -f $seqres.full - _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/generic/570 b/tests/generic/570 index 537bf098..7d03acfe 100755 --- a/tests/generic/570 +++ b/tests/generic/570 @@ -6,15 +6,10 @@ # # Check that we can't modify a block device that's an active swap device. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw swap +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +27,6 @@ _require_scratch_nocheck _require_block_device $SCRATCH_DEV test -e /dev/snapshot && _notrun "userspace hibernation to swap is enabled" -rm -f $seqres.full - $MKSWAP_PROG "$SCRATCH_DEV" >> $seqres.full # Can you modify the swap dev via previously open file descriptors? diff --git a/tests/generic/571 b/tests/generic/571 index 2e32442a..bd5737fa 100755 --- a/tests/generic/571 +++ b/tests/generic/571 @@ -6,21 +6,13 @@ # # lease test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/locktest -trap "_cleanup; exit \$status" 0 1 2 3 15 - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/572 b/tests/generic/572 index d1d6d846..f131c7ed 100755 --- a/tests/generic/572 +++ b/tests/generic/572 @@ -11,15 +11,10 @@ # - can't change contents of verity files, but can change metadata # - can retrieve a verity file's measurement via FS_IOC_MEASURE_VERITY # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick verity +# Override the default cleanup function. _cleanup() { cd / @@ -27,14 +22,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/verity -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_verity diff --git a/tests/generic/573 b/tests/generic/573 index 12f5a50a..63c0aef5 100755 --- a/tests/generic/573 +++ b/tests/generic/573 @@ -7,15 +7,10 @@ # Test access controls on the fs-verity ioctls. FS_IOC_MEASURE_VERITY is # allowed on any file, whereas FS_IOC_ENABLE_VERITY requires write access. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick verity +# Override the default cleanup function. _cleanup() { cd / @@ -23,14 +18,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/verity -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_verity diff --git a/tests/generic/574 b/tests/generic/574 index 1e296618..df0ef95f 100755 --- a/tests/generic/574 +++ b/tests/generic/574 @@ -9,15 +9,10 @@ # the block device. It verifies that this causes I/O errors when the relevant # part of the contents is later read by any means. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick verity +# Override the default cleanup function. _cleanup() { cd / @@ -25,14 +20,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/verity -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_verity diff --git a/tests/generic/575 b/tests/generic/575 index 72616ba8..ffa6b61d 100755 --- a/tests/generic/575 +++ b/tests/generic/575 @@ -8,15 +8,10 @@ # verifies that fs-verity is doing its Merkle tree-based hashing correctly, # i.e. that it hasn't been broken by a change. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick verity +# Override the default cleanup function. _cleanup() { cd / @@ -24,14 +19,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/verity -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_verity diff --git a/tests/generic/576 b/tests/generic/576 index 0034742d..82fbdd71 100755 --- a/tests/generic/576 +++ b/tests/generic/576 @@ -7,15 +7,10 @@ # Test using fs-verity and fscrypt simultaneously. This primarily verifies # correct ordering of the hooks for each feature: fscrypt needs to be first. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick verity encrypt +# Override the default cleanup function. _cleanup() { cd / @@ -23,15 +18,11 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/verity . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_verity diff --git a/tests/generic/577 b/tests/generic/577 index 114463be..98c3888f 100755 --- a/tests/generic/577 +++ b/tests/generic/577 @@ -6,15 +6,10 @@ # # Test the fs-verity built-in signature verification support. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick verity +# Override the default cleanup function. _cleanup() { cd / @@ -22,14 +17,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/verity -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_verity diff --git a/tests/generic/578 b/tests/generic/578 index e7cd7e68..01929a28 100755 --- a/tests/generic/578 +++ b/tests/generic/578 @@ -6,23 +6,17 @@ # # Make sure that we can handle multiple mmap writers to the same file. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,8 +27,6 @@ _require_command "$FILEFRAG_PROG" filefrag _require_test_reflink _require_cp_reflink -rm -f $seqres.full - compare() { for i in $(seq 1 8); do md5sum $testdir/file$i | _filter_test_dir @@ -80,7 +72,6 @@ $here/src/mmap-write-concurrent $len \ $((filesz - 777)) $testdir/file3 \ $(((blksz * 3) - 168)) $testdir/file4 \ - echo "Compare files before remount" | tee -a $seqres.full compare _test_cycle_mount diff --git a/tests/generic/579 b/tests/generic/579 index 0cb069ba..2667585c 100755 --- a/tests/generic/579 +++ b/tests/generic/579 @@ -9,15 +9,10 @@ # before, during, and after the fs-verity enablement), while fsstress is also # running on the same filesystem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto stress verity +# Override the default cleanup function. _cleanup() { # Stop all subprocesses. @@ -29,14 +24,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/verity -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_verity diff --git a/tests/generic/580 b/tests/generic/580 index 2017682c..73f32ff9 100755 --- a/tests/generic/580 +++ b/tests/generic/580 @@ -8,30 +8,14 @@ # and v2 encryption policies. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt echo -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption -v 2 diff --git a/tests/generic/581 b/tests/generic/581 index 546362b6..cabc7e1c 100755 --- a/tests/generic/581 +++ b/tests/generic/581 @@ -8,17 +8,13 @@ # and v2 encryption policies. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt echo -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 orig_maxkeys= +# Override the default cleanup function. _cleanup() { cd / @@ -28,14 +24,10 @@ _cleanup() fi } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_user diff --git a/tests/generic/582 b/tests/generic/582 index f685b09c..bd7d2ea6 100755 --- a/tests/generic/582 +++ b/tests/generic/582 @@ -9,29 +9,13 @@ # # This is the same as generic/548, except using v2 policies. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/583 b/tests/generic/583 index 152be124..771ecd1e 100755 --- a/tests/generic/583 +++ b/tests/generic/583 @@ -9,29 +9,13 @@ # # This is the same as generic/549, except using v2 policies. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/584 b/tests/generic/584 index 46c4c6f4..adafec6a 100755 --- a/tests/generic/584 +++ b/tests/generic/584 @@ -9,29 +9,13 @@ # # This is the same as generic/550, except using v2 policies. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/585 b/tests/generic/585 index f9d28c72..05762b23 100755 --- a/tests/generic/585 +++ b/tests/generic/585 @@ -7,29 +7,13 @@ # Regression test for: # bc56ad8c74b8: ("xfs: Fix deadlock between AGI and AGF with RENAME_WHITEOUT") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rename -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/renameat2 -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch diff --git a/tests/generic/586 b/tests/generic/586 index d5bac5ea..8fe6567f 100755 --- a/tests/generic/586 +++ b/tests/generic/586 @@ -8,23 +8,17 @@ # simultaneously fallocating to the first block. Make sure that we end up # with a two-block file. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw prealloc +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $testfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic @@ -32,8 +26,6 @@ _require_aiodio "aio-dio-append-write-fallocate-race" _require_test _require_xfs_io_command "falloc" -rm -f $seqres.full - testfile=$TEST_DIR/test-$seq $AIO_TEST $testfile 100 >> $seqres.full diff --git a/tests/generic/587 b/tests/generic/587 index 066361cb..19b047ac 100755 --- a/tests/generic/587 +++ b/tests/generic/587 @@ -12,23 +12,10 @@ # This test accompanies the commit 2815a16d7ff623 "xfs: attach dquots and # reserve quota blocks during unwritten conversion". -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw prealloc quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -39,8 +26,6 @@ _require_quota _require_xfs_io_command "falloc" _require_scratch -rm -f $seqres.full - cat > $tmp.awk << ENDL { if (\$1 == qa_user && \$2 != blocks) diff --git a/tests/generic/588 b/tests/generic/588 index 9e19f2e7..563ff65e 100755 --- a/tests/generic/588 +++ b/tests/generic/588 @@ -9,13 +9,10 @@ # fsync it again, power fail and then mount the filesystem, we are able to # read the whole file and it has the correct data. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick log clone +# Override the default cleanup function. _cleanup() { _cleanup_flakey @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmflakey @@ -34,8 +30,6 @@ _supported_fs generic _require_scratch_reflink _require_dm_target flakey -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/generic/589 b/tests/generic/589 index ca22ce1f..c03cf1fc 100755 --- a/tests/generic/589 +++ b/tests/generic/589 @@ -22,15 +22,10 @@ # #----------------------------------------------------------------------- # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto mount +# Override the default cleanup function. _cleanup() { cd / @@ -40,13 +35,9 @@ _cleanup() rm -rf $MNTHEAD } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/generic/590 b/tests/generic/590 index d9ae9741..5f84d004 100755 --- a/tests/generic/590 +++ b/tests/generic/590 @@ -9,15 +9,10 @@ # bunmapi"). On XFS without the fixes, truncate will hang forever. On other # filesystems, this just tests writing into big fallocates. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto prealloc preallocrw +# Override the default cleanup function. _cleanup() { cd / @@ -26,11 +21,8 @@ _cleanup() rm -f "$TEST_DIR/$seq" } -. ./common/rc . ./common/filter -rm -f $seqres.full - _supported_fs generic _require_scratch_nocheck _require_xfs_io_command "falloc" diff --git a/tests/generic/591 b/tests/generic/591 index e243db10..5efc5136 100755 --- a/tests/generic/591 +++ b/tests/generic/591 @@ -6,23 +6,17 @@ # # Test using splice() to read from pipes. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw pipe splice +# Override the default cleanup function. _cleanup() { cd / rm -f $TEST_DIR/a } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic @@ -30,8 +24,6 @@ _require_test _require_odirect _require_test_program "splice-test" -rm -f $seqres.full - $here/src/splice-test -r $TEST_DIR/a $here/src/splice-test -rd $TEST_DIR/a $here/src/splice-test $TEST_DIR/a diff --git a/tests/generic/592 b/tests/generic/592 index 4aef6921..e74d2e12 100755 --- a/tests/generic/592 +++ b/tests/generic/592 @@ -8,29 +8,13 @@ # and use AES-256-XTS to encrypt file contents and AES-256-CTS-CBC to encrypt # file names. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/593 b/tests/generic/593 index 577c9cf7..f0610c57 100755 --- a/tests/generic/593 +++ b/tests/generic/593 @@ -8,29 +8,13 @@ # "fscrypt-provisioning" keyring key. This is an alternative to the normal # method where the raw key is given directly. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption -v 2 diff --git a/tests/generic/594 b/tests/generic/594 index 62a69723..88f9a0dc 100755 --- a/tests/generic/594 +++ b/tests/generic/594 @@ -7,29 +7,13 @@ # Test per-type(user, group and project) filesystem quota timers, make sure # each of grace time can be set/get properly. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch diff --git a/tests/generic/595 b/tests/generic/595 index 6c4f34d1..d559e3bb 100755 --- a/tests/generic/595 +++ b/tests/generic/595 @@ -10,15 +10,10 @@ # the corresponding fscrypt master key being removed. With f2fs, this bug could # also crash the kernel. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick encrypt +# Override the default cleanup function. _cleanup() { # Stop all subprocesses. @@ -28,14 +23,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption -v 2 diff --git a/tests/generic/596 b/tests/generic/596 index 8d5166a9..2113d7f1 100755 --- a/tests/generic/596 +++ b/tests/generic/596 @@ -8,28 +8,19 @@ # PF_MEMALLOC before exiting xfsaild thread"). If the bug exists, a kernel # WARNING should be triggered. See the commit message for details. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { $ACCTON_PROG off >> $seqres.full rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_bsd_process_accounting diff --git a/tests/generic/597 b/tests/generic/597 index 6602dc70..aa93237e 100755 --- a/tests/generic/597 +++ b/tests/generic/597 @@ -6,15 +6,10 @@ # # Test protected_symlink and protected_hardlink sysctls # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick perms +# Override the default cleanup function. _cleanup() { rm -rf $TEST_DIR/$seq @@ -26,13 +21,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/598 b/tests/generic/598 index 230c3ac7..160e6d4b 100755 --- a/tests/generic/598 +++ b/tests/generic/598 @@ -6,15 +6,10 @@ # # Test protected_regular and protected_fifos sysctls # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick perms +# Override the default cleanup function. _cleanup() { rm -rf $TEST_DIR/$seq @@ -26,13 +21,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/599 b/tests/generic/599 index bc2639fd..3fc86056 100755 --- a/tests/generic/599 +++ b/tests/generic/599 @@ -7,28 +7,14 @@ # # Test data integrity for ro remount. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick remount shutdown -here=`pwd` -tmp=/tmp/$$ status=0 -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_fssum diff --git a/tests/generic/600 b/tests/generic/600 index c4af4058..a4233ecc 100755 --- a/tests/generic/600 +++ b/tests/generic/600 @@ -10,29 +10,13 @@ # This test only exercises user quota because it's not known whether the # filesystem can set individual grace timers for each quota type # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch diff --git a/tests/generic/601 b/tests/generic/601 index d935d2e3..f3f3ec9e 100755 --- a/tests/generic/601 +++ b/tests/generic/601 @@ -10,29 +10,13 @@ # This test only exercises user quota because it's not known whether the # filesystem can set individual grace timers for each quota type # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch diff --git a/tests/generic/602 b/tests/generic/602 index ad5a9ebb..c5072fab 100755 --- a/tests/generic/602 +++ b/tests/generic/602 @@ -8,29 +8,13 @@ # and use AES-256-XTS to encrypt file contents and AES-256-CTS-CBC to encrypt # file names. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/603 b/tests/generic/603 index 006bb98b..b362a3d0 100755 --- a/tests/generic/603 +++ b/tests/generic/603 @@ -7,15 +7,10 @@ # Test per-type(user, group and project) filesystem quota timers, make sure # enforcement # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick quota +# Override the default cleanup function. _cleanup() { restore_project @@ -23,14 +18,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - require_project() { rm -f $tmp.projects $tmp.projid diff --git a/tests/generic/604 b/tests/generic/604 index 457ce206..3c6b76a4 100755 --- a/tests/generic/604 +++ b/tests/generic/604 @@ -7,28 +7,12 @@ # Evicting dirty inodes can take a long time during umount. # Check that a new mount racing with such a delayed umount succeeds. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick mount -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/605 b/tests/generic/605 index 1e2d7188..1db58491 100755 --- a/tests/generic/605 +++ b/tests/generic/605 @@ -6,28 +6,12 @@ # # Test per-inode DAX flag by mmap direct/buffered IO. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto attr quick dax -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs generic _require_scratch_dax_mountopt "dax=always" _require_test_program "feature" diff --git a/tests/generic/606 b/tests/generic/606 index f5f205e3..e066d93a 100755 --- a/tests/generic/606 +++ b/tests/generic/606 @@ -13,28 +13,12 @@ # 3) With dax=never option, FS_XFLAG_DAX is ignored and S_DAX flag # never exists on regular file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto attr quick dax -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs generic _require_scratch_dax_mountopt "dax=always" _require_dax_iflag diff --git a/tests/generic/607 b/tests/generic/607 index db4e7cf1..2cfe0773 100755 --- a/tests/generic/607 +++ b/tests/generic/607 @@ -10,28 +10,12 @@ # 3) mv operation make files and directories preserve the FS_XFLAG_DAX from old parent directory. # In addition, setting/clearing FS_XFLAG_DAX flag is not impacted by dax mount options. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto attr quick dax -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs generic _require_scratch _require_dax_iflag diff --git a/tests/generic/608 b/tests/generic/608 index c5bdac32..e36829c3 100755 --- a/tests/generic/608 +++ b/tests/generic/608 @@ -14,28 +14,12 @@ # It's a regression test for: # 'commit 88149082bb8e ("fs: Handle I_DONTCACHE in iput_final() instead of generic_drop_inode()"' -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto attr quick dax -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs generic _require_scratch_dax_mountopt "dax=always" _require_dax_iflag diff --git a/tests/generic/609 b/tests/generic/609 index 43c3ac8e..f955e986 100755 --- a/tests/generic/609 +++ b/tests/generic/609 @@ -8,15 +8,10 @@ # exercise O_DSYNC so any unsuspecting file systems will get lockdep warnings if # their locking isn't compatible. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw +# Override the default cleanup function. _cleanup() { cd / @@ -24,13 +19,9 @@ _cleanup() rm -rf $TEST_DIR/file } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_test diff --git a/tests/generic/610 b/tests/generic/610 index 8717f21d..f75cf979 100755 --- a/tests/generic/610 +++ b/tests/generic/610 @@ -8,21 +8,10 @@ # there are many small extents allocated. Verify the operation does not fail # and the respective range return zeroes on subsequent reads. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick prealloc zero + +# Import common functions. . ./common/filter # real QA test starts here @@ -32,8 +21,6 @@ _require_xfs_io_command "fzero" _require_xfs_io_command "fpunch" _require_test_program "punch-alternating" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/611 b/tests/generic/611 index 2c196f95..3dfeb02b 100755 --- a/tests/generic/611 +++ b/tests/generic/611 @@ -10,29 +10,13 @@ # This test verifies the problem fixed in kernel with commit # f4020438fab0 ("xfs: fix boundary test in xfs_attr_shortform_verify") -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick attr + +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/612 b/tests/generic/612 index 3588ef42..dd17944d 100755 --- a/tests/generic/612 +++ b/tests/generic/612 @@ -11,29 +11,13 @@ # upstream, and in the 5.4 stable tree with: # aee38af574a1 "xfs: trim IO to found COW extent limit" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/613 b/tests/generic/613 index 888ecf0a..4cf5ccc6 100755 --- a/tests/generic/613 +++ b/tests/generic/613 @@ -13,29 +13,13 @@ # In practice, they need to be random to achieve that; and it's easy enough to # test for both uniqueness and randomness, so we test for both. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick encrypt -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/encrypt -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_scratch_encryption -v 2 diff --git a/tests/generic/614 b/tests/generic/614 index 80edf9cd..06630f22 100755 --- a/tests/generic/614 +++ b/tests/generic/614 @@ -7,29 +7,16 @@ # Test that after doing a memory mapped write to an empty file, a call to # stat(2) reports a non-zero number of used blocks. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs generic _require_scratch -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/generic/615 b/tests/generic/615 index b36ab328..4979306d 100755 --- a/tests/generic/615 +++ b/tests/generic/615 @@ -8,21 +8,10 @@ # or direct IO writes, the number of used blocks reported by stat(2) is never # zero while writeback is in progress. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto rw -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -30,8 +19,6 @@ _supported_fs generic _require_scratch _require_odirect -rm -f $seqres.full - stat_loop() { trap "wait; exit" SIGTERM diff --git a/tests/generic/616 b/tests/generic/616 index e2792b47..538b480b 100755 --- a/tests/generic/616 +++ b/tests/generic/616 @@ -7,28 +7,12 @@ # IO_URING soak buffered fsx test, copy from generic/522 but reduce the number # fsx ops to limit the testing time to be an auto group test. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw io_uring stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/617 b/tests/generic/617 index 91e9e376..3bb3112e 100755 --- a/tests/generic/617 +++ b/tests/generic/617 @@ -7,28 +7,12 @@ # IO_URING soak direct-IO fsx test, copy from generic/521 but reduce the number # fsx ops to limit the testing time to be an auto group test. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw io_uring stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/generic/618 b/tests/generic/618 index f1c1605e..992b8457 100755 --- a/tests/generic/618 +++ b/tests/generic/618 @@ -11,29 +11,13 @@ # This test verifies the problem fixed in kernel with commit # ada49d64fb35 ("xfs: fix forkoff miscalculation related to XFS_LITINO(mp)") -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick attr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/619 b/tests/generic/619 index 460699d1..6e42d677 100755 --- a/tests/generic/619 +++ b/tests/generic/619 @@ -23,14 +23,8 @@ # 993778306e79 ("ext4: mballoc: use lock for checking free blocks while # retrying") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto rw enospc FS_SIZE=$((240*1024*1024)) # 240MB DEBUG=1 # set to 0 to disable debug statements in shell and c-prog @@ -45,19 +39,9 @@ SMALL_FILE_SIZE=$((512 * 1024)) # in Bytes BIG_FILE_SIZE=$((1536 * 1024)) # in Bytes MIX_FILE_SIZE=$((2048 * 1024)) # (BIG + SMALL small file size) -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_scratch diff --git a/tests/generic/620 b/tests/generic/620 index 60559441..b052376f 100755 --- a/tests/generic/620 +++ b/tests/generic/620 @@ -15,15 +15,10 @@ # This regression was fixed with following kernel commit commit b75dfde1212 # ("fibmap: Warn and return an error in case of block > INT_MAX") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto mount quick +# Override the default cleanup function. _cleanup() { _dmhugedisk_cleanup @@ -31,14 +26,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmhugedisk -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs generic _require_scratch_size_nocheck $((4 * 1024 * 1024)) #kB diff --git a/tests/generic/621 b/tests/generic/621 index 989bd7ce..8c204eb8 100755 --- a/tests/generic/621 +++ b/tests/generic/621 @@ -35,15 +35,10 @@ # To test this, we try to reproduce the above race. Afterwards we check for # duplicate filenames, plus a few other things. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick encrypt +# Override the default cleanup function. _cleanup() { touch $tmp.done @@ -51,13 +46,10 @@ _cleanup() rm -f $tmp.* } -. ./common/rc . ./common/filter . ./common/encrypt . ./common/renameat2 -rm -f $seqres.full - _supported_fs generic _require_scratch_encryption -v 2 _require_renameat2 noreplace diff --git a/tests/generic/622 b/tests/generic/622 index a2096167..e03fdd71 100755 --- a/tests/generic/622 +++ b/tests/generic/622 @@ -16,14 +16,8 @@ # ("fs: fix lazytime expiration handling in __writeback_single_inode()"). # This test failed on XFS without that commit. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto shutdown metadata atime DIRTY_EXPIRE_CENTISECS_ORIG=$( $seqres.full _require_metadata_journaling $SCRATCH_DEV diff --git a/tests/generic/629 b/tests/generic/629 index 13d433a4..abfa90ab 100755 --- a/tests/generic/629 +++ b/tests/generic/629 @@ -10,15 +10,10 @@ # remounting to check file contents. This is a regression test for commit # 5ffce3cc22a0 ("xfs: force the log after remapping a synchronous-writes file") -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw copy_range +# Override the default cleanup function. _cleanup() { cd / @@ -27,8 +22,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror @@ -39,8 +33,6 @@ _require_xfs_io_command "chattr" "s" _require_xfs_io_command "copy_range" _require_scratch -rm -f $seqres.full - # Format filesystem and set up quota limits _scratch_mkfs > $seqres.full _require_metadata_journaling $SCRATCH_DEV diff --git a/tests/generic/630 b/tests/generic/630 index 49cb1068..f1ea6b17 100755 --- a/tests/generic/630 +++ b/tests/generic/630 @@ -8,23 +8,10 @@ # to the file after the dedupe prep function has decided that the file contents # are identical and we can therefore go ahead with the remapping. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick rw dedupe clone + +# Import common functions. . ./common/reflink # real QA test starts here @@ -32,8 +19,6 @@ _supported_fs generic _require_scratch_dedupe _require_test_program "deduperace" -rm -f $seqres.full - nr_ops=$((TIME_FACTOR * 10000)) # Format filesystem diff --git a/tests/generic/631 b/tests/generic/631 index a4f42f03..a1acdedb 100755 --- a/tests/generic/631 +++ b/tests/generic/631 @@ -21,15 +21,10 @@ # This is a regression test for commit 6da1b4b1ab36 ("xfs: fix an ABBA deadlock # in xfs_rename"). -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto rw overlay rename +# Override the default cleanup function. _cleanup() { stop_workers @@ -37,8 +32,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr # real QA test starts here @@ -48,8 +42,6 @@ _require_attrs test "$FSTYP" = "overlay" && _notrun "Test does not apply to overlayfs." _require_extra_fs overlay -rm -f $seqres.full - _scratch_mkfs >> $seqres.full _scratch_mount _supports_filetype $SCRATCH_MNT || _notrun "overlayfs test requires d_type" diff --git a/tests/generic/632 b/tests/generic/632 index 206b6c13..4d6928a6 100755 --- a/tests/generic/632 +++ b/tests/generic/632 @@ -16,24 +16,8 @@ # Kernel commit ee2e3f50629f ("mount: fix mounting of detached mounts onto # targets that reside on shared mounts") fixed the bug. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -. ./common/rc - -rm -f $seqres.full +. ./common/preamble +_begin_fstest auto quick mount _supported_fs generic _require_test diff --git a/tests/generic/633 b/tests/generic/633 index b4111740..6be8a69e 100755 --- a/tests/generic/633 +++ b/tests/generic/633 @@ -6,28 +6,12 @@ # # Test that idmapped mounts behave correctly. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick atime attr cap idmapped io_uring mount perms rw unlink -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic diff --git a/tests/generic/634 b/tests/generic/634 index 21e46e1b..5cdae584 100755 --- a/tests/generic/634 +++ b/tests/generic/634 @@ -18,30 +18,15 @@ # and fails. If you see a failure on such a kernel, contact your distributor # for an update. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick atime bigtime -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic _require_scratch -rm -f $seqres.full - _scratch_mkfs > $seqres.full _scratch_mount diff --git a/tests/generic/635 b/tests/generic/635 index 714f9e27..198278c4 100755 --- a/tests/generic/635 +++ b/tests/generic/635 @@ -19,31 +19,16 @@ # and fails. If you see a failure on such a kernel, contact your distributor # for an update. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick atime bigtime shutdown -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs generic _require_scratch _require_scratch_shutdown -rm -f $seqres.full - _scratch_mkfs > $seqres.full _scratch_mount diff --git a/tests/generic/636 b/tests/generic/636 index 2f176877..10e658b6 100755 --- a/tests/generic/636 +++ b/tests/generic/636 @@ -7,28 +7,12 @@ # Test invalid swap files. # Empty swap file (only swap header) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick swap -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs generic _require_scratch_swapfile _require_test_program mkswap diff --git a/tests/generic/637 b/tests/generic/637 index 3ece88d4..8805a171 100755 --- a/tests/generic/637 +++ b/tests/generic/637 @@ -5,31 +5,16 @@ # Check that directory modifications to an open dir are observed # by a new open fd # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - cd / - rm -f $tmp.* -} -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick dir + +# Import common functions. . ./common/filter # real QA test starts here _supported_fs generic _require_test -rm -f $seqres.full - testdir=$TEST_DIR/test-$seq rm -rf $testdir mkdir $testdir diff --git a/tests/generic/638 b/tests/generic/638 index 31c0c868..fff25e66 100755 --- a/tests/generic/638 +++ b/tests/generic/638 @@ -19,28 +19,12 @@ # This's a regression test cover kernel commit: # 4f06dd92b5d0 ("fuse: fix write deadlock") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs generic _require_test diff --git a/tests/nfs/001 b/tests/nfs/001 index 662effc2..5b5f0828 100755 --- a/tests/nfs/001 +++ b/tests/nfs/001 @@ -9,28 +9,19 @@ # ERANGE. Upstream commit ed92d8c137b7 ("NFSv4: fix getacl ERANGE for some ACL # buffer sizes") fixed this bug. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick nfs4_acl acl +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $acltest.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs nfs _require_test_nfs_version 4 diff --git a/tests/ocfs2/001 b/tests/ocfs2/001 index 4816532d..76c6b9dc 100755 --- a/tests/ocfs2/001 +++ b/tests/ocfs2/001 @@ -6,23 +6,10 @@ # # Ensure that reflink works correctly with inline-data files. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -31,8 +18,6 @@ _supported_fs ocfs2 _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs --fs-features=local,unwritten,refcount,inline-data > $seqres.full 2>&1 tunefs.ocfs2 --query '%H' $SCRATCH_DEV | grep -q 'inline-data' || \ diff --git a/tests/overlay/001 b/tests/overlay/001 index 880d6a9b..c24d37a9 100755 --- a/tests/overlay/001 +++ b/tests/overlay/001 @@ -9,28 +9,12 @@ # Kernel commit 0480334fa604 ("ovl: use O_LARGEFILE in ovl_copy_up()") # fixed bug when copying up large file from lower dir. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/002 b/tests/overlay/002 index 18847a0e..11300edf 100755 --- a/tests/overlay/002 +++ b/tests/overlay/002 @@ -11,28 +11,12 @@ # memory access) when the lower or upper directory belonged to a btrfs file # system. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metadata -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/003 b/tests/overlay/003 index 05266ac1..9ee69398 100755 --- a/tests/overlay/003 +++ b/tests/overlay/003 @@ -12,28 +12,12 @@ # prevents mounting overlayfs like this since v4.6-rc1. # No harm to keep this test as a sanity check. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick whiteout -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/overlay/004 b/tests/overlay/004 index cae3016f..54ce8a8f 100755 --- a/tests/overlay/004 +++ b/tests/overlay/004 @@ -6,28 +6,12 @@ # # Test file copy up on overlayfs by changing mode bits. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest attr auto copyup quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs overlay _require_scratch diff --git a/tests/overlay/005 b/tests/overlay/005 index 3a2ed27e..a2b9c1d3 100755 --- a/tests/overlay/005 +++ b/tests/overlay/005 @@ -8,15 +8,10 @@ # when unmount the underlying fs. # Kernel commit ab79efab0 fixed this issue. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto copyup quick +# Override the default cleanup function. _cleanup() { cd / @@ -27,13 +22,9 @@ _cleanup() rm -f $upper_img } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/overlay/006 b/tests/overlay/006 index 43d349d2..73eb80c9 100755 --- a/tests/overlay/006 +++ b/tests/overlay/006 @@ -10,26 +10,11 @@ # Upstream commit 45d117389696 ("ovl: ignore lower entries when checking purity # of non-directory entries") fixed the issue # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick copyup whiteout -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/007 b/tests/overlay/007 index 05475d93..5cd97de8 100755 --- a/tests/overlay/007 +++ b/tests/overlay/007 @@ -9,15 +9,10 @@ # Upstream commit ce9113bbcbf4 ("ovl: fix getcwd() failure after unsuccessful # rmdir") fixed this issue # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -25,12 +20,9 @@ _cleanup() rm -rf $TEST_DIR/$seq } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_test diff --git a/tests/overlay/008 b/tests/overlay/008 index e14f17f4..d14f22f2 100755 --- a/tests/overlay/008 +++ b/tests/overlay/008 @@ -10,27 +10,12 @@ # This upstream kernel patch fixed the issue # d0e13f5 ovl: fix uid/gid when creating over whiteout # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick whiteout -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/009 b/tests/overlay/009 index 57512a34..94bd1b66 100755 --- a/tests/overlay/009 +++ b/tests/overlay/009 @@ -9,27 +9,12 @@ # This is fixed by kernel commit named as # ovl: fix dentry leak for default_permissions # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/010 b/tests/overlay/010 index d2fb08f4..71ef6ec1 100755 --- a/tests/overlay/010 +++ b/tests/overlay/010 @@ -9,27 +9,12 @@ # The following kernel commit fixed the kernel crash on the removal # 84889d4 ovl: check dentry positiveness in ovl_cleanup_whiteouts() # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick whiteout -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs overlay # Use non-default scratch underlying overlay dirs, we need to check diff --git a/tests/overlay/011 b/tests/overlay/011 index 0c2d3bcd..20812d88 100755 --- a/tests/overlay/011 +++ b/tests/overlay/011 @@ -10,28 +10,13 @@ # # Commit b581755b1c56 ("ovl: xattr filter fix") fixed this issue. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_test diff --git a/tests/overlay/012 b/tests/overlay/012 index d1eba7bf..ee6e1bf3 100755 --- a/tests/overlay/012 +++ b/tests/overlay/012 @@ -11,26 +11,11 @@ # Commit cfc9fde0b07c ("ovl: verify upper dentry in # ovl_remove_and_whiteout()") fixed this issue. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/013 b/tests/overlay/013 index 49002bf5..51fd2397 100755 --- a/tests/overlay/013 +++ b/tests/overlay/013 @@ -8,27 +8,12 @@ # truncate(2) should return ETXTBSY, not other errno nor segfault # # Commit 03bea6040932 ("ovl: get_write_access() in truncate") fixed this issue. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/014 b/tests/overlay/014 index 6c0a14f1..83295ccc 100755 --- a/tests/overlay/014 +++ b/tests/overlay/014 @@ -13,28 +13,12 @@ # # This is fixed by "ovl: don't copy up opaqueness". # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay # Use non-default scratch underlying overlay dirs, we need to check diff --git a/tests/overlay/015 b/tests/overlay/015 index 0f5e4afe..fd23e373 100755 --- a/tests/overlay/015 +++ b/tests/overlay/015 @@ -6,28 +6,12 @@ # # SGID bit inheritance over whiteout. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick whiteout -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/016 b/tests/overlay/016 index d3f5babf..8a091615 100755 --- a/tests/overlay/016 +++ b/tests/overlay/016 @@ -11,22 +11,10 @@ # - process B writes new data to file F # - process A reads old data from file F # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +22,6 @@ _supported_fs overlay _require_scratch _require_xfs_io_command "open" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 # Create our test files. @@ -45,7 +31,6 @@ echo "This is old news" > $lowerdir/foo _scratch_mount - # # open file for read (rofd) # open file for write (rwfd) diff --git a/tests/overlay/017 b/tests/overlay/017 index 8991a9f1..15b0d613 100755 --- a/tests/overlay/017 +++ b/tests/overlay/017 @@ -15,23 +15,10 @@ # and if inode numbers persist after rename, drop caches and # mount cycle. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup redirect -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -42,8 +29,6 @@ _require_test_program "t_dir_type" # Require redirect_dir for renaming a merge directory _require_scratch_feature redirect_dir -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 # Create our test files. diff --git a/tests/overlay/018 b/tests/overlay/018 index ce250792..b09bca9c 100755 --- a/tests/overlay/018 +++ b/tests/overlay/018 @@ -11,21 +11,10 @@ # - modify A to trigger copy up # - file A is no longer a hardlink of file B # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup hardlink -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +23,6 @@ _require_scratch _require_scratch_feature index _require_test_program "t_dir_type" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 # Create 2 hardlinked files in lower @@ -44,7 +31,6 @@ mkdir -p $lowerdir echo "zero" >> $lowerdir/foo ln $lowerdir/foo $lowerdir/bar - # Record inode numbers in format function record_ino_nlink() { @@ -76,7 +62,6 @@ function check_ino_nlink() # Enable overlay index feature to prevent breaking hardlinks on copy up _scratch_mount -o index=on - rm -f $tmp.* foo=$SCRATCH_MNT/foo diff --git a/tests/overlay/019 b/tests/overlay/019 index 2da4bf52..72c8a5a4 100755 --- a/tests/overlay/019 +++ b/tests/overlay/019 @@ -6,28 +6,12 @@ # # Run fsstress on lower dir and top dir at the same time # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch_nocheck diff --git a/tests/overlay/020 b/tests/overlay/020 index cebb1758..51f97ccd 100755 --- a/tests/overlay/020 +++ b/tests/overlay/020 @@ -8,28 +8,12 @@ # ovl: override creds with the ones from the superblock mounter # Testing ovl copyup/namespace/cred issue. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copyup perms -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here require_unshare() { diff --git a/tests/overlay/021 b/tests/overlay/021 index 2933d23d..19c4b5ca 100755 --- a/tests/overlay/021 +++ b/tests/overlay/021 @@ -6,28 +6,12 @@ # # Test concurrent copy up # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/022 b/tests/overlay/022 index a1d85a78..1a11805d 100755 --- a/tests/overlay/022 +++ b/tests/overlay/022 @@ -10,15 +10,10 @@ # This reproducer was originally written by # Miklos Szeredi # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mount nested +# Override the default cleanup function. _cleanup() { cd / @@ -27,13 +22,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/overlay/023 b/tests/overlay/023 index c05e9d3a..95d5aa22 100755 --- a/tests/overlay/023 +++ b/tests/overlay/023 @@ -13,29 +13,13 @@ # This reproducer was originally written by # Miklos Szeredi # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick attr + +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/overlay/024 b/tests/overlay/024 index 9f81a108..d9a3e409 100755 --- a/tests/overlay/024 +++ b/tests/overlay/024 @@ -13,28 +13,12 @@ # This reproducer was originally written by # Miklos Szeredi # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick mount -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/overlay/025 b/tests/overlay/025 index c5f328c8..3e237910 100755 --- a/tests/overlay/025 +++ b/tests/overlay/025 @@ -12,15 +12,10 @@ # This reproducer was originally written by # Miklos Szeredi # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick attr +# Override the default cleanup function. _cleanup() { cd / @@ -30,13 +25,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/overlay/026 b/tests/overlay/026 index 54f5fb3b..77030d20 100755 --- a/tests/overlay/026 +++ b/tests/overlay/026 @@ -24,29 +24,13 @@ # This reproducer was originally written by # Miklos Szeredi # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto attr quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/overlay/027 b/tests/overlay/027 index e99cddc8..aa47bd7a 100755 --- a/tests/overlay/027 +++ b/tests/overlay/027 @@ -13,15 +13,10 @@ # This reproducer was originally written by # Miklos Szeredi # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick perms +# Override the default cleanup function. _cleanup() { cd / @@ -29,13 +24,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/overlay/028 b/tests/overlay/028 index 9759db6d..2b56aa75 100755 --- a/tests/overlay/028 +++ b/tests/overlay/028 @@ -13,28 +13,12 @@ # This reproducer was originally written by # Miklos Szeredi # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto copyup quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/overlay/029 b/tests/overlay/029 index 02d86d73..1a532c2a 100755 --- a/tests/overlay/029 +++ b/tests/overlay/029 @@ -15,15 +15,10 @@ # This reproducer was originally written by # Miklos Szeredi # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick nested +# Override the default cleanup function. _cleanup() { cd / @@ -32,13 +27,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/overlay/030 b/tests/overlay/030 index c461e502..6c207d2a 100755 --- a/tests/overlay/030 +++ b/tests/overlay/030 @@ -14,25 +14,20 @@ # fail to prepare immutable/append-only directories on the overlay # mount path. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick perms -here=`pwd` timmutable=$here/src/t_immutable upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { $timmutable -r $upperdir/t_immutable &> /dev/null rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs overlay diff --git a/tests/overlay/031 b/tests/overlay/031 index 6e0a5fb7..8fdf482b 100755 --- a/tests/overlay/031 +++ b/tests/overlay/031 @@ -9,20 +9,8 @@ # and remount overlay. This may lead to whiteouts exposure and # rmdir failure. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick whiteout # create test directory and test file, mount overlayfs and remove # testfile to create a whiteout in upper dir. @@ -43,12 +31,9 @@ create_whiteout() $UMOUNT_PROG $SCRATCH_MNT } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch_nocheck diff --git a/tests/overlay/032 b/tests/overlay/032 index bd39322a..2c8221a0 100755 --- a/tests/overlay/032 +++ b/tests/overlay/032 @@ -12,27 +12,12 @@ # should end up being upper hardlinks and both metadata changes should be # applied. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup hardlink -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/033 b/tests/overlay/033 index 75d3ed48..15175cdf 100755 --- a/tests/overlay/033 +++ b/tests/overlay/033 @@ -9,27 +9,12 @@ # nlink of overlay inode should account for the union of lower and upper # hardlinks. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup hardlink -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/034 b/tests/overlay/034 index c2620f95..fcecb387 100755 --- a/tests/overlay/034 +++ b/tests/overlay/034 @@ -23,27 +23,12 @@ # With overlayfs indexed copy up and without the fix, the test triggers # WARN_ON(inode->i_nlink == 0) in drop_link(). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup hardlink -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/035 b/tests/overlay/035 index 638b92a1..8cd76979 100755 --- a/tests/overlay/035 +++ b/tests/overlay/035 @@ -9,15 +9,10 @@ # - No upper dir # - Failure to create work dir # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mount +# Override the default cleanup function. _cleanup() { cd / @@ -25,13 +20,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay # Use non-default scratch underlying overlay dirs, we need to check diff --git a/tests/overlay/036 b/tests/overlay/036 index 849c5608..5a93d480 100755 --- a/tests/overlay/036 +++ b/tests/overlay/036 @@ -25,15 +25,10 @@ # - Upper dir is in-use by another overlay mount # - Work dir is in-use by another overlay mount # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mount +# Override the default cleanup function. _cleanup() { cd / @@ -43,13 +38,9 @@ _cleanup() $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay # Use non-default scratch underlying overlay dirs, we need to check diff --git a/tests/overlay/037 b/tests/overlay/037 index e63acb8c..c188088e 100755 --- a/tests/overlay/037 +++ b/tests/overlay/037 @@ -14,28 +14,12 @@ # # Failure to verify lowerdir/upperdir on mount results in ESTALE. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick mount -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay # Use non-default scratch underlying overlay dirs, we need to check diff --git a/tests/overlay/038 b/tests/overlay/038 index 6383c721..145b4b34 100755 --- a/tests/overlay/038 +++ b/tests/overlay/038 @@ -6,23 +6,10 @@ # # Test consistent d_ino numbers for samefs setup. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick copyup + +# Import common functions. . ./common/filter . ./common/attr @@ -34,8 +21,6 @@ _require_scratch_nocheck _require_attrs trusted _require_test_program "t_dir_type" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 # Create our test files. diff --git a/tests/overlay/039 b/tests/overlay/039 index d4d1028c..21efa2f2 100755 --- a/tests/overlay/039 +++ b/tests/overlay/039 @@ -9,28 +9,12 @@ # Upstream Commit cd91304e7190 ("ovl: fix relatime for directories") # fixed this issue. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick atime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/040 b/tests/overlay/040 index bed3f58a..9f4da94b 100755 --- a/tests/overlay/040 +++ b/tests/overlay/040 @@ -13,15 +13,10 @@ # ioctl on lower layer") return EPERM for this case to avoid # this issue. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -30,13 +25,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/041 b/tests/overlay/041 index 1a33088d..762e7389 100755 --- a/tests/overlay/041 +++ b/tests/overlay/041 @@ -8,23 +8,10 @@ # This is a variant of overlay/038 to test consistent d_ino numbers # for non-samefs setup. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick copyup nonsamefs + +# Import common functions. . ./common/filter . ./common/attr @@ -37,8 +24,6 @@ _require_test _require_attrs trusted _require_test_program "t_dir_type" -rm -f $seqres.full - lowerdir=$OVL_BASE_TEST_DIR/$seq-ovl-lower rm -rf $lowerdir mkdir $lowerdir diff --git a/tests/overlay/042 b/tests/overlay/042 index 27e4c38f..60f4b477 100755 --- a/tests/overlay/042 +++ b/tests/overlay/042 @@ -18,26 +18,11 @@ # This test verifies that behavior is sane after creating lower hardlinks # for copied up files while overlayfs is offline. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick copyup hardlink -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/043 b/tests/overlay/043 index 340c3310..383151dd 100755 --- a/tests/overlay/043 +++ b/tests/overlay/043 @@ -17,23 +17,10 @@ # and if inode numbers persist after rename, drop caches and # mount cycle. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup nonsamefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -47,8 +34,6 @@ _require_test_program "t_dir_type" # Require redirect_dir for renaming a merge directory _require_scratch_feature redirect_dir -rm -f $seqres.full - lowerdir=$OVL_BASE_TEST_DIR/$seq-ovl-lower rm -rf $lowerdir mkdir $lowerdir diff --git a/tests/overlay/044 b/tests/overlay/044 index 26fe91d4..3f54b7ea 100755 --- a/tests/overlay/044 +++ b/tests/overlay/044 @@ -12,21 +12,10 @@ # - modify A to trigger copy up # - file A is no longer a hardlink of file B # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup hardlink nonsamefs -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -38,8 +27,6 @@ _require_test _require_scratch_feature index _require_test_program "t_dir_type" -rm -f $seqres.full - # Record inode numbers in format function record_ino_nlink() { diff --git a/tests/overlay/045 b/tests/overlay/045 index 210100f9..fd826427 100755 --- a/tests/overlay/045 +++ b/tests/overlay/045 @@ -6,29 +6,13 @@ # # Test fsck.overlay how to deal with whiteouts in overlayfs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fsck -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch_nocheck diff --git a/tests/overlay/046 b/tests/overlay/046 index b559add5..b7f1b710 100755 --- a/tests/overlay/046 +++ b/tests/overlay/046 @@ -6,29 +6,13 @@ # # Test fsck.overlay how to deal with redirect xattr in overlayfs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fsck -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch_nocheck diff --git a/tests/overlay/047 b/tests/overlay/047 index 8d586fef..fb0bac19 100755 --- a/tests/overlay/047 +++ b/tests/overlay/047 @@ -11,21 +11,10 @@ # - unlink A and mount cycle # - check that B still contains the modified data # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup hardlink -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +22,6 @@ _supported_fs overlay _require_scratch _require_scratch_feature index -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 # Create 2 hardlinked files in lower @@ -43,11 +30,9 @@ mkdir -p $lowerdir echo "zero" >> $lowerdir/foo ln $lowerdir/foo $lowerdir/bar - # Enable overlay index feature to prevent breaking hardlinks on copy up _scratch_mount -o index=on - rm -f $tmp.* foo=$SCRATCH_MNT/foo diff --git a/tests/overlay/048 b/tests/overlay/048 index bafe375a..7fe6e17c 100755 --- a/tests/overlay/048 +++ b/tests/overlay/048 @@ -10,27 +10,12 @@ # hardlinks. Orphan index inodes with union nlink 0 should be cleaned on # mount. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup hardlink -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/049 b/tests/overlay/049 index 15b9f106..8dd41bd7 100755 --- a/tests/overlay/049 +++ b/tests/overlay/049 @@ -16,20 +16,8 @@ # The check for multiply redirected dir was a by-product of kernel # commit 31747eda41ef ("ovl: hash directory inodes for fsnotify") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copyup redirect # Rename lower dir to create a redirected upper dir and # touch lower file to create copy up with origin xattr @@ -47,12 +35,9 @@ create_redirect() $UMOUNT_PROG $SCRATCH_MNT } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch_nocheck diff --git a/tests/overlay/050 b/tests/overlay/050 index 5c800e4a..e24338e1 100755 --- a/tests/overlay/050 +++ b/tests/overlay/050 @@ -14,23 +14,10 @@ # This test requires and enables overlayfs NFS export support. # NFS export support depends on and requires overlayfs index feature. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup hardlink exportfs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/overlay/051 b/tests/overlay/051 index 1c4b41e3..4b26dd84 100755 --- a/tests/overlay/051 +++ b/tests/overlay/051 @@ -17,15 +17,10 @@ # This test requires and enables overlayfs NFS export support. # NFS export support depends on and requires overlayfs index feature. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick copyup hardlink exportfs nonsamefs +# Override the default cleanup function. _cleanup() { cd / @@ -36,8 +31,7 @@ _cleanup() $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/overlay/052 b/tests/overlay/052 index 385b8b52..da8c645b 100755 --- a/tests/overlay/052 +++ b/tests/overlay/052 @@ -15,23 +15,10 @@ # dir rename support (redirect_dir). # NFS export support depends on and requires overlayfs index feature. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup redirect exportfs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/overlay/053 b/tests/overlay/053 index 35d3a8a8..dfa29d01 100755 --- a/tests/overlay/053 +++ b/tests/overlay/053 @@ -19,15 +19,10 @@ # dir rename support (redirect_dir). # NFS export support depends on and requires overlayfs index feature. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick copyup redirect exportfs nonsamefs +# Override the default cleanup function. _cleanup() { cd / @@ -38,8 +33,7 @@ _cleanup() $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/overlay/054 b/tests/overlay/054 index 6a774313..d95427b6 100755 --- a/tests/overlay/054 +++ b/tests/overlay/054 @@ -28,23 +28,10 @@ # Regression test for kernel commit 2ca3c148a062 ("ovl: check lower ancestry # on encode of lower dir file handle") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup redirect exportfs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/overlay/055 b/tests/overlay/055 index 50ad9b2f..45a3c107 100755 --- a/tests/overlay/055 +++ b/tests/overlay/055 @@ -26,15 +26,10 @@ # Regression test for kernel commit 2ca3c148a062 ("ovl: check lower ancestry # on encode of lower dir file handle") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick copyup redirect exportfs nonsamefs +# Override the default cleanup function. _cleanup() { cd / @@ -45,8 +40,7 @@ _cleanup() $UMOUNT_PROG $SCRATCH_MNT 2>/dev/null } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/overlay/056 b/tests/overlay/056 index b3acd8b6..0516acbb 100755 --- a/tests/overlay/056 +++ b/tests/overlay/056 @@ -6,29 +6,13 @@ # # Test fsck.overlay how to deal with impure xattr in overlayfs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fsck -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch_nocheck diff --git a/tests/overlay/057 b/tests/overlay/057 index 2757b2e5..4bfc32a4 100755 --- a/tests/overlay/057 +++ b/tests/overlay/057 @@ -19,28 +19,12 @@ # "redirect" directory in upper should merge with lower1:/a/b/c/ and # lower0:/a/b/d/, despite lower1:/a/b/ being opaque. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick redirect -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay # We use non-default scratch underlying overlay dirs, we need to check diff --git a/tests/overlay/058 b/tests/overlay/058 index d2596121..7352482e 100755 --- a/tests/overlay/058 +++ b/tests/overlay/058 @@ -15,15 +15,10 @@ # This test requires and enables overlayfs NFS export support. # NFS export support depends on and requires overlayfs index feature. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick exportfs +# Override the default cleanup function. _cleanup() { $KILLALL_PROG -9 open_by_handle >/dev/null 2>&1 @@ -32,8 +27,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/overlay/059 b/tests/overlay/059 index a04adb02..01720c5f 100755 --- a/tests/overlay/059 +++ b/tests/overlay/059 @@ -17,20 +17,8 @@ # The check for multiply referenced origin was a by-product of kernel # commit 31747eda41ef ("ovl: hash directory inodes for fsnotify") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick copyup # Rename lower file to create copy up with origin xattr create_origin_ref() @@ -48,12 +36,9 @@ create_origin_ref() $UMOUNT_PROG $SCRATCH_MNT } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch_nocheck diff --git a/tests/overlay/060 b/tests/overlay/060 index de866014..733245db 100755 --- a/tests/overlay/060 +++ b/tests/overlay/060 @@ -6,29 +6,13 @@ # # Test metadata only copy up functionality. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metacopy -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay # We use non-default scratch underlying overlay dirs, we need to check diff --git a/tests/overlay/061 b/tests/overlay/061 index 54a28c3d..b80cf5a0 100755 --- a/tests/overlay/061 +++ b/tests/overlay/061 @@ -14,22 +14,10 @@ # - process B writes new data to shared mmap # - process A reads old data from shared mmap # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest posix copyup -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,8 +25,6 @@ _supported_fs overlay _require_scratch _require_xfs_io_command "open" -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 # Create our test files. @@ -48,7 +34,6 @@ echo "This is old news" > $lowerdir/foo _scratch_mount - filter_xfs_io_mmap() { # filter out these lines: diff --git a/tests/overlay/062 b/tests/overlay/062 index e5224242..04e13e46 100755 --- a/tests/overlay/062 +++ b/tests/overlay/062 @@ -10,15 +10,10 @@ # commit 8b58924ad55c ("ovl: lookup in inode cache first when decoding # lower file handle"). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick exportfs +# Override the default cleanup function. _cleanup() { cd / @@ -26,8 +21,7 @@ _cleanup() $UMOUNT_PROG $lowertestdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/overlay/063 b/tests/overlay/063 index 69c338e4..94726000 100755 --- a/tests/overlay/063 +++ b/tests/overlay/063 @@ -9,27 +9,11 @@ # The following kernel commit fixed the kernel crash: 5e1275808630 ("ovl: check # whiteout in ovl_create_over_whiteout()") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick whiteout -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/064 b/tests/overlay/064 index 8d3d1e4c..1dd6bd6c 100755 --- a/tests/overlay/064 +++ b/tests/overlay/064 @@ -6,28 +6,12 @@ # # Make sure CAP_SETUID is not cleared over file copy up. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/065 b/tests/overlay/065 index 481d8cca..5f3fe097 100755 --- a/tests/overlay/065 +++ b/tests/overlay/065 @@ -22,15 +22,10 @@ # and its followup fix commit: # 0be0bfd2de9d "ovl: fix regression caused by overlapping layers detection" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mount +# Override the default cleanup function. _cleanup() { cd / @@ -38,13 +33,9 @@ _cleanup() $UMOUNT_PROG $mnt2 2>/dev/null } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay # Use non-default scratch underlying overlay dirs, we need to check diff --git a/tests/overlay/066 b/tests/overlay/066 index 463fdf10..163e74f1 100755 --- a/tests/overlay/066 +++ b/tests/overlay/066 @@ -7,28 +7,12 @@ # # Test overlayfs copy-up function for variant sparse files. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks. -. ./common/rc +# Import common functions.. . ./common/filter -# remove previous $seqres.full before test. -rm -f $seqres.full - # real QA test starts here. # Modify as appropriate. @@ -124,7 +108,6 @@ while [ $pos -le $max_pos ]; do done echo >>$seqres.full - # Create test file with many random holes(hole size is between 1M and 5M), # total file size is 100M. diff --git a/tests/overlay/067 b/tests/overlay/067 index 7f7507c2..7dddb265 100755 --- a/tests/overlay/067 +++ b/tests/overlay/067 @@ -12,26 +12,11 @@ # This is a regression test for kernel commit: # 9c6d8f13e9da ovl: fix corner case of non-unique st_dev;st_ino # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick copyup nonsamefs -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/068 b/tests/overlay/068 index 378e232c..bc3cd569 100755 --- a/tests/overlay/068 +++ b/tests/overlay/068 @@ -19,15 +19,10 @@ # because name_to_handle_at() syscall does not support requesting connectable # file handles. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick copyup hardlink exportfs nested +# Override the default cleanup function. _cleanup() { cd / @@ -36,8 +31,7 @@ _cleanup() $UMOUNT_PROG $mnt2 2>/dev/null } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/overlay/069 b/tests/overlay/069 index 690cf943..b4e54432 100755 --- a/tests/overlay/069 +++ b/tests/overlay/069 @@ -19,15 +19,10 @@ # because name_to_handle_at() syscall does not support requesting connectable # file handles. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick copyup hardlink exportfs nested nonsamefs +# Override the default cleanup function. _cleanup() { cd / @@ -36,8 +31,7 @@ _cleanup() $UMOUNT_PROG $mnt2 2>/dev/null } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/overlay/070 b/tests/overlay/070 index 970bb9ee..d433279a 100755 --- a/tests/overlay/070 +++ b/tests/overlay/070 @@ -17,15 +17,10 @@ # consistent with st_ino and that inode numbers persist after rename to # new parent, drop caches and mount cycle. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick copyup redirect nested +# Override the default cleanup function. _cleanup() { cd / @@ -35,8 +30,7 @@ _cleanup() [ -z "$loopdev" ] || _destroy_loop_device $loopdev } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -171,8 +165,6 @@ check_inode_numbers() done } -rm -f $seqres.full - create_dirs create_test_files $lowerdir diff --git a/tests/overlay/071 b/tests/overlay/071 index 90770936..2ef28369 100755 --- a/tests/overlay/071 +++ b/tests/overlay/071 @@ -20,15 +20,10 @@ # its st_ino/d_ino/i_ino values are not consistent, so test only non-dir # in this test. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick copyup redirect nested nonsamefs +# Override the default cleanup function. _cleanup() { cd / @@ -38,8 +33,7 @@ _cleanup() [ -z "$loopdev" ] || _destroy_loop_device $loopdev } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -181,8 +175,6 @@ check_inode_numbers() done } -rm -f $seqres.full - create_dirs create_test_files $lowerdir diff --git a/tests/overlay/072 b/tests/overlay/072 index 7eea922a..bdb608ff 100755 --- a/tests/overlay/072 +++ b/tests/overlay/072 @@ -20,27 +20,12 @@ # Without the fix, the test triggers # WARN_ON(inode->i_nlink == 0) in drop_link(). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copyup hardlink -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/073 b/tests/overlay/073 index e4203295..53ba0d6a 100755 --- a/tests/overlay/073 +++ b/tests/overlay/073 @@ -15,28 +15,12 @@ # one inode in upper layer, without this feature every whiteout object # will consume one inode in upper layer. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick whiteout -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/074 b/tests/overlay/074 index 6cbf16be..833e7919 100755 --- a/tests/overlay/074 +++ b/tests/overlay/074 @@ -13,23 +13,10 @@ # Fixed by kernel commit 9aafc1b01873: # ovl: potential crash in ovl_fid_to_fh() # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick exportfs dangerous -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -41,8 +28,6 @@ _require_test_program "open_by_handle" # be enabled when index is disabled _require_scratch_overlay_features index nfs_export -rm -f $seqres.full - _scratch_mkfs _scratch_mount -o "index=on,nfs_export=on" diff --git a/tests/overlay/075 b/tests/overlay/075 index f05858b3..911c3d08 100755 --- a/tests/overlay/075 +++ b/tests/overlay/075 @@ -12,18 +12,14 @@ # the test area in lower layer before running the t_immutable test on # the overlayfs mount. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick perms -here=`pwd` timmutable=$here/src/t_immutable lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { # -r will fail to remove test dirs, because we added subdirs @@ -34,8 +30,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs overlay diff --git a/tests/overlay/076 b/tests/overlay/076 index 07827c0b..646cfcc1 100755 --- a/tests/overlay/076 +++ b/tests/overlay/076 @@ -11,15 +11,10 @@ # This is a regression test for the fix commit b854cc659dcb ("ovl: avoid # deadlock on directory ioctl") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick perms dangerous +# Override the default cleanup function. _cleanup() { cd / @@ -28,13 +23,9 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch diff --git a/tests/overlay/077 b/tests/overlay/077 index 58c0f3b5..6510f81f 100755 --- a/tests/overlay/077 +++ b/tests/overlay/077 @@ -9,27 +9,12 @@ # This is a regression test for kernel commit 65cd913ec9d9 # ("ovl: invalidate readdir cache on changes to dir with origin") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick dir -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -rm -f $seqres.full - # real QA test starts here _supported_fs overlay _require_scratch_nocheck diff --git a/tests/overlay/100 b/tests/overlay/100 index 90f24b6f..b958088e 100755 --- a/tests/overlay/100 +++ b/tests/overlay/100 @@ -7,22 +7,14 @@ # Run unionmount testsuite to verify correctness # with single lower layer on same fs as upper # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick union samefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/101 b/tests/overlay/101 index d70a03e1..99dd72fa 100755 --- a/tests/overlay/101 +++ b/tests/overlay/101 @@ -7,22 +7,14 @@ # Run unionmount testsuite to verify correctness # with single lower layer not on same fs as upper # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick union nonsamefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/102 b/tests/overlay/102 index 89a6a08c..adddab70 100755 --- a/tests/overlay/102 +++ b/tests/overlay/102 @@ -8,22 +8,14 @@ # with single lower layer not on same fs as upper # with xino enabled # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick union nonsamefs xino -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/103 b/tests/overlay/103 index b02278f4..1a1b823e 100755 --- a/tests/overlay/103 +++ b/tests/overlay/103 @@ -7,22 +7,14 @@ # Run unionmount testsuite to verify correctness # with multi lower layers on same fs as upper # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate samefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/104 b/tests/overlay/104 index d3205d8d..090abbdd 100755 --- a/tests/overlay/104 +++ b/tests/overlay/104 @@ -7,22 +7,14 @@ # Run unionmount testsuite to verify correctness # with multi lower layers, lowermost on unique fs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate nonsamefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/105 b/tests/overlay/105 index 8b624f48..8c3b149c 100755 --- a/tests/overlay/105 +++ b/tests/overlay/105 @@ -8,22 +8,14 @@ # with multi lower layers, lowermost on unique fs, # with xino enabled # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate nonsamefs xino -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/106 b/tests/overlay/106 index 0b3e0c98..d701e49c 100755 --- a/tests/overlay/106 +++ b/tests/overlay/106 @@ -8,22 +8,14 @@ # with multi lower layers, some layers on unique fs, # one layer is on tmpfs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate nonsamefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/107 b/tests/overlay/107 index 89fde9de..8ae3dc0d 100755 --- a/tests/overlay/107 +++ b/tests/overlay/107 @@ -8,22 +8,14 @@ # with multi lower layers, some layers on unique fs, # one layer is on tmpfs with xino enabled. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate nonsamefs xino -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/108 b/tests/overlay/108 index ae367a5c..4e0e9c71 100755 --- a/tests/overlay/108 +++ b/tests/overlay/108 @@ -8,22 +8,14 @@ # with multi lower layers, all layers on unique fs, # some layers are on tmpfs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate nonsamefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/109 b/tests/overlay/109 index df036616..97338167 100755 --- a/tests/overlay/109 +++ b/tests/overlay/109 @@ -8,22 +8,14 @@ # with multi lower layers, all layers on unique fs, # some layers are on tmpfs with xino enabled. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate nonsamefs xino -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/110 b/tests/overlay/110 index 883e8cf0..414ebcae 100755 --- a/tests/overlay/110 +++ b/tests/overlay/110 @@ -8,22 +8,14 @@ # with single lower overlay layer, whose layers are # on same fs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick union nested samefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/111 b/tests/overlay/111 index 584a0a7a..93835f40 100755 --- a/tests/overlay/111 +++ b/tests/overlay/111 @@ -9,22 +9,14 @@ # on same fs # with xino enabled (xino overflow not expected) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick union nested samefs xino -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/112 b/tests/overlay/112 index e222ec18..33d3338b 100755 --- a/tests/overlay/112 +++ b/tests/overlay/112 @@ -8,22 +8,14 @@ # with single lower overlay layer, whose layers are # not on same fs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick union nested nonsamefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/113 b/tests/overlay/113 index 13a069cb..548af67a 100755 --- a/tests/overlay/113 +++ b/tests/overlay/113 @@ -9,22 +9,14 @@ # not on same fs # with xino enabled (expected xino overflows) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick union nested nonsamefs xino -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/114 b/tests/overlay/114 index c5132275..7e9ec9f7 100755 --- a/tests/overlay/114 +++ b/tests/overlay/114 @@ -8,22 +8,14 @@ # with multi lower layers, lowermost is an overlay layer, # whose layers are on same fs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate nested samefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/115 b/tests/overlay/115 index 1e808e4d..8f4159d2 100755 --- a/tests/overlay/115 +++ b/tests/overlay/115 @@ -9,22 +9,14 @@ # whose layers are on same fs # with xino enabled (xino overflow not expected) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate nested samefs xino -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/116 b/tests/overlay/116 index c3f9dcec..084ea84c 100755 --- a/tests/overlay/116 +++ b/tests/overlay/116 @@ -8,22 +8,14 @@ # with multi lower layers, lowermost is an overlay layer, # whose layers are not on same fs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate nested nonsamefs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/overlay/117 b/tests/overlay/117 index 8c9f651b..b98b79ae 100755 --- a/tests/overlay/117 +++ b/tests/overlay/117 @@ -9,22 +9,14 @@ # whose layers are not on same fs # with xino enabled (expected xino overflows) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto union rotate nested nonsamefs xino -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_unionmount_testsuite_cleanup; exit \$status" 0 1 2 3 15 +_register_cleanup "_unionmount_testsuite_cleanup" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs overlay diff --git a/tests/perf/001 b/tests/perf/001 index bca68cf3..5e622b69 100755 --- a/tests/perf/001 +++ b/tests/perf/001 @@ -6,19 +6,13 @@ # # Buffered random write performance test. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto -here=`pwd` -tmp=/tmp/$$ fio_config=$tmp.fio fio_results=$tmp.json -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/perf @@ -28,8 +22,6 @@ _require_scratch _require_block_device $SCRATCH_DEV _require_fio_results -rm -f $seqres.full - _size=$((16 * $LOAD_FACTOR)) cat >$fio_config <> $seqres.full 2>&1 _require_metadata_journaling $SCRATCH_DEV _init_flakey diff --git a/tests/shared/032 b/tests/shared/032 index 360087ee..a84af3a6 100755 --- a/tests/shared/032 +++ b/tests/shared/032 @@ -6,18 +6,10 @@ # # cross check mkfs detection of foreign filesystems # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest mkfs auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/shared/298 b/tests/shared/298 index 5cb30fc9..981a4dfc 100755 --- a/tests/shared/298 +++ b/tests/shared/298 @@ -6,17 +6,8 @@ # # Test that filesystem sends discard requests only on free blocks # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +. ./common/preamble +_begin_fstest auto trim _supported_fs ext4 xfs btrfs _require_test @@ -36,6 +27,7 @@ fi [ "$FSTYP" = "btrfs" ] && _require_btrfs_command inspect-internal dump-super [ "$FSTYP" = "btrfs" ] && _require_btrfs_command inspect-internal dump-tree +# Override the default cleanup function. _cleanup() { $UMOUNT_PROG $loop_dev &> /dev/null @@ -137,7 +129,6 @@ merge_ranges() rm $tmp_file } -here=`pwd` tmp=`mktemp -d` img_file=$TEST_DIR/$$.fs diff --git a/tests/udf/102 b/tests/udf/102 index 1bcd288a..a086ecea 100755 --- a/tests/udf/102 +++ b/tests/udf/102 @@ -7,22 +7,16 @@ # This tests mkfs_udf/mkudffs and the device detection code # Modified from UDFQA test 031. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest udf +# Override the default cleanup function. _cleanup() { rm -f $tmp.* cd / } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/001 b/tests/xfs/001 index 40766d55..8e6c5835 100755 --- a/tests/xfs/001 +++ b/tests/xfs/001 @@ -8,20 +8,8 @@ # write the value 0, each bit and finally the entry beyond the maximum legal # value. Also makes sure a core write and hex input still work. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest db auto quick _do_bit_test() { @@ -39,8 +27,7 @@ _do_bit_test() echo } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/002 b/tests/xfs/002 index 342115ef..6c0bb4d0 100755 --- a/tests/xfs/002 +++ b/tests/xfs/002 @@ -13,23 +13,10 @@ # for further explanation. (NB: while the commit log was good, the # patch had a bug which was subsequently fixed) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick growfs + +# Import common functions. . ./common/filter # Modify as appropriate. @@ -40,8 +27,6 @@ _require_no_large_scratch_dev # So we can explicitly turn it _off_: _require_xfs_mkfs_crc -rm -f $seqres.full - _scratch_mkfs_xfs -m crc=0 -d size=128m >> $seqres.full 2>&1 || _fail "mkfs failed" # Scribble past a couple V4 secondary superblocks to populate sb_crc diff --git a/tests/xfs/003 b/tests/xfs/003 index 30d56169..431c7ce0 100755 --- a/tests/xfs/003 +++ b/tests/xfs/003 @@ -6,18 +6,13 @@ # # exercise xfs_db bug #784078 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest db auto quick -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -tmp=/tmp/$$ -here=`pwd` status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/004 b/tests/xfs/004 index 4d92a08e..f18316b3 100755 --- a/tests/xfs/004 +++ b/tests/xfs/004 @@ -6,20 +6,17 @@ # # exercise xfs_db bug #789674 and other freesp functionality # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest db auto quick -here=`pwd` -tmp=/tmp/$$ status=0 +# Override the default cleanup function. _cleanup() { _scratch_unmount rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 _populate_scratch() { @@ -39,8 +36,7 @@ _populate_scratch() _scratch_mount # and then remount } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -49,8 +45,6 @@ _supported_fs xfs _require_scratch _require_no_large_scratch_dev -rm -f $seqres.full - _populate_scratch eval `$DF_PROG -P --block-size=512 $SCRATCH_MNT 2>&1 \ diff --git a/tests/xfs/005 b/tests/xfs/005 index 58cd1bec..5f1ab834 100755 --- a/tests/xfs/005 +++ b/tests/xfs/005 @@ -10,23 +10,10 @@ # inadvertently caused primary SB CRC failures to not error out, this # is a regression test for that fix. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # Modify as appropriate. @@ -35,8 +22,6 @@ _supported_fs xfs _require_scratch_nocheck _require_xfs_mkfs_crc -rm -f $seqres.full - _scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed" # Zap the crc. xfs_db updates the CRC post-write, so poke it directly diff --git a/tests/xfs/006 b/tests/xfs/006 index c767bc0c..cecceaa3 100755 --- a/tests/xfs/006 +++ b/tests/xfs/006 @@ -7,15 +7,10 @@ # Test xfs' "fail at unmount" error handling configuration. Stop # XFS from retrying to writeback forever at unmount. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mount eio +# Override the default cleanup function. _cleanup() { cd / @@ -23,14 +18,10 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs _require_scratch diff --git a/tests/xfs/007 b/tests/xfs/007 index d7b7d02d..09268e8c 100755 --- a/tests/xfs/007 +++ b/tests/xfs/007 @@ -6,23 +6,10 @@ # # Test to verify Q_XQUOTARM functionality. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -32,8 +19,6 @@ _supported_fs xfs _require_scratch _require_xfs_quota -rm -f $seqres.full - _scratch_mkfs_xfs | _filter_mkfs > /dev/null 2> $tmp.mkfs . $tmp.mkfs @@ -65,7 +50,6 @@ do_test() _scratch_xfs_db -c "inode $QINO_2" -c "p core.nblocks" } - # Test user and group first _qmount_option "uquota,gquota" _qmount diff --git a/tests/xfs/008 b/tests/xfs/008 index c488954e..a53f6c92 100755 --- a/tests/xfs/008 +++ b/tests/xfs/008 @@ -6,16 +6,13 @@ # # randholes test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw ioctl auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! pgsize=`$here/src/feature -s` -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { rm -f $tmp.* @@ -28,8 +25,7 @@ _filter() -e "s/-l .* -c/-l FSIZE -c/g" } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _do_test() @@ -72,8 +68,6 @@ _do_test() _supported_fs xfs _require_test -rm -f $seqres.full - # Note on special numbers here. # # We are trying to create roughly 50 or 100 holes in a file diff --git a/tests/xfs/009 b/tests/xfs/009 index 4fc8466a..54270243 100755 --- a/tests/xfs/009 +++ b/tests/xfs/009 @@ -6,15 +6,10 @@ # # XFS allocator test (preallocation - allocp, resvsp ,etc) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest rw ioctl auto prealloc quick +# Override the default cleanup function. _cleanup() { echo "*** unmount" @@ -39,8 +34,7 @@ _init() fi } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/010 b/tests/xfs/010 index a9394077..16c08b85 100755 --- a/tests/xfs/010 +++ b/tests/xfs/010 @@ -8,26 +8,20 @@ # corruptions and verify that xfs_repair detects and repairs the filesystem to # a consistent state. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/repair +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 _sparse_inode_populate() { @@ -93,8 +87,6 @@ _require_scratch _require_xfs_mkfs_finobt _require_xfs_finobt -rm -f $seqres.full - _scratch_mkfs_xfs "-m crc=1,finobt=1 -d agcount=2" | _filter_mkfs 2>$seqres.full # sparsely populate the fs such that we create records with free inodes diff --git a/tests/xfs/011 b/tests/xfs/011 index 7de9ff8d..d6e9099e 100755 --- a/tests/xfs/011 +++ b/tests/xfs/011 @@ -8,17 +8,12 @@ # include a variety of fs operations, freeze the filesystem and verify that # there are no oustanding reservations against the log. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto freeze log metadata quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. +# Override the default cleanup function. _cleanup() { $KILLALL_PROG -9 fsstress 2>/dev/null @@ -27,7 +22,6 @@ _cleanup() _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 # Use the information exported by XFS to sysfs to determine whether the log has # active reservations after a filesystem freeze. @@ -71,8 +65,6 @@ _require_freeze _require_xfs_sysfs $(_short_dev $TEST_DEV)/log _require_command "$KILLALL_PROG" killall -rm -f $seqres.full - echo "Silence is golden." _scratch_mkfs_xfs >> $seqres.full 2>&1 diff --git a/tests/xfs/012 b/tests/xfs/012 index fca419b8..5ebc9058 100755 --- a/tests/xfs/012 +++ b/tests/xfs/012 @@ -6,15 +6,12 @@ # # holes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -27,8 +24,7 @@ _filesize() ls -l $1 | $AWK_PROG '{print " filesize = " $5}' } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _do_test() @@ -89,8 +85,6 @@ _do_test() _supported_fs xfs _require_test -rm -f $seqres.full - # small & fairly dense _do_test 1 "-l 40960000 -b 40960 -i 10 -c 1" 100 diff --git a/tests/xfs/013 b/tests/xfs/013 index 5508c53c..2d005753 100755 --- a/tests/xfs/013 +++ b/tests/xfs/013 @@ -10,18 +10,13 @@ # and modifies a sparsely allocated set of inodes in combination with an # fsstress workload. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto metadata stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter +# Override the default cleanup function. _cleanup() { $KILLALL_PROG -9 fsstress 2>/dev/null @@ -30,7 +25,6 @@ _cleanup() _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 filter_enospc() { sed -e '/^.*No space left on device.*/d' @@ -94,8 +88,6 @@ _require_xfs_mkfs_finobt _require_xfs_finobt _require_command "$KILLALL_PROG" killall -rm -f $seqres.full - _scratch_mkfs_xfs "-m crc=1,finobt=1 -d agcount=2" | \ _filter_mkfs 2>> $seqres.full _scratch_mount diff --git a/tests/xfs/014 b/tests/xfs/014 index 4f2e44d5..a605b359 100755 --- a/tests/xfs/014 +++ b/tests/xfs/014 @@ -11,19 +11,14 @@ # new writers reclaim said preallocations rather than prematurely fail with # ENOSPC/EDQUOT. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto enospc quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota +# Override the default cleanup function. _cleanup() { cd / @@ -31,7 +26,6 @@ _cleanup() _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 # Create a file using a repeated open, extending write and close pattern. This # causes the preallocation to persist after the file is closed. Preallocation @@ -152,8 +146,6 @@ _require_quota _require_user _require_group -rm -f $seqres.full - echo "Silence is golden." _scratch_mkfs_xfs >> $seqres.full 2>&1 diff --git a/tests/xfs/015 b/tests/xfs/015 index 3557c8d1..86fa6336 100755 --- a/tests/xfs/015 +++ b/tests/xfs/015 @@ -9,20 +9,8 @@ # Regression test for # xfs: allow inode allocations in post-growfs disk space # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto enospc growfs create_file() { @@ -41,8 +29,7 @@ create_file() done } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -56,8 +43,6 @@ _scratch_mount _require_fs_space $SCRATCH_MNT 131072 _scratch_unmount -rm -f $seqres.full - _scratch_mkfs_sized $((32 * 1024 * 1024)) > $tmp.mkfs.raw cat $tmp.mkfs.raw | _filter_mkfs >$seqres.full 2>$tmp.mkfs # get original data blocks number and agcount diff --git a/tests/xfs/016 b/tests/xfs/016 index d2042742..6337bb1f 100755 --- a/tests/xfs/016 +++ b/tests/xfs/016 @@ -19,16 +19,10 @@ # if it changes, we assume the log is writing over it # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 - -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest rw auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -168,16 +162,13 @@ _check_corrupt() _fail "!!! block $2 corrupted!" } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota # real QA test starts here _supported_fs xfs -rm -f $seqres.full - _require_scratch _init diff --git a/tests/xfs/017 b/tests/xfs/017 index 136ec949..8a20e592 100755 --- a/tests/xfs/017 +++ b/tests/xfs/017 @@ -6,23 +6,19 @@ # # test remount ro - pv 795642 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest mount auto quick stress -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 +_register_cleanup "_cleanup; rm -f $tmp.*" +# Override the default cleanup function. _cleanup() { echo "*** unmount" _scratch_unmount 2>/dev/null } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,7 +32,6 @@ _require_no_large_scratch_dev echo "*** init FS" -rm -f $seqres.full _scratch_unmount >/dev/null 2>&1 echo "*** MKFS ***" >>$seqres.full echo "" >>$seqres.full @@ -72,6 +67,5 @@ done echo "*** done" # happy exit -rm -f $seqres.full status=0 exit 0 diff --git a/tests/xfs/018 b/tests/xfs/018 index afeab8c8..31844c3b 100755 --- a/tests/xfs/018 +++ b/tests/xfs/018 @@ -7,19 +7,14 @@ # xfs_logprint test - test v2 logs of different LR sizes # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest deprecated # log logprint v2log -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/log +# Override the default cleanup function. _cleanup() { cd / @@ -27,12 +22,10 @@ _cleanup() rm -f $tmp.* _scratch_unmount 2>/dev/null } -trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs xfs # prelim -rm -f $seqres.full $tmp.* _require_scratch _require_v2log diff --git a/tests/xfs/019 b/tests/xfs/019 index 7f5ce60c..3dfd5408 100755 --- a/tests/xfs/019 +++ b/tests/xfs/019 @@ -6,25 +6,20 @@ # # mkfs protofile test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest mkfs auto quick -here=`pwd` -tmp=/tmp/$$ seqfull="$seqres.full" -status=1 # failure is the default! -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter +# Override the default cleanup function. _cleanup() { echo "*** unmount" _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 _full() { diff --git a/tests/xfs/020 b/tests/xfs/020 index 18cb7c9e..d6ee3a15 100755 --- a/tests/xfs/020 +++ b/tests/xfs/020 @@ -9,15 +9,10 @@ # Regression test for xfsprogs commit # 7f2d6b8 xfs_repair: avoid segfault if reporting progress early in repair # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto repair +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +20,7 @@ _cleanup() rm -f $fsfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/021 b/tests/xfs/021 index a25ea98c..9432e2ac 100755 --- a/tests/xfs/021 +++ b/tests/xfs/021 @@ -6,25 +6,21 @@ # # xfs_db type attr test (pv 797508 linux-xfs & IRIX) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest db attr auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr +# Override the default cleanup function. _cleanup() { echo "*** unmount" _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 _attr() { @@ -62,7 +58,6 @@ _supported_fs xfs _require_scratch _require_attrs -rm -f $seqres.full _scratch_unmount >/dev/null 2>&1 echo "*** mkfs" diff --git a/tests/xfs/022 b/tests/xfs/022 index 5f406f00..9334bc41 100755 --- a/tests/xfs/022 +++ b/tests/xfs/022 @@ -10,15 +10,12 @@ # Use fsstress to create a directory structure with a mix of files # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl tape -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -26,7 +23,6 @@ _cleanup() rm -f $tmp.* } -. ./common/rc . ./common/dump # real QA test starts here diff --git a/tests/xfs/023 b/tests/xfs/023 index de7dbadc..1ff406a6 100755 --- a/tests/xfs/023 +++ b/tests/xfs/023 @@ -8,15 +8,12 @@ # files with data created by src/fill. # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl tape -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -24,8 +21,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/024 b/tests/xfs/024 index 2dcbd673..a277c83f 100755 --- a/tests/xfs/024 +++ b/tests/xfs/024 @@ -6,15 +6,12 @@ # # Test out incremental dumps # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl tape -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/025 b/tests/xfs/025 index a3f7ac87..b7a5b3bb 100755 --- a/tests/xfs/025 +++ b/tests/xfs/025 @@ -6,15 +6,12 @@ # # Test dump/restore using -m option (min strategy) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl tape -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/026 b/tests/xfs/026 index c0a5a8c6..29ebb5aa 100755 --- a/tests/xfs/026 +++ b/tests/xfs/026 @@ -6,15 +6,12 @@ # # Test xfsdump/xfsrestore to a dump file (as opposed to a tape) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/027 b/tests/xfs/027 index a0ce91d8..a0dcf8b3 100755 --- a/tests/xfs/027 +++ b/tests/xfs/027 @@ -6,15 +6,12 @@ # # Test out "xfsdump | xfsrestore" # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/028 b/tests/xfs/028 index 8700c7e1..b7c9d16b 100755 --- a/tests/xfs/028 +++ b/tests/xfs/028 @@ -6,15 +6,12 @@ # # To test out xfsinvutil # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/029 b/tests/xfs/029 index 48a17f77..6e8aa4db 100755 --- a/tests/xfs/029 +++ b/tests/xfs/029 @@ -6,17 +6,10 @@ # # exercise mkfs log (internal/external) zeroing # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest mkfs logprint log auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter filter_logprint() diff --git a/tests/xfs/030 b/tests/xfs/030 index 81198155..201a9015 100755 --- a/tests/xfs/030 +++ b/tests/xfs/030 @@ -7,14 +7,10 @@ # exercise xfs_repair repairing broken filesystems # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest repair auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -22,10 +18,7 @@ _cleanup() rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/repair . ./common/quota diff --git a/tests/xfs/031 b/tests/xfs/031 index b8338131..6e3813da 100755 --- a/tests/xfs/031 +++ b/tests/xfs/031 @@ -7,18 +7,10 @@ # exercise xfs_repair - ensure repeated use doesn't corrupt # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest repair mkfs auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/repair . ./common/filter diff --git a/tests/xfs/032 b/tests/xfs/032 index 66758323..926de307 100755 --- a/tests/xfs/032 +++ b/tests/xfs/032 @@ -7,17 +7,12 @@ # Test xfs_copy for all filesystem sector size / block size # combinations possible on this platform. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest copy auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs xfs @@ -26,8 +21,6 @@ _require_scratch _require_test_program "feature" _require_xfs_copy -rm -f $seqres.full - SECTORSIZE=`blockdev --getss $SCRATCH_DEV` PAGESIZE=`$here/src/feature -s` IMGFILE=$TEST_DIR/${seq}_copy.img diff --git a/tests/xfs/033 b/tests/xfs/033 index a1311dbe..d47da0d6 100755 --- a/tests/xfs/033 +++ b/tests/xfs/033 @@ -7,14 +7,10 @@ # exercise xfs_repair repairing broken filesystems (root inodes) # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest repair auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -22,10 +18,7 @@ _cleanup() rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/repair . ./common/quota diff --git a/tests/xfs/034 b/tests/xfs/034 index 731ad736..52b0a5f7 100755 --- a/tests/xfs/034 +++ b/tests/xfs/034 @@ -6,14 +6,10 @@ # # pv 801241 - check for reference leaks from the *handle xfsctls # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest other auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -21,10 +17,8 @@ _cleanup() echo "*** unmount" _scratch_unmount 2>/dev/null } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,7 +28,6 @@ _require_scratch echo "*** init FS" -rm -f $seqres.full _scratch_unmount >/dev/null 2>&1 echo "*** MKFS ***" >>$seqres.full echo "" >>$seqres.full diff --git a/tests/xfs/035 b/tests/xfs/035 index 3a914bfe..03cb7a76 100755 --- a/tests/xfs/035 +++ b/tests/xfs/035 @@ -7,15 +7,10 @@ # Test doing multiple dumps to tape and restoring the 2nd one # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl tape auto +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -23,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/036 b/tests/xfs/036 index f7d43b7e..191345c5 100755 --- a/tests/xfs/036 +++ b/tests/xfs/036 @@ -7,15 +7,10 @@ # Test xfsdump/restore minrmt to a remote IRIX tape # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl remote tape +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -23,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/037 b/tests/xfs/037 index 3f90f9e7..b3fbbedd 100755 --- a/tests/xfs/037 +++ b/tests/xfs/037 @@ -6,15 +6,10 @@ # # Test xfsdump/restore minrmt to a remote linux tape # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl remote tape +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/038 b/tests/xfs/038 index a7198831..633c51e0 100755 --- a/tests/xfs/038 +++ b/tests/xfs/038 @@ -6,15 +6,10 @@ # # Test xfsdump/restore to a remote linux tape # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl remote tape +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/039 b/tests/xfs/039 index 6bc25686..e3a98921 100755 --- a/tests/xfs/039 +++ b/tests/xfs/039 @@ -7,15 +7,10 @@ # Test xfsdump/restore to a remote IRIX tape # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl remote tape +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -23,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/040 b/tests/xfs/040 index c1a94699..71d6ac0c 100755 --- a/tests/xfs/040 +++ b/tests/xfs/040 @@ -11,17 +11,10 @@ # is no functional need for anyone to actually run this test to confirm # proper XFS functionalilty, this is an xfsprogs maintainer test. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter [ -z "$KWORKAREA" ] && \ diff --git a/tests/xfs/041 b/tests/xfs/041 index e8624f63..05de5578 100755 --- a/tests/xfs/041 +++ b/tests/xfs/041 @@ -9,24 +9,18 @@ # set +x -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest growfs ioctl auto +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount rm -f $tmp.* } -trap "_cleanup ; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -44,7 +38,6 @@ _fill() } _do_die_on_error=message_only -rm -f $seqres.full agsize=32 echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... " _scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null || _fail "mkfs failed" diff --git a/tests/xfs/042 b/tests/xfs/042 index fcd5181c..d62eb045 100755 --- a/tests/xfs/042 +++ b/tests/xfs/042 @@ -10,23 +10,17 @@ # set +x -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest fsr ioctl auto +# Override the default cleanup function. _cleanup() { _scratch_unmount rm -f $tmp.* } -trap "_cleanup ; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -55,7 +49,6 @@ _require_scratch # - run xfs_fsr on the filesystem # - check checksums for remaining files -rm -f $seqres.full _do_die_on_error=message_only echo -n "Make a 48 megabyte filesystem on SCRATCH_DEV and mount... " diff --git a/tests/xfs/043 b/tests/xfs/043 index 132bc556..5b198dde 100755 --- a/tests/xfs/043 +++ b/tests/xfs/043 @@ -9,15 +9,10 @@ # rebuilt from the on-tape inventory. # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl tape +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -25,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/044 b/tests/xfs/044 index 69c5b008..e66c0cb3 100755 --- a/tests/xfs/044 +++ b/tests/xfs/044 @@ -6,17 +6,10 @@ # # external log uuid/format tests (TODO - version 2 log format) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/045 b/tests/xfs/045 index 28e3781c..d8cc9ac2 100755 --- a/tests/xfs/045 +++ b/tests/xfs/045 @@ -6,17 +6,10 @@ # # test mount of two FSes with identical UUID and mount with unknown option # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _get_existing_uuid() diff --git a/tests/xfs/046 b/tests/xfs/046 index 84e569f5..94d1c051 100755 --- a/tests/xfs/046 +++ b/tests/xfs/046 @@ -6,15 +6,10 @@ # # check on symlinks permissions # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl auto quick +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/047 b/tests/xfs/047 index df350b4a..f83a2c94 100755 --- a/tests/xfs/047 +++ b/tests/xfs/047 @@ -6,15 +6,10 @@ # # invutil with interactive responses # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl auto +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/048 b/tests/xfs/048 index cf2c763d..5c43dced 100755 --- a/tests/xfs/048 +++ b/tests/xfs/048 @@ -6,25 +6,12 @@ # # test return codes from xfsctl on bad userspace address # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -_cleanup() -{ - cd / - rm -f $tmp.* -} - # real QA test starts here _supported_fs xfs _require_test diff --git a/tests/xfs/049 b/tests/xfs/049 index 16bc788d..69656a85 100755 --- a/tests/xfs/049 +++ b/tests/xfs/049 @@ -6,10 +6,10 @@ # # XFS on loop test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -24,13 +24,7 @@ _cleanup() fi } -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -48,8 +42,6 @@ _require_no_large_scratch_dev _require_loop _require_extra_fs ext2 -rm -f $seqres.full - echo "(dev=$SCRATCH_DEV, mount=$SCRATCH_MNT)" >> $seqres.full echo "" >> $seqres.full diff --git a/tests/xfs/050 b/tests/xfs/050 index e7c81d0a..1847611b 100755 --- a/tests/xfs/050 +++ b/tests/xfs/050 @@ -7,26 +7,20 @@ # Exercises basic XFS quota functionality # uquota, gquota, uqnoenforce, gqnoenforce, pquota, pqnoenforce # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest quota auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/051 b/tests/xfs/051 index a6b1a6d8..ea70cb50 100755 --- a/tests/xfs/051 +++ b/tests/xfs/051 @@ -8,15 +8,10 @@ # on I/O failures during log recovery. Note that this test is dangerous as it # causes BUG() errors or a panic. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest shutdown auto log metadata +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +20,7 @@ _cleanup() _scratch_unmount > /dev/null 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dmflakey # Modify as appropriate. diff --git a/tests/xfs/052 b/tests/xfs/052 index feeb46a1..010f9ad6 100755 --- a/tests/xfs/052 +++ b/tests/xfs/052 @@ -9,32 +9,24 @@ # MOUNT_OPTIONS can be set to gquota to test group quota, # defaults to uquota if MOUNT_OPTIONS is not set. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest quota db auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs xfs -rm -f $seqres.full - _require_scratch _require_xfs_quota _require_nobody diff --git a/tests/xfs/053 b/tests/xfs/053 index 28bfef40..e7e73db8 100755 --- a/tests/xfs/053 +++ b/tests/xfs/053 @@ -10,26 +10,13 @@ # Due to bugs here and there, we sometimes matched on partial # strings with those names, and threw off xfs_repair. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest attr acl repair quick auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -_cleanup() -{ - cd / - rm -f $tmp.* -} -trap "_cleanup; exit \$status" 0 1 2 3 15 - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/054 b/tests/xfs/054 index 508d914f..becb76ac 100755 --- a/tests/xfs/054 +++ b/tests/xfs/054 @@ -6,28 +6,12 @@ # # Exercise the xfs_io inode command # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/055 b/tests/xfs/055 index 02f3bb62..1e3ba6ac 100755 --- a/tests/xfs/055 +++ b/tests/xfs/055 @@ -7,15 +7,10 @@ # Test xfsdump/restore to a remote IRIX tape using RMT user # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl remote tape +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -23,8 +18,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/056 b/tests/xfs/056 index e4aaadd1..4ee473f6 100755 --- a/tests/xfs/056 +++ b/tests/xfs/056 @@ -7,15 +7,12 @@ # Test xfsdump/xfsrestore to a dump file (as opposed to a tape) # and test restoring various permissions/modes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -23,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/057 b/tests/xfs/057 index be44959b..d4cfa8dc 100755 --- a/tests/xfs/057 +++ b/tests/xfs/057 @@ -20,15 +20,10 @@ # # Note that this test requires a DEBUG mode kernel. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto log +# Override the default cleanup function. _cleanup() { cd / @@ -39,10 +34,7 @@ _cleanup() wait > /dev/null 2>&1 } -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/inject # real QA test starts here diff --git a/tests/xfs/058 b/tests/xfs/058 index d76908af..8751a7ac 100755 --- a/tests/xfs/058 +++ b/tests/xfs/058 @@ -6,23 +6,10 @@ # # Ensure that xfs_db fuzz command works as advertised. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fuzzers -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/fuzzy diff --git a/tests/xfs/059 b/tests/xfs/059 index 1e906302..4bbfb5f5 100755 --- a/tests/xfs/059 +++ b/tests/xfs/059 @@ -6,15 +6,12 @@ # # Test multi-stream xfsdump/xfsrestore. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/060 b/tests/xfs/060 index 6105a626..4b15c6c2 100755 --- a/tests/xfs/060 +++ b/tests/xfs/060 @@ -6,15 +6,12 @@ # # Test multi-stream xfsdump and restoring one stream at a time. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/061 b/tests/xfs/061 index 75f9651b..c5d4a2d1 100755 --- a/tests/xfs/061 +++ b/tests/xfs/061 @@ -6,15 +6,12 @@ # # Test restoring a dump created in IRIX/XFS # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/062 b/tests/xfs/062 index 9e36857f..0a1c6742 100755 --- a/tests/xfs/062 +++ b/tests/xfs/062 @@ -8,20 +8,8 @@ # Test under various inode counts, inobt record layouts and bulkstat batch # sizes. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto ioctl quick # print the number of inodes counted by bulkstat _bstat_count() @@ -41,8 +29,7 @@ _bstat_test() _bstat_count 1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _require_scratch @@ -51,8 +38,6 @@ _require_scratch _supported_fs xfs -rm -f $seqres.full - DIRCOUNT=8 INOCOUNT=$((2048 / DIRCOUNT)) diff --git a/tests/xfs/063 b/tests/xfs/063 index 22421683..2d1d2cbc 100755 --- a/tests/xfs/063 +++ b/tests/xfs/063 @@ -6,15 +6,10 @@ # # xfsdump/xfsrestore with EAs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump attr auto quick +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dump . ./common/attr diff --git a/tests/xfs/064 b/tests/xfs/064 index 28d842f0..e4e713cd 100755 --- a/tests/xfs/064 +++ b/tests/xfs/064 @@ -6,15 +6,10 @@ # # test multilevel dump and restores with hardlinks # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump auto +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dump diff --git a/tests/xfs/065 b/tests/xfs/065 index b82e0f47..0df7477f 100755 --- a/tests/xfs/065 +++ b/tests/xfs/065 @@ -9,15 +9,10 @@ # directories". # Do different operations for each level. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump auto +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -25,8 +20,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dump . ./common/quota diff --git a/tests/xfs/066 b/tests/xfs/066 index fbfac93a..5f0a74e3 100755 --- a/tests/xfs/066 +++ b/tests/xfs/066 @@ -6,20 +6,14 @@ # # Test dumping of large files # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dump +# Override the default cleanup function. _cleanup() { _cleanup_dump diff --git a/tests/xfs/067 b/tests/xfs/067 index b7cbb8fe..3dc381bb 100755 --- a/tests/xfs/067 +++ b/tests/xfs/067 @@ -6,17 +6,10 @@ # # Test out acl/dacls which fit in shortform in the inode # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest acl attr auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/xfs/068 b/tests/xfs/068 index 5fcf55e9..103466c3 100755 --- a/tests/xfs/068 +++ b/tests/xfs/068 @@ -11,15 +11,12 @@ # c7cb51d xfs: fix error handling at xfs_inumbers # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto stress dump -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -27,12 +24,8 @@ _cleanup() rm -f $tmp.* } -. ./common/rc . ./common/dump -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/069 b/tests/xfs/069 index 620185e0..bf4aa202 100755 --- a/tests/xfs/069 +++ b/tests/xfs/069 @@ -7,23 +7,10 @@ # Determine whether the extent size hint can be set on directories # with allocated extents correctly. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest ioctl auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch diff --git a/tests/xfs/070 b/tests/xfs/070 index 9ef1e786..43ca7f84 100755 --- a/tests/xfs/070 +++ b/tests/xfs/070 @@ -18,15 +18,10 @@ # verify it repairs the fs correctly. We explicitly detect a brute force scan # and abort the repair to save time in the failure case. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick repair +# Override the default cleanup function. _cleanup() { cd / @@ -70,10 +65,7 @@ _xfs_repair_noscan() cat $tmp.repair | _filter_repair } -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/repair diff --git a/tests/xfs/071 b/tests/xfs/071 index 647dc153..8373878a 100755 --- a/tests/xfs/071 +++ b/tests/xfs/071 @@ -6,25 +6,18 @@ # # Exercise IO at large file offsets. seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -rm -f $seqres.full - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest rw auto +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* _scratch_unmount 2>/dev/null } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter bitsperlong=`$here/src/feature -w` diff --git a/tests/xfs/072 b/tests/xfs/072 index 8b1b1798..54c1207c 100755 --- a/tests/xfs/072 +++ b/tests/xfs/072 @@ -6,10 +6,10 @@ # # Check some unwritten extent boundary conditions # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto prealloc quick +# Override the default cleanup function. _cleanup() { cd / @@ -17,13 +17,7 @@ _cleanup() _scratch_unmount 2>/dev/null } -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -32,7 +26,6 @@ _supported_fs xfs _require_scratch _require_xfs_io_command "falloc" -rm -f $seqres.full _scratch_unmount >/dev/null 2>&1 _scratch_mkfs_xfs >/dev/null || _fail "mkfs failed" diff --git a/tests/xfs/073 b/tests/xfs/073 index 2917dbee..c7616b9e 100755 --- a/tests/xfs/073 +++ b/tests/xfs/073 @@ -6,22 +6,17 @@ # # Test xfs_copy # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest copy auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr # don't put fs images in /tmp imgs=$TEST_DIR/$$ +# Override the default cleanup function. _cleanup() { cd / @@ -32,7 +27,6 @@ _cleanup() [ -d $imgs.source_dir ] && rm -rf $imgs.source_dir rm -f $imgs.* $tmp.* /var/tmp/xfs_copy.log.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 _filter_copy() { @@ -116,8 +110,6 @@ _require_xfs_copy _require_scratch _require_loop -rm -f $seqres.full - _scratch_mkfs_xfs -dsize=41m,agcount=2 >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/xfs/074 b/tests/xfs/074 index 0cdd0260..f27700ee 100755 --- a/tests/xfs/074 +++ b/tests/xfs/074 @@ -19,10 +19,10 @@ # of the new extent will be larger than MAXEXTLEN. This will later cause # the bmbt leaf to have an entry whose length is set to zero block count. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest quick auto prealloc rw +# Override the default cleanup function. _cleanup() { cd / @@ -30,20 +30,12 @@ _cleanup() rm -f $tmp.* $LOOP_FILE } -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs xfs -rm -f $seqres.full - _require_test _require_xfs_io_command "falloc" diff --git a/tests/xfs/075 b/tests/xfs/075 index e9a497d8..ec056fb3 100755 --- a/tests/xfs/075 +++ b/tests/xfs/075 @@ -7,23 +7,10 @@ # Commit bbe051c8 disallows ro->rw remount on norecovery mount # This test makes sure the behavior is correct. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick mount -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota diff --git a/tests/xfs/076 b/tests/xfs/076 index 5eb2cf72..eac7410e 100755 --- a/tests/xfs/076 +++ b/tests/xfs/076 @@ -17,25 +17,19 @@ # space, allocates inodes to ENOSPC and then verifies that most of the available # inodes (.i.e., free space) have been consumed. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto enospc punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 _consume_freesp() { @@ -66,8 +60,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "fpunch" _require_xfs_sparse_inodes -rm -f $seqres.full - _scratch_mkfs "-d size=50m -m crc=1 -i sparse" | _filter_mkfs > /dev/null 2> $tmp.mkfs . $tmp.mkfs # for isize diff --git a/tests/xfs/077 b/tests/xfs/077 index 25779b48..f24f6f00 100755 --- a/tests/xfs/077 +++ b/tests/xfs/077 @@ -12,23 +12,10 @@ # matches all the existing metadata) to a new superblock location. # Exercise some of that behavior. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick copy -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -65,8 +52,6 @@ _fs_has_META_UUID() $XFS_DB_PROG -r -c version $FS | grep -q META_UUID } -rm -f $seqres.full - _scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed" ORIG_UUID=`_scratch_xfs_db -c "uuid" | awk '{print $NF}'` diff --git a/tests/xfs/078 b/tests/xfs/078 index 698bfc2d..1f475c96 100755 --- a/tests/xfs/078 +++ b/tests/xfs/078 @@ -6,16 +6,12 @@ # # Check several growfs corner cases # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest growfs auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 - -trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 +_register_cleanup "_cleanup; rm -f $tmp.*" +# Override the default cleanup function. _cleanup() { cd / @@ -27,8 +23,7 @@ _cleanup() rmdir $LOOP_MNT } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # loop devices are available in Linux only @@ -49,8 +44,6 @@ _filter_io() # real QA test starts here -rm -f $seqres.full - echo "*** create loop mount point" rmdir $LOOP_MNT 2>/dev/null mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point" diff --git a/tests/xfs/079 b/tests/xfs/079 index 43a6a3a4..dd5dbd35 100755 --- a/tests/xfs/079 +++ b/tests/xfs/079 @@ -14,15 +14,10 @@ # Test that log recovery succeeds with a different log buffer size from when the # filesystem crashed. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest shutdown auto log quick +# Override the default cleanup function. _cleanup() { cd / @@ -31,10 +26,7 @@ _cleanup() wait > /dev/null 2>&1 } -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/log # real QA test starts here diff --git a/tests/xfs/080 b/tests/xfs/080 index c6e72910..20b20a08 100755 --- a/tests/xfs/080 +++ b/tests/xfs/080 @@ -6,19 +6,13 @@ # # rwtest (iogen|doio) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw ioctl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter +# Override the default cleanup function. _cleanup() { cd / diff --git a/tests/xfs/081 b/tests/xfs/081 index 62748035..17088d30 100755 --- a/tests/xfs/081 +++ b/tests/xfs/081 @@ -6,16 +6,10 @@ # # To test out logprint with quotas # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest deprecated # log logprint quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/log . ./common/quota @@ -23,6 +17,7 @@ status=1 # failure is the default! # real QA test starts here _supported_fs xfs +# Override the default cleanup function. _cleanup() { cd / @@ -31,10 +26,8 @@ _cleanup() echo "*** unmount" _scratch_unmount 2>/dev/null } -trap "_cleanup; exit \$status" 0 1 2 3 15 # prelim -rm -f $seqres.full $tmp.* _require_scratch _require_xfs_quota _require_v2log diff --git a/tests/xfs/082 b/tests/xfs/082 index fd321076..52201ff6 100755 --- a/tests/xfs/082 +++ b/tests/xfs/082 @@ -7,19 +7,14 @@ # Test out the v2 stripe logs with logprint # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest deprecated # log logprint v2log -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/log +# Override the default cleanup function. _cleanup() { cd / @@ -27,13 +22,11 @@ _cleanup() rm -f $tmp.* _scratch_unmount 2>/dev/null } -trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs xfs # prelim -rm -f $seqres.full $tmp.* _require_scratch _require_v2log diff --git a/tests/xfs/083 b/tests/xfs/083 index 14a36416..a9acc9f5 100755 --- a/tests/xfs/083 +++ b/tests/xfs/083 @@ -8,23 +8,17 @@ # the kernel reacts, how xfs_repair fares in fixing the mess, and then # try more kernel accesses to see if it really fixed things. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dangerous_fuzzers punch +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -85,7 +79,6 @@ scratch_repair() { return 1 } -rm -f $seqres.full # This test will corrupt fs intentionally, so there will be WARNINGs # in dmesg as expected _disable_dmesg_check diff --git a/tests/xfs/084 b/tests/xfs/084 index e2887ef0..5967fe12 100755 --- a/tests/xfs/084 +++ b/tests/xfs/084 @@ -7,17 +7,10 @@ # Exercises unwritten extent reads and writes, looking # for data corruption (zeroes read) near the end of file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest ioctl rw auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _filter_resv() diff --git a/tests/xfs/085 b/tests/xfs/085 index 5d898088..dc82f28d 100755 --- a/tests/xfs/085 +++ b/tests/xfs/085 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a superblock, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -37,7 +31,6 @@ _require_attrs _require_populate_commands _require_xfs_db_blocktrash_z_command -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/xfs/086 b/tests/xfs/086 index f4cf950d..c8c6d86e 100755 --- a/tests/xfs/086 +++ b/tests/xfs/086 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt an AGF, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,7 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/xfs/087 b/tests/xfs/087 index e7b06e09..f7cae328 100755 --- a/tests/xfs/087 +++ b/tests/xfs/087 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt the AGI, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,7 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/xfs/088 b/tests/xfs/088 index b3e65dcf..156c6669 100755 --- a/tests/xfs/088 +++ b/tests/xfs/088 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt the AGFL, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,7 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/xfs/089 b/tests/xfs/089 index 21380798..ae8f6564 100755 --- a/tests/xfs/089 +++ b/tests/xfs/089 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt the bnobt, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,7 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/xfs/090 b/tests/xfs/090 index 43ef01d1..663cbcd6 100755 --- a/tests/xfs/090 +++ b/tests/xfs/090 @@ -6,17 +6,10 @@ # # Exercise IO on the realtime device (direct, buffered, mmapd) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/091 b/tests/xfs/091 index ff8f0f1f..85c881ae 100755 --- a/tests/xfs/091 +++ b/tests/xfs/091 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt the cntbt, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,7 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/xfs/092 b/tests/xfs/092 index 1623633d..015149e2 100755 --- a/tests/xfs/092 +++ b/tests/xfs/092 @@ -6,23 +6,10 @@ # # Make sure that we can mount inode64 filesystems # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest other auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/093 b/tests/xfs/093 index 9a61cc3e..04b09e85 100755 --- a/tests/xfs/093 +++ b/tests/xfs/093 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt the inobt, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,7 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/xfs/094 b/tests/xfs/094 index 8a1af61c..438a3ea8 100755 --- a/tests/xfs/094 +++ b/tests/xfs/094 @@ -6,23 +6,10 @@ # # Exercising the inheritable realtime inode bit. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest metadata dir ioctl auto realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/095 b/tests/xfs/095 index 4c87ed43..a3891c85 100755 --- a/tests/xfs/095 +++ b/tests/xfs/095 @@ -6,23 +6,10 @@ # # Test upgrading the XFS log to v2 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest log v2log auto + +# Import common functions. . ./common/filter . ./common/log diff --git a/tests/xfs/096 b/tests/xfs/096 index d658c442..a7a5444f 100755 --- a/tests/xfs/096 +++ b/tests/xfs/096 @@ -8,23 +8,10 @@ # ensure pv#920679 is addressed # seqfull=$0 -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest mkfs v2log auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/log @@ -83,7 +70,6 @@ mkfs_filter() } # real QA test starts here -rm -f $seqres.full # Modify as appropriate. _supported_fs xfs diff --git a/tests/xfs/097 b/tests/xfs/097 index 98648c9e..4cad7216 100755 --- a/tests/xfs/097 +++ b/tests/xfs/097 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt the finobt, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -40,7 +34,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/xfs/098 b/tests/xfs/098 index 1e1f7b40..1e60271f 100755 --- a/tests/xfs/098 +++ b/tests/xfs/098 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt the journal, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -40,8 +34,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - TESTDIR="${SCRATCH_MNT}/scratchdir" TESTFILE="${TESTDIR}/testfile" diff --git a/tests/xfs/099 b/tests/xfs/099 index 9a1408b8..a7eaff6e 100755 --- a/tests/xfs/099 +++ b/tests/xfs/099 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a block directory, then see # how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/100 b/tests/xfs/100 index 277f26ec..79da8cb0 100755 --- a/tests/xfs/100 +++ b/tests/xfs/100 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a leaf directory's data # extent, then see how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/101 b/tests/xfs/101 index 6eb303ad..64f4705a 100755 --- a/tests/xfs/101 +++ b/tests/xfs/101 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a leaf directory's leaf # extent, then see how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/102 b/tests/xfs/102 index 23326ecf..24dce430 100755 --- a/tests/xfs/102 +++ b/tests/xfs/102 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a node directory's data # extent, then see how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/103 b/tests/xfs/103 index 46cc3611..a3f0ef9e 100755 --- a/tests/xfs/103 +++ b/tests/xfs/103 @@ -6,17 +6,10 @@ # # Exercise the XFS nosymlinks inode flag # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest metadata dir ioctl auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _create_scratch() diff --git a/tests/xfs/104 b/tests/xfs/104 index 679aced4..d16f46d8 100755 --- a/tests/xfs/104 +++ b/tests/xfs/104 @@ -6,17 +6,10 @@ # # XFS online growfs-while-allocating tests (data subvol variant) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest growfs ioctl prealloc auto stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _create_scratch() @@ -57,7 +50,6 @@ _supported_fs xfs _require_scratch _require_xfs_io_command "falloc" -rm -f $seqres.full _scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs . $tmp.mkfs # extract blocksize and data size for scratch device diff --git a/tests/xfs/105 b/tests/xfs/105 index 7aeee7f0..22a8bf9f 100755 --- a/tests/xfs/105 +++ b/tests/xfs/105 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a node directory's leaf # extent, then see how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/106 b/tests/xfs/106 index 51180046..f1397f94 100755 --- a/tests/xfs/106 +++ b/tests/xfs/106 @@ -8,29 +8,13 @@ # Use of "sync" mount option here is an attempt to get deterministic # allocator behaviour. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs _require_scratch diff --git a/tests/xfs/107 b/tests/xfs/107 index 790f1b85..ce131a77 100755 --- a/tests/xfs/107 +++ b/tests/xfs/107 @@ -8,17 +8,10 @@ # Use of "sync" mount option here is an attempt to get deterministic # allocator behaviour. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota diff --git a/tests/xfs/108 b/tests/xfs/108 index 729d00ca..0af22443 100755 --- a/tests/xfs/108 +++ b/tests/xfs/108 @@ -6,17 +6,10 @@ # # Simple quota accounting test for direct/buffered/mmap IO. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest quota auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota diff --git a/tests/xfs/109 b/tests/xfs/109 index 99db82db..6cb6917a 100755 --- a/tests/xfs/109 +++ b/tests/xfs/109 @@ -6,17 +6,10 @@ # # ENOSPC deadlock case from Asano Masahiro. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest metadata auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -76,7 +69,6 @@ allocate() # real QA test starts here _scratch_mkfs_xfs >> $seqres.full _scratch_mount -rm -f $seqres.full # see if faststart is possible (and requested) files=2000 diff --git a/tests/xfs/110 b/tests/xfs/110 index cc20a6e4..596057ef 100755 --- a/tests/xfs/110 +++ b/tests/xfs/110 @@ -6,17 +6,10 @@ # # Incorrect dir2 freetab warning case from Masanori Tsuda. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest repair auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/111 b/tests/xfs/111 index cb5fc9b3..ede28aee 100755 --- a/tests/xfs/111 +++ b/tests/xfs/111 @@ -6,25 +6,16 @@ # # Infinite xfs_bulkstat bad-inode loop case from Roger Willcocks. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest ioctl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs xfs _require_scratch -rm -f $seqres.full - [ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found" # real QA test starts here diff --git a/tests/xfs/112 b/tests/xfs/112 index 085f21ee..bc1ab628 100755 --- a/tests/xfs/112 +++ b/tests/xfs/112 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a node directory's freeindex # extent, then see how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/113 b/tests/xfs/113 index 3dc51381..e820ed96 100755 --- a/tests/xfs/113 +++ b/tests/xfs/113 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a btree directory's data # extent, then see how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/114 b/tests/xfs/114 index 3f5575a6..a0ea1d13 100755 --- a/tests/xfs/114 +++ b/tests/xfs/114 @@ -8,23 +8,10 @@ # In particular, make sure that fcollapse works for rmap when the # extents on either side of the collapse area are mergeable. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone rmap collapse insert -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/xfs/115 b/tests/xfs/115 index d9c401b3..f0647281 100755 --- a/tests/xfs/115 +++ b/tests/xfs/115 @@ -9,28 +9,12 @@ # # At the end of the test, the scratch device will purposely be in a corrupted # state, so there is no need for checking that. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fuzzers -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/116 b/tests/xfs/116 index 29f81229..736fb2f9 100755 --- a/tests/xfs/116 +++ b/tests/xfs/116 @@ -8,23 +8,10 @@ # Test out resetting of sb_qflags when mounting with no quotas after # having mounted with quotas. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest quota auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota diff --git a/tests/xfs/117 b/tests/xfs/117 index 32be525f..e4195d9b 100755 --- a/tests/xfs/117 +++ b/tests/xfs/117 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt an inode, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,7 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full victimdir="${SCRATCH_MNT}/scratchdir" echo "+ create scratch fs" diff --git a/tests/xfs/118 b/tests/xfs/118 index 9a431821..03755b28 100755 --- a/tests/xfs/118 +++ b/tests/xfs/118 @@ -15,28 +15,12 @@ # Fixed upstream by proper nextents counting using # ip->i_df.if_bytes not ip->i_d.di_nextents in xfs_swap_extent_forks # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fsr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - _supported_fs xfs _require_scratch diff --git a/tests/xfs/119 b/tests/xfs/119 index aeb376d7..a1180371 100755 --- a/tests/xfs/119 +++ b/tests/xfs/119 @@ -8,23 +8,10 @@ # Test out pv#942130 # This can hang when things aren't working # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest log v2log auto freeze + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/120 b/tests/xfs/120 index f5eb14cc..0a4d72a0 100755 --- a/tests/xfs/120 +++ b/tests/xfs/120 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt the bmbt, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/121 b/tests/xfs/121 index c5c66040..08b5143d 100755 --- a/tests/xfs/121 +++ b/tests/xfs/121 @@ -10,24 +10,16 @@ # are happening. # See pv#953263. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown log auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/log # real QA test starts here _supported_fs xfs -rm -f $seqres.full rm -f $tmp.log _require_scratch diff --git a/tests/xfs/122 b/tests/xfs/122 index c8593315..52006150 100755 --- a/tests/xfs/122 +++ b/tests/xfs/122 @@ -8,24 +8,15 @@ # Keep an eye on some of the xfs type sizes # Motivation from differing ondisk types for 32 and 64 bit word versions. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest other auto quick clone realtime # get standard environment -. ./common/rc # real QA test starts here _supported_fs xfs _require_command "$INDENT_PROG" indent -rm -f $seqres.full - # filter out known changes to xfs type sizes _type_size_filter() { diff --git a/tests/xfs/123 b/tests/xfs/123 index ced453bd..81f39b96 100755 --- a/tests/xfs/123 +++ b/tests/xfs/123 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a long symlink, then see how # the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/124 b/tests/xfs/124 index 50faa66b..39307218 100755 --- a/tests/xfs/124 +++ b/tests/xfs/124 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a block xattr, then see # how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/125 b/tests/xfs/125 index c9ee2cf3..fb5f5695 100755 --- a/tests/xfs/125 +++ b/tests/xfs/125 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a leaf xattr's index extent, # then see how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/126 b/tests/xfs/126 index 0ca0670c..c3a74b1c 100755 --- a/tests/xfs/126 +++ b/tests/xfs/126 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt a leaf xattr's data extent, # then see how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate @@ -38,8 +32,6 @@ _require_populate_commands _require_xfs_db_blocktrash_z_command test -z "${FUZZ_ARGS}" && FUZZ_ARGS="-n 8 -3" -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/127 b/tests/xfs/127 index c8048a72..f39b0582 100755 --- a/tests/xfs/127 +++ b/tests/xfs/127 @@ -6,23 +6,10 @@ # # Tests xfs_growfs on a reflinked filesystem # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick clone + +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/xfs/128 b/tests/xfs/128 index 835a007f..db5d9a60 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -6,23 +6,10 @@ # # Ensure that xfs_fsr un-reflinks files while defragmenting # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick clone fsr + +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/xfs/129 b/tests/xfs/129 index 513d2fdd..df977552 100755 --- a/tests/xfs/129 +++ b/tests/xfs/129 @@ -8,15 +8,10 @@ # of a multi-level refcount btree, and that metadump will successfully copy # said block. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +19,7 @@ _cleanup() rm -rf $tmp.* $testdir $metadump_file $TEST_DIR/image } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _supported_fs xfs _require_loop _require_scratch_reflink -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/xfs/130 b/tests/xfs/130 index 6f6e8512..0eb7d9c0 100755 --- a/tests/xfs/130 +++ b/tests/xfs/130 @@ -7,23 +7,17 @@ # Create and populate an XFS filesystem, corrupt the refcount btree, # then see how the kernel and xfs_repair deal with it. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest fuzzers clone +# Override the default cleanup function. _cleanup() { cd / #rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink diff --git a/tests/xfs/131 b/tests/xfs/131 index a20ebc52..879e2dc6 100755 --- a/tests/xfs/131 +++ b/tests/xfs/131 @@ -6,15 +6,10 @@ # # Ensure that we can't reflink realtime files. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone realtime +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() rm -rf $tmp.* $testdir $metadump_file } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,8 +27,6 @@ _require_realtime _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - echo "Format and mount scratch device" _scratch_mkfs >> $seqres.full _scratch_mount diff --git a/tests/xfs/132 b/tests/xfs/132 index 83b37e69..fa36c09c 100755 --- a/tests/xfs/132 +++ b/tests/xfs/132 @@ -6,29 +6,13 @@ # # Catch inobt/on disk inode free state mismatches on V4 filesystems # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/133 b/tests/xfs/133 index f9351fc8..73f628c4 100755 --- a/tests/xfs/133 +++ b/tests/xfs/133 @@ -13,22 +13,12 @@ # So, create this malformed inode and try a buffered append to make # sure we catch this situation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers PIDS="" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,8 +26,6 @@ _supported_fs xfs _require_scratch_nocheck _disable_dmesg_check -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/xfs/134 b/tests/xfs/134 index 09072f7a..b13615ab 100755 --- a/tests/xfs/134 +++ b/tests/xfs/134 @@ -13,22 +13,12 @@ # So, create this malformed inode and try a dio append to make sure we # catch this situation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers PIDS="" -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -36,8 +26,6 @@ _supported_fs xfs _require_scratch_nocheck _disable_dmesg_check -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/xfs/135 b/tests/xfs/135 index 52389701..6b96d00c 100755 --- a/tests/xfs/135 +++ b/tests/xfs/135 @@ -8,25 +8,10 @@ # correctly for various log stripe unit values. The log is formatted with xfs_db # and verified with xfs_logprint. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto logprint quick v2log -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/log # real QA test starts here diff --git a/tests/xfs/136 b/tests/xfs/136 index 37ef6fa2..1658b760 100755 --- a/tests/xfs/136 +++ b/tests/xfs/136 @@ -8,23 +8,10 @@ # Let's look, xfs_db, at the inode and its literal area for the # extents and the attributes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest attr2 -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/xfs/137 b/tests/xfs/137 index 93e20ab6..2cc974e5 100755 --- a/tests/xfs/137 +++ b/tests/xfs/137 @@ -11,25 +11,10 @@ # put the current LSN behind metadata LSNs and verifies that the kernel and # xfs_repair detect the problem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto metadata v2log -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here diff --git a/tests/xfs/138 b/tests/xfs/138 index cd5ea2f5..966ac03a 100755 --- a/tests/xfs/138 +++ b/tests/xfs/138 @@ -6,23 +6,12 @@ # # Test nesting the 'source' command in xfs_db via -c and interactive. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/139 b/tests/xfs/139 index 58b71711..118930a5 100755 --- a/tests/xfs/139 +++ b/tests/xfs/139 @@ -7,23 +7,17 @@ # Try to ENOSPC while expanding the refcntbt by CoWing every block # of a file that eats the whole AG. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _require_no_large_scratch_dev _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount _xfs_force_bdev data $SCRATCH_MNT diff --git a/tests/xfs/140 b/tests/xfs/140 index eb635360..ba7694c3 100755 --- a/tests/xfs/140 +++ b/tests/xfs/140 @@ -7,23 +7,17 @@ # Try to ENOSPC while expanding the refcntbt by CoWing every other block # of a file that eats the whole AG. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,8 +28,6 @@ _require_no_large_scratch_dev _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount blksz=$(_get_file_block_size $SCRATCH_MNT) diff --git a/tests/xfs/141 b/tests/xfs/141 index defe4b0f..d9b2474d 100755 --- a/tests/xfs/141 +++ b/tests/xfs/141 @@ -11,15 +11,10 @@ # # Note that this test requires a DEBUG mode kernel. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto log metadata +# Override the default cleanup function. _cleanup() { cd / @@ -28,10 +23,7 @@ _cleanup() wait > /dev/null 2>&1 } -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/inject # real QA test starts here diff --git a/tests/xfs/142 b/tests/xfs/142 index 0a5f7613..60b750ed 100755 --- a/tests/xfs/142 +++ b/tests/xfs/142 @@ -9,23 +9,10 @@ # fixes the bmap record validator so that it will not check the attr fork # extent mappings of a realtime file against the size of the realtime volume. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick rw attr realtime + +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _supported_fs xfs _require_scratch _require_realtime -rm -f $seqres.full - # Format filesystem with very tiny realtime volume _scratch_mkfs -r size=256k > $seqres.full _scratch_mount >> $seqres.full diff --git a/tests/xfs/143 b/tests/xfs/143 index 66536a16..185b6387 100755 --- a/tests/xfs/143 +++ b/tests/xfs/143 @@ -10,23 +10,10 @@ # This is a regression test for the xfsprogs commit 31409f48 ("mkfs: set # required parts of the realtime geometry before computing log geometry"). -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick realtime mount -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +21,6 @@ _supported_fs xfs _require_scratch _require_realtime -rm -f $seqres.full - # Format a tiny filesystem to force minimum log size, then see if it mounts _scratch_mkfs -r size=1m -d size=100m > $seqres.full _scratch_mount >> $seqres.full diff --git a/tests/xfs/144 b/tests/xfs/144 index 74988090..5abec9ae 100755 --- a/tests/xfs/144 +++ b/tests/xfs/144 @@ -11,23 +11,10 @@ # regression test for commit 4b8628d57b72 ("xfs: actually bump warning counts # when we send warnings"). -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick quota -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -36,8 +23,6 @@ _supported_fs xfs _require_xfs_quota _require_scratch -rm -f $seqres.full - exercise() { _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs cat $tmp.mkfs >>$seqres.full diff --git a/tests/xfs/145 b/tests/xfs/145 index 3ccbb923..d32e726e 100755 --- a/tests/xfs/145 +++ b/tests/xfs/145 @@ -10,23 +10,10 @@ # for commit 1aecf3734a95 ("xfs: fix chown leaking delalloc quota blocks when # fssetxattr fails"). -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/quota # real QA test starts here @@ -36,8 +23,6 @@ _require_test_program "chprojid_fail" _require_quota _require_scratch -rm -f $seqres.full - echo "Format filesystem" | tee -a $seqres.full _scratch_mkfs > $seqres.full _qmount_option 'prjquota' diff --git a/tests/xfs/146 b/tests/xfs/146 index 49020e01..5516d396 100755 --- a/tests/xfs/146 +++ b/tests/xfs/146 @@ -14,23 +14,10 @@ # the end of the rtbitmap file. When this happens, xfs triggers a verifier # error and returns EFSCORRUPTED. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick rw realtime + +# Import common functions. . ./common/filter # real QA test starts here @@ -39,8 +26,6 @@ _require_scratch _require_realtime _require_test_program "punch-alternating" -rm -f $seqres.full - # Format filesystem to get the block size _scratch_mkfs > $seqres.full _scratch_mount >> $seqres.full diff --git a/tests/xfs/147 b/tests/xfs/147 index 5cc363aa..e21fdd33 100755 --- a/tests/xfs/147 +++ b/tests/xfs/147 @@ -8,23 +8,10 @@ # This is a regression test for fe341eb151ec ("xfs: ensure that fpunch, # fcollapse, and finsert operations are aligned to rt extent size") -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw realtime collapse insert unshare zero prealloc -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -37,8 +24,6 @@ _require_xfs_io_command "funshare" _require_xfs_io_command "fzero" _require_xfs_io_command "falloc" -rm -f $seqres.full - # Format filesystem with a 256k realtime extent size _scratch_mkfs -r extsize=256k > $seqres.full _scratch_mount >> $seqres.full diff --git a/tests/xfs/148 b/tests/xfs/148 index 522256e5..9427aff0 100755 --- a/tests/xfs/148 +++ b/tests/xfs/148 @@ -7,15 +7,10 @@ # See if we catch corrupt directory names or attr names with nulls or slashes # in them. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick fuzzers +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +19,7 @@ _cleanup() rm -r -f $imgfile $mntpt $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -36,8 +30,6 @@ _require_attrs _require_xfs_mkfs_crc _disable_dmesg_check -rm -f $seqres.full - imgfile=$TEST_DIR/img-$seq mntpt=$TEST_DIR/mount-$seq testdir=$mntpt/testdir diff --git a/tests/xfs/149 b/tests/xfs/149 index 27032a3e..503eff65 100755 --- a/tests/xfs/149 +++ b/tests/xfs/149 @@ -12,19 +12,14 @@ # # Based on xfs/289 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick growfs loopfile=$TEST_DIR/fsfile mntdir=$TEST_DIR/mntdir loop_symlink=$TEST_DIR/loop_symlink.$$ +# Override the default cleanup function. _cleanup() { $UMOUNT_PROG $mntdir @@ -34,13 +29,9 @@ _cleanup() rm -f $loopfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/150 b/tests/xfs/150 index a0bad475..bd0241b9 100755 --- a/tests/xfs/150 +++ b/tests/xfs/150 @@ -8,23 +8,10 @@ # This means that it can navigate to random inodes, fails on paths that don't # resolve. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick db + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/151 b/tests/xfs/151 index e6c61563..66425f67 100755 --- a/tests/xfs/151 +++ b/tests/xfs/151 @@ -8,23 +8,10 @@ # This means that we can list the current directory, list an arbitrary path, # and we can't list things that aren't directories. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick db -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/152 b/tests/xfs/152 index ef7b6b04..de85f48c 100755 --- a/tests/xfs/152 +++ b/tests/xfs/152 @@ -10,14 +10,8 @@ # Use of "sync" mount option here is an attempt to get deterministic # allocator behaviour. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick quota idmapped wipe_mounts() { @@ -25,6 +19,7 @@ wipe_mounts() _scratch_unmount >/dev/null 2>&1 } +# Override the default cleanup function. _cleanup() { cd / @@ -32,14 +27,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs _require_idmapped_mounts diff --git a/tests/xfs/153 b/tests/xfs/153 index 19cfc46f..37303701 100755 --- a/tests/xfs/153 +++ b/tests/xfs/153 @@ -9,26 +9,20 @@ # Exercises basic XFS quota functionality # uquota, gquota, uqnoenforce, gqnoenforce # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota idmapped -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/154 b/tests/xfs/154 index 03000b76..3f90a397 100755 --- a/tests/xfs/154 +++ b/tests/xfs/154 @@ -10,23 +10,10 @@ # repair activity in a later phase. Use a debug knob in xfs_repair to abort # the repair immediately after forcing the flag on. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,8 +22,6 @@ _require_scratch_nocheck _require_scratch_xfs_crc # needsrepair only exists for v5 _require_libxfs_debug_flag LIBXFS_DEBUG_WRITE_CRASH -rm -f $seqres.full - # Set up a real filesystem for our actual test _scratch_mkfs >> $seqres.full diff --git a/tests/xfs/155 b/tests/xfs/155 index 5dcfbfbb..c4ee8e20 100755 --- a/tests/xfs/155 +++ b/tests/xfs/155 @@ -13,23 +13,10 @@ # Repeat with the trip point set to successively higher numbers of writes until # we hit ~200 writes or repair manages to run to completion without tripping. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/populate . ./common/filter @@ -40,8 +27,6 @@ _require_scratch_xfs_crc # needsrepair only exists for v5 _require_populate_commands _require_libxfs_debug_flag LIBXFS_DEBUG_WRITE_CRASH -rm -f $seqres.full - # Populate the filesystem _scratch_populate_cached nofill >> $seqres.full 2>&1 diff --git a/tests/xfs/156 b/tests/xfs/156 index e7e37a20..75418805 100755 --- a/tests/xfs/156 +++ b/tests/xfs/156 @@ -9,23 +9,10 @@ # test the options that apply only to V4 filesystems because that disk format # is deprecated. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick admin -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +20,6 @@ _supported_fs xfs _require_scratch _require_command "$XFS_ADMIN_PROG" "xfs_admin" -rm -f $seqres.full - note() { echo "$@" | tee -a $seqres.full } diff --git a/tests/xfs/157 b/tests/xfs/157 index 413e121f..8222d7ee 100755 --- a/tests/xfs/157 +++ b/tests/xfs/157 @@ -17,23 +17,17 @@ # correctly", insofar as the issue fixed by that patch was discovered with an # earlier revision of this test. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick admin +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $fake_logfile $fake_rtfile $fake_datafile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -42,8 +36,6 @@ _require_test _require_scratch_nocheck _require_command "$XFS_ADMIN_PROG" "xfs_admin" -rm -f $seqres.full - # Create some fake sparse files for testing external devices and whatnot fake_datafile=$TEST_DIR/$seq.scratch.data rm -f $fake_datafile diff --git a/tests/xfs/158 b/tests/xfs/158 index 50d31863..505a9c73 100755 --- a/tests/xfs/158 +++ b/tests/xfs/158 @@ -7,23 +7,10 @@ # Check that we can upgrade a filesystem to support inobtcount and that # everything works properly after the upgrade. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick inobtcount + +# Import common functions. . ./common/filter # real QA test starts here @@ -32,8 +19,6 @@ _require_scratch_xfs_inobtcount _require_command "$XFS_ADMIN_PROG" "xfs_admin" _require_xfs_repair_upgrade inobtcount -rm -f $seqres.full - # Make sure we can't format a filesystem with inobtcount and not finobt. _scratch_mkfs -m crc=1,inobtcount=1,finobt=0 &> $seqres.full && \ echo "Should not be able to format with inobtcount but not finobt." diff --git a/tests/xfs/159 b/tests/xfs/159 index 20744946..eaee590e 100755 --- a/tests/xfs/159 +++ b/tests/xfs/159 @@ -8,30 +8,22 @@ # This in combination with an xfs_ondisk.h build time check in the kernel # ensures that the kernel agrees with userspace. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick bigtime +# Override the default cleanup function. _cleanup() { cd / } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs xfs _require_scratch _require_xfs_db_command timelimit -rm -f $seqres.full - # Format filesystem without bigtime support and populate it _scratch_mkfs > $seqres.full echo classic xfs timelimits diff --git a/tests/xfs/160 b/tests/xfs/160 index b121ea89..399fe4bc 100755 --- a/tests/xfs/160 +++ b/tests/xfs/160 @@ -7,23 +7,10 @@ # Check that we can upgrade a filesystem to support bigtime and that inode # timestamps work properly after the upgrade. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick bigtime + +# Import common functions. . ./common/filter # real QA test starts here @@ -35,8 +22,6 @@ _require_xfs_repair_upgrade bigtime date --date='Jan 1 00:00:00 UTC 2040' > /dev/null 2>&1 || \ _notrun "Userspace does not support dates past 2038." -rm -f $seqres.full - # Make sure we can't upgrade a V4 filesystem _scratch_mkfs -m crc=0 >> $seqres.full _scratch_xfs_admin -O bigtime=1 2>> $seqres.full diff --git a/tests/xfs/161 b/tests/xfs/161 index bd5631b8..486fa6ca 100755 --- a/tests/xfs/161 +++ b/tests/xfs/161 @@ -8,23 +8,10 @@ # timers work properly after the upgrade. You need a quota-tools containing # commit 16b60cb9e315ed for this test to run properly; v4.06 should do. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick bigtime quota + +# Import common functions. . ./common/filter . ./common/quota @@ -45,8 +32,6 @@ $QUOTA_PROG --help 2>&1 | grep -q projectname || \ date --date='Jan 1 00:00:00 UTC 2040' > /dev/null 2>&1 || \ _notrun "Userspace does not support dates past 2038." -rm -f $seqres.full - # Format V5 filesystem without bigtime support and populate it _scratch_mkfs -m crc=1,bigtime=0 >> $seqres.full _qmount_option "usrquota" diff --git a/tests/xfs/162 b/tests/xfs/162 index c7c72d13..16922ff6 100755 --- a/tests/xfs/162 +++ b/tests/xfs/162 @@ -7,23 +7,12 @@ # Make sure that attrs are handled properly when repair has to reset the root # directory. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick attr repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy @@ -34,8 +23,6 @@ _require_scratch_nocheck _require_populate_commands _require_xfs_db_command "fuzz" -rm -f $seqres.full - echo "Format and populate btree attr root dir" _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount diff --git a/tests/xfs/163 b/tests/xfs/163 index b4aec2a5..9f6dbeb8 100755 --- a/tests/xfs/163 +++ b/tests/xfs/163 @@ -9,17 +9,10 @@ # This test attempts to shrink with a small size (512K), half AG size and # an out-of-bound size (agsize + 1) to observe if it works as expected. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick growfs shrinkfs -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter test_shrink() @@ -40,7 +33,6 @@ test_shrink() _supported_fs xfs _require_scratch_xfs_shrink -rm -f $seqres.full echo "Format and mount" # agcount = 1 is forbidden on purpose, and need to ensure shrinking to diff --git a/tests/xfs/164 b/tests/xfs/164 index a72d1afe..ba08982d 100755 --- a/tests/xfs/164 +++ b/tests/xfs/164 @@ -12,20 +12,8 @@ # * eof on an unwritten extent # * eof on a sector boundary and not on a sector boundary # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest rw pattern auto prealloc quick _filter_io() { @@ -42,8 +30,7 @@ _filter_bmap() {print $1, $2}' >> $seqres.full } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -54,7 +41,6 @@ _require_test _require_xfs_io_command "falloc" testfile=$TEST_DIR/file.$seq -rm -f $seqres.full _test_eof_hole() { diff --git a/tests/xfs/165 b/tests/xfs/165 index 77a990ad..7664b980 100755 --- a/tests/xfs/165 +++ b/tests/xfs/165 @@ -9,20 +9,8 @@ # pv#962014 - DMF 3.7 reading incorrect data # Doesn't actually reproduce the problem but it tried to :-) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest rw pattern auto prealloc quick _filter_io() { @@ -39,8 +27,7 @@ _filter_bmap() {print $1, $2}' >> $seqres.full } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -53,7 +40,6 @@ _require_xfs_io_command "falloc" # io tests testfile=$TEST_DIR/file.$seq rm -f $testfile -rm -f $seqres.full len=4 end=`expr 10 \* $len` diff --git a/tests/xfs/166 b/tests/xfs/166 index 81f0d189..42379961 100755 --- a/tests/xfs/166 +++ b/tests/xfs/166 @@ -6,18 +6,10 @@ # # ->page-mkwrite test - unwritten extents and mmap # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw metadata auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # assumes 1st, 3rd and 5th blocks are single written blocks, diff --git a/tests/xfs/167 b/tests/xfs/167 index ff6844dd..5f985010 100755 --- a/tests/xfs/167 +++ b/tests/xfs/167 @@ -6,16 +6,10 @@ # # unwritten extent conversion test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -rm -f $seqres.full -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest rw metadata auto stress +# Override the default cleanup function. _cleanup() { $KILLALL_PROG -r -q -TERM fsstress 2> /dev/null @@ -32,8 +26,7 @@ workout() sleep 2 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/168 b/tests/xfs/168 index b98e47c9..ffcd0df8 100755 --- a/tests/xfs/168 +++ b/tests/xfs/168 @@ -10,17 +10,10 @@ # background fsstress workload. It will decrease the shrink size if # larger size fails. And totally repeat 2 * TIME_FACTOR times. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto growfs shrinkfs ioctl prealloc stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter create_scratch() @@ -55,7 +48,6 @@ _supported_fs xfs _require_scratch_xfs_shrink _require_xfs_io_command "falloc" -rm -f $seqres.full _scratch_mkfs_xfs | tee -a $seqres.full | _filter_mkfs 2>$tmp.mkfs >/dev/null . $tmp.mkfs # extract blocksize and data size for scratch device diff --git a/tests/xfs/169 b/tests/xfs/169 index 2051091f..7ea5af99 100755 --- a/tests/xfs/169 +++ b/tests/xfs/169 @@ -8,15 +8,10 @@ # of a multi-level refcount btree. Delete and recreate a few times to # exercise the refcount btree grow/shrink functions. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +19,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,8 +27,6 @@ _cleanup() _supported_fs xfs _require_scratch_reflink -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/xfs/170 b/tests/xfs/170 index 84023e4d..5e622d24 100755 --- a/tests/xfs/170 +++ b/tests/xfs/170 @@ -8,24 +8,10 @@ # Check the filestreams allocator is doing its job. # Multi-file data streams should always write into seperate AGs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw filestreams auto quick -here=`pwd` -tmp=/tmp/$$ -rm -f $seqres.full -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filestreams diff --git a/tests/xfs/171 b/tests/xfs/171 index 0239081a..4412fe2f 100755 --- a/tests/xfs/171 +++ b/tests/xfs/171 @@ -7,24 +7,10 @@ # Check the filestreams allocator is doing its job. # Multi-file data streams should always write into seperate AGs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -rm -f $seqres.full -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest rw filestreams + +# Import common functions. . ./common/filter . ./common/filestreams diff --git a/tests/xfs/172 b/tests/xfs/172 index 56c34e69..0d1b441e 100755 --- a/tests/xfs/172 +++ b/tests/xfs/172 @@ -7,24 +7,10 @@ # Check the filestreams allocator is doing its job. # Multi-file data streams should always write into seperate AGs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -rm -f $seqres.full -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest rw filestreams + +# Import common functions. . ./common/filter . ./common/filestreams diff --git a/tests/xfs/173 b/tests/xfs/173 index f37d2719..bce6ac51 100755 --- a/tests/xfs/173 +++ b/tests/xfs/173 @@ -7,24 +7,10 @@ # Check the filestreams allocator is doing its job. # Multi-file data streams should always write into seperate AGs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -rm -f $seqres.full -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest rw filestreams + +# Import common functions. . ./common/filter . ./common/filestreams diff --git a/tests/xfs/174 b/tests/xfs/174 index fc3de04f..1245a217 100755 --- a/tests/xfs/174 +++ b/tests/xfs/174 @@ -7,24 +7,10 @@ # Check the filestreams allocator is doing its job. # Multi-file data streams should always write into seperate AGs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -rm -f $seqres.full -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest rw filestreams auto + +# Import common functions. . ./common/filter . ./common/filestreams diff --git a/tests/xfs/178 b/tests/xfs/178 index 122d63d2..a65197cd 100755 --- a/tests/xfs/178 +++ b/tests/xfs/178 @@ -7,20 +7,9 @@ # Reproduce PV#:967665 # Test if mkfs.xfs wipes old AG headers when using -f option # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest mkfs other auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} # dd the 1st sector then repair _dd_repair_check() { @@ -36,8 +25,7 @@ _dd_repair_check() fi } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/repair diff --git a/tests/xfs/179 b/tests/xfs/179 index 54a8145b..ec0cb7e5 100755 --- a/tests/xfs/179 +++ b/tests/xfs/179 @@ -6,23 +6,10 @@ # # See how well reflink handles overflowing reflink counts. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink @@ -34,8 +21,6 @@ _require_scratch_nocheck _require_cp_reflink _require_test_program "punch-alternating" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs -d agcount=1 > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/180 b/tests/xfs/180 index 587bebf9..72a1b738 100755 --- a/tests/xfs/180 +++ b/tests/xfs/180 @@ -10,23 +10,10 @@ # - Rewrite the whole file to use up reservations. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +24,6 @@ _require_cp_reflink _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/181 b/tests/xfs/181 index 6a535ff3..a399ae5a 100755 --- a/tests/xfs/181 +++ b/tests/xfs/181 @@ -10,10 +10,10 @@ # will here) also call xfs_inactive_attrs. # We want to test out this xfs_inactive_attrs code being called in recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown log auto quick +# Override the default cleanup function. _cleanup() { rm -f $tmp.* @@ -21,20 +21,14 @@ _cleanup() } pid="" -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/log # real QA test starts here _supported_fs xfs -rm -f $seqres.full rm -f $tmp.log _require_scratch diff --git a/tests/xfs/182 b/tests/xfs/182 index 9f711d05..ea565824 100755 --- a/tests/xfs/182 +++ b/tests/xfs/182 @@ -10,23 +10,10 @@ # - Rewrite the whole file to use up reservations. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/183 b/tests/xfs/183 index a3632ced..5b092acc 100755 --- a/tests/xfs/183 +++ b/tests/xfs/183 @@ -7,23 +7,10 @@ # Test to check bulkstat returns unlinked-but-referenced inodes # (PVs: 972128, 972004) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw other auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/184 b/tests/xfs/184 index 633bdb83..95250b29 100755 --- a/tests/xfs/184 +++ b/tests/xfs/184 @@ -10,23 +10,10 @@ # - falloc the whole file to unshare blocks. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" _require_xfs_io_command "funshare" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/186 b/tests/xfs/186 index dffa0503..b54fcf26 100755 --- a/tests/xfs/186 +++ b/tests/xfs/186 @@ -17,20 +17,8 @@ # and then turn on attr1 and add one more EA which # will write over the shortform dirents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest attr auto quick _create_dirents() { @@ -123,8 +111,7 @@ _changeto_attr1() _scratch_xfs_db -x -c "version attr1" | _filter_version } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -137,8 +124,6 @@ _require_scratch _require_attrs _require_attr_v1 -rm -f $seqres.full - _scratch_mkfs -i attr=2,size=512 -l lazy-count=1 | _filter_mkfs \ >>$seqres.full 2>$tmp.mkfs # import crc status and attr version diff --git a/tests/xfs/187 b/tests/xfs/187 index c60f3e6f..3f8c7ef8 100755 --- a/tests/xfs/187 +++ b/tests/xfs/187 @@ -11,28 +11,15 @@ # Test the case where there are no more features2 bits on and # so the morebitsbit should be off. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest attr auto quick _filter_version() { tee -a $seqres.full | tr ',' '\n' | egrep 'ATTR|MORE|LAZY' } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -44,8 +31,6 @@ _require_attrs _require_attr_v1 _require_projid16bit -rm -f $seqres.full - # Reset the options so that we can control what is going on here export MKFS_OPTIONS="" export MOUNT_OPTIONS="" diff --git a/tests/xfs/188 b/tests/xfs/188 index 2879a107..d40e4123 100755 --- a/tests/xfs/188 +++ b/tests/xfs/188 @@ -13,15 +13,12 @@ # value in XFS stressing leaf block traversal in # node form directories as well. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest ci dir auto -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { cd / @@ -29,20 +26,17 @@ _cleanup() rm -rf $SCRATCH_MNT/$seq } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs xfs _require_scratch _require_xfs_mkfs_ciname -rm -f $seqres.full _scratch_mkfs -n version=ci >/dev/null 2>&1 _scratch_mount -status=1 # default failure sourcefile=$tmp.ci_nametest seed=1 diff --git a/tests/xfs/189 b/tests/xfs/189 index 7cb8b3a6..e601881a 100755 --- a/tests/xfs/189 +++ b/tests/xfs/189 @@ -33,18 +33,12 @@ # <---- Normal programming is resumed ----> # # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -tag="added by qa $seq" +. ./common/preamble +_begin_fstest mount auto quick -rm -f $seqres.full +tag="added by qa $seq" +# Override the default cleanup function. _cleanup() { cd / @@ -223,8 +217,7 @@ _putback_scratch_fstab() $SED_PROG -i "/# $tag/d" /etc/fstab } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/xfs/190 b/tests/xfs/190 index e63e095e..860a3516 100755 --- a/tests/xfs/190 +++ b/tests/xfs/190 @@ -11,17 +11,12 @@ # PV 985792 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest rw auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -rm -f $seqres.full -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/191-input-validation b/tests/xfs/191-input-validation index 005152fb..2728846e 100755 --- a/tests/xfs/191-input-validation +++ b/tests/xfs/191-input-validation @@ -7,15 +7,10 @@ # mkfs.xfs input validation test. Designed to break mkfs.xfs if it doesn't # filter garbage input or invalid option combinations correctly. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mkfs realtime +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() [ -n "$loopdev" ] && _destroy_loop_device $loopdev } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +29,6 @@ _require_test _require_loop _require_xfs_mkfs_validation -rm -f $seqres.full echo silence is golden # clear out any options to mkfs first. We want to test realtime and external log @@ -248,8 +241,6 @@ do_mkfs_fail -l lazy-count=0 -m crc=1 $SCRATCH_DEV do_mkfs_fail -l version=1 -m crc=1 $SCRATCH_DEV do_mkfs_fail -l version=0 $SCRATCH_DEV - - # naming section, should pass do_mkfs_pass -n size=65536 $SCRATCH_DEV do_mkfs_pass -n version=2 $SCRATCH_DEV @@ -295,14 +286,12 @@ do_mkfs_pass -r extsize=4k $SCRATCH_DEV do_mkfs_pass -r extsize=1G $SCRATCH_DEV do_mkfs_pass -r noalign $SCRATCH_DEV - # realtime section, should fail do_mkfs_fail -r rtdev=$SCRATCH_DEV do_mkfs_fail -r extsize=256 $SCRATCH_DEV do_mkfs_fail -r extsize=2G $SCRATCH_DEV do_mkfs_fail -r size=65536 $SCRATCH_DEV - # inode section, should pass do_mkfs_pass -i size=256 -m crc=0 $SCRATCH_DEV do_mkfs_pass -i size=512 $SCRATCH_DEV @@ -319,7 +308,6 @@ do_mkfs_pass -i projid32bit $SCRATCH_DEV do_mkfs_pass -i sparse=0 $SCRATCH_DEV do_mkfs_pass -i sparse -m crc $SCRATCH_DEV - # inode section, should fail do_mkfs_fail -i size=256 -m crc $SCRATCH_DEV do_mkfs_fail -i size=128 $SCRATCH_DEV diff --git a/tests/xfs/192 b/tests/xfs/192 index 047eb5e7..1eb9d52e 100755 --- a/tests/xfs/192 +++ b/tests/xfs/192 @@ -10,23 +10,10 @@ # - falloc the whole file to unshare blocks. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -39,8 +26,6 @@ _require_xfs_io_command "cowextsize" _require_xfs_io_command "funshare" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/193 b/tests/xfs/193 index 5a8654dd..1bc48610 100755 --- a/tests/xfs/193 +++ b/tests/xfs/193 @@ -9,23 +9,10 @@ # - Buffered write to random offsets to scatter CoW reservations. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -36,8 +23,6 @@ _require_cp_reflink _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/194 b/tests/xfs/194 index 238db5c3..5a1dff5d 100755 --- a/tests/xfs/194 +++ b/tests/xfs/194 @@ -6,15 +6,10 @@ # # Test mapping around/over holes for sub-page blocks # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest rw auto +# Override the default cleanup function. _cleanup() { cd / @@ -26,15 +21,13 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # only xfs supported due to use of xfs_bmap _supported_fs xfs # real QA test starts here -rm -f $seqres.full _require_scratch _scratch_mkfs_xfs >/dev/null 2>&1 @@ -86,7 +79,6 @@ _scratch_mount test "$(_get_block_size $SCRATCH_MNT)" = $blksize || \ _notrun "Could not get $blksize-byte blocks" - # 512b block / 4k page example: # #1) Write 1k of data (buffered): diff --git a/tests/xfs/195 b/tests/xfs/195 index 59a0e382..3e388142 100755 --- a/tests/xfs/195 +++ b/tests/xfs/195 @@ -8,20 +8,15 @@ # # http://oss.sgi.com/bugzilla/show_bug.cgi?id=340 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest ioctl dump auto quick +# Override the default cleanup function. _cleanup() { rm -rf $TEST_DIR/d rm -f $TEST_DIR/dumpfile } -trap "_cleanup; exit \$status" 0 1 2 3 15 # # Perform a level 0 dump that respects the chattr dump exclude flag, @@ -40,8 +35,7 @@ _do_dump() | sed -e 's/.*xfsdump: pruned ino [0-9]*, owner 0, estimated size 0: skip flag set/xfsdump: pruned ino NNN, owner 0, estimated size 0: skip flag set/' } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -69,5 +63,4 @@ _do_dump # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/xfs/196 b/tests/xfs/196 index 91161a6a..dc87b48a 100755 --- a/tests/xfs/196 +++ b/tests/xfs/196 @@ -12,28 +12,14 @@ # without any indirect block reservation whatsoever. This leads to assert # failures and possibly other problems in XFS. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rw -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/punch . ./common/inject # real QA test starts here -rm -f $seqres.full # Modify as appropriate. _supported_fs generic diff --git a/tests/xfs/197 b/tests/xfs/197 index 75d026d2..109bf478 100755 --- a/tests/xfs/197 +++ b/tests/xfs/197 @@ -12,22 +12,16 @@ # # http://oss.sgi.com/bugzilla/show_bug.cgi?id=808 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest dir auto quick +# Override the default cleanup function. _cleanup() { rm -rf $TEST_DIR/ttt } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -47,5 +41,4 @@ $here/src/t_dir_offset $TEST_DIR/ttt # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/xfs/198 b/tests/xfs/198 index a0d466dc..0c650874 100755 --- a/tests/xfs/198 +++ b/tests/xfs/198 @@ -9,23 +9,10 @@ # - Directio write to random offsets to scatter CoW reservations. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +24,6 @@ _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/199 b/tests/xfs/199 index 54cf4c24..4669f2c3 100755 --- a/tests/xfs/199 +++ b/tests/xfs/199 @@ -9,23 +9,17 @@ # filesystem is first mounted read-only and then later remounted read-write, # which is the usual case for the root filesystem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest mount auto quick +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount >/dev/null 2>&1 } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -75,5 +69,4 @@ rof2=`_scratch_xfs_get_sb_field features2` # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/xfs/200 b/tests/xfs/200 index 9500444a..2324fbdb 100755 --- a/tests/xfs/200 +++ b/tests/xfs/200 @@ -12,23 +12,10 @@ # - falloc the whole fle to see if the extsz hints still apply. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -40,8 +27,6 @@ _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" _require_xfs_io_command "funshare" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/201 b/tests/xfs/201 index 3947589e..b9f2aab1 100755 --- a/tests/xfs/201 +++ b/tests/xfs/201 @@ -9,22 +9,16 @@ # Only happens on 32-bit kernels without CONFIG_LBD, but it should be harmless # to run this everywhere. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest metadata auto quick +# Override the default cleanup function. _cleanup() { _scratch_unmount } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -79,5 +73,4 @@ sync # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/xfs/202 b/tests/xfs/202 index 936575a0..5075d3a1 100755 --- a/tests/xfs/202 +++ b/tests/xfs/202 @@ -6,16 +6,10 @@ # # Test out the xfs_repair -o force_geometry option on single-AG filesystems. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest repair auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/repair @@ -43,5 +37,4 @@ _scratch_xfs_repair -o force_geometry 2>&1 | _filter_repair # success, all done echo "*** done" -rm -f $seqres.full status=0 diff --git a/tests/xfs/203 b/tests/xfs/203 index 6b3f4918..a12ae7c3 100755 --- a/tests/xfs/203 +++ b/tests/xfs/203 @@ -7,13 +7,8 @@ # Test out reallocation of the extent array in xfs_io. # Based on a testcase from Tomasz Majkowski . # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest ioctl auto _write_holes() { @@ -41,16 +36,13 @@ _filter_bmap() {print $1, $2; next}' } +# Override the default cleanup function. _cleanup() { rm -f $SCRATCH_MNT/r?? } -trap "_cleanup; exit \$status" 0 1 2 3 15 - -rm -f $seqres.full -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/204 b/tests/xfs/204 index e183ad04..931be128 100755 --- a/tests/xfs/204 +++ b/tests/xfs/204 @@ -12,23 +12,10 @@ # - falloc the whole fle to see if the extsz hints still apply. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -41,8 +28,6 @@ _require_xfs_io_command "cowextsize" _require_xfs_io_command "funshare" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/205 b/tests/xfs/205 index 1f7ce3d8..104f1f45 100755 --- a/tests/xfs/205 +++ b/tests/xfs/205 @@ -6,16 +6,10 @@ # # Test out ENOSPC flushing on small filesystems. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest metadata rw auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -24,8 +18,6 @@ _supported_fs xfs # single AG will cause xfs_repair to fail checks. _require_scratch_nocheck -rm -f $seqres.full - # Disable the scratch rt device to avoid test failures relating to the rt # bitmap consuming all the free space in our small data device. unset SCRATCH_RTDEV diff --git a/tests/xfs/206 b/tests/xfs/206 index 808c3108..cb346b6d 100755 --- a/tests/xfs/206 +++ b/tests/xfs/206 @@ -12,15 +12,10 @@ # Patch and testcase at # http://article.gmane.org/gmane.comp.file-systems.xfs.general/29193 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest growfs auto quick +# Override the default cleanup function. _cleanup() { umount $tmpdir @@ -29,8 +24,7 @@ _cleanup() rm -f $tmpfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -45,8 +39,6 @@ if [ "$bitsperlong" -ne 64 ]; then _notrun "This test is only valid on 64 bit machines" fi -rm -f $seqres.full - tmpfile=$TEST_DIR/fsfile.$$ tmpdir=$TEST_DIR/tmpdir.$$ diff --git a/tests/xfs/207 b/tests/xfs/207 index f0f30754..ba07f1ee 100755 --- a/tests/xfs/207 +++ b/tests/xfs/207 @@ -9,23 +9,10 @@ # - Ensure that we can set only cowextsz on a many-byte file. # - Ensure that whatever we set we get back later. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -45,8 +32,6 @@ test_xflag() grep -q "\[.*${flg}.*\]" && echo "$flg flag set" || echo "$flg flag unset" } -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/208 b/tests/xfs/208 index 2a899fc0..66c3eda1 100755 --- a/tests/xfs/208 +++ b/tests/xfs/208 @@ -13,23 +13,10 @@ # - Check the number of extents. # - Repeat, but with extsz = 1MB and cowextsz = $blocksize. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick clone + +# Import common functions. . ./common/filter . ./common/reflink @@ -40,8 +27,6 @@ _require_cp_reflink _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/209 b/tests/xfs/209 index ea2bd89f..220ea31d 100755 --- a/tests/xfs/209 +++ b/tests/xfs/209 @@ -6,23 +6,10 @@ # # Make sure setting cowextsz on a directory propagates it to subfiles. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,8 +20,6 @@ _require_cp_reflink _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/210 b/tests/xfs/210 index 94a8b640..6edc5606 100755 --- a/tests/xfs/210 +++ b/tests/xfs/210 @@ -10,23 +10,10 @@ # destination does not already have a cowextsz setting. It should not do so # otherwise. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick clone + +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +24,6 @@ _require_cp_reflink _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/211 b/tests/xfs/211 index 3630747f..05515041 100755 --- a/tests/xfs/211 +++ b/tests/xfs/211 @@ -10,23 +10,10 @@ # - Rewrite the whole file to use up reservations. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest clone_stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/212 b/tests/xfs/212 index ef4fc62f..b133e09b 100755 --- a/tests/xfs/212 +++ b/tests/xfs/212 @@ -9,23 +9,10 @@ # - Dirty one byte on the second file and fsync. # - Crash the FS to test recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest shutdown auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +22,6 @@ _require_scratch_reflink _require_cp_reflink _require_xfs_io_command "fiemap" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/213 b/tests/xfs/213 index 3f3e06aa..3e1c45cd 100755 --- a/tests/xfs/213 +++ b/tests/xfs/213 @@ -8,23 +8,10 @@ # charged for buffered copy on write. Same test as g/305, but we get to # play with cowextsz. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/quota @@ -39,8 +26,6 @@ _require_nobody _require_xfs_io_command "cowextsize" _require_user -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" diff --git a/tests/xfs/214 b/tests/xfs/214 index f5feeadd..7c694e92 100755 --- a/tests/xfs/214 +++ b/tests/xfs/214 @@ -8,23 +8,10 @@ # charged for directio copy on write. Same as g/326, but we get to play # with cowextsz. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/quota @@ -40,8 +27,6 @@ _require_xfs_io_command "cowextsize" _require_odirect _require_user -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 export MOUNT_OPTIONS="-o usrquota,grpquota $MOUNT_OPTIONS" diff --git a/tests/xfs/215 b/tests/xfs/215 index 14b4e68a..20217187 100755 --- a/tests/xfs/215 +++ b/tests/xfs/215 @@ -12,23 +12,10 @@ # - directio CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/216 b/tests/xfs/216 index eeefbbaf..c3697db7 100755 --- a/tests/xfs/216 +++ b/tests/xfs/216 @@ -6,23 +6,10 @@ # # log size mkfs test - ensure the log size scaling works for small filesystems # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest log metadata auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/217 b/tests/xfs/217 index b1f59b23..bf9c5123 100755 --- a/tests/xfs/217 +++ b/tests/xfs/217 @@ -6,23 +6,10 @@ # # large log size mkfs test - ensure the log size scaling works # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest log metadata auto -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/218 b/tests/xfs/218 index 47cd2d3a..b834bbeb 100755 --- a/tests/xfs/218 +++ b/tests/xfs/218 @@ -12,23 +12,10 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +24,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/219 b/tests/xfs/219 index ea46daa6..b0eeb784 100755 --- a/tests/xfs/219 +++ b/tests/xfs/219 @@ -12,23 +12,10 @@ # - directio CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/220 b/tests/xfs/220 index 55d5b518..8d955225 100755 --- a/tests/xfs/220 +++ b/tests/xfs/220 @@ -9,23 +9,17 @@ # Based on bug reports from Utako Kusaka and # Ryota Yamauchi . # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quota quick +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount >/dev/null 2>&1 } -trap "_cleanup; exit \$status" 0 1 2 3 15 -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota diff --git a/tests/xfs/221 b/tests/xfs/221 index 61d0f422..09b2067d 100755 --- a/tests/xfs/221 +++ b/tests/xfs/221 @@ -12,23 +12,10 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +24,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/222 b/tests/xfs/222 index dfb87fd4..96790313 100755 --- a/tests/xfs/222 +++ b/tests/xfs/222 @@ -9,23 +9,10 @@ # inodes to try to defragment. This is effectively a crash/assert failure # test looking for corruption induced by xfs_fsr runs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto fsr ioctl quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/223 b/tests/xfs/223 index 23fa4026..f002f1de 100755 --- a/tests/xfs/223 +++ b/tests/xfs/223 @@ -13,23 +13,10 @@ # - directio CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -39,8 +26,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/224 b/tests/xfs/224 index 3ec241f9..11a54fa3 100755 --- a/tests/xfs/224 +++ b/tests/xfs/224 @@ -13,23 +13,10 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/225 b/tests/xfs/225 index 8dd84d08..52a37d64 100755 --- a/tests/xfs/225 +++ b/tests/xfs/225 @@ -12,23 +12,10 @@ # - directio CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/226 b/tests/xfs/226 index ae835024..826bd08d 100755 --- a/tests/xfs/226 +++ b/tests/xfs/226 @@ -12,23 +12,10 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +24,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/227 b/tests/xfs/227 index 9d65730a..cd927dc4 100755 --- a/tests/xfs/227 +++ b/tests/xfs/227 @@ -11,31 +11,16 @@ # the indoes to be swapped. It also is good for validating fsr's attribute fork # generation code. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto fsr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs xfs _require_scratch -rm -f $seqres.full - [ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found" # create freespace holes of 1-3 blocks in length diff --git a/tests/xfs/228 b/tests/xfs/228 index 85c9b455..5c644c0f 100755 --- a/tests/xfs/228 +++ b/tests/xfs/228 @@ -16,23 +16,10 @@ # - directio CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -44,8 +31,6 @@ _require_xfs_io_command "fpunch" _require_cp_reflink _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/229 b/tests/xfs/229 index 64851557..2221b9c4 100755 --- a/tests/xfs/229 +++ b/tests/xfs/229 @@ -12,23 +12,16 @@ # # Based on a bug report and testcase from Geoffrey Wehrman . # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto rw +# Override the default cleanup function. _cleanup() { rm -rf ${TDIR} } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/230 b/tests/xfs/230 index 06b1ea27..53e8dd78 100755 --- a/tests/xfs/230 +++ b/tests/xfs/230 @@ -16,23 +16,10 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -44,8 +31,6 @@ _require_xfs_io_command "fpunch" _require_cp_reflink _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/231 b/tests/xfs/231 index 119a71bb..8155d0ab 100755 --- a/tests/xfs/231 +++ b/tests/xfs/231 @@ -11,15 +11,10 @@ # - Wait for the reclaim to run. # - Write more and see how bad fragmentation is. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -28,8 +23,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -43,8 +37,6 @@ _require_xfs_io_command "fiemap" old_cowgc_interval=$(_xfs_get_cowgc_interval) -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/232 b/tests/xfs/232 index 909f921c..06217466 100755 --- a/tests/xfs/232 +++ b/tests/xfs/232 @@ -12,15 +12,10 @@ # - Wait for the reclaim to run. # - Write more and see how bad fragmentation is. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -29,8 +24,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -44,8 +38,6 @@ _require_xfs_io_command "fiemap" old_cowgc_interval=$(_xfs_get_cowgc_interval) -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/233 b/tests/xfs/233 index 0c8ae271..2b2b8666 100755 --- a/tests/xfs/233 +++ b/tests/xfs/233 @@ -6,23 +6,10 @@ # # Tests xfs_growfs on a rmapbt filesystem # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick rmap + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/234 b/tests/xfs/234 index a3a57f2d..a61681ab 100755 --- a/tests/xfs/234 +++ b/tests/xfs/234 @@ -8,15 +8,10 @@ # of a multi-level rmap btree, and that metadump will successfully copy # said block. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rmap punch +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +19,7 @@ _cleanup() rm -rf $tmp.* $metadump_file $TEST_DIR/image } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,8 +28,6 @@ _require_loop _require_xfs_scratch_rmapbt _require_xfs_io_command "fpunch" -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/xfs/235 b/tests/xfs/235 index 55f5c5a6..59292bec 100755 --- a/tests/xfs/235 +++ b/tests/xfs/235 @@ -7,23 +7,10 @@ # Create and populate an XFS filesystem, corrupt the rmap btree, # then see how the kernel and xfs_repair deal with it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest fuzzers rmap -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -32,8 +19,6 @@ _supported_fs xfs _require_xfs_scratch_rmapbt test -n ${FORCE_FUZZ} || _require_scratch_xfs_crc -rm -f $seqres.full - echo "+ create scratch fs" _scratch_mkfs_xfs > /dev/null diff --git a/tests/xfs/236 b/tests/xfs/236 index 8ce11ccd..a66ea2d5 100755 --- a/tests/xfs/236 +++ b/tests/xfs/236 @@ -8,15 +8,10 @@ # of a multi-level rmap btree. Delete and recreate a few times to # exercise the rmap btree grow/shrink functions. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto rmap punch +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +19,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -33,8 +27,6 @@ _supported_fs xfs _require_xfs_scratch_rmapbt _require_xfs_io_command "fpunch" -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/xfs/237 b/tests/xfs/237 index 874ab87e..34d54a6c 100755 --- a/tests/xfs/237 +++ b/tests/xfs/237 @@ -6,15 +6,10 @@ # # Test AIO DIO CoW behavior when the write temporarily fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -36,9 +30,6 @@ _require_dm_target error _require_xfs_io_command "cowextsize" _require_aiodio "aiocp" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/xfs/238 b/tests/xfs/238 index b156390d..64abb4de 100755 --- a/tests/xfs/238 +++ b/tests/xfs/238 @@ -6,23 +6,10 @@ # # Check stale handles pointing to unlinked files are detected correctly # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick metadata ioctl -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/239 b/tests/xfs/239 index b011eb41..5143cc2e 100755 --- a/tests/xfs/239 +++ b/tests/xfs/239 @@ -6,23 +6,17 @@ # # Test AIO DIO CoW behavior. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $TEST_DIR/moo } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,9 +27,6 @@ _require_cp_reflink _require_xfs_io_command "cowextsize" _require_aiodio "aiocp" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/240 b/tests/xfs/240 index 47cc7279..e5d35a83 100755 --- a/tests/xfs/240 +++ b/tests/xfs/240 @@ -6,15 +6,10 @@ # # Test AIO CoW behavior when the write temporarily fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone eio +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/dmerror @@ -37,9 +31,6 @@ _require_xfs_io_command "cowextsize" _require_aiodio "aiocp" AIO_TEST="$here/src/aio-dio-regress/aiocp" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _dmerror_init diff --git a/tests/xfs/241 b/tests/xfs/241 index 2073ecca..7988c2d8 100755 --- a/tests/xfs/241 +++ b/tests/xfs/241 @@ -6,23 +6,17 @@ # # Test AIO CoW behavior. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $TEST_DIR/moo } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -34,9 +28,6 @@ _require_xfs_io_command "cowextsize" _require_aiodio "aiocp" AIO_TEST="$here/src/aio-dio-regress/aiocp" -rm -f $seqres.full - - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/242 b/tests/xfs/242 index 12bca19c..cf88fa47 100755 --- a/tests/xfs/242 +++ b/tests/xfs/242 @@ -6,23 +6,10 @@ # # Test XFS_IOC_ZERO_RANGE # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch diff --git a/tests/xfs/243 b/tests/xfs/243 index f2060c66..8f0c5939 100755 --- a/tests/xfs/243 +++ b/tests/xfs/243 @@ -16,23 +16,10 @@ # - CoW across the halfway mark, starting with the unwritten extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -46,8 +33,6 @@ _require_xfs_io_command "fpunch" _require_xfs_io_command "bmap" "-c" _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/244 b/tests/xfs/244 index 17941eb5..28f1328a 100755 --- a/tests/xfs/244 +++ b/tests/xfs/244 @@ -6,20 +6,14 @@ # # test to verify that proper project quota id is correctly set # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota +# Override the default cleanup function. _cleanup() { cd / @@ -36,7 +30,6 @@ _require_projid16bit export MOUNT_OPTIONS="-opquota" -rm -f $seqres.full # make fs with no projid32bit _scratch_mkfs_xfs -i projid32bit=0 >> $seqres.full || _fail "mkfs failed" _qmount diff --git a/tests/xfs/245 b/tests/xfs/245 index cc1e4351..417dd18c 100755 --- a/tests/xfs/245 +++ b/tests/xfs/245 @@ -10,23 +10,10 @@ # - reflink file1 to file2 # - compare file[12] # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "bmap" "-c" _require_cp_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/246 b/tests/xfs/246 index 7045ad1d..53e1b8b0 100755 --- a/tests/xfs/246 +++ b/tests/xfs/246 @@ -6,23 +6,10 @@ # # Create an empty file and try to query the (nonexistant) CoW fork. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -31,8 +18,6 @@ _require_xfs_debug _require_xfs_io_command "bmap" "-c" _require_scratch -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/247 b/tests/xfs/247 index a47be05f..593ac47b 100755 --- a/tests/xfs/247 +++ b/tests/xfs/247 @@ -7,23 +7,10 @@ # Mount a reflink/rmap filesystem ro (so the per-AG reservation isn't # created) and unmount, to ensure that we free correctly. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -31,8 +18,6 @@ _cleanup() _supported_fs xfs _require_scratch_reflink -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount -o ro >> $seqres.full 2>&1 diff --git a/tests/xfs/248 b/tests/xfs/248 index 91ba07cf..32902cb7 100755 --- a/tests/xfs/248 +++ b/tests/xfs/248 @@ -13,23 +13,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/249 b/tests/xfs/249 index 82986de0..774d3bf2 100755 --- a/tests/xfs/249 +++ b/tests/xfs/249 @@ -13,23 +13,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -39,8 +26,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/250 b/tests/xfs/250 index fdfa1618..8af32711 100755 --- a/tests/xfs/250 +++ b/tests/xfs/250 @@ -6,15 +6,10 @@ # # Bmap btree corruption regression test # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw prealloc metadata +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rmdir $LOOP_MNT } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/251 b/tests/xfs/251 index ff199769..0b090180 100755 --- a/tests/xfs/251 +++ b/tests/xfs/251 @@ -15,23 +15,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -40,8 +27,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/252 b/tests/xfs/252 index 1d9c4471..43740cb4 100755 --- a/tests/xfs/252 +++ b/tests/xfs/252 @@ -6,23 +6,10 @@ # # Test fallocate hole punching # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick prealloc punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -_cleanup() -{ - rm -f $tmp.* -} - -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch diff --git a/tests/xfs/253 b/tests/xfs/253 index fb7fc80b..a96a2c17 100755 --- a/tests/xfs/253 +++ b/tests/xfs/253 @@ -17,15 +17,10 @@ # instances where the obfuscation process has produced a filename # that is already in use (and no other name is available to use). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -34,8 +29,7 @@ _cleanup() rm -f "${METADUMP_FILE}" } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _require_test @@ -56,8 +50,6 @@ function create_file() { echo "Disciplyne of silence is goed." -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/xfs/254 b/tests/xfs/254 index 073a8ad3..40d176fc 100755 --- a/tests/xfs/254 +++ b/tests/xfs/254 @@ -15,23 +15,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -41,8 +28,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/255 b/tests/xfs/255 index 49dfa03c..255f3b2f 100755 --- a/tests/xfs/255 +++ b/tests/xfs/255 @@ -15,23 +15,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -40,8 +27,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/256 b/tests/xfs/256 index 093b67e4..1c703242 100755 --- a/tests/xfs/256 +++ b/tests/xfs/256 @@ -15,23 +15,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -41,8 +28,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/257 b/tests/xfs/257 index 75d1a2fa..acd55c22 100755 --- a/tests/xfs/257 +++ b/tests/xfs/257 @@ -16,23 +16,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -41,8 +28,6 @@ _require_scratch_reflink _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/258 b/tests/xfs/258 index b064e563..25e8eb60 100755 --- a/tests/xfs/258 +++ b/tests/xfs/258 @@ -16,23 +16,10 @@ # regular extent. # - Check that the files are now different where we say they're different. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -42,8 +29,6 @@ _require_xfs_io_command "falloc" _require_xfs_io_command "cowextsize" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/259 b/tests/xfs/259 index bddf3f52..88e2f3ee 100755 --- a/tests/xfs/259 +++ b/tests/xfs/259 @@ -6,21 +6,16 @@ # # Test fs creation on 4 TB minus few bytes partition # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { rm -f "$testfile" } -trap "_cleanup ; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/260 b/tests/xfs/260 index f4da0302..a780365f 100755 --- a/tests/xfs/260 +++ b/tests/xfs/260 @@ -11,15 +11,10 @@ # (mkfs.xfs: fix ASSERT on too-small device with stripe geometry) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mkfs +# Override the default cleanup function. _cleanup() { cd / @@ -27,11 +22,7 @@ _cleanup() rm -f $localfile } -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. echo 'Silence is golden' diff --git a/tests/xfs/261 b/tests/xfs/261 index 0d791e77..3b58db8d 100755 --- a/tests/xfs/261 +++ b/tests/xfs/261 @@ -10,33 +10,25 @@ # directory, even if the problem directory is completely unrelated # to the directory one wants to operate on. # -seq=$(basename $0) -seqres=$RESULT_DIR/$seq -echo "QA output created by ${seq}" +. ./common/preamble +_begin_fstest auto quick quota -here=$(pwd) - -tmp=/tmp/$$ my_mtab=${tmp}.mtab mtab=/proc/self/mounts -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - +# Override the default cleanup function. _cleanup() { cd / rm -f ${tmp}.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota echo "Silence is golden." -rm -f $seqres.full # real QA test starts here diff --git a/tests/xfs/262 b/tests/xfs/262 index 4c6c0609..78db5e34 100755 --- a/tests/xfs/262 +++ b/tests/xfs/262 @@ -8,23 +8,12 @@ # repair mode (which will rebuild the data forks of the running scrub # executable and libraries!) to see what happens. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/fuzzy . ./common/inject diff --git a/tests/xfs/263 b/tests/xfs/263 index 45a68c0c..fadd6280 100755 --- a/tests/xfs/263 +++ b/tests/xfs/263 @@ -6,29 +6,13 @@ # # test xfs_quota state command # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. @@ -42,8 +26,6 @@ _require_xfs_quota _require_xfs_mkfs_crc _require_xfs_crc -rm -f $seqres.full - function option_string() { VAL=$1 diff --git a/tests/xfs/264 b/tests/xfs/264 index db0bedab..191f57d5 100755 --- a/tests/xfs/264 +++ b/tests/xfs/264 @@ -7,15 +7,10 @@ # Test XFS EIO error handling configuration. Stop XFS from retrying # to writeback forever when hit EIO. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mount eio +# Override the default cleanup function. _cleanup() { cd / @@ -23,14 +18,10 @@ _cleanup() _dmerror_cleanup } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmerror -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs _require_scratch diff --git a/tests/xfs/265 b/tests/xfs/265 index 51f13ab8..c0edb6d2 100755 --- a/tests/xfs/265 +++ b/tests/xfs/265 @@ -9,15 +9,10 @@ # truncating the copies at successively lower sizes. Delete and recreate a few # times to exercise the refcount btree grow/shrink functions. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +20,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _supported_fs xfs _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/xfs/266 b/tests/xfs/266 index a5320073..549fff3b 100755 --- a/tests/xfs/266 +++ b/tests/xfs/266 @@ -6,15 +6,12 @@ # # Test incremental dumps with -D (skip unchanged dirs) # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl auto quick -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -48,8 +45,7 @@ filter_cumulative_quota_updates() { {print}' } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/267 b/tests/xfs/267 index 0dfe2f44..62d39aba 100755 --- a/tests/xfs/267 +++ b/tests/xfs/267 @@ -6,15 +6,12 @@ # # Test xfsdump with a file spanning multiple media files. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl tape -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -42,8 +39,7 @@ End-of-File _stable_fs } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump . ./common/attr diff --git a/tests/xfs/268 b/tests/xfs/268 index 5d99a467..b1dd312d 100755 --- a/tests/xfs/268 +++ b/tests/xfs/268 @@ -8,15 +8,12 @@ # at the end of the first media file (i.e., no file is split # across media files). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dump ioctl tape -here=`pwd` -tmp=/tmp/$$ status=0 # success is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -45,8 +42,7 @@ End-of-File _stable_fs } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump . ./common/attr diff --git a/tests/xfs/269 b/tests/xfs/269 index dbc21495..c1477373 100755 --- a/tests/xfs/269 +++ b/tests/xfs/269 @@ -6,23 +6,17 @@ # # Check that attr_list_by_handle copies the cursor back to userspace. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick ioctl +# Override the default cleanup function. _cleanup() { cd / rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/populate diff --git a/tests/xfs/270 b/tests/xfs/270 index 047e3964..0ab0c7d8 100755 --- a/tests/xfs/270 +++ b/tests/xfs/270 @@ -9,28 +9,12 @@ # kernel (d0a58e8 xfs: disallow rw remount on fs with unknown # ro-compat features), and this case is the regression testcase. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick mount -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs # skip fs check because superblock contains unknown ro-compat features diff --git a/tests/xfs/271 b/tests/xfs/271 index 35c23b84..14d64cd0 100755 --- a/tests/xfs/271 +++ b/tests/xfs/271 @@ -6,23 +6,17 @@ # # Check that getfsmap reports the AG metadata we're expecting. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rmap fsmap +# Override the default cleanup function. _cleanup() { cd / rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/272 b/tests/xfs/272 index 6a1372b8..7ed8b951 100755 --- a/tests/xfs/272 +++ b/tests/xfs/272 @@ -6,23 +6,17 @@ # # Check that getfsmap agrees with getbmap. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rmap fsmap +# Override the default cleanup function. _cleanup() { cd / rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/bmap } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/273 b/tests/xfs/273 index b8986170..a22e9d47 100755 --- a/tests/xfs/273 +++ b/tests/xfs/273 @@ -6,23 +6,17 @@ # # Populate filesystem, check that fsmap -n10000 matches fsmap -n1. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto rmap fsmap +# Override the default cleanup function. _cleanup() { cd / rm -rf "$tmp".* $TEST_DIR/a $TEST_DIR/b } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate diff --git a/tests/xfs/274 b/tests/xfs/274 index 23718ae7..dcaea688 100755 --- a/tests/xfs/274 +++ b/tests/xfs/274 @@ -6,23 +6,17 @@ # # Check that getfsmap agrees with getbmap for reflinked files. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rmap fsmap +# Override the default cleanup function. _cleanup() { cd / rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/bmap } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/xfs/275 b/tests/xfs/275 index f43d56d2..d22e21e9 100755 --- a/tests/xfs/275 +++ b/tests/xfs/275 @@ -6,23 +6,17 @@ # # Check that getfsmap reports external log devices # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rmap fsmap +# Override the default cleanup function. _cleanup() { cd / rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/276 b/tests/xfs/276 index afea48ad..8cc48675 100755 --- a/tests/xfs/276 +++ b/tests/xfs/276 @@ -6,23 +6,17 @@ # # Check that getfsmap agrees with getbmap when realtime files are present. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rmap fsmap realtime +# Override the default cleanup function. _cleanup() { cd / rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/bmap } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/277 b/tests/xfs/277 index cdbf16db..03208ef2 100755 --- a/tests/xfs/277 +++ b/tests/xfs/277 @@ -6,23 +6,17 @@ # # Check that getfsmap reports internal log devices # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rmap fsmap +# Override the default cleanup function. _cleanup() { cd / rm -rf "$tmp".* $TEST_DIR/fsmap $TEST_DIR/testout } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/278 b/tests/xfs/278 index 7683ad69..4a7e3309 100755 --- a/tests/xfs/278 +++ b/tests/xfs/278 @@ -8,30 +8,18 @@ # at the first run. See also commit 198b747f255346bca64408875763b6ca0ed3d57d # from xfsprogs tree. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest repair auto -here=`pwd` -tmp=/tmp/$$ status=0 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here _supported_fs xfs _require_scratch -rm -f $seqres.full _scratch_mkfs >$seqres.full 2>&1 _scratch_mount diff --git a/tests/xfs/279 b/tests/xfs/279 index 71b057c4..835d187f 100755 --- a/tests/xfs/279 +++ b/tests/xfs/279 @@ -7,15 +7,10 @@ # Test mkfs.xfs against various types of devices with varying # logical & physical sector sizes and offsets. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto mkfs +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() _put_scsi_debug_dev } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/scsi_debug @@ -33,8 +27,6 @@ _supported_fs xfs _require_scsi_debug -rm -f $seqres.full - # Remove xfs signature so -f isn't needed to re-mkfs _wipe_device() { diff --git a/tests/xfs/280 b/tests/xfs/280 index 1462b2d3..bc26e629 100755 --- a/tests/xfs/280 +++ b/tests/xfs/280 @@ -6,23 +6,12 @@ # # Check that GETBMAPX accurately report shared extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/xfs/281 b/tests/xfs/281 index 1ff769cf..ea114761 100755 --- a/tests/xfs/281 +++ b/tests/xfs/281 @@ -6,15 +6,10 @@ # # Test that xfsdump can generate a format 2 dump. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl auto quick +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/282 b/tests/xfs/282 index 333b7d22..07a4623a 100755 --- a/tests/xfs/282 +++ b/tests/xfs/282 @@ -8,15 +8,10 @@ # level 0 - format 2 # level 1 - current format # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl auto quick +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -24,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/283 b/tests/xfs/283 index cb473ab5..47fd4c3a 100755 --- a/tests/xfs/283 +++ b/tests/xfs/283 @@ -8,15 +8,10 @@ # level 0 - current format # level 1 - format 2 # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump ioctl auto quick +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -24,8 +19,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dump # real QA test starts here diff --git a/tests/xfs/284 b/tests/xfs/284 index cc9d723a..9d75bcec 100755 --- a/tests/xfs/284 +++ b/tests/xfs/284 @@ -7,15 +7,10 @@ # Do xfs_metadump, xfs_mdrestore, xfs_copy, xfs_db, xfs_repair and mkfs.xfs # on mounted XFS to make sure they refuse to proceed. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick dump copy db mkfs repair +# Override the default cleanup function. _cleanup() { cd / @@ -24,13 +19,9 @@ _cleanup() rm -f $COPY_FILE 2>/dev/null } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs _require_xfs_copy diff --git a/tests/xfs/285 b/tests/xfs/285 index 6bc53ae0..711211d4 100755 --- a/tests/xfs/285 +++ b/tests/xfs/285 @@ -6,23 +6,12 @@ # # Race fio and xfs_scrub for a while to see if we crash or livelock. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/fuzzy . ./common/inject diff --git a/tests/xfs/286 b/tests/xfs/286 index f93d4875..7edc9c42 100755 --- a/tests/xfs/286 +++ b/tests/xfs/286 @@ -6,23 +6,12 @@ # # Race fio and xfs_scrub for a while to see if we crash or livelock. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/fuzzy . ./common/inject diff --git a/tests/xfs/287 b/tests/xfs/287 index f77ed2f1..31bbf0d7 100755 --- a/tests/xfs/287 +++ b/tests/xfs/287 @@ -7,20 +7,14 @@ # Test to verify project quota xfs_admin, xfsdump/xfsrestore and # xfs_db functionality # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -here=`pwd` -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto dump quota quick + +# Import common functions. . ./common/quota . ./common/dump +# Override the default cleanup function. _cleanup() { _cleanup_dump diff --git a/tests/xfs/288 b/tests/xfs/288 index f6f9f9b5..e3d230e9 100755 --- a/tests/xfs/288 +++ b/tests/xfs/288 @@ -7,29 +7,13 @@ # When an attribute leaf block count is 0, xfs_repair should junk # that leaf directly (as xfsprogs commit f714016). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick repair fuzzers -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs xfs _require_scratch diff --git a/tests/xfs/289 b/tests/xfs/289 index 9464c884..c722deff 100755 --- a/tests/xfs/289 +++ b/tests/xfs/289 @@ -7,15 +7,10 @@ # Test to ensure xfs_growfs command rejects non-existent mount points # and accepts mounted targets. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest growfs auto quick +# Override the default cleanup function. _cleanup() { $UMOUNT_PROG $tmpdir @@ -26,13 +21,9 @@ _cleanup() rm -f $tmpfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/290 b/tests/xfs/290 index 6f19de39..e41a478d 100755 --- a/tests/xfs/290 +++ b/tests/xfs/290 @@ -11,17 +11,10 @@ # Primarily tests page boundries and boundries that are # off-by-one to ensure we're only tossing what's expected # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rw prealloc quick ioctl zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch diff --git a/tests/xfs/291 b/tests/xfs/291 index c906f248..bbc6f2b9 100755 --- a/tests/xfs/291 +++ b/tests/xfs/291 @@ -6,29 +6,15 @@ # # Test xfs_repair on fragmented multi-block dir2 fs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto repair + +# Import common functions. . ./common/filter _supported_fs xfs # real QA test starts here -rm -f $seqres.full _require_scratch logblks=$(_scratch_find_xfs_min_logblocks -n size=16k -d size=133m) _scratch_mkfs_xfs -n size=16k -l size=${logblks}b -d size=133m >> $seqres.full 2>&1 diff --git a/tests/xfs/292 b/tests/xfs/292 index ffc8580b..cf501571 100755 --- a/tests/xfs/292 +++ b/tests/xfs/292 @@ -7,23 +7,10 @@ # Ensure mkfs with stripe geometry goes into multidisk mode # which results in more AGs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto mkfs quick + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/293 b/tests/xfs/293 index 7f45791d..fbd26b63 100755 --- a/tests/xfs/293 +++ b/tests/xfs/293 @@ -6,23 +6,10 @@ # # Ensure all xfs_io commands are documented # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/294 b/tests/xfs/294 index 56771700..e00f0127 100755 --- a/tests/xfs/294 +++ b/tests/xfs/294 @@ -13,28 +13,12 @@ # # Failure is a hang; KASAN should also catch this. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto dir metadata -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/295 b/tests/xfs/295 index 329adcab..aad3c899 100755 --- a/tests/xfs/295 +++ b/tests/xfs/295 @@ -6,23 +6,10 @@ # # Test xfs_logprint w/ multiply-logged inodes & continued transactions # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto logprint quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr @@ -33,8 +20,6 @@ _supported_fs xfs _require_scratch _require_attrs -rm -f $seqres.full - logblks=$(_scratch_find_xfs_min_logblocks) _scratch_mkfs -l size=${logblks}b >/dev/null 2>&1 diff --git a/tests/xfs/296 b/tests/xfs/296 index 77726e54..4eaf049b 100755 --- a/tests/xfs/296 +++ b/tests/xfs/296 @@ -6,15 +6,10 @@ # # Test that xfsdump/restore preserves file capabilities # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest dump auto quick +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dump @@ -35,8 +29,6 @@ _require_scratch _require_command "$SETCAP_PROG" setcap _require_command "$GETCAP_PROG" getcap -rm -f $seqres.full - _wipe_fs mkdir -p $dump_dir diff --git a/tests/xfs/297 b/tests/xfs/297 index 4d5cedd2..ca482e06 100755 --- a/tests/xfs/297 +++ b/tests/xfs/297 @@ -8,23 +8,10 @@ # Regression test for commit: # 437a255 xfs: fix direct IO nested transaction deadlock. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto freeze -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -34,7 +21,6 @@ _require_scratch _require_freeze _require_command "$KILLALL_PROG" killall -rm -f $seqres.full logblks=$(_scratch_find_xfs_min_logblocks -d agcount=16,su=256k,sw=12 -l su=256k) _scratch_mkfs_xfs -d agcount=16,su=256k,sw=12 -l su=256k,size=${logblks}b >/dev/null 2>&1 _scratch_mount diff --git a/tests/xfs/298 b/tests/xfs/298 index 921ea460..b0153ebf 100755 --- a/tests/xfs/298 +++ b/tests/xfs/298 @@ -8,23 +8,10 @@ # attributes forces it into being remote symlink. # Warning: this test will ASSERT on unpatched DEBUG XFS. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto attr symlink quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here @@ -35,7 +22,6 @@ _supported_fs xfs _require_scratch -rm -f $seqres.full _scratch_mkfs_xfs >/dev/null 2>&1 SYMLINK_FILE="$SCRATCH_MNT/symlink" diff --git a/tests/xfs/299 b/tests/xfs/299 index 26b7fcfd..a3077b0c 100755 --- a/tests/xfs/299 +++ b/tests/xfs/299 @@ -8,26 +8,20 @@ # uquota, gquota, pquota # uqnoenforce, gqnoenforce, pqnoenforce # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota +# Override the default cleanup function. _cleanup() { cd / _scratch_unmount 2>/dev/null rm -f $tmp.* } -trap "_cleanup; exit \$status" 0 1 2 3 15 # real QA test starts here _supported_fs xfs @@ -190,7 +184,6 @@ _exercise u echo "*** unmount" _scratch_unmount - _scratch_mkfs_xfs -m crc=1 2>/dev/null | _filter_mkfs 2>$tmp.mkfs cat $tmp.mkfs >>$seqres.full # keep the blocksize and data size for dd later diff --git a/tests/xfs/300 b/tests/xfs/300 index b5fa9d50..2ee5eee7 100755 --- a/tests/xfs/300 +++ b/tests/xfs/300 @@ -6,23 +6,10 @@ # # Test xfs_fsr / swapext management of di_forkoff w/ selinux # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto fsr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _require_scratch @@ -34,8 +21,6 @@ _supported_fs xfs getenforce | grep -q "Enforcing\|Permissive" || _notrun "SELinux not enabled" [ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found" -rm -f $seqres.full - _scratch_mkfs_xfs -m crc=0 -i size=256 >> $seqres.full 2>&1 \ || _fail "mkfs failed" diff --git a/tests/xfs/301 b/tests/xfs/301 index eea7a151..d44533d6 100755 --- a/tests/xfs/301 +++ b/tests/xfs/301 @@ -6,15 +6,10 @@ # # Verify multi-stream xfsdump/restore preserves extended attributes # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto dump +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dump . ./common/attr @@ -38,8 +32,6 @@ _require_scratch attr_name=attrname attr_value=1234 -rm -f $seqres.full - _create_dumpdir_fill_ea # Create and add wholly-sparse file to the dump directory diff --git a/tests/xfs/302 b/tests/xfs/302 index e64faf90..6587a6e6 100755 --- a/tests/xfs/302 +++ b/tests/xfs/302 @@ -6,15 +6,10 @@ # # Dump and restore partialmax + 1 wholly-sparse files # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto dump +# Override the default cleanup function. _cleanup() { _cleanup_dump @@ -22,8 +17,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dump @@ -33,8 +27,6 @@ _cleanup() _supported_fs xfs _require_scratch -rm -f $seqres.full - echo "Silence is golden." _wipe_fs mkdir $dump_dir >> $seqres.full 2>&1 || _fail "mkdir \"$dump_dir\" failed" diff --git a/tests/xfs/303 b/tests/xfs/303 index 15aad995..b2e5668c 100755 --- a/tests/xfs/303 +++ b/tests/xfs/303 @@ -7,23 +7,10 @@ # Test to verify xfs_quota(8) administrator commands can deal with invalid # storage mount point without NULL pointer dereference problem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/304 b/tests/xfs/304 index 1582d9b8..2716ccd5 100755 --- a/tests/xfs/304 +++ b/tests/xfs/304 @@ -7,23 +7,10 @@ # Test to verify that turn group/project quotas off while user quotas # are left on. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -35,7 +22,6 @@ _require_xfs_quota _require_xfs_mkfs_crc _require_xfs_crc -rm -f $seqres.full _scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1 _qmount_option "uquota,gquota,pquota" diff --git a/tests/xfs/305 b/tests/xfs/305 index 9a3f0e03..140557a0 100755 --- a/tests/xfs/305 +++ b/tests/xfs/305 @@ -7,23 +7,10 @@ # Test to verify that turn group/project quotas off while fstress and # user quotas are left on. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -36,7 +23,6 @@ _require_xfs_mkfs_crc _require_xfs_crc _require_command "$KILLALL_PROG" killall -rm -f $seqres.full _scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1 _qmount_option "uquota,gquota,pquota" diff --git a/tests/xfs/306 b/tests/xfs/306 index e98eda4b..b57bf4c0 100755 --- a/tests/xfs/306 +++ b/tests/xfs/306 @@ -12,23 +12,10 @@ # transaction submission, when the associated buffer log item is pushed from the # CIL (i.e., when the log is subsequently flushed). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # Modify as appropriate. _supported_fs xfs @@ -37,8 +24,6 @@ _require_scratch_nocheck # check complains about single AG fs _require_xfs_io_command "fpunch" _require_command $UUIDGEN_PROG uuidgen -rm -f $seqres.full - # Disable the scratch rt device to avoid test failures relating to the rt # bitmap consuming all the free space in our small data device. unset SCRATCH_RTDEV diff --git a/tests/xfs/307 b/tests/xfs/307 index c04387aa..ba7204dd 100755 --- a/tests/xfs/307 +++ b/tests/xfs/307 @@ -8,23 +8,10 @@ # - Use the debugger to fake a leftover CoW extent # - See if xfs_repair fixes it # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick clone -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -32,8 +19,6 @@ _cleanup() _supported_fs xfs _require_scratch_reflink -rm -f $seqres.full - echo "Format" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full diff --git a/tests/xfs/308 b/tests/xfs/308 index d9c5b070..de5ee5c1 100755 --- a/tests/xfs/308 +++ b/tests/xfs/308 @@ -8,23 +8,10 @@ # - Use the debugger to fake a leftover CoW extent # - See if mount/umount fixes it # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest auto quick clone -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -32,8 +19,6 @@ _cleanup() _supported_fs xfs _require_scratch_reflink -rm -f $seqres.full - echo "Format" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full diff --git a/tests/xfs/309 b/tests/xfs/309 index 50357add..3e909509 100755 --- a/tests/xfs/309 +++ b/tests/xfs/309 @@ -9,15 +9,10 @@ # truncating the copies at successively lower sizes. Delete and recreate a few # times to exercise the refcount btree grow/shrink functions. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +20,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _supported_fs xfs _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - _scratch_mkfs >/dev/null 2>&1 _scratch_mount diff --git a/tests/xfs/310 b/tests/xfs/310 index 2f922b76..3214e04b 100755 --- a/tests/xfs/310 +++ b/tests/xfs/310 @@ -6,15 +6,10 @@ # # Create a file with more than 2^21 blocks (the max length of a bmbt record). # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto clone rmap +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/dmhugedisk @@ -34,8 +28,6 @@ _require_xfs_scratch_rmapbt _require_scratch_nocheck _require_xfs_io_command "falloc" -rm -f $seqres.full - # Figure out block size echo "Figure out block size" _scratch_mkfs >/dev/null 2>&1 diff --git a/tests/xfs/311 b/tests/xfs/311 index 4b2cf375..d5e3afbf 100755 --- a/tests/xfs/311 +++ b/tests/xfs/311 @@ -10,15 +10,10 @@ # certain metadata read verifier checks could access invalid memory and cause a # panic. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { cd / @@ -27,8 +22,7 @@ _cleanup() _cleanup_delay > /dev/null 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dmdelay # Modify as appropriate. @@ -37,8 +31,6 @@ _supported_fs xfs _require_scratch _require_dm_target delay -rm -f $seqres.full - echo "Silence is golden." _scratch_mkfs_xfs >> $seqres.full 2>&1 diff --git a/tests/xfs/312 b/tests/xfs/312 index 16a6094d..1fcf26ab 100755 --- a/tests/xfs/312 +++ b/tests/xfs/312 @@ -7,15 +7,10 @@ # Reflink a file with a few dozen extents, CoW a few blocks, and rm. # Inject an error during block remap to test log recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -36,8 +30,6 @@ _require_scratch_reflink _require_xfs_io_command "fpunch" _require_xfs_io_error_injection "bmap_finish_one" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/313 b/tests/xfs/313 index 9cbc5d6a..6d2f9fac 100755 --- a/tests/xfs/313 +++ b/tests/xfs/313 @@ -7,15 +7,10 @@ # Reflink a file with a few dozen extents, CoW a few blocks, and rm. # Inject an error during refcount updates to test log recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -36,8 +30,6 @@ _require_scratch_reflink _require_xfs_io_command "fpunch" _require_xfs_io_error_injection "refcount_finish_one" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/314 b/tests/xfs/314 index e4f814b9..5165393e 100755 --- a/tests/xfs/314 +++ b/tests/xfs/314 @@ -7,15 +7,10 @@ # Reflink a file with a few dozen extents, CoW a few blocks, and rm. # Inject an error during rmap updates to test log recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -37,8 +31,6 @@ _require_xfs_scratch_rmapbt _require_error_injection _require_xfs_io_error_injection "rmap_finish_one" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/315 b/tests/xfs/315 index b49e8368..958a8c99 100755 --- a/tests/xfs/315 +++ b/tests/xfs/315 @@ -7,15 +7,10 @@ # Reflink a file with a few dozen extents and CoW a few blocks. # Inject an error during extent freeing to test log recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -37,8 +31,6 @@ _require_error_injection _require_xfs_io_command "cowextsize" _require_xfs_io_error_injection "free_extent" -rm -f $seqres.full - blksz=65536 blks=4 sz=$((blksz * blks)) diff --git a/tests/xfs/316 b/tests/xfs/316 index ebc6fc2f..cf0c5adc 100755 --- a/tests/xfs/316 +++ b/tests/xfs/316 @@ -7,15 +7,10 @@ # Reflink a file with a few dozen extents, CoW a few blocks, and rm. # Force XFS into "two refcount updates per transaction" mode. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -37,8 +31,6 @@ _require_error_injection _require_xfs_io_command "fpunch" _require_xfs_io_error_injection "refcount_continue_update" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/317 b/tests/xfs/317 index def47350..7eef67af 100755 --- a/tests/xfs/317 +++ b/tests/xfs/317 @@ -6,15 +6,10 @@ # # Simulate rmap update errors with a file write and a file remove. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rmap +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/inject @@ -34,8 +28,6 @@ _require_xfs_scratch_rmapbt _require_error_injection _require_xfs_io_error_injection "rmap_finish_one" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/318 b/tests/xfs/318 index 07b4f7f1..d822e89a 100755 --- a/tests/xfs/318 +++ b/tests/xfs/318 @@ -6,15 +6,10 @@ # # Simulate free extent errors with a file write and a file remove. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +17,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/inject @@ -33,8 +27,6 @@ _require_scratch _require_error_injection _require_xfs_io_error_injection "rmap_finish_one" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/319 b/tests/xfs/319 index f4f64fd3..0f61c119 100755 --- a/tests/xfs/319 +++ b/tests/xfs/319 @@ -7,15 +7,10 @@ # Reflink a file. # Inject an error during block remap to test log recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -35,8 +29,6 @@ _require_cp_reflink _require_scratch_reflink _require_xfs_io_error_injection "bmap_finish_one" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/320 b/tests/xfs/320 index 58bb5340..f65f3ad1 100755 --- a/tests/xfs/320 +++ b/tests/xfs/320 @@ -7,15 +7,10 @@ # Reflink a file. # Inject an error during block remap to test log recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -35,8 +29,6 @@ _require_cp_reflink _require_scratch_reflink _require_xfs_io_error_injection "bmap_finish_one" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks - 17)) diff --git a/tests/xfs/321 b/tests/xfs/321 index d686ef9c..daff4449 100755 --- a/tests/xfs/321 +++ b/tests/xfs/321 @@ -7,15 +7,10 @@ # Reflink a file. # Inject an error during refcount update to test log recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -35,8 +29,6 @@ _require_cp_reflink _require_scratch_reflink _require_xfs_io_error_injection "refcount_finish_one" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/322 b/tests/xfs/322 index 03417d69..f36e54d8 100755 --- a/tests/xfs/322 +++ b/tests/xfs/322 @@ -7,15 +7,10 @@ # Reflink a file. # Inject an error during rmap update to test log recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -36,8 +30,6 @@ _require_scratch_reflink _require_xfs_scratch_rmapbt _require_xfs_io_error_injection "rmap_finish_one" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/323 b/tests/xfs/323 index 5cd4ad68..f66a8ebf 100755 --- a/tests/xfs/323 +++ b/tests/xfs/323 @@ -7,15 +7,10 @@ # Reflink a file. # Inject an error during extent free to test log recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -35,8 +29,6 @@ _require_cp_reflink _require_scratch_reflink _require_xfs_io_error_injection "free_extent" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/324 b/tests/xfs/324 index dc75b1b3..ca2f25ac 100755 --- a/tests/xfs/324 +++ b/tests/xfs/324 @@ -7,15 +7,10 @@ # Reflink a file with a few dozen extents. # Force XFS into "two refcount updates per transaction" mode. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -37,8 +31,6 @@ _require_error_injection _require_xfs_io_command "fpunch" _require_xfs_io_error_injection "refcount_continue_update" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/325 b/tests/xfs/325 index 1d21e416..3b98fd50 100755 --- a/tests/xfs/325 +++ b/tests/xfs/325 @@ -7,15 +7,10 @@ # Reflink a file with a few dozen extents, CoW a few blocks, and rm. # Inject an error during extent freeing to test log recovery. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -23,8 +18,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -36,8 +30,6 @@ _require_scratch_reflink _require_error_injection _require_xfs_io_error_injection "free_extent" -rm -f $seqres.full - blksz=65536 blks=30 echo "Format filesystem" diff --git a/tests/xfs/326 b/tests/xfs/326 index f65609df..bf5db08a 100755 --- a/tests/xfs/326 +++ b/tests/xfs/326 @@ -9,15 +9,10 @@ # cowextsize so that the refcount failure is somewhere in the CoW remap # instead of when we're stashing the CoW orphan record. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +20,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject @@ -39,8 +33,6 @@ _require_xfs_io_command "cowextsize" _require_xfs_io_command "fpunch" _require_xfs_io_error_injection "refcount_finish_one" -rm -f $seqres.full - blksz=65536 blks=64 sz=$((blksz * blks)) diff --git a/tests/xfs/327 b/tests/xfs/327 index 7a14798f..25855f77 100755 --- a/tests/xfs/327 +++ b/tests/xfs/327 @@ -9,15 +9,10 @@ # that (fortunately) triggered asserts in the rmap code when clearing # the reflink flag. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick clone +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +20,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -35,8 +29,6 @@ _supported_fs xfs _require_cp_reflink _require_scratch_reflink -rm -f $seqres.full - nr=128 # spanning at least one inode chunk tickles a bug in xfs_repair echo "Format filesystem" _scratch_mkfs >/dev/null 2>&1 diff --git a/tests/xfs/328 b/tests/xfs/328 index 26325b40..c45fa5f8 100755 --- a/tests/xfs/328 +++ b/tests/xfs/328 @@ -6,23 +6,10 @@ # # See how well xfs_fsr handles "defragging" a file with a hojillion extents. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone fsr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink diff --git a/tests/xfs/329 b/tests/xfs/329 index c6fbb202..e57f6f7f 100755 --- a/tests/xfs/329 +++ b/tests/xfs/329 @@ -6,23 +6,10 @@ # # Ensure that xfs_fsr handles errors correctly while defragging files. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone fsr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink diff --git a/tests/xfs/330 b/tests/xfs/330 index 5dc5b645..40be4c46 100755 --- a/tests/xfs/330 +++ b/tests/xfs/330 @@ -6,23 +6,10 @@ # # Ensure that xfs_fsr handles quota correctly while defragging files. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone fsr quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink diff --git a/tests/xfs/331 b/tests/xfs/331 index 8e92b2e3..733ff58f 100755 --- a/tests/xfs/331 +++ b/tests/xfs/331 @@ -6,23 +6,10 @@ # # Create a big enough rmapbt that we tickle a fdblocks accounting bug. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rmap clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink diff --git a/tests/xfs/332 b/tests/xfs/332 index 11c02ef2..4cc01e97 100755 --- a/tests/xfs/332 +++ b/tests/xfs/332 @@ -6,23 +6,10 @@ # # Make sure query_range returns -EINVAL if lowkey > highkey. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rmap clone collapse punch insert zero -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/xfs/333 b/tests/xfs/333 index 868d3f26..728c5184 100755 --- a/tests/xfs/333 +++ b/tests/xfs/333 @@ -6,23 +6,10 @@ # # Set rrmapino to another inode on an non-rt rmap fs and see if repair fixes it. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick rmap realtime + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/334 b/tests/xfs/334 index 4621cda7..cf7b104a 100755 --- a/tests/xfs/334 +++ b/tests/xfs/334 @@ -6,23 +6,10 @@ # # Ensure that we can create a few realtime files on a rmapbt filesystem. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick rmap realtime + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/335 b/tests/xfs/335 index abfb9e72..ccc508e7 100755 --- a/tests/xfs/335 +++ b/tests/xfs/335 @@ -6,23 +6,10 @@ # # Exercise expanding and shrinking the realtime rmap btree. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto rmap realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/336 b/tests/xfs/336 index b35be8a0..279830b5 100755 --- a/tests/xfs/336 +++ b/tests/xfs/336 @@ -6,23 +6,17 @@ # # Exercise metadump on realtime rmapbt preservation. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto rmap realtime +# Override the default cleanup function. _cleanup() { cd / rm -rf "$tmp".* $metadump_file } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/337 b/tests/xfs/337 index 093f7418..a2515e36 100755 --- a/tests/xfs/337 +++ b/tests/xfs/337 @@ -6,23 +6,10 @@ # # Corrupt the realtime rmapbt and see how the kernel and xfs_repair deal. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest fuzzers rmap realtime + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/338 b/tests/xfs/338 index 8707561e..9f36150c 100755 --- a/tests/xfs/338 +++ b/tests/xfs/338 @@ -6,23 +6,10 @@ # # Set rrmapino to zero on an rtrmap fs and see if repair fixes it. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick rmap realtime + +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/339 b/tests/xfs/339 index 02ef34d1..3e0b4d97 100755 --- a/tests/xfs/339 +++ b/tests/xfs/339 @@ -6,23 +6,10 @@ # # Link rrmapino into the rootdir on an rtrmap fs and see if repair fixes it. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rmap realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/340 b/tests/xfs/340 index f96b2012..2c001451 100755 --- a/tests/xfs/340 +++ b/tests/xfs/340 @@ -6,23 +6,10 @@ # # Set rrmapino to another inode on an rtrmap fs and see if repair fixes it. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rmap realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/341 b/tests/xfs/341 index 8bf05087..f026aa37 100755 --- a/tests/xfs/341 +++ b/tests/xfs/341 @@ -6,23 +6,10 @@ # # Cross-link file block into rtrmapbt and see if repair fixes it. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rmap realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/342 b/tests/xfs/342 index 4db222d6..1ae414eb 100755 --- a/tests/xfs/342 +++ b/tests/xfs/342 @@ -6,23 +6,10 @@ # # Cross-link rtrmapbt block into a file and see if repair fixes it. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rmap realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/343 b/tests/xfs/343 index 3dcea20f..816ff241 100755 --- a/tests/xfs/343 +++ b/tests/xfs/343 @@ -6,23 +6,10 @@ # # Basic rmap manipulation tests for realtime files. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rmap collapse punch insert zero realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/344 b/tests/xfs/344 index 46868fa5..f87095bf 100755 --- a/tests/xfs/344 +++ b/tests/xfs/344 @@ -10,23 +10,10 @@ # - falloc the whole file to unshare blocks. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -39,8 +26,6 @@ _require_xfs_io_command "cowextsize" _require_xfs_io_command "funshare" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/345 b/tests/xfs/345 index 4204cc22..702c6d82 100755 --- a/tests/xfs/345 +++ b/tests/xfs/345 @@ -9,23 +9,10 @@ # - Buffered write to random offsets to scatter CoW reservations. # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -37,8 +24,6 @@ _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" _require_xfs_io_command "funshare" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/346 b/tests/xfs/346 index a634134f..bb542202 100755 --- a/tests/xfs/346 +++ b/tests/xfs/346 @@ -10,23 +10,10 @@ # - Unmount, remount, repeat (twice more). # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -39,8 +26,6 @@ _require_xfs_io_command "cowextsize" _require_xfs_io_command "funshare" _require_odirect -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/347 b/tests/xfs/347 index 8141acf4..63ee1ec6 100755 --- a/tests/xfs/347 +++ b/tests/xfs/347 @@ -10,23 +10,10 @@ # - Unmount, remount, repeat (twice more). # - Check the number of extents. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -38,8 +25,6 @@ _require_xfs_io_command "fiemap" _require_xfs_io_command "cowextsize" _require_xfs_io_command "funshare" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/348 b/tests/xfs/348 index 208382fb..faf2dca5 100755 --- a/tests/xfs/348 +++ b/tests/xfs/348 @@ -9,21 +9,10 @@ # Set all possible file type values for different types of files # and verify that xfs_repair detects the correct errors. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fuzzers repair -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/repair @@ -35,8 +24,6 @@ _require_scratch # in dmesg as expected _disable_dmesg_check -rm -f $seqres.full - _scratch_mkfs >>$seqres.full 2>&1 _scratch_mount diff --git a/tests/xfs/349 b/tests/xfs/349 index d308cade..76745097 100755 --- a/tests/xfs/349 +++ b/tests/xfs/349 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and ensure that scrub and repair are happy. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers scrub -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/350 b/tests/xfs/350 index f96ffaad..aeb99578 100755 --- a/tests/xfs/350 +++ b/tests/xfs/350 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every superblock field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/351 b/tests/xfs/351 index 1f9d7636..74765aea 100755 --- a/tests/xfs/351 +++ b/tests/xfs/351 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every superblock field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/352 b/tests/xfs/352 index c19461d1..49bd85b2 100755 --- a/tests/xfs/352 +++ b/tests/xfs/352 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every AGF field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/353 b/tests/xfs/353 index bb8dc41c..b58dc9cb 100755 --- a/tests/xfs/353 +++ b/tests/xfs/353 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every AGF field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/354 b/tests/xfs/354 index affb7d23..b10ce1d6 100755 --- a/tests/xfs/354 +++ b/tests/xfs/354 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every AGFL field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/355 b/tests/xfs/355 index 469b127d..530c9a97 100755 --- a/tests/xfs/355 +++ b/tests/xfs/355 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every AGFL field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/356 b/tests/xfs/356 index e3a69c24..9d5ff251 100755 --- a/tests/xfs/356 +++ b/tests/xfs/356 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every AGI field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/357 b/tests/xfs/357 index 9318dbd6..8a2c920e 100755 --- a/tests/xfs/357 +++ b/tests/xfs/357 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every AGI field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/358 b/tests/xfs/358 index 11452a54..a00eb6f9 100755 --- a/tests/xfs/358 +++ b/tests/xfs/358 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every bnobt field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/359 b/tests/xfs/359 index bc726e96..f0a82db4 100755 --- a/tests/xfs/359 +++ b/tests/xfs/359 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every bnobt field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/360 b/tests/xfs/360 index a17ab94b..3942ffd1 100755 --- a/tests/xfs/360 +++ b/tests/xfs/360 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every bnobt key/pointer. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/361 b/tests/xfs/361 index a79997ae..b7ee0f6f 100755 --- a/tests/xfs/361 +++ b/tests/xfs/361 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every bnobt key/pointer. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/362 b/tests/xfs/362 index e275d9cc..f711661b 100755 --- a/tests/xfs/362 +++ b/tests/xfs/362 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every cntbt field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/363 b/tests/xfs/363 index 8bebbb4c..6be9109e 100755 --- a/tests/xfs/363 +++ b/tests/xfs/363 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every cntbt field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/364 b/tests/xfs/364 index b28b0f84..fcd18fe6 100755 --- a/tests/xfs/364 +++ b/tests/xfs/364 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every inobt field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/365 b/tests/xfs/365 index 41ac81b5..6f116f9b 100755 --- a/tests/xfs/365 +++ b/tests/xfs/365 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every inobt field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/366 b/tests/xfs/366 index 2c65c3bc..4c651288 100755 --- a/tests/xfs/366 +++ b/tests/xfs/366 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every finobt field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/367 b/tests/xfs/367 index 414468ab..c474a9e7 100755 --- a/tests/xfs/367 +++ b/tests/xfs/367 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every finobt field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/368 b/tests/xfs/368 index 343f599b..b1c1f976 100755 --- a/tests/xfs/368 +++ b/tests/xfs/368 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every rmapbt field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/369 b/tests/xfs/369 index 42a4d933..5e6d8d9b 100755 --- a/tests/xfs/369 +++ b/tests/xfs/369 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every rmapbt field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/370 b/tests/xfs/370 index 1a50ee2a..0a916242 100755 --- a/tests/xfs/370 +++ b/tests/xfs/370 @@ -8,23 +8,12 @@ # Use xfs_repair to fix the corruption. # Use xfs_repair to repair the problems. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/371 b/tests/xfs/371 index 430e04e6..a9b914d9 100755 --- a/tests/xfs/371 +++ b/tests/xfs/371 @@ -8,23 +8,12 @@ # Use xfs_scrub to fix the corruption. # Use xfs_scrub to repair the problems. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/372 b/tests/xfs/372 index a5c2ba34..c39a9175 100755 --- a/tests/xfs/372 +++ b/tests/xfs/372 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every refcountbt field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/373 b/tests/xfs/373 index 2f9c6cda..324aa9fe 100755 --- a/tests/xfs/373 +++ b/tests/xfs/373 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every refcountbt field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/374 b/tests/xfs/374 index 850dcd91..e3af7e4b 100755 --- a/tests/xfs/374 +++ b/tests/xfs/374 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every btree-format directory inode field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/375 b/tests/xfs/375 index adc28766..cb0efefe 100755 --- a/tests/xfs/375 +++ b/tests/xfs/375 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every btree-format directory inode field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/376 b/tests/xfs/376 index d5f94c41..2470e1d9 100755 --- a/tests/xfs/376 +++ b/tests/xfs/376 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every extents-format file inode field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/377 b/tests/xfs/377 index 3e9bcd12..eabb03fb 100755 --- a/tests/xfs/377 +++ b/tests/xfs/377 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every extents-format file inode field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/378 b/tests/xfs/378 index 9b0ea2a5..c1fb40e6 100755 --- a/tests/xfs/378 +++ b/tests/xfs/378 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every btree-format file inode field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/379 b/tests/xfs/379 index a96a81e1..1b5bfa41 100755 --- a/tests/xfs/379 +++ b/tests/xfs/379 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every btree-format file inode field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/380 b/tests/xfs/380 index 792f8375..aba8441c 100755 --- a/tests/xfs/380 +++ b/tests/xfs/380 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every bmbt block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/381 b/tests/xfs/381 index cf3c8832..ea0c44db 100755 --- a/tests/xfs/381 +++ b/tests/xfs/381 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every bmbt block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/382 b/tests/xfs/382 index e49bde87..6cbc2bcf 100755 --- a/tests/xfs/382 +++ b/tests/xfs/382 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every symlink remote block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/383 b/tests/xfs/383 index f9a34d1e..a7875998 100755 --- a/tests/xfs/383 +++ b/tests/xfs/383 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every symlink remote block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/384 b/tests/xfs/384 index b017b05a..409dbbf4 100755 --- a/tests/xfs/384 +++ b/tests/xfs/384 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every inline directory inode field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/385 b/tests/xfs/385 index 715b4ac7..2133d296 100755 --- a/tests/xfs/385 +++ b/tests/xfs/385 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every inline directory inode field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/386 b/tests/xfs/386 index 3181cf50..edeaa9a0 100755 --- a/tests/xfs/386 +++ b/tests/xfs/386 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every block-format dir block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/387 b/tests/xfs/387 index 7224fc80..cd46f6fc 100755 --- a/tests/xfs/387 +++ b/tests/xfs/387 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every block-format dir block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/388 b/tests/xfs/388 index 3233c190..42e780c8 100755 --- a/tests/xfs/388 +++ b/tests/xfs/388 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every data-format dir block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/389 b/tests/xfs/389 index 389d487b..258c5ef0 100755 --- a/tests/xfs/389 +++ b/tests/xfs/389 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every data-format dir block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/390 b/tests/xfs/390 index 3d46d628..c3fecd44 100755 --- a/tests/xfs/390 +++ b/tests/xfs/390 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every leaf1-format dir block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/391 b/tests/xfs/391 index f8da273a..f5b90467 100755 --- a/tests/xfs/391 +++ b/tests/xfs/391 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every leaf1-format dir block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/392 b/tests/xfs/392 index 7f2262eb..9044da0c 100755 --- a/tests/xfs/392 +++ b/tests/xfs/392 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every leafn-format dir block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/393 b/tests/xfs/393 index 26a0355b..700691e1 100755 --- a/tests/xfs/393 +++ b/tests/xfs/393 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every leafn-format dir block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/394 b/tests/xfs/394 index 7844442e..c9eabcd8 100755 --- a/tests/xfs/394 +++ b/tests/xfs/394 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every node-format dir block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/395 b/tests/xfs/395 index 4c4b9190..dcbfb51e 100755 --- a/tests/xfs/395 +++ b/tests/xfs/395 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every node-format dir block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/396 b/tests/xfs/396 index f503137d..3209967d 100755 --- a/tests/xfs/396 +++ b/tests/xfs/396 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every freeindex-format dir block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/397 b/tests/xfs/397 index 4213bd4b..ebfd7f63 100755 --- a/tests/xfs/397 +++ b/tests/xfs/397 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every freeindex-format dir block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/398 b/tests/xfs/398 index 9be7c606..08573f36 100755 --- a/tests/xfs/398 +++ b/tests/xfs/398 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every inline attr inode field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/399 b/tests/xfs/399 index 9b8ddddf..0a5a0bd5 100755 --- a/tests/xfs/399 +++ b/tests/xfs/399 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every inline attr inode field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/400 b/tests/xfs/400 index 51aa9ce0..f85c04cc 100755 --- a/tests/xfs/400 +++ b/tests/xfs/400 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every leaf-format attr block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/401 b/tests/xfs/401 index 75a77576..4c19665e 100755 --- a/tests/xfs/401 +++ b/tests/xfs/401 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every leaf-format attr block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/402 b/tests/xfs/402 index b06ce6f4..f42b6465 100755 --- a/tests/xfs/402 +++ b/tests/xfs/402 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every node-format attr block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/403 b/tests/xfs/403 index f91dc57b..8e7ab07b 100755 --- a/tests/xfs/403 +++ b/tests/xfs/403 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every node-format attr block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/404 b/tests/xfs/404 index a4ce57aa..c0f5c917 100755 --- a/tests/xfs/404 +++ b/tests/xfs/404 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every external attr block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/405 b/tests/xfs/405 index 38f72540..e33eb8f1 100755 --- a/tests/xfs/405 +++ b/tests/xfs/405 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every external attr block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/406 b/tests/xfs/406 index 148e2f95..78db1807 100755 --- a/tests/xfs/406 +++ b/tests/xfs/406 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every rtrmapbt record field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/407 b/tests/xfs/407 index 31b55ecd..5a43775b 100755 --- a/tests/xfs/407 +++ b/tests/xfs/407 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every rtrmapbt record field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/408 b/tests/xfs/408 index df4f2dd4..8049d6be 100755 --- a/tests/xfs/408 +++ b/tests/xfs/408 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every rtrmapbt keyptr field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/409 b/tests/xfs/409 index 9135808e..adac95fe 100755 --- a/tests/xfs/409 +++ b/tests/xfs/409 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every rtrmapbt keyptr field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/410 b/tests/xfs/410 index 0783e94f..e98a63eb 100755 --- a/tests/xfs/410 +++ b/tests/xfs/410 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every refcountbt field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/411 b/tests/xfs/411 index 6692cd65..cfe77961 100755 --- a/tests/xfs/411 +++ b/tests/xfs/411 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every refcountbt field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/412 b/tests/xfs/412 index ab050824..8b89dd6a 100755 --- a/tests/xfs/412 +++ b/tests/xfs/412 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every btree-format attr inode field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/413 b/tests/xfs/413 index 10254d4b..c4b525c2 100755 --- a/tests/xfs/413 +++ b/tests/xfs/413 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every btree-format attr inode field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/414 b/tests/xfs/414 index 47ed8fa5..ee5db9c8 100755 --- a/tests/xfs/414 +++ b/tests/xfs/414 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every blockdev inode field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/415 b/tests/xfs/415 index 7beb4b47..ab757629 100755 --- a/tests/xfs/415 +++ b/tests/xfs/415 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every blockdev inode field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/416 b/tests/xfs/416 index bbae36f0..3e213068 100755 --- a/tests/xfs/416 +++ b/tests/xfs/416 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every local-format symlink inode field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/417 b/tests/xfs/417 index 2c808442..3d09ec7e 100755 --- a/tests/xfs/417 +++ b/tests/xfs/417 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every local-format symlink inode field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/418 b/tests/xfs/418 index 455e3dd9..c4ba385c 100755 --- a/tests/xfs/418 +++ b/tests/xfs/418 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every AG1 superblock field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/420 b/tests/xfs/420 index ebf4129c..12b17588 100755 --- a/tests/xfs/420 +++ b/tests/xfs/420 @@ -29,23 +29,10 @@ # second dirty block. We need the huge cowextsize so that the hole # area receives preallocation in the CoW fork. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick clone punch seek + +# Import common functions. . ./common/filter . ./common/reflink @@ -56,8 +43,6 @@ _require_cp_reflink _require_xfs_io_command "cowextsize" _require_xfs_io_command "fpunch" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/421 b/tests/xfs/421 index ce183142..027ae47c 100755 --- a/tests/xfs/421 +++ b/tests/xfs/421 @@ -29,23 +29,10 @@ # second dirty block. We need the huge cowextsize so that the hole # area receives preallocation in the CoW fork. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick clone punch seek + +# Import common functions. . ./common/filter . ./common/reflink @@ -56,8 +43,6 @@ _require_cp_reflink _require_xfs_io_command "cowextsize" _require_xfs_io_command "fpunch" -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > $seqres.full 2>&1 _scratch_mount >> $seqres.full 2>&1 diff --git a/tests/xfs/422 b/tests/xfs/422 index be690342..77db492e 100755 --- a/tests/xfs/422 +++ b/tests/xfs/422 @@ -8,23 +8,12 @@ # rmapbt repair requires us to freeze the filesystem to stop all filesystem # activity, so we can't have userspace wandering in and thawing it. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} +. ./common/preamble +_begin_fstest dangerous_scrub dangerous_online_repair + +_register_cleanup "_cleanup" BUS -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/fuzzy . ./common/inject diff --git a/tests/xfs/423 b/tests/xfs/423 index 183c9cf5..be56f311 100755 --- a/tests/xfs/423 +++ b/tests/xfs/423 @@ -9,23 +9,12 @@ # extents for di_nblocks if the fork is in extents format, but we don't # count them if the fork is in btree format. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_scrub -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/fuzzy . ./common/inject diff --git a/tests/xfs/424 b/tests/xfs/424 index 73056d5f..c8d522fd 100755 --- a/tests/xfs/424 +++ b/tests/xfs/424 @@ -17,33 +17,17 @@ # emit spurious verifier errors for all but the first. # This issue has been fixed in xfsprogs-dev: # '533d1d2 ("xfs_db: properly set inode type")' -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick db filter_dbval() { awk '{ print $4 }' } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate _supported_fs xfs diff --git a/tests/xfs/425 b/tests/xfs/425 index c1c1abda..c2e16ee8 100755 --- a/tests/xfs/425 +++ b/tests/xfs/425 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every user dquot field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/426 b/tests/xfs/426 index 1bf80828..e52b15f2 100755 --- a/tests/xfs/426 +++ b/tests/xfs/426 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every user dquot field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/427 b/tests/xfs/427 index 54cb0627..19f45fbd 100755 --- a/tests/xfs/427 +++ b/tests/xfs/427 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every group dquot field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/428 b/tests/xfs/428 index 64fb26a7..338e659d 100755 --- a/tests/xfs/428 +++ b/tests/xfs/428 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every group dquot field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/429 b/tests/xfs/429 index f74d32ee..a4aeb6e4 100755 --- a/tests/xfs/429 +++ b/tests/xfs/429 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every project dquot field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/430 b/tests/xfs/430 index d01ed88f..d94f65bd 100755 --- a/tests/xfs/430 +++ b/tests/xfs/430 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every project dquot field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/431 b/tests/xfs/431 index 797b8fcd..68c57525 100755 --- a/tests/xfs/431 +++ b/tests/xfs/431 @@ -11,28 +11,12 @@ # # See CVE-2017-14340 for more information. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/432 b/tests/xfs/432 index 7df74234..40cb2474 100755 --- a/tests/xfs/432 +++ b/tests/xfs/432 @@ -13,23 +13,17 @@ # Now that we've upped metadump's default too-long-extent discard # threshold to 2^21 blocks, make sure we never do that again. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick dir metadata +# Override the default cleanup function. _cleanup() { cd / rm -f "$tmp".* $metadump_file $metadump_img } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/433 b/tests/xfs/433 index 2d4d4aca..54686e38 100755 --- a/tests/xfs/433 +++ b/tests/xfs/433 @@ -17,29 +17,13 @@ # Commit f35c5e10c6ed ("xfs: reinit btree pointer on attr tree inactivation # walk") fixed the bug. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick attr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/attr . ./common/inject -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/434 b/tests/xfs/434 index 20512186..576f1b0e 100755 --- a/tests/xfs/434 +++ b/tests/xfs/434 @@ -17,23 +17,10 @@ # be able to release the quota inodes when we're aborting the mount. We # also should not leak dquots. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone fsr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink diff --git a/tests/xfs/435 b/tests/xfs/435 index 1d2c512b..ded942a1 100755 --- a/tests/xfs/435 +++ b/tests/xfs/435 @@ -12,23 +12,10 @@ # On a subsequent mount attempt, we should be able to release the quota # inodes when we're aborting the mount. We also should not leak dquots. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink diff --git a/tests/xfs/436 b/tests/xfs/436 index e48dd4d3..d99183cf 100755 --- a/tests/xfs/436 +++ b/tests/xfs/436 @@ -15,23 +15,10 @@ # the unlinked inode and without leaking the linked inode, and we should # be able to release all the inodes when we're aborting the mount. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone fsr -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf "$tmp".* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr . ./common/reflink diff --git a/tests/xfs/437 b/tests/xfs/437 index 97ae4748..dbdb3e9d 100755 --- a/tests/xfs/437 +++ b/tests/xfs/437 @@ -10,17 +10,10 @@ # libxfs_ symbols (in libxfs-api-defs.h) instead of raw xfs_ functions. # This is for the maintainers; it's not a functionality test. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick other -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter [ -z "$WORKAREA" ] && \ diff --git a/tests/xfs/438 b/tests/xfs/438 index cae056b1..c3008b1c 100755 --- a/tests/xfs/438 +++ b/tests/xfs/438 @@ -20,15 +20,10 @@ # # Fixed by upstream commit 373b058 ("xfs: Properly retry failed dquot # items in case of error during buffer writeback") -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick quota +# Override the default cleanup function. _cleanup() { [ -z "${interval}" ] || \ @@ -87,8 +82,7 @@ make_xfs_scratch_flakey_table() echo -e $table } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/dmflakey . ./common/quota @@ -101,8 +95,6 @@ _require_user _require_xfs_quota _require_freeze -rm -f $seqres.full - echo "Silence is golden" _scratch_mkfs > $seqres.full 2>&1 diff --git a/tests/xfs/439 b/tests/xfs/439 index 32a5831c..b7929493 100755 --- a/tests/xfs/439 +++ b/tests/xfs/439 @@ -11,22 +11,10 @@ # the invalid sb_logsunit leads to crash as soon as we try to write to # the log. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fuzzers log -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/440 b/tests/xfs/440 index 0d4def2b..496ee04e 100755 --- a/tests/xfs/440 +++ b/tests/xfs/440 @@ -8,23 +8,10 @@ # a file that has CoW reservations and no dirty pages. The reservations # should shift over to the new owner, but they do not. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/reflink . ./common/quota . ./common/filter @@ -37,8 +24,6 @@ _require_scratch_reflink _require_cp_reflink _require_user -rm -f $seqres.full - echo "Format and mount" _scratch_mkfs > "$seqres.full" 2>&1 _scratch_mount "-o usrquota,grpquota" >> "$seqres.full" 2>&1 diff --git a/tests/xfs/441 b/tests/xfs/441 index a0f9e085..82654bf3 100755 --- a/tests/xfs/441 +++ b/tests/xfs/441 @@ -7,23 +7,10 @@ # Regression test for a quota accounting bug when reflinking across EOF # of a file in which we forgot dq_attach. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick clone quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/reflink . ./common/quota . ./common/filter @@ -36,8 +23,6 @@ _require_scratch_reflink _require_cp_reflink _require_user -rm -f $seqres.full - check_quota() { du_total="$(du -ksc $SCRATCH_MNT/a $SCRATCH_MNT/b | tail -n 1 | awk '{print $1}')" qu_total="$(_report_quota_blocks "-u $SCRATCH_MNT" | grep $qa_user | awk '{print $2}')" diff --git a/tests/xfs/442 b/tests/xfs/442 index d3a40501..b04b1c83 100755 --- a/tests/xfs/442 +++ b/tests/xfs/442 @@ -9,15 +9,10 @@ # This is a general regression/stress test for numerous quota bugs with # reflink and copy on write. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto stress clone quota +# Override the default cleanup function. _cleanup() { cd / @@ -25,8 +20,7 @@ _cleanup() $KILLALL_PROG -9 fsstress > /dev/null 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/quota . ./common/filter . ./common/reflink @@ -38,8 +32,6 @@ _require_scratch_reflink _require_quota _require_command "$KILLALL_PROG" "killall" -rm -f $seqres.full - report_quota_blocks() { $XFS_QUOTA_PROG -x -c "report $1" $SCRATCH_MNT | \ awk '{x += $2;} END { print(x); }' diff --git a/tests/xfs/443 b/tests/xfs/443 index a9b31808..f2390bf3 100755 --- a/tests/xfs/443 +++ b/tests/xfs/443 @@ -14,29 +14,13 @@ # blocks than expected, lead to block reservation overrun and free space # accounting inconsistency. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick ioctl fsr punch -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/punch -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/444 b/tests/xfs/444 index e4c987f8..69158f03 100755 --- a/tests/xfs/444 +++ b/tests/xfs/444 @@ -10,25 +10,12 @@ # and the patch "xfs: detect agfl count corruption and reset agfl") for details # about the fix. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick -rm -f $seqres.full +_register_cleanup "_cleanup; rm -f $tmp.*" -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/445 b/tests/xfs/445 index d35010a9..9c55cac7 100755 --- a/tests/xfs/445 +++ b/tests/xfs/445 @@ -17,29 +17,13 @@ # the backing pages for freed inodes may still reside in the cache with the # freed inodes in a partially initialized state. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick filestreams -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/filestreams -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here drop_caches() { diff --git a/tests/xfs/446 b/tests/xfs/446 index 986ebf7e..2481bbaf 100755 --- a/tests/xfs/446 +++ b/tests/xfs/446 @@ -6,17 +6,10 @@ # # checkbashisms on all /bin/sh scripts. This is a maintainer script. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick # get standard environment -. ./common/rc # real QA test starts here _supported_fs xfs @@ -24,8 +17,6 @@ _require_command "$CHECKBASHISMS_PROG" checkbashisms test -z "$WORKAREA" && _notrun "Can't find xfsprogs source" -rm -f $seqres.full - echo "Silence is golden" find $WORKAREA -type f -name 'xfs*.sh' -print0 | xargs -0 grep '^#!.*/bin/sh' | sed -e 's/:.*$//g' | while read f; do $CHECKBASHISMS_PROG $f diff --git a/tests/xfs/447 b/tests/xfs/447 index 894b25c4..795c43b9 100755 --- a/tests/xfs/447 +++ b/tests/xfs/447 @@ -6,15 +6,10 @@ # # Exercise mount vs superblock shrinker races. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto mount +# Override the default cleanup function. _cleanup() { cd / @@ -22,13 +17,9 @@ _cleanup() echo 0 > /sys/fs/xfs/debug/mount_delay } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/448 b/tests/xfs/448 index a11698fa..815f56cb 100755 --- a/tests/xfs/448 +++ b/tests/xfs/448 @@ -17,23 +17,10 @@ # we should have non fatal asserts configured, because assert # failures triggered by the intentional corrupt would crash system. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fuzzers -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate diff --git a/tests/xfs/449 b/tests/xfs/449 index 8bef50e1..a3fcd78e 100755 --- a/tests/xfs/449 +++ b/tests/xfs/449 @@ -6,25 +6,10 @@ # # Make sure pretty printed XFS geometry is the same across all programs. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/450 b/tests/xfs/450 index c947cf26..d35e55cb 100755 --- a/tests/xfs/450 +++ b/tests/xfs/450 @@ -7,27 +7,13 @@ # Make sure that the statfs b_avail counter doesn't change across remount # after the rmapbt has grown in size. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick rmap -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # remove previous \$seqres.full before test -rm -f $seqres.full # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/451 b/tests/xfs/451 index 458cfc0b..8ca4e7d1 100755 --- a/tests/xfs/451 +++ b/tests/xfs/451 @@ -7,27 +7,11 @@ # Make sure xfs_repair can repair root inode parent's pointer # when it contains a bogus ino when it's using shot form directory -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick metadata repair -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter echo "Silence is golden" diff --git a/tests/xfs/452 b/tests/xfs/452 index 36ac5f1e..6c04cd49 100755 --- a/tests/xfs/452 +++ b/tests/xfs/452 @@ -7,28 +7,12 @@ # Test xfs_db by bad character in field list selector string. The issue # has been fixed by xfsprogs 945e47e2. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto db -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # Modify as appropriate. _supported_fs xfs _require_scratch diff --git a/tests/xfs/453 b/tests/xfs/453 index 84b12d3d..62974453 100755 --- a/tests/xfs/453 +++ b/tests/xfs/453 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every superblock field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/454 b/tests/xfs/454 index 43beb8de..2540cd01 100755 --- a/tests/xfs/454 +++ b/tests/xfs/454 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every AGF field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/455 b/tests/xfs/455 index cbae84e7..96820bc3 100755 --- a/tests/xfs/455 +++ b/tests/xfs/455 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every AGFL field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/456 b/tests/xfs/456 index f82f7233..dca03e10 100755 --- a/tests/xfs/456 +++ b/tests/xfs/456 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every AGI field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/457 b/tests/xfs/457 index 8453045d..332eeb98 100755 --- a/tests/xfs/457 +++ b/tests/xfs/457 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every bnobt field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/458 b/tests/xfs/458 index 75efb8be..ce03d687 100755 --- a/tests/xfs/458 +++ b/tests/xfs/458 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every bnobt key/pointer. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/459 b/tests/xfs/459 index 1ff8f95d..d166160f 100755 --- a/tests/xfs/459 +++ b/tests/xfs/459 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every cntbt field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/460 b/tests/xfs/460 index f462ee0b..0daafa30 100755 --- a/tests/xfs/460 +++ b/tests/xfs/460 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every inobt field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/461 b/tests/xfs/461 index 07ce659a..2d20c69d 100755 --- a/tests/xfs/461 +++ b/tests/xfs/461 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every finobt field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/462 b/tests/xfs/462 index 785de33f..587facc0 100755 --- a/tests/xfs/462 +++ b/tests/xfs/462 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every rmapbt field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/463 b/tests/xfs/463 index 3306a687..7270f701 100755 --- a/tests/xfs/463 +++ b/tests/xfs/463 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every rmapbt key/pointer field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/464 b/tests/xfs/464 index 48d426a9..59d25ae1 100755 --- a/tests/xfs/464 +++ b/tests/xfs/464 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every refcountbt field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/465 b/tests/xfs/465 index 274cf368..71399300 100755 --- a/tests/xfs/465 +++ b/tests/xfs/465 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every btree-format directory inode field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/466 b/tests/xfs/466 index e840c52b..c1a1628a 100755 --- a/tests/xfs/466 +++ b/tests/xfs/466 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every extents-format file inode field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/467 b/tests/xfs/467 index 55878cc4..42b820d1 100755 --- a/tests/xfs/467 +++ b/tests/xfs/467 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every btree-format file inode field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/468 b/tests/xfs/468 index c755cf5d..34612c88 100755 --- a/tests/xfs/468 +++ b/tests/xfs/468 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every bmbt block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/469 b/tests/xfs/469 index 71a49581..630b3329 100755 --- a/tests/xfs/469 +++ b/tests/xfs/469 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every symlink remote block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/470 b/tests/xfs/470 index 9fd87a1b..acc43ba7 100755 --- a/tests/xfs/470 +++ b/tests/xfs/470 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every inline directory inode field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/471 b/tests/xfs/471 index 3ec9143f..7883a00a 100755 --- a/tests/xfs/471 +++ b/tests/xfs/471 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every block-format dir block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/472 b/tests/xfs/472 index e5b04dc6..a4ab9d75 100755 --- a/tests/xfs/472 +++ b/tests/xfs/472 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every data-format dir block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/473 b/tests/xfs/473 index 7cb74a0a..cbeed345 100755 --- a/tests/xfs/473 +++ b/tests/xfs/473 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every leaf1-format dir block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/474 b/tests/xfs/474 index 5dfbd5d7..746e3531 100755 --- a/tests/xfs/474 +++ b/tests/xfs/474 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every leafn-format dir block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/475 b/tests/xfs/475 index 1d01c406..20053afe 100755 --- a/tests/xfs/475 +++ b/tests/xfs/475 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every node-format dir block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/476 b/tests/xfs/476 index 687dfbfe..f8f79e4f 100755 --- a/tests/xfs/476 +++ b/tests/xfs/476 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every freeindex-format dir block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/477 b/tests/xfs/477 index 618557e9..0c2e2b36 100755 --- a/tests/xfs/477 +++ b/tests/xfs/477 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every inline attr inode field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/478 b/tests/xfs/478 index 599421e8..44e42e3e 100755 --- a/tests/xfs/478 +++ b/tests/xfs/478 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every leaf-format attr block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/479 b/tests/xfs/479 index ddf3157a..9101d651 100755 --- a/tests/xfs/479 +++ b/tests/xfs/479 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every node-format attr block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/480 b/tests/xfs/480 index 6755e881..4f3ae6dc 100755 --- a/tests/xfs/480 +++ b/tests/xfs/480 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every external attr block field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/481 b/tests/xfs/481 index 1d34d45c..48c7580c 100755 --- a/tests/xfs/481 +++ b/tests/xfs/481 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every rtrmapbt record field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair realtime + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/482 b/tests/xfs/482 index 78d77204..0192b94c 100755 --- a/tests/xfs/482 +++ b/tests/xfs/482 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every rtrmapbt keyptr field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair realtime -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/483 b/tests/xfs/483 index 843a470f..d7b0101a 100755 --- a/tests/xfs/483 +++ b/tests/xfs/483 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every refcountbt field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/484 b/tests/xfs/484 index 849b87ea..27522bbd 100755 --- a/tests/xfs/484 +++ b/tests/xfs/484 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every btree-format attr inode field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/485 b/tests/xfs/485 index efa7d737..efffbb85 100755 --- a/tests/xfs/485 +++ b/tests/xfs/485 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every blockdev inode field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/486 b/tests/xfs/486 index 1a74c104..6d7f4031 100755 --- a/tests/xfs/486 +++ b/tests/xfs/486 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every local-format symlink inode field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 - -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair + +_register_cleanup "_cleanup" BUS + +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/487 b/tests/xfs/487 index 48085a22..337541bb 100755 --- a/tests/xfs/487 +++ b/tests/xfs/487 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every user dquot field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/488 b/tests/xfs/488 index 10d47aa2..43477689 100755 --- a/tests/xfs/488 +++ b/tests/xfs/488 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every group dquot field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/489 b/tests/xfs/489 index 57e54e2a..c70e674c 100755 --- a/tests/xfs/489 +++ b/tests/xfs/489 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every project dquot field. # Do not fix the filesystem, to test metadata verifiers. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/490 b/tests/xfs/490 index 893d23cf..8c3b0684 100755 --- a/tests/xfs/490 +++ b/tests/xfs/490 @@ -10,28 +10,12 @@ # This case test same bug (upstream linux commit ee457001ed6c) as xfs/132, but # through different code path. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/491 b/tests/xfs/491 index 7d447ccf..5c7c5d1f 100755 --- a/tests/xfs/491 +++ b/tests/xfs/491 @@ -6,27 +6,11 @@ # # Test detection & fixing of bad summary block counts at mount time. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap '_cleanup; exit $status' 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick fuzz -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here diff --git a/tests/xfs/492 b/tests/xfs/492 index 21c6872f..8258e5d8 100755 --- a/tests/xfs/492 +++ b/tests/xfs/492 @@ -6,27 +6,11 @@ # # Test detection & fixing of bad summary inode counts at mount time. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap '_cleanup; exit $status' 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc -. ./common/filter +. ./common/preamble +_begin_fstest auto quick fuzz -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. +. ./common/filter # real QA test starts here diff --git a/tests/xfs/493 b/tests/xfs/493 index a78fe00c..58fd9c99 100755 --- a/tests/xfs/493 +++ b/tests/xfs/493 @@ -7,28 +7,12 @@ # Test detection & fixing of bad summary block counts at mount time. # Corrupt the AGFs to test mount failure when mount-fixing fails. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fuzz -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap '_cleanup; exit $status' 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/494 b/tests/xfs/494 index 3f08609e..2ff85758 100755 --- a/tests/xfs/494 +++ b/tests/xfs/494 @@ -6,23 +6,10 @@ # # Ensure that xfsprogs crc32 works correctly via xfs_io crc32cselftest command. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/495 b/tests/xfs/495 index a3b4fb2c..8da61f23 100755 --- a/tests/xfs/495 +++ b/tests/xfs/495 @@ -9,23 +9,12 @@ # repair also doesn't crash when it hits a corrupt da btree with a zero before # pointer. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/496 b/tests/xfs/496 index d8e9f79f..a2624d2e 100755 --- a/tests/xfs/496 +++ b/tests/xfs/496 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every single-leafn-format dir block field. # Use xfs_repair to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/497 b/tests/xfs/497 index bf2cf758..9a985d8c 100755 --- a/tests/xfs/497 +++ b/tests/xfs/497 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every single-leafn-format dir block field. # Use xfs_scrub to fix the corruption. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_scrub dangerous_online_repair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/498 b/tests/xfs/498 index 460a30bd..20bd326a 100755 --- a/tests/xfs/498 +++ b/tests/xfs/498 @@ -7,23 +7,12 @@ # Populate a XFS filesystem and fuzz every single-leafn-format dir block field. # Do not fix the filesystem, to test metadata verifiers. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest dangerous_fuzzers dangerous_norepair -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate . ./common/fuzzy diff --git a/tests/xfs/499 b/tests/xfs/499 index ca7b9614..b5597708 100755 --- a/tests/xfs/499 +++ b/tests/xfs/499 @@ -8,23 +8,12 @@ # which suggest that we forgot to TRACE_DEFINE_ENUM somewhere, which causes # incomplete ftrace reporting. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS -_cleanup() -{ - cd / - rm -rf $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/500 b/tests/xfs/500 index 73cf155e..7c336e86 100755 --- a/tests/xfs/500 +++ b/tests/xfs/500 @@ -6,29 +6,16 @@ # # Make sure we can't format a filesystem with insane extent hints. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick mkfs prealloc mkfs testfile=$TEST_DIR/$seq.txt -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs xfs _require_scratch_nocheck -rm -f $seqres.full - # Try regular extent size hint echo extszinherit >> $seqres.full _scratch_mkfs -d extszinherit=8388608 >> $seqres.full 2>&1 diff --git a/tests/xfs/501 b/tests/xfs/501 index b6f41c9a..a9acf0af 100755 --- a/tests/xfs/501 +++ b/tests/xfs/501 @@ -11,16 +11,13 @@ # Here we force the use of the slow iunlink bucket walk code in a single # threaded situation. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick unlink testfile=$TEST_DIR/$seq.txt -trap "_cleanup; exit \$status" 0 1 2 3 15 delay_knob="/sys/fs/xfs/debug/log_recovery_delay" +# Override the default cleanup function. _cleanup() { cd / @@ -28,8 +25,7 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/inject # real QA test starts here @@ -39,7 +35,6 @@ _require_xfs_sysfs debug/log_recovery_delay _require_scratch _require_test_program "t_open_tmpfiles" -rm -f $seqres.full _scratch_mkfs >> $seqres.full 2>&1 _scratch_mount diff --git a/tests/xfs/502 b/tests/xfs/502 index 202bfbc6..fb9a82c1 100755 --- a/tests/xfs/502 +++ b/tests/xfs/502 @@ -11,22 +11,11 @@ # Here we force the use of the slow iunlink bucket walk code, using every # CPU possible. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" -tmp=/tmp/$$ -status=1 # failure is the default! +. ./common/preamble +_begin_fstest auto quick unlink testfile=$TEST_DIR/$seq.txt -trap "_cleanup; exit \$status" 0 1 2 3 15 -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/inject . ./common/filter @@ -36,8 +25,6 @@ _require_xfs_io_error_injection "iunlink_fallback" _require_scratch _require_test_program "t_open_tmpfiles" -rm -f $seqres.full - _scratch_mkfs | _filter_mkfs 2> $tmp.mkfs > /dev/null cat $tmp.mkfs >> $seqres.full . $tmp.mkfs diff --git a/tests/xfs/503 b/tests/xfs/503 index 20d9c83d..6c4bfd1c 100755 --- a/tests/xfs/503 +++ b/tests/xfs/503 @@ -7,23 +7,19 @@ # Populate a XFS filesystem and ensure that metadump, mdrestore, and copy # all work properly. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto copy metadump -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / rm -rf $tmp.* $testdir } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/populate diff --git a/tests/xfs/504 b/tests/xfs/504 index e6629f1e..40318314 100755 --- a/tests/xfs/504 +++ b/tests/xfs/504 @@ -9,23 +9,10 @@ # theory it should allow this (labels are a sequence of arbitrary bytes) # even if the user implications are horrifying. # -seq=`basename "$0"` -seqres="$RESULT_DIR/$seq" -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto quick mkfs label -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _supported_fs xfs diff --git a/tests/xfs/505 b/tests/xfs/505 index fa9f6e25..8a999ff4 100755 --- a/tests/xfs/505 +++ b/tests/xfs/505 @@ -6,23 +6,10 @@ # # Ensure all xfs_spaceman commands are documented. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick spaceman + +# Import common functions. # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/506 b/tests/xfs/506 index 7e553849..157dac29 100755 --- a/tests/xfs/506 +++ b/tests/xfs/506 @@ -6,23 +6,10 @@ # # Basic tests of the xfs_spaceman health command. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick health -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/fuzzy . ./common/filter @@ -32,8 +19,6 @@ _require_scratch_nocheck _require_scrub _require_xfs_spaceman_command "health" -rm -f $seqres.full - _scratch_mkfs > $seqres.full 2>&1 _scratch_mount _scratch_cycle_mount # make sure we haven't run quotacheck on this mount diff --git a/tests/xfs/507 b/tests/xfs/507 index 3deb7ad9..aa3d8eeb 100755 --- a/tests/xfs/507 +++ b/tests/xfs/507 @@ -9,15 +9,12 @@ # reflinking it, and retouching every written byte to see if we can create # enough speculative COW reservations to overflow i_delayed_blks. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest clone -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -26,8 +23,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/reflink . ./common/filter diff --git a/tests/xfs/508 b/tests/xfs/508 index 43c48b80..47c04f89 100755 --- a/tests/xfs/508 +++ b/tests/xfs/508 @@ -8,29 +8,13 @@ # commit b136f48b19a5 ("xfs_quota: fix false error reporting of project # inheritance flag is not set") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs _require_scratch diff --git a/tests/xfs/509 b/tests/xfs/509 index ae3a66ca..d04dfbbf 100755 --- a/tests/xfs/509 +++ b/tests/xfs/509 @@ -10,20 +10,8 @@ # bulkstat batch sizes. Test v1 and v5 ioctls explicitly, as well as the # ioctl version autodetection code in libfrog. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} +. ./common/preamble +_begin_fstest auto ioctl bstat_versions() { @@ -141,7 +129,6 @@ bstat_test() } # Get standard environment, filters and checks -. ./common/rc . ./common/filter _require_scratch @@ -153,8 +140,6 @@ _require_xfs_io_command inumbers _supported_fs xfs -rm -f $seqres.full - DIRCOUNT=8 INOCOUNT=$((2048 / DIRCOUNT)) diff --git a/tests/xfs/510 b/tests/xfs/510 index 3ce21d9d..5784077c 100755 --- a/tests/xfs/510 +++ b/tests/xfs/510 @@ -11,23 +11,10 @@ # This is a regression test for commit f16fe3ecde62 ("xfs: bulkstat should copy # lastip whenever userspace supplies one") # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto ioctl quick -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter _require_test_program "bulkstat_null_ocount" @@ -36,8 +23,6 @@ _require_test_program "bulkstat_null_ocount" _supported_fs xfs -rm -f $seqres.full - echo "Silence is golden." $here/src/bulkstat_null_ocount $TEST_DIR diff --git a/tests/xfs/511 b/tests/xfs/511 index c9bb5e0c..d2550404 100755 --- a/tests/xfs/511 +++ b/tests/xfs/511 @@ -7,15 +7,10 @@ # Test statfs when project quota is set. # Uncover de7243057 fs/xfs: fix f_ffree value for statfs when project quota is set # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick quota +# Override the default cleanup function. _cleanup() { cd / @@ -23,14 +18,10 @@ _cleanup() rm -f $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs _require_scratch diff --git a/tests/xfs/512 b/tests/xfs/512 index daa44491..4595770e 100755 --- a/tests/xfs/512 +++ b/tests/xfs/512 @@ -7,23 +7,17 @@ # Ensure that removing the access ACL through the XFS-specific attr name removes # the cached ACL as well # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick acl attr +# Override the default cleanup function. _cleanup() { cd / rm -f $FILE } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/attr diff --git a/tests/xfs/513 b/tests/xfs/513 index 9045dbb5..bfdfd4f6 100755 --- a/tests/xfs/513 +++ b/tests/xfs/513 @@ -6,15 +6,10 @@ # # XFS mount options sanity check, refer to 'man 5 xfs'. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto mount +# Override the default cleanup function. _cleanup() { cd / @@ -31,13 +26,9 @@ _cleanup() rmdir $LOOP_MNT } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs _require_test diff --git a/tests/xfs/514 b/tests/xfs/514 index 8a4f8cca..a9c67645 100755 --- a/tests/xfs/514 +++ b/tests/xfs/514 @@ -6,23 +6,17 @@ # # Ensure all xfs_db commands are documented. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick db +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $file } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/515 b/tests/xfs/515 index d11514aa..32216fe6 100755 --- a/tests/xfs/515 +++ b/tests/xfs/515 @@ -6,23 +6,17 @@ # # Ensure all xfs_quota commands are documented. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick quota +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $file } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/516 b/tests/xfs/516 index d611a2e6..9e1b9931 100755 --- a/tests/xfs/516 +++ b/tests/xfs/516 @@ -7,25 +7,17 @@ # Update sunit and width and make sure that the filesystem still passes # xfs_repair afterwards. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick +# Override the default cleanup function. _cleanup() { rm -f $tmp.* cd / } -rm -f $seqres.full - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/fuzzy # real QA test starts here diff --git a/tests/xfs/517 b/tests/xfs/517 index 79dd9d7d..512f795f 100755 --- a/tests/xfs/517 +++ b/tests/xfs/517 @@ -6,15 +6,12 @@ # # Race freeze and fsmap for a while to see if we crash or livelock. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick fsmap freeze -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 7 15 +_register_cleanup "_cleanup" BUS +# Override the default cleanup function. _cleanup() { cd / @@ -22,8 +19,7 @@ _cleanup() rm -rf $tmp.* } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/fuzzy . ./common/inject diff --git a/tests/xfs/518 b/tests/xfs/518 index 9e14ca56..332ff16a 100755 --- a/tests/xfs/518 +++ b/tests/xfs/518 @@ -7,23 +7,10 @@ # Make sure that the quota default grace period and maximum warning limits # survive quotacheck. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick quota -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/quota @@ -32,8 +19,6 @@ _supported_fs xfs _require_scratch _require_quota -rm -f $seqres.full - # Format filesystem and set up quota limits _scratch_mkfs > $seqres.full _qmount_option "usrquota" diff --git a/tests/xfs/519 b/tests/xfs/519 index 1c25da3f..675ec07e 100755 --- a/tests/xfs/519 +++ b/tests/xfs/519 @@ -8,23 +8,10 @@ # that it actually forced the log by immediately shutting down the fs without # flushing the log and then remounting to check file contents. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick reflink -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink @@ -33,8 +20,6 @@ _supported_fs xfs _require_scratch_reflink _require_cp_reflink -rm -f $seqres.full - # Format filesystem and set up quota limits _scratch_mkfs > $seqres.full _scratch_mount -o wsync >> $seqres.full diff --git a/tests/xfs/520 b/tests/xfs/520 index b99b9c6e..8410f2ba 100755 --- a/tests/xfs/520 +++ b/tests/xfs/520 @@ -11,15 +11,10 @@ # commit d0c7feaf8767 ("xfs: add agf freeblocks verify in xfs_agf_verify") # is included in the current kernel. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick reflink +# Override the default cleanup function. _cleanup() { cd / @@ -27,13 +22,9 @@ _cleanup() _scratch_unmount > /dev/null 2>&1 } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/521 b/tests/xfs/521 index 99408a06..60f28740 100755 --- a/tests/xfs/521 +++ b/tests/xfs/521 @@ -13,15 +13,10 @@ # xfs: make xfs_growfs_rt update secondary superblocks # xfs: annotate grabbing the realtime bitmap/summary locks in growfs # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick realtime growfs +# Override the default cleanup function. _cleanup() { cd / @@ -30,8 +25,7 @@ _cleanup() rm -f $tmp.* $TEST_DIR/$seq.rtvol } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/522 b/tests/xfs/522 index 4b9dbc93..2475d584 100755 --- a/tests/xfs/522 +++ b/tests/xfs/522 @@ -7,28 +7,19 @@ # Feed valid mkfs config files to the mkfs parser to ensure that they are # recognized as valid. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap '_cleanup; exit $status' 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mkfs +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $def_cfgfile $fsimg } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/523 b/tests/xfs/523 index 491414bc..bd9b7553 100755 --- a/tests/xfs/523 +++ b/tests/xfs/523 @@ -7,28 +7,19 @@ # Feed invalid mkfs config files to the mkfs parser to ensure that they are # recognized as invalid. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap '_cleanup; exit $status' 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mkfs +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $def_cfgfile $fsimg } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/524 b/tests/xfs/524 index 8b53c1a9..fe4d134b 100755 --- a/tests/xfs/524 +++ b/tests/xfs/524 @@ -6,28 +6,19 @@ # # Test formatting with a well known config file. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap '_cleanup; exit $status' 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mkfs +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $def_cfgfile $fsimg } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/525 b/tests/xfs/525 index cf10c8ac..a17c9f19 100755 --- a/tests/xfs/525 +++ b/tests/xfs/525 @@ -6,28 +6,19 @@ # # Test formatting with a config file that contains conflicting options. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap '_cleanup; exit $status' 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mkfs +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $def_cfgfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/526 b/tests/xfs/526 index 9b57678e..4261e849 100755 --- a/tests/xfs/526 +++ b/tests/xfs/526 @@ -6,28 +6,19 @@ # # Test formatting with conflicts between the config file and the cli. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap '_cleanup; exit $status' 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick mkfs +# Override the default cleanup function. _cleanup() { cd / rm -f $tmp.* $def_cfgfile } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here # Modify as appropriate. diff --git a/tests/xfs/527 b/tests/xfs/527 index f612e7ac..8abc866f 100755 --- a/tests/xfs/527 +++ b/tests/xfs/527 @@ -14,23 +14,10 @@ # xfs: fix incorrect root dquot corruption error when switching group/project # quota types -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick quota + +# Import common functions. . ./common/quota # real QA test starts here @@ -40,8 +27,6 @@ _require_quota _require_scratch _require_check_dmesg -rm -f $seqres.full - echo "Format filesystem" | tee -a $seqres.full _scratch_mkfs > $seqres.full diff --git a/tests/xfs/528 b/tests/xfs/528 index d483ae82..29e81228 100755 --- a/tests/xfs/528 +++ b/tests/xfs/528 @@ -7,15 +7,10 @@ # Make sure that regular fallocate functions work ok when the realtime extent # size is and isn't a power of 2. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick rw realtime +# Override the default cleanup function. _cleanup() { cd / @@ -24,8 +19,7 @@ _cleanup() rm -f $tmp.* $TEST_DIR/$seq.rtvol } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter # real QA test starts here diff --git a/tests/xfs/529 b/tests/xfs/529 index b4533eba..1cd0454d 100755 --- a/tests/xfs/529 +++ b/tests/xfs/529 @@ -8,31 +8,15 @@ # adding a single extent while there's no possibility of splitting an existing # mapping. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick quota + +# Import common functions. . ./common/filter . ./common/quota . ./common/inject . ./common/populate -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/530 b/tests/xfs/530 index 0e4dd6b5..4d168ac5 100755 --- a/tests/xfs/530 +++ b/tests/xfs/530 @@ -7,15 +7,10 @@ # Verify that XFS does not cause bitmap/summary inode fork's extent count to # overflow when growing an the realtime volume of the filesystem. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 +. ./common/preamble +_begin_fstest auto quick realtime growfs +# Override the default cleanup function. _cleanup() { cd / @@ -24,15 +19,11 @@ _cleanup() rm -f $tmp.* $TEST_DIR/$seq.rtvol } -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/inject . ./common/populate -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/531 b/tests/xfs/531 index 935c52b0..48cb37cd 100755 --- a/tests/xfs/531 +++ b/tests/xfs/531 @@ -6,29 +6,13 @@ # # Verify that XFS does not cause inode fork's extent count to overflow when # punching out an extent. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick punch zero insert collapse + +# Import common functions. . ./common/filter . ./common/inject -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/532 b/tests/xfs/532 index f421070a..74a7ac30 100755 --- a/tests/xfs/532 +++ b/tests/xfs/532 @@ -6,31 +6,15 @@ # # Verify that XFS does not cause inode fork's extent count to overflow when # adding/removing xattrs. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick attr + +# Import common functions. . ./common/filter . ./common/attr . ./common/inject . ./common/populate -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/533 b/tests/xfs/533 index 1c8cc925..b85b5298 100755 --- a/tests/xfs/533 +++ b/tests/xfs/533 @@ -6,30 +6,14 @@ # # Verify that XFS does not cause inode fork's extent count to overflow when # adding/removing directory entries. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick dir hardlink symlink + +# Import common functions. . ./common/filter . ./common/inject . ./common/populate -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/534 b/tests/xfs/534 index 338282ef..47c0dac9 100755 --- a/tests/xfs/534 +++ b/tests/xfs/534 @@ -6,29 +6,13 @@ # # Verify that XFS does not cause inode fork's extent count to overflow when # writing to an unwritten extent. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. . ./common/filter . ./common/inject -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/535 b/tests/xfs/535 index f2a8a3a5..4c883675 100755 --- a/tests/xfs/535 +++ b/tests/xfs/535 @@ -6,30 +6,14 @@ # # Verify that XFS does not cause inode fork's extent count to overflow when # writing to a shared extent. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick reflink + +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/536 b/tests/xfs/536 index 405de296..e5f904f5 100755 --- a/tests/xfs/536 +++ b/tests/xfs/536 @@ -6,30 +6,14 @@ # # Verify that XFS does not cause inode fork's extent count to overflow when # remapping extents from one file's inode fork to another. -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick reflink -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/reflink . ./common/inject -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/537 b/tests/xfs/537 index 32dc805e..7d7776f7 100755 --- a/tests/xfs/537 +++ b/tests/xfs/537 @@ -6,29 +6,13 @@ # # Verify that XFS does not cause inode fork's extent count to overflow when # swapping forks between files -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" - -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +. ./common/preamble +_begin_fstest auto quick + +# Import common functions. . ./common/filter . ./common/inject -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/538 b/tests/xfs/538 index dc0e5f28..e0102f48 100755 --- a/tests/xfs/538 +++ b/tests/xfs/538 @@ -6,30 +6,14 @@ # # Execute fsstress with bmap_alloc_minlen_extent error tag enabled. # -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto stress -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc +# Import common functions. . ./common/filter . ./common/inject . ./common/populate -# remove previous $seqres.full before test -rm -f $seqres.full - # real QA test starts here _supported_fs xfs diff --git a/tests/xfs/539 b/tests/xfs/539 index dc04253b..4bc52c1a 100755 --- a/tests/xfs/539 +++ b/tests/xfs/539 @@ -11,26 +11,10 @@ # Regression test for commit: # xfs: Skip repetitive warnings about mount options -seq=`basename $0` -seqres=$RESULT_DIR/$seq -echo "QA output created by $seq" +. ./common/preamble +_begin_fstest auto quick mount -here=`pwd` -tmp=/tmp/$$ -status=1 # failure is the default! -trap "_cleanup; exit \$status" 0 1 2 3 15 - -_cleanup() -{ - cd / - rm -f $tmp.* -} - -# get standard environment, filters and checks -. ./common/rc - -# remove previous $seqres.full before test -rm -f $seqres.full +# Import common functions. _require_check_dmesg _supported_fs xfs @@ -54,7 +38,6 @@ check_dmesg_for_since_tag() echo "Silence is golden." - # Skip old kernels that did not print the warning yet log_tag _scratch_mkfs > $seqres.full 2>&1 -- 2.30.2