Bug 1331820

Summary: test_sparse_file fails
Product: [Fedora] Fedora Reporter: Dan Horák <dan>
Component: borgbackupAssignee: Persona non grata <nobody+366555>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: nobody+366555, yselkowi
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: s390x   
OS: Unspecified   
Whiteboard:
Fixed In Version: borgbackup-1.0.6-1.fc24 borgbackup-1.0.6-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-22 18:23:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 467765, 1344111    
Attachments:
Description Flags
Patch for rawhide none

Description Dan Horák 2016-04-29 16:21:12 UTC
=================================== FAILURES ===================================
______________________ ArchiverTestCase.test_sparse_file _______________________
self = <borg.testsuite.archiver.ArchiverTestCase testMethod=test_sparse_file>
    def test_sparse_file(self):
        # no sparse file support on Mac OS X
        sparse_support = sys.platform != 'darwin'
        filename = os.path.join(self.input_path, 'sparse')
        content = b'foobar'
        hole_size = 5 * (1 << CHUNK_MAX_EXP)  # 5 full chunker buffers
        with open(filename, 'wb') as fd:
            # create a file that has a hole at the beginning and end (if the
            # OS and filesystem supports sparse files)
            fd.seek(hole_size, 1)
            fd.write(content)
            fd.seek(hole_size, 1)
            pos = fd.tell()
            fd.truncate(pos)
        total_len = hole_size + len(content) + hole_size
        st = os.stat(filename)
        self.assert_equal(st.st_size, total_len)
        if sparse_support and hasattr(st, 'st_blocks'):
            self.assert_true(st.st_blocks * 512 < total_len / 9)  # is input sparse?
        self.cmd('init', self.repository_location)
        self.cmd('create', self.repository_location + '::test', 'input')
        with changedir('output'):
            self.cmd('extract', '--sparse', self.repository_location + '::test')
        self.assert_dirs_equal('input', 'output/input')
        filename = os.path.join(self.output_path, 'input', 'sparse')
        with open(filename, 'rb') as fd:
            # check if file contents are as expected
            self.assert_equal(fd.read(hole_size), b'\0' * hole_size)
            self.assert_equal(fd.read(len(content)), content)
            self.assert_equal(fd.read(hole_size), b'\0' * hole_size)
        st = os.stat(filename)
        self.assert_equal(st.st_size, total_len)
        if sparse_support and hasattr(st, 'st_blocks'):
>           self.assert_true(st.st_blocks * 512 < total_len / 9)  # is output sparse?
E           AssertionError: False is not true
borg/testsuite/archiver.py:416: AssertionError
----------------------------- Captured stderr call -----------------------------
Warning: File system encoding is "ascii", extracting non-ascii filenames will not be supported.
Hint: You likely need to fix your locale setup. E.g. install locales and use: LANG=en_US.UTF-8
___________________ RemoteArchiverTestCase.test_sparse_file ____________________
self = <borg.testsuite.archiver.RemoteArchiverTestCase testMethod=test_sparse_file>
    def test_sparse_file(self):
        # no sparse file support on Mac OS X
        sparse_support = sys.platform != 'darwin'
        filename = os.path.join(self.input_path, 'sparse')
        content = b'foobar'
        hole_size = 5 * (1 << CHUNK_MAX_EXP)  # 5 full chunker buffers
        with open(filename, 'wb') as fd:
            # create a file that has a hole at the beginning and end (if the
            # OS and filesystem supports sparse files)
            fd.seek(hole_size, 1)
            fd.write(content)
            fd.seek(hole_size, 1)
            pos = fd.tell()
            fd.truncate(pos)
        total_len = hole_size + len(content) + hole_size
        st = os.stat(filename)
        self.assert_equal(st.st_size, total_len)
        if sparse_support and hasattr(st, 'st_blocks'):
            self.assert_true(st.st_blocks * 512 < total_len / 9)  # is input sparse?
        self.cmd('init', self.repository_location)
        self.cmd('create', self.repository_location + '::test', 'input')
        with changedir('output'):
            self.cmd('extract', '--sparse', self.repository_location + '::test')
        self.assert_dirs_equal('input', 'output/input')
        filename = os.path.join(self.output_path, 'input', 'sparse')
        with open(filename, 'rb') as fd:
            # check if file contents are as expected
            self.assert_equal(fd.read(hole_size), b'\0' * hole_size)
            self.assert_equal(fd.read(len(content)), content)
            self.assert_equal(fd.read(hole_size), b'\0' * hole_size)
        st = os.stat(filename)
        self.assert_equal(st.st_size, total_len)
        if sparse_support and hasattr(st, 'st_blocks'):
>           self.assert_true(st.st_blocks * 512 < total_len / 9)  # is output sparse?
E           AssertionError: False is not true
borg/testsuite/archiver.py:416: AssertionError
----------------------------- Captured stderr call -----------------------------
Warning: File system encoding is "ascii", extracting non-ascii filenames will not be supported.
Hint: You likely need to fix your locale setup. E.g. install locales and use: LANG=en_US.UTF-8
 56 tests deselected by '-knot test_non_ascii_acl and not test_fuse_mount and not benchmark' 
= 2 failed, 414 passed, 48 skipped, 56 deselected, 2 xfailed in 210.22 seconds =

for full logs please see eg. http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=2192700


Version-Release number of selected component (if applicable):
borgbackup-1.0.2-1.fc24


Additional info:
The s390(x) builder are using XFS for its / filesystem, while other builders in Fedora are ext4 based.

Comment 2 Yaakov Selkowitz 2016-07-01 23:58:38 UTC
Created attachment 1175147 [details]
Patch for rawhide

Please merge this into epel7 as well.

s390x scratch build: http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=2274179

Also mock tested on RHELSA 7.2.

Comment 3 Fedora Update System 2016-07-08 01:42:29 UTC
borgbackup-1.0.3-2.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-e2b9285caa

Comment 4 Fedora Update System 2016-07-08 01:45:36 UTC
borgbackup-1.0.3-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-cb16bbd36a

Comment 5 Fedora Update System 2016-07-10 03:17:59 UTC
borgbackup-1.0.3-2.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-e2b9285caa

Comment 6 Fedora Update System 2016-07-10 15:58:24 UTC
borgbackup-1.0.3-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-cb16bbd36a

Comment 7 Fedora Update System 2016-07-13 15:12:18 UTC
borgbackup-1.0.6-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-76c184ea7a

Comment 8 Fedora Update System 2016-07-13 15:13:30 UTC
borgbackup-1.0.6-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-46d99c6930

Comment 9 Fedora Update System 2016-07-14 22:28:31 UTC
borgbackup-1.0.6-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-76c184ea7a

Comment 10 Fedora Update System 2016-07-15 07:47:17 UTC
borgbackup-1.0.6-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-46d99c6930

Comment 11 Fedora Update System 2016-07-22 18:23:19 UTC
borgbackup-1.0.6-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2016-08-01 16:21:29 UTC
borgbackup-1.0.6-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.