3 # Copyright (C) 2011 Red Hat Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 # Test various aspects of core inspection of /etc/fstab.
20 # This also tests: https://bugzilla.redhat.com/668574
25 guestfish=../fish/guestfish
27 rm -f test1.img test.fstab test.output
29 # Start with the regular (good) fedora image, modify /etc/fstab
30 # and then inspect it.
31 cp ../images/fedora.img test1.img
33 cat <<'EOF' > test.fstab
34 /dev/VG/Root / ext2 default 0 0
36 # Xen-style partition names.
37 /dev/xvda1 /boot ext2 default 0 0
39 # Non-existant device.
40 /dev/sdb3 /var ext2 default 0 0
42 # Non-existant mountpoint.
43 /dev/VG/LV1 /nosuchfile ext2 default 0 0
46 $guestfish -a test1.img <<'EOF'
48 mount-options "" /dev/VG/Root /
49 upload test.fstab /etc/fstab
54 # This will give a warning, but should not fail.
55 $guestfish -a test1.img -i <<'EOF' | sort > test.output
56 inspect-get-mountpoints /dev/VG/Root
61 if [ "$(cat test.output)" != "/: /dev/VG/Root
63 /nosuchfile: /dev/VG/LV1
64 /var: /dev/sdb3" ]; then
65 echo "$0: error: unexpected output from inspect-get-mountpoints command"