psss / rpms / libguestfs

Forked from rpms/libguestfs 5 years ago
Clone
3606b80
#!/bin/sh -
3606b80
# libguestfs
3606b80
# Copyright (C) 2009 Red Hat Inc.
3606b80
#
3606b80
# This program is free software; you can redistribute it and/or modify
3606b80
# it under the terms of the GNU General Public License as published by
3606b80
# the Free Software Foundation; either version 2 of the License, or
3606b80
# (at your option) any later version.
3606b80
#
3606b80
# This program is distributed in the hope that it will be useful,
3606b80
# but WITHOUT ANY WARRANTY; without even the implied warranty of
3606b80
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3606b80
# GNU General Public License for more details.
3606b80
#
3606b80
# You should have received a copy of the GNU General Public License
3606b80
# along with this program; if not, write to the Free Software
3606b80
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
3606b80
3606b80
# Some versions of qemu can be flakey and can hang occasionally
3606b80
# during boot (particularly KVM if the BIOS is the qemu version
3606b80
# which doesn't have the required KVM patches).  Test repeatedly
3606b80
# booting.
3606b80
3606b80
set -e
3606b80
3606b80
rm -f test1.img
3606b80
dd if=/dev/zero of=test1.img bs=1024k count=500
3606b80
3606b80
n=20
3606b80
if [ -n "$1" ]; then n=$1; fi
3606b80
3606b80
export LIBGUESTFS_DEBUG=1
3606b80
3606b80
for i in $(seq 1 $n); do
3606b80
  echo Test boot $i of $n ...
3606b80
  ./fish/guestfish -a test1.img run
3606b80
done
3606b80
3606b80
rm test1.img
3606b80
3606b80
echo Test boot completed after $n iterations.