[libguestfs/el5] Add patches (also upstream) so we can skip FUSE tests.

Richard W.M. Jones rjones at fedoraproject.org
Mon Jun 25 14:25:19 UTC 2012


commit 3fde43fb5b7eeb56e23b0fb7b8ccbd5b20ab1bbb
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Mon Jun 25 15:24:58 2012 +0100

    Add patches (also upstream) so we can skip FUSE tests.

 ...-SELinux-tests-to-be-skipped-with-an-envi.patch |   29 +++++++++++++++++++
 ...mount-local-test-to-be-skipped-with-envir.patch |   29 +++++++++++++++++++
 ...-t-check-for-dev-fuse-before-running-the-.patch |   30 ++++++++++++++++++++
 libguestfs.spec                                    |   16 ++++++++--
 4 files changed, 101 insertions(+), 3 deletions(-)
---
diff --git a/0001-tests-Allow-SELinux-tests-to-be-skipped-with-an-envi.patch b/0001-tests-Allow-SELinux-tests-to-be-skipped-with-an-envi.patch
new file mode 100644
index 0000000..bc18e90
--- /dev/null
+++ b/0001-tests-Allow-SELinux-tests-to-be-skipped-with-an-envi.patch
@@ -0,0 +1,29 @@
+From 994545fb9636e46c9d255c04d75b00973d78c70b Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Mon, 25 Jun 2012 15:14:46 +0100
+Subject: [PATCH 1/3] tests: Allow SELinux tests to be skipped with an environment variable.
+
+---
+ tests/selinux/run-test.pl |    6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/tests/selinux/run-test.pl b/tests/selinux/run-test.pl
+index 4a0ccee..6b0ffb5 100755
+--- a/tests/selinux/run-test.pl
++++ b/tests/selinux/run-test.pl
+@@ -45,6 +45,12 @@ die unless $test_type eq "xattrs" || $test_type eq "selinux";
+ my $test_via = $ARGV[1];
+ die unless $test_via eq "direct" || $test_via eq "fuse";
+ 
++my $env_name = "SKIP_TEST_SELINUX_" . uc ($test_type) . "_" . uc ($test_via);
++if ($ENV{$env_name}) {
++    print "$prog $test_type $test_via: test skipped because $env_name is set.\n";
++    exit 0
++}
++
+ # SELinux labelling won't work (and can be skipped) if SELinux isn't
+ # installed or isn't enabled on the host.
+ if ($test_type eq "selinux") {
+-- 
+1.7.4.1
+
diff --git a/0002-fish-Allow-mount-local-test-to-be-skipped-with-envir.patch b/0002-fish-Allow-mount-local-test-to-be-skipped-with-envir.patch
new file mode 100644
index 0000000..fce3053
--- /dev/null
+++ b/0002-fish-Allow-mount-local-test-to-be-skipped-with-envir.patch
@@ -0,0 +1,29 @@
+From 034274a51e8544b18add7a34eeaf3bdaa74c9bcd Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Mon, 25 Jun 2012 15:19:19 +0100
+Subject: [PATCH 2/3] fish: Allow mount-local test to be skipped with environment variable.
+
+The test uses FUSE, so we need a way to disable it on RHEL 5.
+---
+ fish/test-mount-local.sh |    5 +++++
+ 1 files changed, 5 insertions(+), 0 deletions(-)
+
+diff --git a/fish/test-mount-local.sh b/fish/test-mount-local.sh
+index a71db04..c1b3f55 100755
+--- a/fish/test-mount-local.sh
++++ b/fish/test-mount-local.sh
+@@ -18,6 +18,11 @@
+ 
+ # Test guestfish mount-local / mount-local-run commands.
+ 
++if [ -n "$SKIP_TEST_MOUNT_LOCAL_SH" ]; then
++    echo "$0: skipping test because SKIP_TEST_MOUNT_LOCAL_SH is set."
++    exit 0
++fi
++
+ # Skip if no FUSE.
+ 
+ test -w /dev/fuse || {
+-- 
+1.7.4.1
+
diff --git a/0003-sysprep-Don-t-check-for-dev-fuse-before-running-the-.patch b/0003-sysprep-Don-t-check-for-dev-fuse-before-running-the-.patch
new file mode 100644
index 0000000..e6983a1
--- /dev/null
+++ b/0003-sysprep-Don-t-check-for-dev-fuse-before-running-the-.patch
@@ -0,0 +1,30 @@
+From 448803d625b6673d233ce765412c784320d9923c Mon Sep 17 00:00:00 2001
+From: Richard W.M. Jones <rjones at redhat.com>
+Date: Mon, 25 Jun 2012 15:19:58 +0100
+Subject: [PATCH 3/3] sysprep: Don't check for /dev/fuse before running the test.
+
+The program doesn't actually require FUSE when used without
+any --script options.
+---
+ sysprep/test-virt-sysprep.sh |    5 -----
+ 1 files changed, 0 insertions(+), 5 deletions(-)
+
+diff --git a/sysprep/test-virt-sysprep.sh b/sysprep/test-virt-sysprep.sh
+index 5e541fe..2443ce2 100755
+--- a/sysprep/test-virt-sysprep.sh
++++ b/sysprep/test-virt-sysprep.sh
+@@ -19,11 +19,6 @@
+ export LANG=C
+ set -e
+ 
+-if [ ! -w /dev/fuse ]; then
+-    echo "$0: SKIPPING test, because there is no /dev/fuse."
+-    exit 0
+-fi
+-
+ # virt-sysprep with the -n option doesn't modify the guest.  It ought
+ # to be able to sysprep any of our test guests.
+ 
+-- 
+1.7.4.1
+
diff --git a/libguestfs.spec b/libguestfs.spec
index 7396bef..88efee5 100644
--- a/libguestfs.spec
+++ b/libguestfs.spec
@@ -22,7 +22,7 @@ Summary:       Access and modify virtual machine disk images
 Name:          libguestfs
 Epoch:         1
 Version:       1.19.11
-Release:       1%{?dist}
+Release:       2%{?dist}
 License:       LGPLv2+
 Group:         Development/Libraries
 URL:           http://libguestfs.org/
@@ -59,6 +59,11 @@ Patch0017:     0017-EPEL-5-Remove-Fedora-MD-test-images.patch
 Patch0018:     0018-EPEL-5-Add-mkisofs-to-package-list.patch
 Patch0019:     0019-EPEL-5-Add-1-second-pause-after-unmounting-any-files.patch
 
+# Upstream in libguestfs >= 1.19.12.
+Patch0101:     0001-tests-Allow-SELinux-tests-to-be-skipped-with-an-envi.patch
+Patch0102:     0002-fish-Allow-mount-local-test-to-be-skipped-with-envir.patch
+Patch0103:     0003-sysprep-Don-t-check-for-dev-fuse-before-running-the-.patch
+
 # Basic build requirements:
 BuildRequires: /usr/bin/pod2man
 BuildRequires: /usr/bin/pod2text
@@ -668,8 +673,13 @@ export SKIP_TEST_NTFSCLONE_SH=1
 # IDE interface not supported.
 export SKIP_TEST_RHBZ690819_SH=1
 
-# FUSE not supported.
+# FUSE is only partially working, and in any case we cannot do any
+# tests in RHEL 5 because it requires the current user to be added
+# to the 'fuse' group, which we can't do in Koji.
 export SKIP_TEST_FUSE_SH=1
+export SKIP_TEST_MOUNT_LOCAL_SH=1
+export SKIP_TEST_SELINUX_XATTRS_FUSE=1
+export SKIP_TEST_SELINUX_SELINUX_FUSE=1
 export SKIP_TEST_VIRT_SYSPREP_SCRIPT_SH=1
 
 # blkid can't read NTFS labels.
@@ -901,7 +911,7 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
-* Mon Jun 25 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.19.11-1
+* Mon Jun 25 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.19.11-2
 - New upstream version 1.19.11.
 
 * Fri Jun 22 2012 Richard W.M. Jones <rjones at redhat.com> - 1:1.19.10-1


More information about the scm-commits mailing list