3 # Copyright (C) 2010 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
30 LABEL=BOOT /boot ext2 default 0 0
31 LABEL=ROOT / ext2 default 0 0
34 # Create a disk image.
35 ../fish/guestfish <<'EOF'
36 sparse fedora.img- 512M
40 part-init /dev/sda mbr
41 part-add /dev/sda p 64 524287
42 part-add /dev/sda p 524288 -64
51 # Phony /boot filesystem.
52 mkfs-b ext2 4096 /dev/sda1
53 set-e2label /dev/sda1 BOOT
55 # Phony root filesystem.
56 mkfs-b ext2 4096 /dev/VG/Root
57 set-e2label /dev/VG/Root ROOT
59 # Enough to fool virt-inspector.
60 mount-options "" /dev/VG/Root /
62 mount-options "" /dev/sda1 /boot
66 upload fstab.tmp /etc/fstab
68 touch /boot/grub/grub.conf
71 write /etc/test1 "abcdefg"
73 write /bin/test1 "abcdefg"
74 write /bin/test2 "zxcvbnm"
75 write /bin/test3 "1234567"
77 ln-s /bin/test1 /bin/test5
78 mkfifo 0777 /bin/test6
79 mknod 0777 10 10 /bin/test7
82 # Note that these should be empty, for testing virt-df.
83 mkfs-b ext2 4096 /dev/VG/LV1
84 mkfs-b ext2 1024 /dev/VG/LV2
85 mkfs-b ext2 2048 /dev/VG/LV3
89 mv fedora.img- fedora.img