3 # Copyright (C) 2010-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 # Make a standard test image which is used by all the tools test
20 # scripts. This test image is supposed to look like a Fedora
21 # installation, or at least enough of one to fool the inspection API
29 LABEL=BOOT /boot ext2 default 0 0
30 LABEL=ROOT / ext2 default 0 0
33 # Create a disk image.
34 ../run ../fish/guestfish <<EOF
35 sparse fedora.img.tmp 512M
39 part-init /dev/sda mbr
40 part-add /dev/sda p 64 524287
41 part-add /dev/sda p 524288 -64
50 # Phony /boot filesystem.
51 mkfs-opts ext2 /dev/sda1 blocksize:4096
52 set-e2label /dev/sda1 BOOT
53 set-e2uuid /dev/sda1 01234567-0123-0123-0123-012345678901
55 # Phony root filesystem.
56 mkfs-opts ext2 /dev/VG/Root blocksize:4096
57 set-e2label /dev/VG/Root ROOT
58 set-e2uuid /dev/VG/Root 01234567-0123-0123-0123-012345678902
60 # Enough to fool inspection API.
61 mount-options "" /dev/VG/Root /
63 mount-options "" /dev/sda1 /boot
70 upload fstab.tmp /etc/fstab
71 write /etc/redhat-release "Fedora release 14 (Phony)"
72 write /etc/fedora-release "Fedora release 14 (Phony)"
73 write /etc/sysconfig/network "HOSTNAME=fedora.invalid"
75 upload guest-aux/fedora-name.db /var/lib/rpm/Name
76 upload guest-aux/fedora-packages.db /var/lib/rpm/Packages
78 upload ${SRCDIR}/bin-x86_64-dynamic /bin/ls
81 touch /boot/grub/grub.conf
84 write /etc/test1 "abcdefg"
86 upload -<<__end /etc/test3
94 write /bin/test1 "abcdefg"
95 write /bin/test2 "zxcvbnm"
96 write /bin/test3 "1234567"
98 ln-s /bin/test1 /bin/test5
99 mkfifo 0777 /bin/test6
100 mknod 0777 10 10 /bin/test7
103 # Note that these should be empty, for testing virt-df.
104 mkfs-opts ext2 /dev/VG/LV1 blocksize:4096
105 mkfs-opts ext2 /dev/VG/LV2 blocksize:1024
106 mkfs-opts ext2 /dev/VG/LV3 blocksize:2048
110 mv fedora.img.tmp fedora.img