On Tue, 2012-10-23 at 17:35 +0200, Jiri Jaburek wrote:
This change introduces a new --namespace option for rlFileBackup
and rlFileRestore, allowing the user to perform several backup/restore
operations independently.
Getopt might seem like an overkill, but there's no primitive and safe
way of using multiple long options with arguments without it.
Also while rlFileRestore could get away without it (no --clean),
I believe it's important to keep a certain level of consistency.
Cool. I'm having trouble with the attached test, though. If I run the
testsuite as non-root, I see a bunch of ERRORs coming out from the
testcase, but the tests actually finish as PASS.
[ INFO ] Running test_rlFileBackupAndRestoreNamespaces
chown: changing ownership of `/var/tmp/beakerlib-123456/backup/tmp':
Operation not permitted
chown: changing ownership of `/var/tmp/beakerlib-123456/backup/':
Operation not permitted
:: [19:04:15] :: [ ERROR ] :: rlFileBackup: Failed to preserve all
attributes for backup path /var/tmp/beakerlib-123456/backup/tmp.
chown: changing ownership of
`/var/tmp/beakerlib-123456/backup-myspace1/tmp': Operation not permitted
chown: changing ownership of
`/var/tmp/beakerlib-123456/backup-myspace1/': Operation not permitted
:: [19:04:15] :: [ ERROR ] :: rlFileBackup: Failed to preserve all
attributes for backup
path /var/tmp/beakerlib-123456/backup-myspace1/tmp.
cp: preserving times for `/tmp': Operation not permitted
:: [19:04:16] :: [ ERROR ] :: rlFileRestore: Failed to restore files
from /var/tmp/beakerlib-123456/backup
[ PASS ] Normal restore shouldn't restore namespaced backup
cp: preserving times for `/tmp': Operation not permitted
:: [19:04:16] :: [ ERROR ] :: rlFileRestore: Failed to restore files
from /var/tmp/beakerlib-123456/backup-myspace1
[ PASS ] Namespaced restore shouldn't restore normal backup
chown: changing ownership of `/var/tmp/beakerlib-123456/backup/tmp':
Operation not permitted
chown: changing ownership of `/var/tmp/beakerlib-123456/backup/':
Operation not permitted
:: [19:04:16] :: [ ERROR ] :: rlFileBackup: Failed to preserve all
attributes for backup path /var/tmp/beakerlib-123456/backup/tmp.
chown: changing ownership of
`/var/tmp/beakerlib-123456/backup-myspace2/tmp': Operation not permitted
chown: changing ownership of
`/var/tmp/beakerlib-123456/backup-myspace2/': Operation not permitted
:: [19:04:16] :: [ ERROR ] :: rlFileBackup: Failed to preserve all
attributes for backup
path /var/tmp/beakerlib-123456/backup-myspace2/tmp.
cp: preserving times for `/tmp': Operation not permitted
:: [19:04:16] :: [ ERROR ] :: rlFileRestore: Failed to restore files
from /var/tmp/beakerlib-123456/backup
[ PASS ] Namespaced backup shouldn't overwrite normal one
That's pretty weird: why all the errors, when the result is actually
PASS? The tests should probably detect this and FAIL, I suppose. Please
note its OK to fail if the suite is not run as root: thats what the
basic rlFileBackup test does:
[ FAIL ] rlFileBackup & rlFileRestore sanity test (needs to be root to
run this)
PM