This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 980445 - rlFileRestore does not handle --clean while namespace is used
rlFileRestore does not handle --clean while namespace is used
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: beakerlib (Show other bugs)
20
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Dalibor Pospíšil
Fedora Extras Quality Assurance
:
Depends On:
Blocks: Fedora-beakerlib-1.9-3 1116317
  Show dependency treegraph
 
Reported: 2013-07-02 07:45 EDT by Dalibor Pospíšil
Modified: 2014-07-30 02:57 EDT (History)
6 users (show)

See Also:
Fixed In Version: beakerlib-1.9-3.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 984675 (view as bug list)
Environment:
Last Closed: 2014-07-30 02:57:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
rlFileBackup-and-rlFileRestore-namespaces-fix (1.91 KB, patch)
2013-07-02 07:45 EDT, Dalibor Pospíšil
no flags Details | Diff
fixed patch (2.00 KB, patch)
2013-07-10 10:19 EDT, Dalibor Pospíšil
no flags Details | Diff
test if namespaced backups "clean too much" (1.07 KB, application/x-shellscript)
2014-06-09 16:12 EDT, Alois Mahdal
no flags Details
log from failed test (2.14 KB, text/plain)
2014-06-18 07:53 EDT, Alois Mahdal
no flags Details
log from passed test (1.67 KB, text/plain)
2014-07-03 02:59 EDT, Jakub Jelen
no flags Details

  None (edit)
Description Dalibor Pospíšil 2013-07-02 07:45:53 EDT
Created attachment 767694 [details]
rlFileBackup-and-rlFileRestore-namespaces-fix

rlFileBackup and rlFileRestore does not correctly handle namespaces if --clean option is used.
This cause the last rlFileRestore, no matter what namespace, do the clean (rm -rf) on all backed up locations.

Included patch solves this issue.
Comment 1 David Spurek 2013-07-02 07:58:28 EDT
Tests that use rlFileBackup --clean with more namespaces are destructive due to this bug.
Comment 2 Dalibor Pospíšil 2013-07-10 09:38:23 EDT
The $namespace should be replaced by $(echo -n "$namespace" | od -A n -t x1 -v | tr -d ' ') in the patch to prevent unwanted characters in variable names.

Petr, this is really crucial thing to allow usage of the namespaces with --clean. Could you include this patch ASAP in at least in testing beakerlib?
Comment 3 Dalibor Pospíšil 2013-07-10 10:19:13 EDT
Created attachment 771650 [details]
fixed patch

Adding fixed patch.
Comment 4 Petr Muller 2013-07-10 10:54:41 EDT
I do not plan to do new RPMs anytime soon. I fail to see how this is urgent and crucial.
Comment 6 Dalibor Pospíšil 2013-08-05 05:25:13 EDT
We have discovered an issue in the patch.
line:
eval $tmp="\$$tmp\n\$file"

should be replaced by:
eval $tmp="\$$tmp\\\n\$file"

Since eval breaks the backslash before the new line character.

To be more precise even the double-quotes should be escaped but there should not be any whitespace in it so it is not necessary.
Comment 7 Dalibor Pospíšil 2013-09-10 06:00:05 EDT
Hi Peter, is there any progress on it?
Comment 8 Petr Muller 2013-09-10 08:04:54 EDT
No. I would have updated this BZ otherwise.
Comment 9 Fedora End Of Life 2013-09-16 12:45:25 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20
Comment 10 Karel Srot 2014-01-15 11:29:04 EST
Hi Peter, is there anything we can do to get this patch into the beakerlib any time soon?  Thank you.
Comment 11 Dalibor Pospíšil 2014-03-06 11:13:43 EST
code fixed by https://git.fedorahosted.org/cgit/beakerlib.git/commit/?id=44b8f7c306e4c1e7f4a147fc7dc599422fe7b887

Code is now ready for release in git.
Comment 12 Alois Mahdal 2014-06-09 16:09:47 EDT
This bug is still present in beakerlib-1.8-4.fc20.noarch and others (el6, el7...).

