Changeset 3082 for box/trunk


Ignore:
Timestamp:
02/02/2012 22:20:29 (4 months ago)
Author:
chris
Message:

Force all options to be present to BackupClientRestore?(), to fix
misinterpretation of char * arguments as bools. Use macros to
simplify test code. Test that locations not present when bbackupd
started will be detected and backed up if subsequently created.

Location:
box/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/backupclient/BackupClientRestore.cpp

    r3002 r3082  
    842842// -------------------------------------------------------------------------- 
    843843int BackupClientRestore(BackupProtocolClient &rConnection, 
    844         int64_t DirectoryID, const char *RemoteDirectoryName, 
    845         const char *LocalDirectoryName, bool PrintDots, bool RestoreDeleted, 
     844        int64_t DirectoryID, const std::string& RemoteDirectoryName, 
     845        const std::string& LocalDirectoryName, bool PrintDots, bool RestoreDeleted, 
    846846        bool UndeleteAfterRestoreDeleted, bool Resume, 
    847847        bool ContinueAfterErrors) 
  • box/trunk/lib/backupclient/BackupClientRestore.h

    r2828 r3082  
    2525int BackupClientRestore(BackupProtocolClient &rConnection, 
    2626        int64_t DirectoryID, 
    27         const char *RemoteDirectoryName, 
    28         const char *LocalDirectoryName, 
    29         bool PrintDots = false, 
    30         bool RestoreDeleted = false, 
    31         bool UndeleteAfterRestoreDeleted = false, 
    32         bool Resume = false, 
    33         bool ContinueAfterErrors = false); 
     27        const std::string& RemoteDirectoryName, 
     28        const std::string& LocalDirectoryName, 
     29        bool PrintDots, 
     30        bool RestoreDeleted, 
     31        bool UndeleteAfterRestoreDeleted, 
     32        bool Resume, 
     33        bool ContinueAfterErrors); 
    3434 
    3535#endif // BACKUPSCLIENTRESTORE__H 
  • box/trunk/test/bbackupd/testbbackupd.cpp

    r2983 r3082  
    6363#include "FileModificationTime.h" 
    6464#include "FileStream.h" 
     65#include "intercept.h" 
    6566#include "IOStreamGetLine.h" 
    6667#include "LocalProcessStream.h" 
     
    7374#include "Timer.h" 
    7475#include "Utils.h" 
    75  
    76 #include "intercept.h" 
    77 #include "ServerControl.h" 
    7876 
    7977#include "MemLeakFindOn.h" 
     
    524522                        // Test the restoration 
    525523                        TEST_THAT(BackupClientRestore(protocol, restoredirid, 
    526                                 "Test1", "testfiles/restore-interrupt", 
    527                                 true /* print progress dots */) 
    528                                 == Restore_Complete); 
     524                                "testfiles/restore-interrupt", /* remote */ 
     525                                "testfiles/restore-interrupt", /* local */ 
     526                                true /* print progress dots */, 
     527                                false /* restore deleted */, 
     528                                false /* undelete after */, 
     529                                false /* resume */, 
     530                                false /* keep going */) == Restore_Complete); 
    529531 
    530532                        // Log out 
     
    651653} 
    652654         
     655Daemon* spDaemon = NULL; 
     656 
    653657int start_internal_daemon() 
    654658{ 
     
    664668 
    665669        BackupDaemon daemon; 
     670        spDaemon = &daemon; // to propagate into child 
    666671        int result; 
    667672 
     
    674679                result = daemon.Main("testfiles/bbackupd.conf", 1, argv); 
    675680        } 
     681 
     682        spDaemon = NULL; // to ensure not used by parent 
    676683         
    677684        TEST_EQUAL_LINE(0, result, "Daemon exit code"); 
     
    711718 
    712719        TEST_THAT(pid > 0); 
     720        spDaemon = &daemon; 
    713721        return pid; 
    714722} 
     
    751759extern "C" struct dirent *readdir_test_hook_2(DIR *dir) 
    752760{ 
     761        if (spDaemon->IsTerminateWanted()) 
     762        { 
     763                // force daemon to crash, right now 
     764                return NULL; 
     765        } 
     766 
    753767        time_t time_now = time(NULL); 
    754768 
     
    838852} 
    839853 
     854bool compare_all(BackupQueries::ReturnCode::Type expected_status, 
     855        std::string config_file = "testfiles/bbackupd.conf") 
     856{ 
     857        std::string cmd = BBACKUPQUERY; 
     858        cmd += " "; 
     859        cmd += (expected_status == BackupQueries::ReturnCode::Compare_Same) 
     860                ? "-Werror" : "-Wwarning"; 
     861        cmd += " -c "; 
     862        cmd += config_file; 
     863        cmd += " \"compare -acQ\" quit"; 
     864 
     865        int returnValue = ::system(cmd.c_str()); 
     866 
     867        int expected_system_result = (int) expected_status; 
     868 
     869        #ifndef WIN32 
     870                expected_system_result <<= 8; 
     871        #endif 
     872 
     873        TEST_EQUAL_LINE(expected_system_result, returnValue, "compare return value"); 
     874        TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     875        return (returnValue == expected_system_result); 
     876} 
     877 
     878#define TEST_COMPARE(...) \ 
     879        TEST_THAT(compare_all(BackupQueries::ReturnCode::__VA_ARGS__)); 
     880 
    840881int test_bbackupd() 
    841882{ 
     
    9801021                        TEST_LINE(comp2 != sub, line); 
    9811022                } 
     1023 
     1024                Timers::Init(); 
    9821025                 
    9831026                if (failures > 0) 
    9841027                { 
    9851028                        // stop early to make debugging easier 
    986                         Timers::Init(); 
    9871029                        return 1; 
    9881030                } 
     
    9941036                intercept_setup_delay("testfiles/TestDir1/spacetest/f1",  
    9951037                        0, 4000, SYS_read, 1); 
    996                 pid = start_internal_daemon(); 
    997                 intercept_clear_setup(); 
    998                  
    999                 fd = open("testfiles/TestDir1/spacetest/f1", O_WRONLY); 
    1000                 TEST_THAT(fd > 0); 
    1001                 // write again, to update the file's timestamp 
    1002                 TEST_EQUAL_LINE(sizeof(buffer), 
    1003                         write(fd, buffer, sizeof(buffer)), 
    1004                         "Buffer write"); 
    1005                 TEST_THAT(close(fd) == 0);       
    1006  
    1007                 wait_for_backup_operation("internal daemon to sync " 
    1008                         "spacetest/f1 again"); 
    1009                 // can't test whether intercept was triggered, because 
    1010                 // it's in a different process. 
    1011                 // TEST_THAT(intercept_triggered()); 
    1012                 TEST_THAT(stop_internal_daemon(pid)); 
     1038                 
     1039                { 
     1040                        BackupDaemon bbackupd; 
     1041                        bbackupd.Configure("testfiles/bbackupd.conf"); 
     1042                        bbackupd.InitCrypto(); 
     1043                 
     1044                        fd = open("testfiles/TestDir1/spacetest/f1", O_WRONLY); 
     1045                        TEST_THAT(fd > 0); 
     1046                        // write again, to update the file's timestamp 
     1047                        TEST_EQUAL_LINE(1, write(fd, "z", 1), "Buffer write"); 
     1048                        TEST_THAT(close(fd) == 0); 
     1049 
     1050                        // wait long enough to put file into sync window 
     1051                        wait_for_operation(5, "locally modified file to " 
     1052                                "mature for sync"); 
     1053 
     1054                        bbackupd.RunSyncNow(); 
     1055                        TEST_THAT(intercept_triggered()); 
     1056                        intercept_clear_setup(); 
     1057                        Timers::Cleanup(); 
     1058                } 
    10131059 
    10141060                // check that the diff was aborted, i.e. upload was not a diff 
     
    13161362 
    13171363                BOX_TRACE("Compare to check that there are differences"); 
    1318                 int compareReturnValue = ::system(BBACKUPQUERY " " 
    1319                         "-c testfiles/bbackupd.conf " 
    1320                         "-l testfiles/query0a.log " 
    1321                         "-Werror \"compare -acQ\" quit"); 
    1322                 TEST_RETURN(compareReturnValue, 
    1323                         BackupQueries::ReturnCode::Compare_Different); 
    1324                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     1364                TEST_COMPARE(Compare_Different); 
    13251365                BOX_TRACE("Compare finished."); 
    13261366 
     
    13841424 
    13851425                BackupDaemon bbackupd; 
     1426 
     1427                { 
     1428                        const char* argv[] = { "bbackupd", 
     1429                                bbackupd_args.c_str() }; 
     1430                        TEST_EQUAL_LINE(0, bbackupd.ProcessOptions(2, argv), 
     1431                                "processing command-line options"); 
     1432                } 
     1433 
    13861434                bbackupd.Configure("testfiles/bbackupd-exclude.conf"); 
    13871435                bbackupd.InitCrypto(); 
     
    15541602                // Run another backup, now there should be enough space 
    15551603                // for everything we want to upload. 
    1556                 { 
    1557                         Logging::Guard guard(Log::ERROR); 
    1558                         bbackupd.RunSyncNow(); 
    1559                 } 
     1604                bbackupd.RunSyncNow(); 
    15601605                TEST_THAT(!bbackupd.StorageLimitExceeded()); 
    15611606 
    15621607                // Check that the contents of the store are the same  
    15631608                // as the contents of the disc  
    1564                 // (-a = all, -c = give result in return code) 
    1565                 BOX_TRACE("Check that all files were uploaded successfully"); 
    1566                 compareReturnValue = ::system(BBACKUPQUERY " " 
    1567                         "-c testfiles/bbackupd-exclude.conf " 
    1568                         "-l testfiles/query1.log " 
    1569                         "-Wwarning \"compare -acQ\" quit"); 
    1570                 TEST_RETURN(compareReturnValue, 
    1571                         BackupQueries::ReturnCode::Compare_Same); 
    1572                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     1609                TEST_COMPARE(Compare_Same, "testfiles/bbackupd-exclude.conf"); 
    15731610                BOX_TRACE("done."); 
    15741611 
     
    16341671                // (-a = all, -c = give result in return code) 
    16351672                BOX_TRACE("Check that all files were uploaded successfully"); 
    1636                 compareReturnValue = ::system(BBACKUPQUERY " " 
    1637                         "-c testfiles/bbackupd.conf " 
    1638                         "-l testfiles/query1.log " 
    1639                         "-Wwarning \"compare -acQ\" quit"); 
    1640                 TEST_RETURN(compareReturnValue,  
    1641                         BackupQueries::ReturnCode::Compare_Same); 
    1642                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     1673                TEST_COMPARE(Compare_Same); 
    16431674                BOX_TRACE("done."); 
    16441675 
     
    18271858 
    18281859                // Check that the backup was successful, i.e. no differences 
    1829                 int compareReturnValue = ::system(BBACKUPQUERY " " 
    1830                         "-c testfiles/bbackupd.conf " 
    1831                         "-l testfiles/query1.log " 
    1832                         "-Wwarning \"compare -acQ\" quit"); 
    1833                 TEST_RETURN(compareReturnValue, 
    1834                         BackupQueries::ReturnCode::Compare_Same); 
    1835                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     1860                TEST_COMPARE(Compare_Same); 
    18361861 
    18371862                // now stop bbackupd and update the test file, 
     
    18491874 
    18501875                // check that we can restore it 
    1851                 compareReturnValue = ::system(BBACKUPQUERY " " 
    1852                         "-c testfiles/bbackupd.conf " 
    1853                         "-Wwarning \"restore Test1 testfiles/restore-symlink\" " 
    1854                         "quit"); 
    1855                 TEST_RETURN(compareReturnValue, 
    1856                         BackupQueries::ReturnCode::Command_OK); 
     1876                { 
     1877                        int returnValue = ::system(BBACKUPQUERY " " 
     1878                                "-c testfiles/bbackupd.conf " 
     1879                                "-Wwarning \"restore Test1 testfiles/restore-symlink\" " 
     1880                                "quit"); 
     1881                        TEST_RETURN(returnValue, 
     1882                                BackupQueries::ReturnCode::Command_OK); 
     1883                } 
    18571884 
    18581885                // make it accessible again 
     
    19221949        #endif // !WIN32 
    19231950 
    1924         // Check that no read error has been reported yet 
    1925         TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
    1926  
    1927         printf("\n==== Testing that redundant locations are deleted on time\n"); 
    1928  
    1929         // unpack the files for the redundant location test 
     1951        printf("\n==== Testing that nonexistent locations are backed up " 
     1952                "if they are created later\n"); 
     1953         
     1954        // ensure that the directory does not exist at the start 
    19301955        TEST_THAT(::system("rm -rf testfiles/TestDir2") == 0); 
     1956 
     1957        // BLOCK 
     1958        { 
     1959                // Kill the daemon 
     1960                terminate_bbackupd(bbackupd_pid); 
     1961 
     1962                // Delete any old result marker files 
     1963                TEST_RETURN(0, system("rm -f testfiles/notifyran.*")); 
     1964 
     1965                // Start it with a config that has a temporary location 
     1966                // whose path does not exist yet 
     1967                std::string cmd = BBACKUPD " " + bbackupd_args +  
     1968                        " testfiles/bbackupd-temploc.conf"; 
     1969 
     1970                bbackupd_pid = LaunchServer(cmd, "testfiles/bbackupd.pid"); 
     1971                TEST_THAT(bbackupd_pid != -1 && bbackupd_pid != 0); 
     1972 
     1973                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     1974                TEST_THAT(ServerIsAlive(bbstored_pid)); 
     1975                if (!ServerIsAlive(bbackupd_pid)) return 1; 
     1976                if (!ServerIsAlive(bbstored_pid)) return 1; 
     1977 
     1978                TEST_THAT(!TestFileExists("testfiles/notifyran.backup-start.1")); 
     1979                TEST_THAT(!TestFileExists("testfiles/notifyran.backup-start.2")); 
     1980                TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
     1981                TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.2")); 
     1982                TEST_THAT(!TestFileExists("testfiles/notifyran.backup-ok.1")); 
     1983                TEST_THAT(!TestFileExists("testfiles/notifyran.backup-finish.1")); 
     1984                TEST_THAT(!TestFileExists("testfiles/notifyran.backup-finish.2")); 
     1985 
     1986                sync_and_wait(); 
     1987                TEST_COMPARE(Compare_Same); 
     1988 
     1989                TEST_THAT( TestFileExists("testfiles/notifyran.backup-start.1")); 
     1990                TEST_THAT(!TestFileExists("testfiles/notifyran.backup-start.2")); 
     1991                TEST_THAT( TestFileExists("testfiles/notifyran.read-error.1")); 
     1992                TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.2")); 
     1993                TEST_THAT(!TestFileExists("testfiles/notifyran.backup-ok.1")); 
     1994                TEST_THAT( TestFileExists("testfiles/notifyran.backup-finish.1")); 
     1995                TEST_THAT(!TestFileExists("testfiles/notifyran.backup-finish.2")); 
     1996                 
     1997                // Did it actually get created? Should not have been! 
     1998                std::auto_ptr<BackupProtocolClient> client = 
     1999                        ConnectAndLogin(context, 
     2000                        BackupProtocolLogin::Flags_ReadOnly); 
     2001                 
     2002                std::auto_ptr<BackupStoreDirectory> dir =  
     2003                        ReadDirectory(*client); 
     2004                int64_t testDirId = SearchDir(*dir, "Test2"); 
     2005                TEST_THAT(testDirId == 0); 
     2006                client->QueryFinished(); 
     2007                sSocket.Close(); 
     2008        } 
     2009 
     2010        // create the location directory and unpack some files into it 
    19312011        TEST_THAT(::mkdir("testfiles/TestDir2", 0777) == 0); 
    19322012 
     
    19392019        #endif 
    19402020 
     2021        // check that the files are backed up now 
     2022        sync_and_wait(); 
     2023        TEST_COMPARE(Compare_Same); 
     2024 
     2025        TEST_THAT( TestFileExists("testfiles/notifyran.backup-start.2")); 
     2026        TEST_THAT(!TestFileExists("testfiles/notifyran.backup-start.3")); 
     2027        TEST_THAT( TestFileExists("testfiles/notifyran.read-error.1")); 
     2028        TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.2")); 
     2029        TEST_THAT( TestFileExists("testfiles/notifyran.backup-ok.1")); 
     2030        TEST_THAT(!TestFileExists("testfiles/notifyran.backup-ok.2")); 
     2031        TEST_THAT( TestFileExists("testfiles/notifyran.backup-finish.2")); 
     2032        TEST_THAT(!TestFileExists("testfiles/notifyran.backup-finish.3")); 
     2033 
     2034        // BLOCK 
     2035        { 
     2036                std::auto_ptr<BackupProtocolClient> client = 
     2037                        ConnectAndLogin(context, 
     2038                        BackupProtocolLogin::Flags_ReadOnly); 
     2039                 
     2040                std::auto_ptr<BackupStoreDirectory> dir =  
     2041                        ReadDirectory(*client, 
     2042                        BackupProtocolListDirectory::RootDirectory); 
     2043                int64_t testDirId = SearchDir(*dir, "Test2"); 
     2044                TEST_THAT(testDirId != 0); 
     2045 
     2046                client->QueryFinished(); 
     2047                sSocket.Close(); 
     2048        } 
     2049 
     2050        printf("\n==== Testing that redundant locations are deleted on time\n"); 
     2051 
    19412052        // BLOCK 
    19422053        { 
     
    19442055                terminate_bbackupd(bbackupd_pid); 
    19452056 
    1946                 // Start it with a config that has a temporary location 
    1947                 // that will be created on the server 
    1948                 std::string cmd = BBACKUPD " " + bbackupd_args +  
    1949                         " testfiles/bbackupd-temploc.conf"; 
    1950  
     2057                // Start it again with the normal config (no Test2) 
     2058                cmd = BBACKUPD " " + bbackupd_args + " testfiles/bbackupd.conf"; 
    19512059                bbackupd_pid = LaunchServer(cmd, "testfiles/bbackupd.pid"); 
     2060 
    19522061                TEST_THAT(bbackupd_pid != -1 && bbackupd_pid != 0); 
     2062 
    19532063                ::safe_sleep(1); 
    19542064 
     
    19582068                if (!ServerIsAlive(bbstored_pid)) return 1; 
    19592069 
    1960                 sync_and_wait(); 
     2070                // Test2 should be deleted after 10 seconds (4 runs) 
     2071                wait_for_sync_end(); 
     2072                wait_for_sync_end(); 
     2073                wait_for_sync_end(); 
     2074 
     2075                // not yet! should still be there 
    19612076 
    19622077                { 
     
    19742089                } 
    19752090 
    1976                 // Kill the daemon 
    1977                 terminate_bbackupd(bbackupd_pid); 
    1978  
    1979                 // Start it again with the normal config (no Test2) 
    1980                 cmd = BBACKUPD " " + bbackupd_args + 
    1981                         " testfiles/bbackupd.conf"; 
    1982                 bbackupd_pid = LaunchServer(cmd, "testfiles/bbackupd.pid"); 
    1983  
    1984                 TEST_THAT(bbackupd_pid != -1 && bbackupd_pid != 0); 
    1985  
    1986                 ::safe_sleep(1); 
    1987  
    1988                 TEST_THAT(ServerIsAlive(bbackupd_pid)); 
    1989                 TEST_THAT(ServerIsAlive(bbstored_pid)); 
    1990                 if (!ServerIsAlive(bbackupd_pid)) return 1; 
    1991                 if (!ServerIsAlive(bbstored_pid)) return 1; 
    1992  
    1993                 // Test2 should be deleted after 10 seconds (4 runs) 
    1994                 wait_for_sync_end(); 
    1995                 wait_for_sync_end(); 
    1996                 wait_for_sync_end(); 
    1997  
    1998                 // not yet! should still be there 
    1999  
    2000                 { 
    2001                         std::auto_ptr<BackupProtocolClient> client = 
    2002                                 ConnectAndLogin(context, 
    2003                                 BackupProtocolLogin::Flags_ReadOnly); 
    2004                          
    2005                         std::auto_ptr<BackupStoreDirectory> dir =  
    2006                                 ReadDirectory(*client); 
    2007                         int64_t testDirId = SearchDir(*dir, "Test2"); 
    2008                         TEST_THAT(testDirId != 0); 
    2009  
    2010                         client->QueryFinished(); 
    2011                         sSocket.Close(); 
    2012                 } 
    2013  
    20142091                wait_for_sync_end(); 
    20152092 
     
    20382115        if(bbackupd_pid > 0) 
    20392116        { 
    2040                 // Check that no read error has been reported yet 
    2041                 TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
     2117                // Delete any old result marker files 
     2118                TEST_RETURN(0, system("rm -f testfiles/notifyran.*")); 
    20422119 
    20432120                printf("\n==== Check that read-only directories and " 
     
    22522329 
    22532330                // Compare to check that the file was uploaded 
    2254                 compareReturnValue = ::system(BBACKUPQUERY " -Wwarning " 
    2255                         "-c testfiles/bbackupd.conf \"compare -acQ\" quit"); 
    2256                 TEST_RETURN(compareReturnValue, 
    2257                         BackupQueries::ReturnCode::Compare_Same); 
    2258                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     2331                TEST_COMPARE(Compare_Same); 
    22592332 
    22602333                // Check that we can find it in directory listing 
     
    25082581 
    25092582                        // check that no backup has run (compare fails) 
    2510                         compareReturnValue = ::system(BBACKUPQUERY " " 
    2511                                 "-Werror " 
    2512                                 "-c testfiles/bbackupd.conf " 
    2513                                 "-l testfiles/query3.log " 
    2514                                 "\"compare -acQ\" quit"); 
    2515                         TEST_RETURN(compareReturnValue, 
    2516                                 BackupQueries::ReturnCode::Compare_Different); 
    2517                         TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     2583                        TEST_COMPARE(Compare_Different); 
    25182584 
    25192585                        TEST_THAT(unlink(sync_control_file) == 0); 
     
    25342600 
    25352601                        wait_for_sync_end(); 
     2602 
    25362603                        // check that backup has run (compare succeeds) 
    2537                         compareReturnValue = ::system(BBACKUPQUERY " " 
    2538                                 "-Wwarning " 
    2539                                 "-c testfiles/bbackupd.conf " 
    2540                                 "-l testfiles/query3a.log " 
    2541                                 "\"compare -acQ\" quit"); 
    2542                         TEST_RETURN(compareReturnValue, 
    2543                                 BackupQueries::ReturnCode::Compare_Same); 
    2544                         TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     2604                        TEST_COMPARE(Compare_Same); 
    25452605 
    25462606                        if (failures > 0) 
     
    25942654 
    25952655                // compare to make sure that it worked 
    2596                 compareReturnValue = ::system(BBACKUPQUERY " -Wwarning " 
    2597                         "-c testfiles/bbackupd.conf " 
    2598                         "-l testfiles/query2.log " 
    2599                         "\"compare -acQ\" quit"); 
    2600                 TEST_RETURN(compareReturnValue, 
    2601                         BackupQueries::ReturnCode::Compare_Same); 
    2602                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     2656                TEST_COMPARE(Compare_Same); 
    26032657 
    26042658                // Try a quick compare, just for fun 
     
    26752729                // Check that we DO get errors on compare (cannot do this 
    26762730                // until after we fix the store, which creates a race) 
    2677                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2678                         "-c testfiles/bbackupd.conf " 
    2679                         "-l testfiles/query3b.log " 
    2680                         "-Werror \"compare -acQ\" quit"); 
    2681                 TEST_RETURN(compareReturnValue, 
    2682                         BackupQueries::ReturnCode::Compare_Different); 
    2683                 TestRemoteProcessMemLeaks("bbackupquery.memleaks");              
     2731                TEST_COMPARE(Compare_Different); 
    26842732 
    26852733                // Test initial state 
     
    27062754 
    27072755                // Should not have backed up, should still get errors 
    2708                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2709                         "-c testfiles/bbackupd.conf " 
    2710                         "-l testfiles/query3b.log " 
    2711                         "-Werror \"compare -acQ\" quit"); 
    2712                 TEST_RETURN(compareReturnValue, 
    2713                         BackupQueries::ReturnCode::Compare_Different); 
    2714                 TestRemoteProcessMemLeaks("bbackupquery.memleaks");              
     2756                TEST_COMPARE(Compare_Different); 
    27152757 
    27162758                // wait another 10 seconds, bbackup should have run 
     
    27202762         
    27212763                // Check that it did get uploaded, and we have no more errors 
    2722                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2723                         "-c testfiles/bbackupd.conf " 
    2724                         "-l testfiles/query3b.log " 
    2725                         "-Wwarning \"compare -acQ\" quit"); 
    2726                 TEST_RETURN(compareReturnValue, 
    2727                         BackupQueries::ReturnCode::Compare_Same); 
    2728                 TestRemoteProcessMemLeaks("bbackupquery.memleaks");              
     2764                TEST_COMPARE(Compare_Same); 
    27292765 
    27302766                TEST_THAT(::unlink("testfiles/notifyscript.tag") == 0); 
     
    27752811                // Check that we DO get errors on compare (cannot do this 
    27762812                // until after we fix the store, which creates a race) 
    2777                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2778                         "-c testfiles/bbackupd.conf " 
    2779                         "-l testfiles/query3b.log " 
    2780                         "-Werror \"compare -acQ\" quit"); 
    2781                 TEST_RETURN(compareReturnValue, 
    2782                         BackupQueries::ReturnCode::Compare_Different); 
    2783                 TestRemoteProcessMemLeaks("bbackupquery.memleaks");              
     2813                TEST_COMPARE(Compare_Different); 
    27842814 
    27852815                // Test initial state 
     
    28062836 
    28072837                // Should not have backed up, should still get errors 
    2808                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2809                         "-c testfiles/bbackupd.conf " 
    2810                         "-l testfiles/query3b.log " 
    2811                         "-Werror \"compare -acQ\" quit"); 
    2812                 TEST_RETURN(compareReturnValue, 
    2813                         BackupQueries::ReturnCode::Compare_Different); 
    2814                 TestRemoteProcessMemLeaks("bbackupquery.memleaks");              
     2838                TEST_COMPARE(Compare_Different); 
    28152839 
    28162840                // wait another 10 seconds, bbackup should have run 
     
    28202844         
    28212845                // Check that it did get uploaded, and we have no more errors 
    2822                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2823                         "-c testfiles/bbackupd.conf " 
    2824                         "-l testfiles/query3b.log " 
    2825                         "-Wwarning \"compare -acQ\" quit"); 
    2826                 TEST_RETURN(compareReturnValue, 
    2827                         BackupQueries::ReturnCode::Compare_Same); 
    2828                 TestRemoteProcessMemLeaks("bbackupquery.memleaks");              
     2846                TEST_COMPARE(Compare_Same); 
    28292847 
    28302848                TEST_THAT(::unlink("testfiles/notifyscript.tag") == 0); 
     
    28592877 
    28602878                wait_for_backup_operation("bbackupd to sync the changes"); 
    2861                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2862                         "-c testfiles/bbackupd.conf " 
    2863                         "-l testfiles/query3c.log " 
    2864                         "-Wwarning \"compare -acQ\" quit"); 
    2865                 TEST_RETURN(compareReturnValue, 
    2866                         BackupQueries::ReturnCode::Compare_Same); 
    2867                 TestRemoteProcessMemLeaks("bbackupquery.memleaks");              
     2879                TEST_COMPARE(Compare_Same); 
    28682880 
    28692881                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    28892901                wait_for_backup_operation("bbackupd to sync the changes"); 
    28902902 
    2891                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2892                         "-c testfiles/bbackupd.conf " 
    2893                         "-l testfiles/query3d.log " 
    2894                         "-Wwarning \"compare -acQ\" quit"); 
    2895                 TEST_RETURN(compareReturnValue, 
    2896                         BackupQueries::ReturnCode::Compare_Same); 
    2897                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     2903                TEST_COMPARE(Compare_Same); 
    28982904                 
    28992905                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    29222928                wait_for_backup_operation("bbackupd to sync the changes"); 
    29232929 
    2924                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2925                         "-c testfiles/bbackupd.conf " 
    2926                         "-l testfiles/query3e.log " 
    2927                         "-Wwarning \"compare -acQ\" quit"); 
    2928                 TEST_RETURN(compareReturnValue, 
    2929                         BackupQueries::ReturnCode::Compare_Same); 
    2930                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     2930                TEST_COMPARE(Compare_Same); 
    29312931                 
    29322932                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    29552955                wait_for_backup_operation("bbackupd to sync the changes"); 
    29562956 
    2957                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2958                         "-c testfiles/bbackupd.conf " 
    2959                         "-l testfiles/query3f.log " 
    2960                         "-Wwarning \"compare -acQ\" quit"); 
    2961                 TEST_RETURN(compareReturnValue, 
    2962                         BackupQueries::ReturnCode::Compare_Same); 
    2963                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     2957                TEST_COMPARE(Compare_Same); 
    29642958 
    29652959                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    29902984                        "untracked files"); 
    29912985 
    2992                 compareReturnValue = ::system(BBACKUPQUERY " " 
    2993                         "-c testfiles/bbackupd.conf " 
    2994                         "-l testfiles/query3g.log " 
    2995                         "-Wwarning \"compare -acQ\" quit"); 
    2996                 TEST_RETURN(compareReturnValue, 
    2997                         BackupQueries::ReturnCode::Compare_Same); 
    2998                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     2986                TEST_COMPARE(Compare_Same); 
    29992987 
    30002988                #ifdef WIN32 
     
    30112999                        "files again"); 
    30123000 
    3013                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3014                         "-c testfiles/bbackupd.conf " 
    3015                         "-l testfiles/query3g.log " 
    3016                         "-Wwarning \"compare -acQ\" quit"); 
    3017                 TEST_RETURN(compareReturnValue, 
    3018                         BackupQueries::ReturnCode::Compare_Same); 
    3019                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3001                TEST_COMPARE(Compare_Same); 
    30203002 
    30213003                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    30513033 
    30523034                // compare to make sure that it worked 
    3053                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3054                         "-c testfiles/bbackupd.conf " 
    3055                         "-l testfiles/query3h.log " 
    3056                         "-Wwarning \"compare -acQ\" quit"); 
    3057                 TEST_RETURN(compareReturnValue, 
    3058                         BackupQueries::ReturnCode::Compare_Same); 
    3059                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3035                TEST_COMPARE(Compare_Same); 
    30603036 
    30613037                #ifdef WIN32 
     
    30723048                        "files again"); 
    30733049 
    3074                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3075                         "-c testfiles/bbackupd.conf " 
    3076                         "-l testfiles/query3i.log " 
    3077                         "-Wwarning \"compare -acQ\" quit"); 
    3078                 TEST_RETURN(compareReturnValue, 
    3079                         BackupQueries::ReturnCode::Compare_Same); 
    3080                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3050                TEST_COMPARE(Compare_Same); 
    30813051         
    30823052                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    30943064                wait_for_backup_operation("bbackupd to sync"); 
    30953065 
    3096                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3097                         "-c testfiles/bbackupd.conf " 
    3098                         "-l testfiles/query3j.log " 
    3099                         "-Wwarning \"compare -acQ\" quit"); 
    3100                 TEST_RETURN(compareReturnValue, 
    3101                         BackupQueries::ReturnCode::Compare_Same); 
    3102                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3066                TEST_COMPARE(Compare_Same); 
    31033067                 
    31043068                // Check that no read error has been reported yet 
     
    31333097                wait_for_backup_operation("bbackupd to sync old files"); 
    31343098 
    3135                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3136                         "-c testfiles/bbackupd.conf " 
    3137                         "-l testfiles/query3k.log " 
    3138                         "-Wwarning \"compare -acQ\" quit"); 
    3139                 TEST_RETURN(compareReturnValue, 
    3140                         BackupQueries::ReturnCode::Compare_Same); 
    3141                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3099                TEST_COMPARE(Compare_Same); 
    31423100                 
    31433101                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    31953153                wait_for_sync_end(); // should (not) be backed up this time 
    31963154 
    3197                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3198                         "-c testfiles/bbackupd.conf " 
    3199                         "-l testfiles/query3l.log " 
    3200                         "-Wwarning \"compare -acQ\" quit"); 
    3201                 TEST_RETURN(compareReturnValue, 
    3202                         BackupQueries::ReturnCode::Compare_Same); 
    3203                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3155                TEST_COMPARE(Compare_Same); 
    32043156 
    32053157                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    32273179                 
    32283180                // compare with exclusions, should not find differences 
    3229                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3230                         "-c testfiles/bbackupd.conf " 
    3231                         "-l testfiles/query3m.log " 
    3232                         "-Wwarning \"compare -acQ\" quit"); 
    3233                 TEST_RETURN(compareReturnValue, 
    3234                         BackupQueries::ReturnCode::Compare_Same); 
    3235                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3181                TEST_COMPARE(Compare_Same); 
    32363182 
    32373183                // compare without exclusions, should find differences 
     
    32593205                                BackupProtocolLogin::Flags_ReadOnly); 
    32603206                         
    3261                         std::auto_ptr<BackupStoreDirectory> dir = ReadDirectory( 
    3262                                 *client); 
     3207                        std::auto_ptr<BackupStoreDirectory> dir =  
     3208                                ReadDirectory(*client); 
    32633209 
    32643210                        int64_t testDirId = SearchDir(*dir, "Test1"); 
     
    33163262                        wait_for_backup_operation("bbackupd to try to sync " 
    33173263                                "unreadable file"); 
    3318                         compareReturnValue = ::system(BBACKUPQUERY " " 
    3319                                 "-c testfiles/bbackupd.conf " 
    3320                                 "-l testfiles/query3o.log " 
    3321                                 "-Werror \"compare -acQ\" quit"); 
    3322  
    3323                         // should find differences 
    3324                         TEST_RETURN(compareReturnValue, 
    3325                                 BackupQueries::ReturnCode::Compare_Error); 
    3326                         TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3264 
     3265                        // should fail with an error due to unreadable file 
     3266                        TEST_COMPARE(Compare_Error); 
    33273267 
    33283268                        // Check that it was reported correctly 
     
    34223362                        "of directory"); 
    34233363 
    3424                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3425                         "-c testfiles/bbackupd.conf " 
    3426                         "-l testfiles/query4.log " 
    3427                         "-Werror \"compare -acQ\" quit"); 
    3428                 TEST_RETURN(compareReturnValue, 
    3429                         BackupQueries::ReturnCode::Compare_Same); 
    3430                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3364                TEST_COMPARE(Compare_Same); 
    34313365         
    34323366                printf("\n==== Restore files and directories\n"); 
     
    34373371                        std::auto_ptr<BackupProtocolClient> client =  
    34383372                                ConnectAndLogin(context, 
    3439                                 BackupProtocolLogin::Flags_ReadOnly); 
     3373                                        BackupProtocolLogin::Flags_ReadOnly); 
    34403374 
    34413375                        // Find the ID of the Test1 directory 
     
    34463380                        // Test the restoration 
    34473381                        TEST_THAT(BackupClientRestore(*client, restoredirid,  
    3448                                 "Test1", "testfiles/restore-Test1",  
    3449                                 true /* print progress dots */)  
     3382                                "Test1" /* remote */, 
     3383                                "testfiles/restore-Test1" /* local */, 
     3384                                true /* print progress dots */, 
     3385                                false /* restore deleted */, 
     3386                                false /* undelete after */, 
     3387                                false /* resume */, 
     3388                                false /* keep going */)  
    34503389                                == Restore_Complete); 
    34513390 
     
    34563395                        TEST_THAT(BackupClientRestore(*client, restoredirid,  
    34573396                                "Test1", "testfiles/restore-Test1",  
    3458                                 true /* print progress dots */)  
     3397                                true /* print progress dots */, 
     3398                                false /* restore deleted */, 
     3399                                false /* undelete after */, 
     3400                                false /* resume */, 
     3401                                false /* keep going */)  
    34593402                                == Restore_TargetExists); 
    34603403                         
     
    34663409                        // properly later (when bbackupd is stopped) 
    34673410                        TEST_THAT(BackupClientRestore(*client, deldirid,  
    3468                                 "Test1", "testfiles/restore-Test1-x1",  
     3411                                "Test1", "testfiles/restore-Test1-x1", 
    34693412                                true /* print progress dots */,  
    3470                                 true /* deleted files */)  
     3413                                true /* restore deleted */, 
     3414                                false /* undelete after */, 
     3415                                false /* resume */, 
     3416                                false /* keep going */)  
    34713417                                == Restore_Complete); 
    34723418 
     
    34813427                                        restoredirid, "Test1", 
    34823428                                        "testfiles/no-such-path/subdir",  
    3483                                         true /* print progress dots */)  
     3429                                        true /* print progress dots */,  
     3430                                        true /* restore deleted */, 
     3431                                        false /* undelete after */, 
     3432                                        false /* resume */, 
     3433                                        false /* keep going */)  
    34843434                                        == Restore_TargetPathNotFound); 
    34853435                        } 
     
    34913441 
    34923442                // Compare the restored files 
    3493                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3494                         "-c testfiles/bbackupd.conf " 
    3495                         "-l testfiles/query10.log " 
    3496                         "-Wwarning " 
    3497                         "\"compare -cEQ Test1 testfiles/restore-Test1\" " 
    3498                         "quit"); 
    3499                 TEST_RETURN(compareReturnValue, 
    3500                         BackupQueries::ReturnCode::Compare_Same); 
    3501                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3443                TEST_COMPARE(Compare_Same); 
    35023444                 
    35033445                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    35123454                TEST_RETURN(compareReturnValue, 0); 
    35133455 
    3514                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3515                         "-c testfiles/bbackupd.conf " 
    3516                         "-l testfiles/query10a.log " 
    3517                         "-Werror " 
    3518                         "\"compare -cEQ Test1 testfiles/restore-Test1\" " 
    3519                         "quit"); 
    3520                 TEST_RETURN(compareReturnValue, 
    3521                         BackupQueries::ReturnCode::Compare_Different); 
    3522                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3456                TEST_COMPARE(Compare_Different); 
    35233457         
    35243458                // set it back, expect no failures 
     
    35273461                TEST_RETURN(compareReturnValue, 0); 
    35283462 
    3529                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3530                         "-c testfiles/bbackupd.conf -l testfiles/query10a.log " 
    3531                         "-Wwarning " 
    3532                         "\"compare -cEQ Test1 testfiles/restore-Test1\" " 
    3533                         "quit"); 
    3534                 TEST_RETURN(compareReturnValue, 
    3535                         BackupQueries::ReturnCode::Compare_Same); 
    3536                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3463                TEST_COMPARE(Compare_Same); 
    35373464 
    35383465                // change the timestamp on a file, expect a compare failure 
     
    35533480                TEST_THAT(set_file_time(testfile, dummyTime, lastModTime, 
    35543481                        lastAccessTime)); 
    3555                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3556                         "-c testfiles/bbackupd.conf " 
    3557                         "-l testfiles/query10a.log " 
    3558                         "-Werror " 
    3559                         "\"compare -cEQ Test1 testfiles/restore-Test1\" " 
    3560                         "quit"); 
    3561                 TEST_RETURN(compareReturnValue, 
    3562                         BackupQueries::ReturnCode::Compare_Different); 
    3563                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3482 
     3483                TEST_COMPARE(Compare_Different); 
    35643484 
    35653485                // last access time is not backed up, so it cannot be compared 
    35663486                TEST_THAT(set_file_time(testfile, creationTime, lastModTime, 
    35673487                        dummyTime)); 
    3568                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3569                         "-c testfiles/bbackupd.conf " 
    3570                         "-l testfiles/query10a.log " 
    3571                         "-Wwarning " 
    3572                         "\"compare -cEQ Test1 testfiles/restore-Test1\" " 
    3573                         "quit"); 
    3574                 TEST_RETURN(compareReturnValue, 
    3575                         BackupQueries::ReturnCode::Compare_Same); 
    3576                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3488                TEST_COMPARE(Compare_Same); 
    35773489 
    35783490                // last write time is backed up, so changing it should cause 
     
    35803492                TEST_THAT(set_file_time(testfile, creationTime, dummyTime, 
    35813493                        lastAccessTime)); 
    3582                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3583                         "-c testfiles/bbackupd.conf " 
    3584                         "-l testfiles/query10a.log " 
    3585                         "-Werror " 
    3586                         "\"compare -cEQ Test1 testfiles/restore-Test1\" " 
    3587                         "quit"); 
    3588                 TEST_RETURN(compareReturnValue, 
    3589                         BackupQueries::ReturnCode::Compare_Different); 
    3590                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3494                TEST_COMPARE(Compare_Different); 
    35913495 
    35923496                // set back to original values, check that compare succeeds 
    35933497                TEST_THAT(set_file_time(testfile, creationTime, lastModTime, 
    35943498                        lastAccessTime)); 
    3595                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3596                         "-c testfiles/bbackupd.conf " 
    3597                         "-l testfiles/query10a.log " 
    3598                         "-Wwarning " 
    3599                         "\"compare -cEQ Test1 testfiles/restore-Test1\" " 
    3600                         "quit"); 
    3601                 TEST_RETURN(compareReturnValue, 
    3602                         BackupQueries::ReturnCode::Compare_Same); 
    3603                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3499                TEST_COMPARE(Compare_Same); 
    36043500#endif // WIN32 
    36053501 
     
    36243520                wait_for_backup_operation("bbackupd to sync new files"); 
    36253521 
    3626                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3627                         "-c testfiles/bbackupd.conf " 
    3628                         "-l testfiles/query5.log " 
    3629                         "-Wwarning \"compare -acQ\" quit"); 
    3630                 TEST_RETURN(compareReturnValue, 
    3631                         BackupQueries::ReturnCode::Compare_Same); 
    3632                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3522                TEST_COMPARE(Compare_Same); 
    36333523                 
    36343524                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    36443534                wait_for_backup_operation("bbackupd to sync renamed directory"); 
    36453535 
    3646                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3647                         "-c testfiles/bbackupd.conf " 
    3648                         "-l testfiles/query6.log " 
    3649                         "-Wwarning \"compare -acQ\" quit"); 
    3650                 TEST_RETURN(compareReturnValue, 
    3651                         BackupQueries::ReturnCode::Compare_Same); 
    3652                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3536                TEST_COMPARE(Compare_Same); 
    36533537 
    36543538                // and again, but with quick flag 
     
    36723556                wait_for_backup_operation("bbackupd to sync renamed files"); 
    36733557 
    3674                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3675                         "-c testfiles/bbackupd.conf " 
    3676                         "-l testfiles/query6.log " 
    3677                         "-Wwarning \"compare -acQ\" quit"); 
    3678                 TEST_RETURN(compareReturnValue, 
    3679                         BackupQueries::ReturnCode::Compare_Same); 
    3680                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3558                TEST_COMPARE(Compare_Same); 
    36813559 
    36823560                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    37153593                // Wait and test 
    37163594                wait_for_backup_operation("bbackup to sync future file"); 
    3717                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3718                         "-c testfiles/bbackupd.conf " 
    3719                         "-l testfiles/query3e.log " 
    3720                         "-Wwarning \"compare -acQ\" quit"); 
    3721                 TEST_RETURN(compareReturnValue, 
    3722                         BackupQueries::ReturnCode::Compare_Same); 
    3723                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3595                TEST_COMPARE(Compare_Same); 
    37243596 
    37253597                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    37863658 
    37873659                // Test that there *are* differences 
    3788                 compareReturnValue = ::system(BBACKUPQUERY " " 
    3789                         "-c testfiles/bbackupd.conf " 
    3790                         "-l testfiles/query6.log " 
    3791                         "-Werror \"compare -acQ\" quit"); 
    3792                 TEST_RETURN(compareReturnValue, 
    3793                         BackupQueries::ReturnCode::Compare_Different); 
    3794                 TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3660                TEST_COMPARE(Compare_Different); 
    37953661         
    37963662                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    38283694                        TEST_THAT(BackupClientRestore(*client, restoredirid,  
    38293695                                "Test1", "testfiles/restore-interrupt",  
    3830                                 true /* print progress dots */)  
     3696                                true /* print progress dots */,  
     3697                                false /* restore deleted */,  
     3698                                false /* undelete after */,  
     3699                                false /* resume */, 
     3700                                false /* keep going */)  
    38313701                                == Restore_ResumePossible); 
    38323702 
     
    38353705                                "Test1", "testfiles/restore-interrupt",  
    38363706                                true /* print progress dots */,  
    3837                                 false /* deleted files */,  
    3838                                 false /* undelete server */,  
    3839                                 true /* resume */)  
     3707                                false /* restore deleted */,  
     3708                                false /* undelete after */,  
     3709                                true /* resume */, 
     3710                                false /* keep going */)  
    38403711                                == Restore_Complete); 
    38413712 
     
    38713742                                true /* print progress dots */,  
    38723743                                true /* deleted files */,  
    3873                                 true /* undelete on server */)  
     3744                                true /* undelete after */, 
     3745                                false /* resume */, 
     3746                                false /* keep going */)  
    38743747                                == Restore_Complete); 
    38753748 
     
    39613834                        // compare, and check that it works 
    39623835                        // reports the correct error message (and finishes) 
    3963                         compareReturnValue = ::system(BBACKUPQUERY " " 
    3964                                 "-c testfiles/bbackupd.conf " 
    3965                                 "-l testfiles/query15a.log " 
    3966                                 "-Wwarning \"compare -acQ\" quit"); 
    3967                         TEST_RETURN(compareReturnValue, 
    3968                                 BackupQueries::ReturnCode::Compare_Same); 
    3969                         TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3836                        TEST_THAT(compare_all(false)); 
    39703837                } 
    39713838 
     
    39833850                        TEST_THAT(handle != INVALID_HANDLE_VALUE); 
    39843851 
    3985                         compareReturnValue = ::system(BBACKUPQUERY " " 
    3986                                 "-c testfiles/bbackupd.conf " 
    3987                                 "-l testfiles/query15.log " 
    3988                                 "-Werror \"compare -acQ\" quit"); 
    3989                         TEST_RETURN(compareReturnValue, 
    3990                                 BackupQueries::ReturnCode::Compare_Error); 
    3991                         TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3852                        TEST_COMPARE(Compare_Error); 
    39923853 
    39933854                        // close the file again, check that compare 
     
    40033864                if (handle != 0) 
    40043865                { 
    4005                         compareReturnValue = ::system(BBACKUPQUERY " " 
    4006                                 "-c testfiles/bbackupd.conf " 
    4007                                 "-l testfiles/query15a.log " 
    4008                                 "-Wwarning \"compare -acQ\" quit"); 
    4009                         TEST_RETURN(compareReturnValue, 
    4010                                 BackupQueries::ReturnCode::Compare_Same); 
    4011                         TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3866                        TEST_COMPARE(Compare_Same); 
    40123867                } 
    40133868#endif 
     
    40343889                                (TIME_TO_WAIT_FOR_BACKUP_OPERATION*3) / 2, 
    40353890                                "bbackupd to sync everything");  
    4036                         compareReturnValue = ::system(BBACKUPQUERY " " 
    4037                                 "-c testfiles/bbackupd.conf " 
    4038                                 "-l testfiles/query4a.log " 
    4039                                 "-Wwarning \"compare -acQ\" quit"); 
    4040                         TEST_RETURN(compareReturnValue, 
    4041                                 BackupQueries::ReturnCode::Compare_Same); 
    4042                         TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
     3891                        TEST_COMPARE(Compare_Same); 
    40433892 
    40443893                        // Kill it again 
Note: See TracChangeset for help on using the changeset viewer.