diff options
author | Virendra Thakur <thakur.virendra1810@gmail.com> | 2025-05-22 19:42:26 +0530 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2025-06-02 07:12:34 -0700 |
commit | 09edf92b0ddfa5d3af5aefd829fd9feb8f2e4b98 (patch) | |
tree | 3eada1461fe39ed68d5ea786b47294ec74285ae3 | |
parent | 51ae2b0ed0e9ec9bad7c529bc899fdb6cb9a8aa6 (diff) | |
download | poky-09edf92b0ddfa5d3af5aefd829fd9feb8f2e4b98.tar.gz |
util-linux: Add fix to isolate test fstab entries using CUSTOM_FSTAB
During ptest execution, util-linux adds mount entries in /etc/fstab
and runs `mount -a`, which mounts all available entries from
/etc/fstab. This can cause unintended mounts that are unrelated to
the test, leading to incorrect test behavior.
To avoid this, upstream util-linux introduced a mechanism using
CUSTOM_FSTAB,which isolates test-specific fstab entries. Only entries
listed in CUSTOM_FSTAB are mounted during test execution, ensuring
tests do not interfere with or depend on the system's /etc/fstab.
This commit backports below upstream changes to use CUSTOM_FSTAB.
https://github.com/util-linux/util-linux/commit/ed3d33faff17fb702a3acfca2f9f24e69f4920de
https://github.com/util-linux/util-linux/commit/b1580bd760519a2cf052f023057846e54de47484
https://github.com/util-linux/util-linux/commit/6aa8d17b6b53b86a46c5da68c02a893113130496
(From OE-Core rev: e7420db0d77611140149ccfefefc8becfad4f34b)
Signed-off-by: Virendra Thakur <virendra.thakur@kpit.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | meta/recipes-core/util-linux/util-linux.inc | 1 | ||||
-rw-r--r-- | meta/recipes-core/util-linux/util-linux/fstab-isolation.patch | 448 |
2 files changed, 449 insertions, 0 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc index 48520ef951..1ecf5c7b39 100644 --- a/meta/recipes-core/util-linux/util-linux.inc +++ b/meta/recipes-core/util-linux/util-linux.inc | |||
@@ -42,6 +42,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-lin | |||
42 | file://fcntl-lock.c \ | 42 | file://fcntl-lock.c \ |
43 | file://CVE-2024-28085-0001.patch \ | 43 | file://CVE-2024-28085-0001.patch \ |
44 | file://CVE-2024-28085-0002.patch \ | 44 | file://CVE-2024-28085-0002.patch \ |
45 | file://fstab-isolation.patch \ | ||
45 | " | 46 | " |
46 | 47 | ||
47 | SRC_URI[sha256sum] = "7b6605e48d1a49f43cc4b4cfc59f313d0dd5402fa40b96810bd572e167dfed0f" | 48 | SRC_URI[sha256sum] = "7b6605e48d1a49f43cc4b4cfc59f313d0dd5402fa40b96810bd572e167dfed0f" |
diff --git a/meta/recipes-core/util-linux/util-linux/fstab-isolation.patch b/meta/recipes-core/util-linux/util-linux/fstab-isolation.patch new file mode 100644 index 0000000000..51d209ec60 --- /dev/null +++ b/meta/recipes-core/util-linux/util-linux/fstab-isolation.patch | |||
@@ -0,0 +1,448 @@ | |||
1 | From 51f1e56cc8b6843bf65ceadc5eca1545258bf020 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de> | ||
3 | Date: Sat, 22 Apr 2023 17:48:58 +0200 | ||
4 | Subject: [PATCH 1/3] tests: (functions.sh) create variable for test fstab | ||
5 | location | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de> | ||
11 | (cherry picked from commit ed3d33faff17fb702a3acfca2f9f24e69f4920de) | ||
12 | Upstream-Status: Backport [https://github.com/util-linux/util-linux/commit/ed3d33faff17fb702a3acfca2f9f24e69f4920de] | ||
13 | Signed-off-by: Virendra Thakur <virendra.thakur@kpit.com> | ||
14 | --- | ||
15 | tests/functions.sh | 13 +++++++------ | ||
16 | tests/ts/mount/fstab-broken | 2 +- | ||
17 | 2 files changed, 8 insertions(+), 7 deletions(-) | ||
18 | |||
19 | diff --git a/tests/functions.sh b/tests/functions.sh | ||
20 | index 5a562a39a..c2e2f33ae 100644 | ||
21 | --- a/tests/functions.sh | ||
22 | +++ b/tests/functions.sh | ||
23 | @@ -386,6 +386,7 @@ function ts_init_env { | ||
24 | TS_ENABLE_UBSAN="yes" | ||
25 | fi | ||
26 | |||
27 | + TS_FSTAB="/etc/fstab" | ||
28 | BLKID_FILE="$TS_OUTDIR/${TS_TESTNAME}.blkidtab" | ||
29 | |||
30 | declare -a TS_SUID_PROGS | ||
31 | @@ -824,12 +825,12 @@ function ts_is_mounted { | ||
32 | } | ||
33 | |||
34 | function ts_fstab_open { | ||
35 | - echo "# <!-- util-linux test entry" >> /etc/fstab | ||
36 | + echo "# <!-- util-linux test entry" >> "$TS_FSTAB" | ||
37 | } | ||
38 | |||
39 | function ts_fstab_close { | ||
40 | - echo "# -->" >> /etc/fstab | ||
41 | - sync /etc/fstab 2>/dev/null | ||
42 | + echo "# -->" >> "$TS_FSTAB" | ||
43 | + sync "$TS_FSTAB" 2>/dev/null | ||
44 | } | ||
45 | |||
46 | function ts_fstab_addline { | ||
47 | @@ -838,7 +839,7 @@ function ts_fstab_addline { | ||
48 | local FS=${3:-"auto"} | ||
49 | local OPT=${4:-"defaults"} | ||
50 | |||
51 | - echo "$SPEC $MNT $FS $OPT 0 0" >> /etc/fstab | ||
52 | + echo "$SPEC $MNT $FS $OPT 0 0" >> "$TS_FSTAB" | ||
53 | } | ||
54 | |||
55 | function ts_fstab_lock { | ||
56 | @@ -862,9 +863,9 @@ function ts_fstab_clean { | ||
57 | ba | ||
58 | } | ||
59 | s/# <!-- util-linux.*-->//; | ||
60 | -/^$/d" /etc/fstab | ||
61 | +/^$/d" "$TS_FSTAB" | ||
62 | |||
63 | - sync /etc/fstab 2>/dev/null | ||
64 | + sync "$TS_FSTAB" 2>/dev/null | ||
65 | ts_unlock "fstab" | ||
66 | } | ||
67 | |||
68 | diff --git a/tests/ts/mount/fstab-broken b/tests/ts/mount/fstab-broken | ||
69 | index 19edc5fe3..3b7a1ee9d 100755 | ||
70 | --- a/tests/ts/mount/fstab-broken | ||
71 | +++ b/tests/ts/mount/fstab-broken | ||
72 | @@ -34,7 +34,7 @@ mkdir -p $MNT | ||
73 | |||
74 | ts_fstab_lock | ||
75 | ts_fstab_open | ||
76 | -echo "tmpd $MNT tmpfs" >> /etc/fstab | ||
77 | +echo "tmpd $MNT tmpfs" >> "$TS_FSTAB" | ||
78 | ts_fstab_close | ||
79 | |||
80 | ts_init_subtest "mount" | ||
81 | -- | ||
82 | 2.34.1 | ||
83 | |||
84 | |||
85 | From 1e4a9141ca7d310030311e09123a81591f994f83 Mon Sep 17 00:00:00 2001 | ||
86 | From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de> | ||
87 | Date: Sat, 22 Apr 2023 17:20:45 +0200 | ||
88 | Subject: [PATCH 2/3] tests: (functions.sh) use per-test fstab file | ||
89 | MIME-Version: 1.0 | ||
90 | Content-Type: text/plain; charset=UTF-8 | ||
91 | Content-Transfer-Encoding: 8bit | ||
92 | |||
93 | Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de> | ||
94 | (cherry picked from commit 6aa8d17b6b53b86a46c5da68c02a893113130496) | ||
95 | Upstream-Status: Backport [https://github.com/util-linux/util-linux/commit/6aa8d17b6b53b86a46c5da68c02a893113130496] | ||
96 | Signed-off-by: Virendra Thakur <virendra.thakur@kpit.com> | ||
97 | --- | ||
98 | tests/functions.sh | 2 +- | ||
99 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
100 | |||
101 | diff --git a/tests/functions.sh b/tests/functions.sh | ||
102 | index c2e2f33ae..3089e8cda 100644 | ||
103 | --- a/tests/functions.sh | ||
104 | +++ b/tests/functions.sh | ||
105 | @@ -386,7 +386,7 @@ function ts_init_env { | ||
106 | TS_ENABLE_UBSAN="yes" | ||
107 | fi | ||
108 | |||
109 | - TS_FSTAB="/etc/fstab" | ||
110 | + TS_FSTAB="$TS_OUTDIR/${TS_TESTNAME}.fstab" | ||
111 | BLKID_FILE="$TS_OUTDIR/${TS_TESTNAME}.blkidtab" | ||
112 | |||
113 | declare -a TS_SUID_PROGS | ||
114 | -- | ||
115 | 2.34.1 | ||
116 | |||
117 | |||
118 | From 02c483f982e23a86d58cd7c6a4eb4b6e4d5def1a Mon Sep 17 00:00:00 2001 | ||
119 | From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de> | ||
120 | Date: Sat, 22 Apr 2023 17:34:28 +0200 | ||
121 | Subject: [PATCH 3/3] mount: (tests) explicitly use test fstab location | ||
122 | MIME-Version: 1.0 | ||
123 | Content-Type: text/plain; charset=UTF-8 | ||
124 | Content-Transfer-Encoding: 8bit | ||
125 | |||
126 | Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de> | ||
127 | (cherry picked from commit b1580bd760519a2cf052f023057846e54de47484) | ||
128 | Upstream-Status: Backport [https://github.com/util-linux/util-linux/commit/b1580bd760519a2cf052f023057846e54de47484] | ||
129 | Signed-off-by: Virendra Thakur <virendra.thakur@kpit.com> | ||
130 | --- | ||
131 | tests/ts/mount/fslists | 2 +- | ||
132 | tests/ts/mount/fstab-bind | 2 +- | ||
133 | tests/ts/mount/fstab-broken | 4 ++-- | ||
134 | tests/ts/mount/fstab-btrfs | 8 ++++---- | ||
135 | tests/ts/mount/fstab-devname | 4 ++-- | ||
136 | tests/ts/mount/fstab-devname2label | 2 +- | ||
137 | tests/ts/mount/fstab-devname2uuid | 2 +- | ||
138 | tests/ts/mount/fstab-label | 6 +++--- | ||
139 | tests/ts/mount/fstab-label2devname | 4 ++-- | ||
140 | tests/ts/mount/fstab-label2uuid | 4 ++-- | ||
141 | tests/ts/mount/fstab-loop | 4 ++-- | ||
142 | tests/ts/mount/fstab-none | 2 +- | ||
143 | tests/ts/mount/fstab-symlink | 2 +- | ||
144 | tests/ts/mount/fstab-uuid | 6 +++--- | ||
145 | tests/ts/mount/fstab-uuid2devname | 4 ++-- | ||
146 | tests/ts/mount/fstab-uuid2label | 4 ++-- | ||
147 | 16 files changed, 30 insertions(+), 30 deletions(-) | ||
148 | |||
149 | diff --git a/tests/ts/mount/fslists b/tests/ts/mount/fslists | ||
150 | index 230186a1e..6ac72c3ce 100755 | ||
151 | --- a/tests/ts/mount/fslists | ||
152 | +++ b/tests/ts/mount/fslists | ||
153 | @@ -61,7 +61,7 @@ ts_finalize_subtest | ||
154 | ts_init_subtest "more-types-fstab" | ||
155 | [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT | ||
156 | ts_fstab_add $DEVICE $TS_MOUNTPOINT "foo,bar,ext2" | ||
157 | -$TS_CMD_MOUNT $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
158 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
159 | ts_fstab_clean | ||
160 | ts_is_mounted $DEVICE || ts_die "Cannot find $DEVICE in /proc/mounts" | ||
161 | $TS_CMD_UMOUNT $TS_MOUNTPOINT | ||
162 | diff --git a/tests/ts/mount/fstab-bind b/tests/ts/mount/fstab-bind | ||
163 | index 2c799df78..cae016dd2 100755 | ||
164 | --- a/tests/ts/mount/fstab-bind | ||
165 | +++ b/tests/ts/mount/fstab-bind | ||
166 | @@ -20,7 +20,7 @@ ts_fstab_add $MY_SOURCE "$TS_MOUNTPOINT" "none" "bind,default,noauto" | ||
167 | mkdir -p $MY_SOURCE | ||
168 | mkdir -p $TS_MOUNTPOINT | ||
169 | |||
170 | -$TS_CMD_MOUNT $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
171 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
172 | [ "$?" = "0" ] || ts_log "error: mount $TS_MOUNTPOINT" | ||
173 | |||
174 | $TS_CMD_FINDMNT --mountpoint "$TS_MOUNTPOINT" &> /dev/null | ||
175 | diff --git a/tests/ts/mount/fstab-broken b/tests/ts/mount/fstab-broken | ||
176 | index 3b7a1ee9d..ec4c34241 100755 | ||
177 | --- a/tests/ts/mount/fstab-broken | ||
178 | +++ b/tests/ts/mount/fstab-broken | ||
179 | @@ -38,7 +38,7 @@ echo "tmpd $MNT tmpfs" >> "$TS_FSTAB" | ||
180 | ts_fstab_close | ||
181 | |||
182 | ts_init_subtest "mount" | ||
183 | -$TS_CMD_MOUNT $MNT &> /dev/null | ||
184 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $MNT &> /dev/null | ||
185 | [ "$?" = "0" ] || ts_log "error: mount $MNT" | ||
186 | $TS_CMD_FINDMNT --kernel --mountpoint "$MNT" &> /dev/null | ||
187 | if [ "$?" != "0" ]; then | ||
188 | @@ -57,7 +57,7 @@ ts_finalize_subtest | ||
189 | |||
190 | |||
191 | ts_init_subtest "mount-all" | ||
192 | -$TS_CMD_MOUNT -a &> /dev/null | ||
193 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -a &> /dev/null | ||
194 | [ "$?" = "0" ] || ts_log "error: mount -a" | ||
195 | $TS_CMD_FINDMNT --kernel --mountpoint "$MNT" &> /dev/null | ||
196 | if [ "$?" != "0" ]; then | ||
197 | diff --git a/tests/ts/mount/fstab-btrfs b/tests/ts/mount/fstab-btrfs | ||
198 | index a1003ab52..8e76dbba6 100755 | ||
199 | --- a/tests/ts/mount/fstab-btrfs | ||
200 | +++ b/tests/ts/mount/fstab-btrfs | ||
201 | @@ -94,8 +94,8 @@ ts_fstab_addline "$DEVICE" "$TS_MOUNTPOINT_SUBVOLID" "btrfs" "subvolid=$NON_DEFA | ||
202 | ts_fstab_addline "$TS_MOUNTPOINT_SUBVOLID" "$TS_MOUNTPOINT_BIND" "auto" "bind" | ||
203 | ts_fstab_close | ||
204 | |||
205 | -$TS_CMD_MOUNT -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
206 | -$TS_CMD_MOUNT -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
207 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
208 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
209 | |||
210 | $TS_CMD_UMOUNT "$TS_MOUNTPOINT_BIND" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
211 | $TS_CMD_UMOUNT "$TS_MOUNTPOINT_DEFAULT" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
212 | @@ -124,8 +124,8 @@ ts_fstab_addline "$DEVICE" "$TS_MOUNTPOINT_SUBVOLID" "auto" "subvolid=$NON_DEFAU | ||
213 | ts_fstab_addline "$TS_MOUNTPOINT_SUBVOL/bind-mnt" "$TS_MOUNTPOINT_BIND" "auto" "bind" | ||
214 | ts_fstab_close | ||
215 | |||
216 | -$TS_CMD_MOUNT -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
217 | -$TS_CMD_MOUNT -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
218 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
219 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
220 | |||
221 | $TS_CMD_UMOUNT "$TS_MOUNTPOINT_BIND" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
222 | $TS_CMD_UMOUNT "$TS_MOUNTPOINT_DEFAULT" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
223 | diff --git a/tests/ts/mount/fstab-devname b/tests/ts/mount/fstab-devname | ||
224 | index 5b64a32a6..6ac03b5a7 100755 | ||
225 | --- a/tests/ts/mount/fstab-devname | ||
226 | +++ b/tests/ts/mount/fstab-devname | ||
227 | @@ -42,13 +42,13 @@ MOUNTPOINT=$TS_MOUNTPOINT | ||
228 | ts_fstab_add $DEVICE | ||
229 | |||
230 | ts_init_subtest "mountpoint" | ||
231 | -$TS_CMD_MOUNT $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
232 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
233 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
234 | $TS_CMD_UMOUNT $DEVICE || >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
235 | ts_finalize_subtest | ||
236 | |||
237 | ts_init_subtest "device-name" | ||
238 | -$TS_CMD_MOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
239 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
240 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
241 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
242 | ts_finalize_subtest | ||
243 | diff --git a/tests/ts/mount/fstab-devname2label b/tests/ts/mount/fstab-devname2label | ||
244 | index 1d8562109..44066e153 100755 | ||
245 | --- a/tests/ts/mount/fstab-devname2label | ||
246 | +++ b/tests/ts/mount/fstab-devname2label | ||
247 | @@ -41,7 +41,7 @@ ts_device_has "LABEL" $LABEL $DEVICE \ | ||
248 | ts_fstab_add "LABEL=$LABEL" | ||
249 | ts_udevadm_settle "$DEVICE" "LABEL" | ||
250 | |||
251 | -$TS_CMD_MOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
252 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
253 | ts_is_mounted $DEVICE || ts_die "Cannot find $DEVICE in /proc/mounts" | ||
254 | $TS_CMD_UMOUNT $DEVICE || ts_die "Cannot umount $DEVICE" | ||
255 | |||
256 | diff --git a/tests/ts/mount/fstab-devname2uuid b/tests/ts/mount/fstab-devname2uuid | ||
257 | index 8105fa028..503959103 100755 | ||
258 | --- a/tests/ts/mount/fstab-devname2uuid | ||
259 | +++ b/tests/ts/mount/fstab-devname2uuid | ||
260 | @@ -39,7 +39,7 @@ UUID=$(ts_uuid_by_devname "$DEVICE") || ts_die "Cannot find UUID on $DEVICE" | ||
261 | ts_fstab_add "UUID=$UUID" | ||
262 | ts_udevadm_settle "$DEVICE" "UUID" | ||
263 | |||
264 | -$TS_CMD_MOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
265 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
266 | ts_is_mounted $DEVICE || ts_die "Cannot find $DEVICE in /proc/mounts" | ||
267 | $TS_CMD_UMOUNT $DEVICE || ts_die "Cannot umount $DEVICE" | ||
268 | |||
269 | diff --git a/tests/ts/mount/fstab-label b/tests/ts/mount/fstab-label | ||
270 | index 4b23e7fee..a3cc06d52 100755 | ||
271 | --- a/tests/ts/mount/fstab-label | ||
272 | +++ b/tests/ts/mount/fstab-label | ||
273 | @@ -42,19 +42,19 @@ ts_fstab_add "LABEL=$LABEL" | ||
274 | ts_udevadm_settle "$DEVICE" "LABEL" | ||
275 | |||
276 | ts_init_subtest "no-option" | ||
277 | -$TS_CMD_MOUNT $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
278 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
279 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
280 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
281 | ts_finalize_subtest | ||
282 | |||
283 | ts_init_subtest "L-option" | ||
284 | -$TS_CMD_MOUNT -L $LABEL >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
285 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -L $LABEL >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
286 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
287 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
288 | ts_finalize_subtest | ||
289 | |||
290 | ts_init_subtest "LABEL-option" | ||
291 | -$TS_CMD_MOUNT LABEL=$LABEL >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
292 | +$TS_CMD_MOUNT -T "$TS_FSTAB" LABEL=$LABEL >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
293 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
294 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
295 | ts_finalize_subtest | ||
296 | diff --git a/tests/ts/mount/fstab-label2devname b/tests/ts/mount/fstab-label2devname | ||
297 | index 75ca05e8c..fddbfa0ba 100755 | ||
298 | --- a/tests/ts/mount/fstab-label2devname | ||
299 | +++ b/tests/ts/mount/fstab-label2devname | ||
300 | @@ -44,13 +44,13 @@ ts_udevadm_settle "$DEVICE" "LABEL" | ||
301 | [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT | ||
302 | |||
303 | ts_init_subtest "L-option" | ||
304 | -$TS_CMD_MOUNT -L $LABEL >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
305 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -L $LABEL >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
306 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
307 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
308 | ts_finalize_subtest | ||
309 | |||
310 | ts_init_subtest "LABEL-option" | ||
311 | -$TS_CMD_MOUNT "LABEL=$LABEL" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
312 | +$TS_CMD_MOUNT -T "$TS_FSTAB" "LABEL=$LABEL" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
313 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
314 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
315 | ts_finalize_subtest | ||
316 | diff --git a/tests/ts/mount/fstab-label2uuid b/tests/ts/mount/fstab-label2uuid | ||
317 | index 4bfcae4b9..927cde9aa 100755 | ||
318 | --- a/tests/ts/mount/fstab-label2uuid | ||
319 | +++ b/tests/ts/mount/fstab-label2uuid | ||
320 | @@ -46,13 +46,13 @@ ts_udevadm_settle "$DEVICE" "LABEL" "UUID" | ||
321 | [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT | ||
322 | |||
323 | ts_init_subtest "L-option" | ||
324 | -$TS_CMD_MOUNT -L $LABEL >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
325 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -L $LABEL >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
326 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
327 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
328 | ts_finalize_subtest | ||
329 | |||
330 | ts_init_subtest "LABEL-option" | ||
331 | -$TS_CMD_MOUNT "LABEL=$LABEL" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
332 | +$TS_CMD_MOUNT -T "$TS_FSTAB" "LABEL=$LABEL" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
333 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
334 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
335 | ts_finalize_subtest | ||
336 | diff --git a/tests/ts/mount/fstab-loop b/tests/ts/mount/fstab-loop | ||
337 | index 7cc589fd2..0541e3a74 100755 | ||
338 | --- a/tests/ts/mount/fstab-loop | ||
339 | +++ b/tests/ts/mount/fstab-loop | ||
340 | @@ -39,10 +39,10 @@ ts_fstab_lock | ||
341 | ts_fstab_open | ||
342 | |||
343 | ts_fstab_addline "$IMG" "$TS_MOUNTPOINT-1" "ext2" "loop" | ||
344 | -$TS_CMD_MOUNT -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
345 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
346 | |||
347 | ts_fstab_addline "$IMG" "$TS_MOUNTPOINT-2" "ext2" "loop" | ||
348 | -$TS_CMD_MOUNT -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
349 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -a >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
350 | |||
351 | ts_fstab_close | ||
352 | |||
353 | diff --git a/tests/ts/mount/fstab-none b/tests/ts/mount/fstab-none | ||
354 | index 6a4d05b62..95daa6cee 100755 | ||
355 | --- a/tests/ts/mount/fstab-none | ||
356 | +++ b/tests/ts/mount/fstab-none | ||
357 | @@ -17,7 +17,7 @@ ts_fstab_add "none" "$TS_MOUNTPOINT" "tmpfs" "rw,nosuid,nodev,relatime" | ||
358 | |||
359 | mkdir -p $TS_MOUNTPOINT | ||
360 | |||
361 | -$TS_CMD_MOUNT $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
362 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $TS_MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
363 | [ "$?" = "0" ] || ts_log "error: mount $TS_MOUNTPOINT" | ||
364 | |||
365 | $TS_CMD_FINDMNT --mountpoint "$TS_MOUNTPOINT" &> /dev/null | ||
366 | diff --git a/tests/ts/mount/fstab-symlink b/tests/ts/mount/fstab-symlink | ||
367 | index 4d3e37b19..6d419f9fe 100755 | ||
368 | --- a/tests/ts/mount/fstab-symlink | ||
369 | +++ b/tests/ts/mount/fstab-symlink | ||
370 | @@ -46,7 +46,7 @@ ln -s $DEVICE $LINKNAME | ||
371 | ts_fstab_add $LINKNAME $TS_MOUNTPOINT "auto" "defaults,user" | ||
372 | |||
373 | # variant A) -- UID=0 | ||
374 | -$TS_CMD_MOUNT $LINKNAME >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
375 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $LINKNAME >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
376 | ts_is_mounted $DEVICE || ts_die "A) Cannot find $DEVICE in /proc/mounts" | ||
377 | $TS_CMD_UMOUNT $LINKNAME || ts_die "A) Cannot umount $LINKNAME" | ||
378 | |||
379 | diff --git a/tests/ts/mount/fstab-uuid b/tests/ts/mount/fstab-uuid | ||
380 | index 03917b782..f51bb294e 100755 | ||
381 | --- a/tests/ts/mount/fstab-uuid | ||
382 | +++ b/tests/ts/mount/fstab-uuid | ||
383 | @@ -42,19 +42,19 @@ ts_fstab_add "UUID=$UUID" | ||
384 | ts_udevadm_settle "$DEVICE" "UUID" | ||
385 | |||
386 | ts_init_subtest "no-option" | ||
387 | -$TS_CMD_MOUNT $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
388 | +$TS_CMD_MOUNT -T "$TS_FSTAB" $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
389 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
390 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
391 | ts_finalize_subtest | ||
392 | |||
393 | ts_init_subtest "U-option" | ||
394 | -$TS_CMD_MOUNT -U $UUID >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
395 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -U $UUID >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
396 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
397 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
398 | ts_finalize_subtest | ||
399 | |||
400 | ts_init_subtest "UUID-option" | ||
401 | -$TS_CMD_MOUNT UUID=$UUID >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
402 | +$TS_CMD_MOUNT -T "$TS_FSTAB" UUID=$UUID >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
403 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
404 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
405 | ts_finalize_subtest | ||
406 | diff --git a/tests/ts/mount/fstab-uuid2devname b/tests/ts/mount/fstab-uuid2devname | ||
407 | index 9bf165e16..2b338acb1 100755 | ||
408 | --- a/tests/ts/mount/fstab-uuid2devname | ||
409 | +++ b/tests/ts/mount/fstab-uuid2devname | ||
410 | @@ -42,13 +42,13 @@ ts_udevadm_settle "$DEVICE" "UUID" | ||
411 | [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT | ||
412 | |||
413 | ts_init_subtest "U-option" | ||
414 | -$TS_CMD_MOUNT -U $UUID >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
415 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -U $UUID >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
416 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
417 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
418 | ts_finalize_subtest | ||
419 | |||
420 | ts_init_subtest "UUID-option" | ||
421 | -$TS_CMD_MOUNT "UUID=$UUID" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
422 | +$TS_CMD_MOUNT -T "$TS_FSTAB" "UUID=$UUID" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
423 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
424 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
425 | ts_finalize_subtest | ||
426 | diff --git a/tests/ts/mount/fstab-uuid2label b/tests/ts/mount/fstab-uuid2label | ||
427 | index de10ff0b0..02eb6b985 100755 | ||
428 | --- a/tests/ts/mount/fstab-uuid2label | ||
429 | +++ b/tests/ts/mount/fstab-uuid2label | ||
430 | @@ -45,13 +45,13 @@ ts_udevadm_settle "$DEVICE" "LABEL" "UUID" | ||
431 | [ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT | ||
432 | |||
433 | ts_init_subtest "U-option" | ||
434 | -$TS_CMD_MOUNT -U $UUID >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
435 | +$TS_CMD_MOUNT -T "$TS_FSTAB" -U $UUID >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
436 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
437 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
438 | ts_finalize_subtest | ||
439 | |||
440 | ts_init_subtest "UUID-option" | ||
441 | -$TS_CMD_MOUNT "UUID=$UUID" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
442 | +$TS_CMD_MOUNT -T "$TS_FSTAB" "UUID=$UUID" >> $TS_OUTPUT 2>> $TS_ERRLOG | ||
443 | ts_is_mounted $DEVICE || ts_log "Cannot find $DEVICE in /proc/mounts" | ||
444 | $TS_CMD_UMOUNT $DEVICE >> $TS_OUTPUT 2>>$TS_ERRLOG | ||
445 | ts_finalize_subtest | ||
446 | -- | ||
447 | 2.34.1 | ||
448 | |||