Changeset 2316


Ignore:
Timestamp:
03/10/2008 23:45:11 (3 years ago)
Author:
chris
Message:

Fix directory record conflicts caused by including the same directory
twice.

Fix/reduce locked file timing conflict problems.

Location:
box/trunk/test/bbackupd
Files:
2 edited

Legend:

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

    r2291 r2316  
    14181418                // will see that the deleted files have been removed. 
    14191419 
    1420                 #ifdef WIN32 
    1421                         BOX_TRACE("Wait long enough that housekeeping " 
    1422                                 "will run again") 
    1423                         wait_for_backup_operation(5); 
    1424                         BOX_TRACE("done."); 
    1425                 #endif 
     1420#ifndef WIN32 
     1421                BOX_TRACE("Wait long enough that housekeeping " 
     1422                        "will run again") 
     1423                wait_for_backup_operation(5); 
     1424                BOX_TRACE("done."); 
    14261425 
    14271426                BOX_TRACE("Find out whether bbackupd marked files as deleted"); 
     
    14961495                        return 1; 
    14971496                } 
     1497#endif 
    14981498 
    14991499                // Wait for housekeeping to run 
     
    19321932 
    19331933        printf("\n==== Testing that redundant locations are deleted on time\n"); 
     1934 
     1935        // unpack the files for the redundant location test 
     1936        TEST_THAT(::system("rm -rf testfiles/TestDir2") == 0); 
     1937        TEST_THAT(::mkdir("testfiles/TestDir2", 0777) == 0); 
     1938 
     1939        #ifdef WIN32 
     1940                TEST_THAT(::system("tar xzvf testfiles/spacetest1.tgz " 
     1941                        "-C testfiles/TestDir2") == 0); 
     1942        #else 
     1943                TEST_THAT(::system("gzip -d < testfiles/spacetest1.tgz " 
     1944                        "| ( cd testfiles/TestDir2 && tar xf - )") == 0); 
     1945        #endif 
    19341946 
    19351947        // BLOCK 
     
    38233835                // and the appropriate error is reported. 
    38243836                // Wait for the sync to finish, so that we have time to work 
    3825                 wait_for_sync_start(); 
     3837                wait_for_sync_end(); 
    38263838                // Now we have about three seconds to work 
    38273839 
     
    38363848                        TEST_THAT(!TestFileExists("testfiles/" 
    38373849                                "notifyran.read-error.1")); 
    3838  
     3850                } 
     3851 
     3852                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     3853                TEST_THAT(ServerIsAlive(bbstored_pid)); 
     3854                if (!ServerIsAlive(bbackupd_pid)) return 1; 
     3855                if (!ServerIsAlive(bbstored_pid)) return 1; 
     3856 
     3857                if (handle != 0) 
     3858                { 
    38393859                        // this sync should try to back up the file,  
    38403860                        // and fail, because it's locked 
     
    38443864                        TEST_THAT(!TestFileExists("testfiles/" 
    38453865                                "notifyran.read-error.2")); 
    3846  
     3866                } 
     3867 
     3868                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     3869                TEST_THAT(ServerIsAlive(bbstored_pid)); 
     3870                if (!ServerIsAlive(bbackupd_pid)) return 1; 
     3871                if (!ServerIsAlive(bbstored_pid)) return 1; 
     3872 
     3873                if (handle != 0) 
     3874                { 
    38473875                        // now close the file and check that it is 
    38483876                        // backed up on the next run. 
     
    38533881                        TEST_THAT(!TestFileExists("testfiles/" 
    38543882                                "notifyran.read-error.2")); 
    3855  
     3883                } 
     3884 
     3885                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     3886                TEST_THAT(ServerIsAlive(bbstored_pid)); 
     3887                if (!ServerIsAlive(bbackupd_pid)) return 1; 
     3888                if (!ServerIsAlive(bbstored_pid)) return 1; 
     3889 
     3890                if (handle != 0) 
     3891                { 
    38563892                        // compare, and check that it works 
    38573893                        // reports the correct error message (and finishes) 
     
    38633899                                BackupQueries::ReturnCode::Compare_Same); 
    38643900                        TestRemoteProcessMemLeaks("bbackupquery.memleaks"); 
    3865  
     3901                } 
     3902 
     3903                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     3904                TEST_THAT(ServerIsAlive(bbstored_pid)); 
     3905                if (!ServerIsAlive(bbackupd_pid)) return 1; 
     3906                if (!ServerIsAlive(bbstored_pid)) return 1; 
     3907 
     3908                if (handle != 0) 
     3909                { 
    38663910                        // open the file again, compare and check that compare 
    38673911                        // reports the correct error message (and finishes) 
     
    38813925                        // works again 
    38823926                        CloseHandle(handle); 
    3883  
     3927                } 
     3928 
     3929                TEST_THAT(ServerIsAlive(bbackupd_pid)); 
     3930                TEST_THAT(ServerIsAlive(bbstored_pid)); 
     3931                if (!ServerIsAlive(bbackupd_pid)) return 1; 
     3932                if (!ServerIsAlive(bbstored_pid)) return 1; 
     3933 
     3934                if (handle != 0) 
     3935                { 
    38843936                        compareReturnValue = ::system(BBACKUPQUERY " " 
    38853937                                "-c testfiles/bbackupd.conf " 
  • box/trunk/test/bbackupd/testfiles/bbackupd-temploc.conf

    r2127 r2316  
    5050        Test2 
    5151        { 
    52                 Path = testfiles/TestDir1 
     52                Path = testfiles/TestDir2 
    5353        } 
    5454} 
Note: See TracChangeset for help on using the changeset viewer.