SHA256
1
0
forked from pool/tar

Accepting request 606438 from home:kstreitova:branches:Base:System

- add tar-1.30-tests_dirrem_race.patch to fix race in dirrem01 and
  dirrem02 tests that were passing/failing randomly because of that
- run spec-cleaner
- renumber patches

OBS-URL: https://build.opensuse.org/request/show/606438
OBS-URL: https://build.opensuse.org/package/show/Base:System/tar?expand=0&rev=86
This commit is contained in:
Kristyna Streitova 2018-05-11 15:18:25 +00:00 committed by Git OBS Bridge
parent d8018f71b3
commit c43661598f
3 changed files with 115 additions and 14 deletions

View File

@ -0,0 +1,90 @@
From 64b43fdf70d82c39eb2ca900cd4f8e49b86c2020 Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Thu, 4 Jan 2018 18:55:12 +0100
Subject: tests: fix race in dirrem01 and dirrem02
Previously the '--checkpoint-action=echo' was triggered after
'--checkpoint-action=sleep=1' - so the order of events *usually*
was (for --format='gnu'):
...
1. checkpoint handler before write of 'dir/sub' member
2. one-second delay
3. stderr write: 'tar: Write checkpoint 3'
4. write the member 'dir/sub' into the archive
5. check that the member's ctime has not been changed
6. genfile's detecting 'Write checkpoint', doing unlink
...
But sometimes, the genfile was fast enough to win the race and
unlinked the directory before the member was written into the
archive (IOW, the order was 1-2-3-6-4-5). This led to the
occasional warning 'tar: dir/sub: file changed as we read it'.
Swap the order of 'sleep=1' and 'echo' actions so the genfile
utility has (hopefully) enough time to do the unlink before
writing the file into the archive (enforce 1-2-3-6-4-5 order).
* tests/dirrem01.at: Swap 'sleep=1' and 'echo' actions.
* tests/dirrem02.at: Likewise.
---
tests/dirrem01.at | 5 +++--
tests/dirrem02.at | 7 ++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/tests/dirrem01.at b/tests/dirrem01.at
index 40344dc..dabc206 100644
--- a/tests/dirrem01.at
+++ b/tests/dirrem01.at
@@ -47,14 +47,15 @@ gnu) CPT=3;;
esac
genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \
- tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
- --checkpoint-action='echo' -c -f archive.tar \
+ tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='echo' \
+ --checkpoint-action='sleep=1' -c -f archive.tar \
--listed-incremental db -v dir >/dev/null
],
[1],
[ignore],
[tar: dir: Directory is new
tar: dir/sub: Directory is new
+tar: dir/sub: file changed as we read it
tar: dir/sub: File removed before we read it
],[],[],[gnu,posix])
diff --git a/tests/dirrem02.at b/tests/dirrem02.at
index e1cf9ef..924454f 100644
--- a/tests/dirrem02.at
+++ b/tests/dirrem02.at
@@ -20,7 +20,7 @@
# Description:
#
-# When an explicitley named directory disappears during creation
+# When an explicitly named directory disappears during creation
# of incremental dump, tar should still exit with TAREXIT_FAILURE (2).
#
# For further details see dirrem01.at
@@ -44,14 +44,15 @@ gnu) CPT=3;;
esac
genfile --run --checkpoint=$CPT --unlink dir/sub/file2 --unlink dir/sub -- \
- tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='sleep=1' \
- --checkpoint-action='echo' -c -f archive.tar \
+ tar --blocking-factor=1 --checkpoint=1 --checkpoint-action='echo' \
+ --checkpoint-action='sleep=1' -c -f archive.tar \
--listed-incremental db -v dir dir/sub >/dev/null
],
[2],
[ignore],
[tar: dir: Directory is new
tar: dir/sub: Directory is new
+tar: dir/sub: file changed as we read it
tar: dir/sub: Cannot open: No such file or directory
tar: Exiting with failure status due to previous errors
],[],[],[gnu,posix])
--
cgit v1.0-41-gc330

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri May 11 10:41:40 UTC 2018 - kstreitova@suse.com
- add tar-1.30-tests_dirrem_race.patch to fix race in dirrem01 and
dirrem02 tests that were passing/failing randomly because of that
- run spec-cleaner
- renumber patches
-------------------------------------------------------------------
Tue Apr 3 14:58:19 CEST 2018 - kukuk@suse.de

View File

@ -29,19 +29,21 @@ Source0: https://ftp.gnu.org/gnu/tar/%{name}-%{version}.tar.bz2
Source1: https://ftp.gnu.org/gnu/tar/%{name}-%{version}.tar.bz2.sig
# http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0x3602B07F55D0C732
Source2: %{name}.keyring
Patch3: %{name}-wildcards.patch
Patch6: %{name}-backup-spec-fix-paths.patch
Patch10: paxutils-rtapelib_mtget.patch
Patch0: %{name}-wildcards.patch
Patch1: %{name}-backup-spec-fix-paths.patch
Patch2: paxutils-rtapelib_mtget.patch
# don't print warning about zero blocks
# the patch is used in Fedora and Debian
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=235820
Patch11: %{name}-ignore_lone_zero_blocks.patch
Patch3: %{name}-ignore_lone_zero_blocks.patch
# The next patch is disabled because it causes a regression:
#https://bugzilla.opensuse.org/show_bug.cgi?id=918487
Patch12: %{name}-recursive--files-from.patch
Patch20: add_readme-tests.patch
Patch4: %{name}-recursive--files-from.patch
Patch5: add_readme-tests.patch
# PATCH-FIX-UPSTREAM kstreitova@suse.com -- fix difflink.at test
Patch21: tar-1.30-tests-difflink.patch
Patch6: tar-1.30-tests-difflink.patch
# PATCH-FIX-UPSTREAM kstreitova@suse.com -- fix race in dirrem01 and dirrem02 tests
Patch7: tar-1.30-tests_dirrem_race.patch
BuildRequires: automake
BuildRequires: libacl-devel
BuildRequires: libattr-devel
@ -109,13 +111,14 @@ it may as well access remote devices or files.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
#%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch10 -p1
%patch11 -p1
#%patch12 -p1
%patch20 -p1
%patch21 -p1
%patch7 -p1
%build
%define my_cflags -W -Wall -Wpointer-arith -Wstrict-prototypes -Wformat-security -Wno-unused-parameter -fPIE
@ -202,7 +205,7 @@ fi
%ghost %{_bindir}/rmt
%{_bindir}/gnurmt
%ghost %{_mandir}/man1/rmt.1%{ext_man}
%{_mandir}/man1/gnurmt.1%{ext_man}
%{_mandir}/man1/gnurmt.1%{?ext_man}
%ghost %{_sysconfdir}/alternatives/rmt
%ghost %{_sysconfdir}/alternatives/rmt.1%{ext_man}
@ -223,6 +226,6 @@ fi
/bin/%{name}
#EndUsrMerge
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1%{ext_man}
%{_mandir}/man1/%{name}.1%{?ext_man}
%changelog