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-md-devices command
24 ../../fish/guestfish <<EOF
26 sparse md-test1.img 100M
27 sparse md-test2.img 100M
30 # list-md-devices should return nothing
33 # Create a raid1 based on the 2 disks
34 md-create test "/dev/sda /dev/sdb" level:raid1
38 # Ensure list-md-devices above returned nothing
39 if [ ! -z "$output" ]; then
40 echo "$0: error: output of list-md-devices with no MD devices did not match expected output"
45 # Ensure list-md-devices now returns the newly created md device
47 ../../fish/guestfish -a md-test1.img -a md-test2.img <<EOF
53 if [ "$output" != "/dev/md127" ]; then
54 echo "$0: error: output of list-md-devices did not match expected output"
59 rm -f md-test1.img md-test2.img