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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 # Test guestfish list-mddevices command
23 # Create 2 disks partitioned as:
25 # sda2: 20M MD (md127)
28 # sdb2: 20M MD (md127)
34 ../../fish/guestfish <<EOF
36 sparse fs-test1.img 50M
37 sparse fs-test2.img 50M
40 part-init /dev/sda mbr
41 part-add /dev/sda p 64 41023
42 part-add /dev/sda p 41024 81983
43 part-init /dev/sdb mbr
44 part-add /dev/sdb p 64 41023
45 part-add /dev/sdb p 41024 81983
47 # Create vg0 and lv0 on /dev/sdb1
49 vgcreate vg0 /dev/sdb1
52 # Create an md device from sda2 and sdb2
53 md-create test "/dev/sda2 /dev/sdb2" level:raid1
58 mkfs vfat /dev/vg0/lv0
64 expected="/dev/vda1: ext3
68 # Check the output of list-filesystems
69 if [ "$output" != "$expected" ]; then
70 echo "$0: error: output of list-filesystems did not match expected output"
71 printf "%s\n" "$output"
76 rm -f fs-test1.img fs-test2.img