X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=regressions%2Ftest-inspect-fstab.sh;h=26ea10f9fe34e1e429d764f80b70dfb40be63469;hb=acd06dbe326da7cd883f0a7df599d0d173c4bd04;hp=fb28415236da8d722e5d6c7679be9a82824cd5ae;hpb=0c60e4d9dd6549c2135699490ba8a9ec1dd50ab9;p=libguestfs.git diff --git a/regressions/test-inspect-fstab.sh b/regressions/test-inspect-fstab.sh index fb28415..26ea10f 100755 --- a/regressions/test-inspect-fstab.sh +++ b/regressions/test-inspect-fstab.sh @@ -49,15 +49,11 @@ $guestfish -a test1.img <<'EOF' upload test.fstab /etc/fstab EOF -rm test.fstab - # This will give a warning, but should not fail. $guestfish -a test1.img -i <<'EOF' | sort > test.output inspect-get-mountpoints /dev/VG/Root EOF -rm test1.img - if [ "$(cat test.output)" != "/: /dev/VG/Root /boot: /dev/vda1 /nosuchfile: /dev/VG/LV1 @@ -67,4 +63,68 @@ if [ "$(cat test.output)" != "/: /dev/VG/Root exit 1 fi +# Test device name hints + +cat <<'EOF' > test.fstab +/dev/VG/Root / ext2 default 0 0 + +# Device name which requires a hint +/dev/xvdg1 /boot ext2 default 0 0 +EOF + +$guestfish -a test1.img <<'EOF' + run + mount-options "" /dev/VG/Root / + upload test.fstab /etc/fstab +EOF + +$guestfish <<'EOF' > test.output + add-drive-opts test1.img readonly:true name:xvdg + run + inspect-os + inspect-get-mountpoints /dev/VG/Root +EOF + +if [ "$(cat test.output)" != "/dev/VG/Root +/: /dev/VG/Root +/boot: /dev/vda1" ]; then + echo "$0: error: unexpected output from inspect-get-mountpoints command" + cat test.output + exit 1 +fi + +cat <<'EOF' > test.fstab +/dev/VG/Root / ext2 default 0 0 + +# cciss device which requires a hint +/dev/cciss/c1d3p1 /boot ext2 default 0 0 + +# cciss device, whole disk +/dev/cciss/c1d3 /var ext2 default 0 0 +EOF + +$guestfish -a test1.img <<'EOF' + run + mount-options "" /dev/VG/Root / + upload test.fstab /etc/fstab +EOF + +$guestfish <<'EOF' > test.output + add-drive-opts test1.img readonly:true name:cciss/c1d3 + run + inspect-os + inspect-get-mountpoints /dev/VG/Root +EOF + +if [ "$(cat test.output)" != "/dev/VG/Root +/: /dev/VG/Root +/boot: /dev/vda1 +/var: /dev/vda" ]; then + echo "$0: error: unexpected output from inspect-get-mountpoints command" + cat test.output + exit 1 +fi + +rm test.fstab +rm test1.img rm test.output