3 TS_TOPDIR
="${0%/*}/../.."
6 .
$TS_TOPDIR/functions.sh
11 TESTPROG
="$TS_HELPER_PYLIBMOUNT_TAB"
12 [ -x $TESTPROG ] || ts_die
"test script missing"
14 ts_check_prog
"mkfs.ext3"
16 PYDBG
="$PYTHON -m pdb"
18 # set global variable TS_DEVICE
19 ts_scsi_debug_init dev_size_mb
=50 sector_size
=512
21 UUID
="de1bc6e9-34ab-4151-a1d7-900042eee8d9"
26 mkfs.ext3
-F -L $LABEL $TS_DEVICE -U $UUID &> /dev
/null || ts_die
"Cannot make ext3 on $TS_DEVICE" $TS_DEVICE
29 ts_device_has_uuid
$TS_DEVICE || ts_die
"Cannot find UUID on $TS_DEVICE" $TS_DEVICE
31 FSTAB
="$TS_OUTDIR/fstab"
36 echo "LABEL=$LABEL /mnt/mountpoint auto defaults" > $FSTAB
38 ts_init_subtest
"fstab-label2uuid"
39 $PYTHON $TESTPROG --find-forward $FSTAB source "UUID=$UUID" &> $TS_OUTPUT
40 sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
43 ts_init_subtest
"fstab-label2dev"
44 $PYTHON $TESTPROG --find-forward $FSTAB source $TS_DEVICE &> $TS_OUTPUT
45 sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
49 # Add more enties for the same device
51 echo "UUID=$UUID /mnt/mountpoint2 auto defaults" >> $FSTAB
53 ts_init_subtest
"fstab-uuid"
54 # has to return /mnt/mountpoint2
55 $PYTHON $TESTPROG --find-forward $FSTAB source "UUID=$UUID" &> $TS_OUTPUT
56 sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
59 ts_init_subtest
"fstab-label"
60 # has to return /mnt/mountpoint
61 $PYTHON $TESTPROG --find-forward $FSTAB source "LABEL=$LABEL" &> $TS_OUTPUT
62 sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
66 ts_init_subtest
"fstab-dev2label"
67 # has to return /mnt/mountpoint
68 $PYTHON $TESTPROG --find-forward $FSTAB source $TS_DEVICE &> $TS_OUTPUT
69 sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
75 echo "$TS_DEVICE /mnt/mountpoint3 auto defaults" >> $FSTAB
77 ts_init_subtest
"fstab-dev"
78 # has to return /mnt/mountpoint3
79 $PYTHON $TESTPROG --find-forward $FSTAB source $TS_DEVICE &> $TS_OUTPUT
80 sed -i -e 's/fs: 0x.*/fs:/g' $TS_OUTPUT
81 sed -i -e 's/source: .*//g' $TS_OUTPUT # devname is generated, remove it