Is there a release planned that would contain the fix?  Let me know if I can help.
Comment 13 Alois Mahdal 2014-06-09 16:12:19 EDT
Created attachment 906135 [details]
test if namespaced backups "clean too much"
Comment 14 Fedora Update System 2014-06-17 09:41:45 EDT
beakerlib-1.9-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/beakerlib-1.9-1.fc20
Comment 15 Fedora Update System 2014-06-17 19:29:16 EDT
Package beakerlib-1.9-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing beakerlib-1.9-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-7442/beakerlib-1.9-1.fc20
then log in and leave karma (feedback).
Comment 16 Alois Mahdal 2014-06-18 07:35:38 EDT
Sorry but rlBackup/rlRestore still fail.  Excerpt from running the test I have attached:


    :: [  BEGIN   ] :: compare results :: actually running 'diff -u ORIG POST'
    --- ORIG	2014-06-18 13:26:08.384142718 +0200
    +++ POST	2014-06-18 13:26:08.811146452 +0200
    @@ -1,4 +1,6 @@
     dir1
     dir2
    +dir2/trash
     dirA
     dirB
    +dirB/trash
    :: [   FAIL   ] :: compare results (Expected 0, got 1)


Note that there are some messages evoked during rlFileBackup (shouldn't they cause failure of the backup?):


    :: [  BEGIN   ] :: save original state :: actually running 'lsall > ORIG'
    :: [   PASS   ] :: save original state (Expected 0, got 0)
    [GENERIC]
    bnvtymvycwo. = ZGlyMQo=

    bstor: PUT needs exactly three arguments (command, key, value)
    [GENERIC]
    bnvtymvycwo. = ZGlyMQo=
    bgv0dgvycwo. = ZGlyQQo=

    bstor: PUT needs exactly three arguments (command, key, value)
    :: [  BEGIN   ] :: Running 'mktrash'
Comment 17 Alois Mahdal 2014-06-18 07:53:55 EDT
Created attachment 909983 [details]
log from failed test
Comment 18 Dalibor Pospíšil 2014-06-19 04:25:38 EDT
Actually it is bug in the new part behind this.

fixed by https://git.fedorahosted.org/cgit/beakerlib.git/commit/?id=32a0abbee3f5d4b0f167783c7e1b1cc9fce205e2
Comment 19 Fedora Update System 2014-07-02 04:01:26 EDT
beakerlib-1.9-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/beakerlib-1.9-2.fc20
Comment 20 Fedora Update System 2014-07-03 00:03:01 EDT
Package beakerlib-1.9-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing beakerlib-1.9-2.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-7998/beakerlib-1.9-2.fc20
then log in and leave karma (feedback).
Comment 21 Jakub Jelen 2014-07-03 02:59:07 EDT
Created attachment 914363 [details]
log from passed test

Current version in Rawhide (beakerlib-1.9-2.fc21.noarch) seems to work - attached test PASSes for me on Rawhide (see log).

But since we use test /distribution/system/setup PHASE=workarounds, current check doesn't work anymore and we are getting errors [1]. According to this I propose to update this test to patch only version 1.8 (I hope we don't use any older version somewhere). This patch should make it:
http://pastebin.test.redhat.com/219360

[1] https://beaker.engineering.redhat.com/recipes/1409888#task22184555
Comment 22 Dalibor Pospíšil 2014-07-03 04:26:53 EDT
(In reply to Jakub Jelen from comment #21)
> Created attachment 914363 [details]
> log from passed test
> 
> Current version in Rawhide (beakerlib-1.9-2.fc21.noarch) seems to work -
> attached test PASSes for me on Rawhide (see log).
> 
> But since we use test /distribution/system/setup PHASE=workarounds, current
> check doesn't work anymore and we are getting errors [1]. According to this
> I propose to update this test to patch only version 1.8 (I hope we don't use
> any older version somewhere). This patch should make it:
> http://pastebin.test.redhat.com/219360
> 
> [1] https://beaker.engineering.redhat.com/recipes/1409888#task22184555

Thanks for that. I have fixed workarounds.
Comment 23 Dalibor Pospíšil 2014-07-04 04:50:59 EDT
Please consider the package fixing this bug available in Fedora stable repos once bz1116308 is closed and RHEL stable repos once bz1116317 is closed.

Fixed in:
beakerlib-1.9-2.fc19
beakerlib-1.9-2.fc20
beakerlib-1.9-2.fc21
beakerlib-1.9-3.el5
beakerlib-1.9-2.el6
beakerlib-1.9-2.el7
Comment 24 Fedora Update System 2014-07-17 09:15:46 EDT
beakerlib-1.9-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/beakerlib-1.9-3.fc20
Comment 25 Fedora Update System 2014-07-30 02:57:17 EDT
beakerlib-1.9-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.