Bug 980445
Summary: | rlFileRestore does not handle --clean while namespace is used | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Dalibor Pospíšil <dapospis> | ||||||||||||
Component: | beakerlib | Assignee: | Dalibor Pospíšil <dapospis> | ||||||||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||||||||
Severity: | high | Docs Contact: | |||||||||||||
Priority: | unspecified | ||||||||||||||
Version: | 20 | CC: | amahdal, dspurek, jjelen, ksrot, pmuller, psplicha | ||||||||||||
Target Milestone: | --- | ||||||||||||||
Target Release: | --- | ||||||||||||||
Hardware: | Unspecified | ||||||||||||||
OS: | Unspecified | ||||||||||||||
Whiteboard: | |||||||||||||||
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 06:57:17 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: | 1116308, 1116317 | ||||||||||||||
Attachments: |
|
Tests that use rlFileBackup --clean with more namespaces are destructive due to this bug. 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? Created attachment 771650 [details]
fixed patch
Adding fixed patch.
I do not plan to do new RPMs anytime soon. I fail to see how this is urgent and crucial. 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. Hi Peter, is there any progress on it? No. I would have updated this BZ otherwise. 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 Hi Peter, is there anything we can do to get this patch into the beakerlib any time soon? Thank you. code fixed by https://git.fedorahosted.org/cgit/beakerlib.git/commit/?id=44b8f7c306e4c1e7f4a147fc7dc599422fe7b887 Code is now ready for release in git. 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. Created attachment 906135 [details]
test if namespaced backups "clean too much"
beakerlib-1.9-1.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/beakerlib-1.9-1.fc20 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). 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' Created attachment 909983 [details]
log from failed test
Actually it is bug in the new part behind this. fixed by https://git.fedorahosted.org/cgit/beakerlib.git/commit/?id=32a0abbee3f5d4b0f167783c7e1b1cc9fce205e2 beakerlib-1.9-2.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/beakerlib-1.9-2.fc20 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). 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 (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. 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 beakerlib-1.9-3.fc20 has been submitted as an update for Fedora 20. https://admin.fedoraproject.org/updates/beakerlib-1.9-3.fc20 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. |
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.