tests: move guestfs-md5.sh to test-data

Move it to the test-data directory, giving it a more generic name so it
can be used also for more than just md5; adjust qemu tests accordingly.

This is just code motion, no behaviour change.
This commit is contained in:
Pino Toscano
2016-03-18 14:45:54 +01:00
parent 7e970fcdb3
commit 41795a1c98
5 changed files with 5 additions and 3 deletions

View File

@@ -26,6 +26,9 @@ SUBDIRS += fake-virtio-win fake-virt-tools
SUBDIRS += files
SUBDIRS += .
EXTRA_DIST = \
guestfs-hashsums.sh
# Build an ISO containing various files from the subdirectories, which
# is used by tests/c-api and a few guestfish tests and regression
# tests.

30
test-data/guestfs-hashsums.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash -
# libguestfs
# Copyright (C) 2014 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
do_md5 ()
{
case "$(uname)" in
Linux)
md5sum "$1" | awk '{print $1}'
;;
*)
echo "$0: unknown method to calculate MD5 of file on $(uname)"
exit 1
;;
esac
}