[Freeipa-devel] [PATCH 0153] ipatests: Fix incorrect order of operations when restoring

Petr Viktorin pviktori at redhat.com
Thu Feb 20 12:07:01 UTC 2014


On 02/20/2014 12:58 PM, Jan Pazdziora wrote:
> On Thu, Feb 20, 2014 at 12:20:12PM +0100, Petr Viktorin wrote:
>> On 02/19/2014 04:54 PM, Jan Pazdziora wrote:
>>>
>>> However: since this is about restoring a backup, can't the backup
>>> contain the extended attributes, so that the SELinux context gets
>>> restored to the original state (which could be different from what
>>> the restorecon will give you)?
>>
>> Well, I guess you're the Beaker authority here. Is that necessary
>
> This is not about Beaker, is it?

It is; all other use cases I know of use disposable or at least 
single-purpose VMs.

> But since you mention it, beakerlib does cp -a upon backup and restore
>
> 	https://git.fedorahosted.org/cgit/beakerlib.git/tree/src/infrastructure.sh#n484
> 	https://git.fedorahosted.org/cgit/beakerlib.git/tree/src/infrastructure.sh#n593
>
> for files to preserve the SELinux context, plus chcon --reference
> upon backup for directories:
>
> 	https://git.fedorahosted.org/cgit/beakerlib.git/tree/src/infrastructure.sh#n495
>
>> when restoring?
>> The tests expect a "sane" state, and they return to that; using a
>> somehow customized machine to test on is a bad idea anyway.
>
> You might specifically want to run your test on non-sane state because
> you want to test that the non-sane state will for example produce
> correct error, SELinux-related or other.

In that case you're on your own, you should wrap the test in custom 
setup & teardown code.


There's no way we can perfectly restore a system after IPA has been 
installed on it, much less if it was an unstable/testing version of IPA, 
so returning to a sane state seems good for me.

-- 
Petr³




More information about the Freeipa-devel mailing list