diff options
author | Chris Wilson <chris+github@qwirx.com> | 2010-09-22 21:12:02 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2010-09-22 21:12:02 +0000 |
commit | 0529b414696b73b0b922da59c03b267d676e35b9 (patch) | |
tree | ebc4c9136bcb0525ecb8f75ff3e6a89a368ec529 /test | |
parent | b059d5ef03a1b68938e82097723f282d54c1c6f6 (diff) |
Allow restoring directories with a single argument, using the remote name
as the local destination name also.
Diffstat (limited to 'test')
-rw-r--r-- | test/bbackupd/testbbackupd.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp index 32f3c176..c129a584 100644 --- a/test/bbackupd/testbbackupd.cpp +++ b/test/bbackupd/testbbackupd.cpp @@ -2070,6 +2070,31 @@ int test_bbackupd() BackupQueries::ReturnCode::Compare_Same); TestRemoteProcessMemLeaks("bbackupquery.memleaks"); + // Try a restore with just the remote directory name, + // check that it uses the same name in the local + // directory. + TEST_THAT(::mkdir("testfiles/restore-test", 0700) == 0); + + compareReturnValue = ::system(BBACKUPQUERY " " + "-Wwarning " + "-c testfiles/bbackupd.conf " + "\"lcd testfiles/restore-test\" " + "\"restore Test1\" " + "quit"); + TEST_RETURN(compareReturnValue, + BackupQueries::ReturnCode::Command_OK); + TestRemoteProcessMemLeaks("bbackupquery.memleaks"); + + // check that it restored properly + compareReturnValue = ::system(BBACKUPQUERY " " + "-Wwarning " + "-c testfiles/bbackupd.conf " + "\"compare -cEQ Test1 testfiles/restore-test/Test1\" " + "quit"); + TEST_RETURN(compareReturnValue, + BackupQueries::ReturnCode::Compare_Same); + TestRemoteProcessMemLeaks("bbackupquery.memleaks"); + // put the permissions back to sensible values #ifdef WIN32 TEST_THAT(::system("chmod 0755 testfiles/" @@ -2082,7 +2107,6 @@ int test_bbackupd() TEST_THAT(chmod("testfiles/restore1/x1", 0755) == 0); #endif - } #ifdef WIN32 |