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. --- test-data/Makefile.am | 3 +++ test-data/guestfs-hashsums.sh | 30 ++++++++++++++++++++++++++++++ tests/qemu/Makefile.am | 1 - tests/qemu/guestfs-md5.sh | 30 ------------------------------ tests/qemu/qemu-liveness.sh | 2 +- tests/qemu/qemu-snapshot-isolation.sh | 2 +- 6 files changed, 35 insertions(+), 33 deletions(-) create mode 100755 test-data/guestfs-hashsums.sh delete mode 100755 tests/qemu/guestfs-md5.sh diff --git a/test-data/Makefile.am b/test-data/Makefile.am index 0a9c65e..0c37c97 100644 --- a/test-data/Makefile.am +++ b/test-data/Makefile.am @@ -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. diff --git a/test-data/guestfs-hashsums.sh b/test-data/guestfs-hashsums.sh new file mode 100755 index 0000000..79dbd67 --- /dev/null +++ b/test-data/guestfs-hashsums.sh @@ -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 +} diff --git a/tests/qemu/Makefile.am b/tests/qemu/Makefile.am index 6c72b18..091361f 100644 --- a/tests/qemu/Makefile.am +++ b/tests/qemu/Makefile.am @@ -30,7 +30,6 @@ TESTS_ENVIRONMENT = $(top_builddir)/run --test EXTRA_DIST = \ $(TESTS) \ - guestfs-md5.sh \ qemu-boot.c \ qemu-speed-test.c diff --git a/tests/qemu/guestfs-md5.sh b/tests/qemu/guestfs-md5.sh deleted file mode 100755 index 79dbd67..0000000 --- a/tests/qemu/guestfs-md5.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/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 -} diff --git a/tests/qemu/qemu-liveness.sh b/tests/qemu/qemu-liveness.sh index 7129bb2..fda3cc2 100755 --- a/tests/qemu/qemu-liveness.sh +++ b/tests/qemu/qemu-liveness.sh @@ -22,7 +22,7 @@ set -e -. $srcdir/guestfs-md5.sh +. $srcdir/../../test-data/guestfs-hashsums.sh rm -f liveness1.img diff --git a/tests/qemu/qemu-snapshot-isolation.sh b/tests/qemu/qemu-snapshot-isolation.sh index c217dc4..4d60e59 100755 --- a/tests/qemu/qemu-snapshot-isolation.sh +++ b/tests/qemu/qemu-snapshot-isolation.sh @@ -22,7 +22,7 @@ set -e -. $srcdir/guestfs-md5.sh +. $srcdir/../../test-data/guestfs-hashsums.sh # UML backend doesn't support qcow2 format. supports_qcow2=yes -- 2.5.0