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 # If you used the guestfish command 'upload' and accidentally set the
20 # target to a directory instead of the full filename, then previously
21 # libguestfs would hang. It should return an error instead.
25 rm -f test1.img test.out
27 if ../fish/guestfish -N fs -m /dev/sda1 upload ../images/test.iso / 2>test.out
29 echo "$0: expecting guestfish to return an error"
33 if ! grep -q "upload: /: Is a directory" test.out; then
34 echo "$0: unexpected error message from guestfish"
39 rm -f test1.img test.out