Ignore:
Timestamp:
12/09/2008 21:39:45 (4 years ago)
Author:
chris
Message:

Test for read errors being reported at more points during the tests.

Test that symlink to self does not cause restore to fail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/test/bbackupd/testbbackupd.cpp

    r2266 r2276  
    12311231#endif // PLATFORM_CLIB_FNS_INTERCEPTION_IMPOSSIBLE 
    12321232 
     1233        // Check that no read error has been reported yet 
     1234        TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
     1235 
    12331236        std::string cmd = BBACKUPD " " + bbackupd_args +  
    12341237                " testfiles/bbackupd.conf"; 
     
    16591662        } 
    16601663 
     1664        // Check that no read error has been reported yet 
     1665        TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
     1666 
    16611667        #ifndef WIN32 // requires fork 
    16621668        printf("\n==== Testing that bbackupd responds correctly to " 
     
    18211827                        DIRECTORY_SEPARATOR "link") == 0); 
    18221828 
     1829                // also test symlink-to-self loop does not break restore 
     1830                TEST_THAT(symlink("self", SYM_DIR "/self") == 0); 
     1831 
    18231832                ::wait_for_operation(4); 
    18241833                ::sync_and_wait(); 
     
    19191928        } 
    19201929        #endif // !WIN32 
     1930 
     1931        // Check that no read error has been reported yet 
     1932        TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
    19211933 
    19221934        printf("\n==== Testing that redundant locations are deleted on time\n"); 
     
    20242036        if(bbackupd_pid > 0) 
    20252037        { 
     2038                // Check that no read error has been reported yet 
     2039                TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
     2040 
    20262041                printf("\n==== Check that read-only directories and " 
    20272042                        "their contents can be restored.\n"); 
     
    23842399#endif // WIN32 
    23852400 
     2401                // Check that no read error has been reported yet 
     2402                TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
     2403 
    23862404                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
    23872405                TEST_THAT(ServerIsAlive(bbstored_pid)); 
     
    24952513                        } 
    24962514                } 
     2515 
     2516                // Check that no read error has been reported yet 
     2517                TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
    24972518 
    24982519                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     
    30103031                TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
    30113032                 
     3033                // Check that no read error has been reported yet 
     3034                TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
     3035 
    30123036                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
    30133037                TEST_THAT(ServerIsAlive(bbstored_pid)); 
     
    30503074                if (!ServerIsAlive(bbstored_pid)) return 1; 
    30513075 
     3076                // Check that no read error has been reported yet 
     3077                TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
     3078 
    30523079                // Check that modifying files with old timestamps 
    30533080                // still get added 
     
    31083135                if (!ServerIsAlive(bbackupd_pid)) return 1; 
    31093136                if (!ServerIsAlive(bbstored_pid)) return 1; 
     3137 
     3138                // Check that no read error has been reported yet 
     3139                TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
    31103140 
    31113141                // Add some files and directories which are marked as excluded 
     
    31953225                if(::getuid() != 0) 
    31963226                { 
     3227                        // Check that the error has not been reported yet 
     3228                        TEST_THAT(!TestFileExists("testfiles/notifyran.read-error.1")); 
     3229 
    31973230                        // Check that read errors are reported neatly 
    31983231                        printf("\n==== Add unreadable files\n"); 
     
    38173850                        CloseHandle(handle); 
    38183851                        wait_for_sync_end(); 
     3852 
     3853                        // still no read errors? 
    38193854                        TEST_THAT(!TestFileExists("testfiles/" 
    38203855                                "notifyran.read-error.2")); 
Note: See TracChangeset for help on using the changeset viewer.