Util-Linux package development
 help / color / mirror / Atom feed
* about test mount/rlimit
@ 2015-04-01 12:04 Ruediger Meier
  2015-04-02  8:33 ` Karel Zak
  0 siblings, 1 reply; 5+ messages in thread
From: Ruediger Meier @ 2015-04-01 12:04 UTC (permalink / raw)
  To: util-linux

Hi,

Some questions regarding test mount/rlimit which runs only if /etc/mtab 
is a file.

This is the umount subtest:

.......
ts_init_subtest "umount"
[ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT
$TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT &> /dev/null
OLD_SUM=$(mtab_checksum)
(
        ulimit -f 1
        $TS_CMD_UMOUNT $TS_MOUNTPOINT &> /dev/null
) &> /dev/null
NEW_SUM=$(mtab_checksum)
$TS_CMD_UMOUNT $TS_MOUNTPOINT &> /dev/null
[ $NEW_SUM = $OLD_SUM ] && echo "OK: mtab unmodified by umount" >> 
$TS_OUTPUT
ts_finalize_subtest
...........

I do not fully understand what is expected. Obviously the first "umount" 
should NOT modify /etc/mtab. But should it umount or not, or doesn't 
matter? Why we call a second umount then?

The problem is that in case that the first umount works we are leaving 
the test with a broken mtab file. This is not nice and also problematic 
because later tests may find a mounted /dev/loop0 in /etc/mtab.

Should we restore the original mtab? I guess it's a bit unsafe to copy 
back a backed up one. Or is there a way to "repair/sync" 
from /proc/mounts.?

cu,
Rudi

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-02 10:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-01 12:04 about test mount/rlimit Ruediger Meier
2015-04-02  8:33 ` Karel Zak
2015-04-02 10:05   ` Ruediger Meier
2015-04-02 10:41     ` Ruediger Meier
2015-04-02 10:57     ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox