Remove patches which are now upstream.

This commit is contained in:
Richard W.M. Jones 2014-03-15 23:07:43 +00:00
parent c28e621afd
commit e46d2018e1
3 changed files with 0 additions and 81 deletions

View File

@ -1,49 +0,0 @@
From 9b883d3c3ec0ff93bbea776572afb54d2a9b3524 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 14 Mar 2014 09:15:49 +0000
Subject: [PATCH 1/2] tests/discard: Ensure a significant number of blocks are
freed up on the host.
It's reasonable to expect megabytes will be freed up and given back to
the host. Previously we just tested that at least 1 block was
released. This test checks that at least 1000 blocks are released
(since stat(2) returns blocks of 512 bytes: 512 bytes * 1000 = approx 0.5 MB).
---
tests/discard/test-blkdiscard.pl | 2 +-
tests/discard/test-discard.pl | 2 +-
tests/discard/test-fstrim.pl | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/discard/test-blkdiscard.pl b/tests/discard/test-blkdiscard.pl
index 77b72b9..e080350 100755
--- a/tests/discard/test-blkdiscard.pl
+++ b/tests/discard/test-blkdiscard.pl
@@ -114,4 +114,4 @@ my $trimmed_size = (stat ($disk))[12];
print "trimmed size:\t$trimmed_size (blocks)\n";
die "$0: looks like the blkdiscard operation did not work\n"
- if $trimmed_size >= $full_size;
+ if $full_size - $trimmed_size < 1000;
diff --git a/tests/discard/test-discard.pl b/tests/discard/test-discard.pl
index 3f350b3..5e2f879 100755
--- a/tests/discard/test-discard.pl
+++ b/tests/discard/test-discard.pl
@@ -114,4 +114,4 @@ print "trimmed size:\t$trimmed_size (blocks)\n";
#system "du -sh $disk";
die "$0: looks like the -o discard mount option did not work\n"
- if $trimmed_size >= $full_size;
+ if $full_size - $trimmed_size < 1000;
diff --git a/tests/discard/test-fstrim.pl b/tests/discard/test-fstrim.pl
index 54451b8..30bb855 100755
--- a/tests/discard/test-fstrim.pl
+++ b/tests/discard/test-fstrim.pl
@@ -122,4 +122,4 @@ print "trimmed size:\t$trimmed_size (blocks)\n";
#system "du -sh $disk";
die "$0: looks like the fstrim operation did not work\n"
- if $trimmed_size >= $full_size;
+ if $full_size - $trimmed_size < 1000;
--
1.8.5.3

View File

@ -1,26 +0,0 @@
From accf1b66aa835714690a2979e990c49243875dab Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 14 Mar 2014 10:09:47 +0000
Subject: [PATCH 2/2] tests: fstrim: Remount the disk.
This makes fstrim work. It's not clear why exactly.
---
tests/discard/test-fstrim.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/discard/test-fstrim.pl b/tests/discard/test-fstrim.pl
index 30bb855..cec853f 100755
--- a/tests/discard/test-fstrim.pl
+++ b/tests/discard/test-fstrim.pl
@@ -113,6 +113,8 @@ die "$0: surprising result: full size <= original size\n"
# Remove the file and then try to trim the filesystem.
$g->rm ("/data");
+$g->umount ("/");
+$g->mount_options ("nodiscard", "/dev/sda", "/");
$g->fstrim ("/");
$g->sync ();
$g->close ();
--
1.8.5.3

View File

@ -27,9 +27,6 @@ License: LGPLv2+
URL: http://libguestfs.org/ URL: http://libguestfs.org/
Source0: http://libguestfs.org/download/1.25-development/%{name}-%{version}.tar.gz Source0: http://libguestfs.org/download/1.25-development/%{name}-%{version}.tar.gz
Patch1: 0001-tests-discard-Ensure-a-significant-number-of-blocks-.patch
Patch2: 0002-tests-fstrim-Remount-the-disk.patch
# Basic build requirements: # Basic build requirements:
BuildRequires: perl(Pod::Simple) BuildRequires: perl(Pod::Simple)
BuildRequires: perl(Pod::Man) BuildRequires: perl(Pod::Man)
@ -673,9 +670,6 @@ for %{name}.
%prep %prep
%setup -q %setup -q
%patch1 -p1
%patch2 -p1
if [ "$(getenforce | tr '[A-Z]' '[a-z]')" != "disabled" ]; then if [ "$(getenforce | tr '[A-Z]' '[a-z]')" != "disabled" ]; then
# For sVirt to work, the local temporary directory we use in the # For sVirt to work, the local temporary directory we use in the
# tests must be labelled the same way as /tmp. # tests must be labelled the same way as /tmp.