Changeset 2708 for box/trunk/test


Ignore:
Timestamp:
27/08/2010 10:24:18 (18 months ago)
Author:
chris
Message:

Test that numbers of files are adjusted correctly during normal store
operations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/test/backupstore/testbackupstore.cpp

    r2542 r2708  
    920920} 
    921921 
    922 std::auto_ptr<BackupProtocolClient> test_server_login(SocketStreamTLS& rConn) 
    923 { 
     922std::auto_ptr<BackupProtocolClient> test_server_login(const char *hostname, 
     923        TLSContext& rContext, std::auto_ptr<SocketStreamTLS>& rapConn) 
     924{ 
     925        rapConn = open_conn(hostname, rContext); 
     926 
    924927        // Make a protocol 
    925928        std::auto_ptr<BackupProtocolClient> protocol(new 
    926                 BackupProtocolClient(rConn)); 
     929                BackupProtocolClient(*rapConn)); 
    927930         
    928931        // Check the version 
     
    949952} 
    950953 
     954// Run housekeeping (for which we need to disconnect ourselves) and check 
     955// that it doesn't change the numbers of files. 
     956// 
     957// Also check that bbstoreaccounts doesn't change anything 
     958 
     959void run_housekeeping_and_check_account(const char *hostname, 
     960        TLSContext& rContext, std::auto_ptr<SocketStreamTLS>& rapConn, 
     961        std::auto_ptr<BackupProtocolClient>& rapProtocol) 
     962{ 
     963        rapProtocol->QueryFinished(); 
     964        std::auto_ptr<BackupStoreAccountDatabase> apAccounts( 
     965                BackupStoreAccountDatabase::Read("testfiles/accounts.txt")); 
     966        BackupStoreAccountDatabase::Entry account = 
     967                apAccounts->GetEntry(0x1234567); 
     968        run_housekeeping(account); 
     969 
     970        TEST_THAT(::system(BBSTOREACCOUNTS 
     971                " -c testfiles/bbstored.conf check 01234567 fix") == 0); 
     972        TestRemoteProcessMemLeaks("bbstoreaccounts.memleaks"); 
     973 
     974        rapProtocol = test_server_login(hostname, rContext, rapConn); 
     975} 
     976 
    951977int test_server(const char *hostname) 
    952978{ 
    953979        TLSContext context; 
    954         std::auto_ptr<SocketStreamTLS> conn = open_conn(hostname, context); 
    955         std::auto_ptr<BackupProtocolClient> apProtocol( 
    956                 test_server_login(*conn)); 
    957         BackupProtocolClient& protocol(*apProtocol); 
     980        std::auto_ptr<SocketStreamTLS> conn; 
     981        std::auto_ptr<BackupProtocolClient> apProtocol = 
     982                test_server_login(hostname, context, conn); 
    958983 
    959984        // Make some test attributes 
     
    9761001                FILE *protocolLog = ::fopen("testfiles/protocol.log", "w"); 
    9771002                TEST_THAT(protocolLog != 0); 
    978                 protocol.SetLogToFile(protocolLog); 
     1003                apProtocol->SetLogToFile(protocolLog); 
    9791004 
    9801005#ifndef WIN32 
     
    9941019                 
    9951020                // Set the client store marker 
    996                 protocol.QuerySetClientStoreMarker(0x8732523ab23aLL); 
     1021                apProtocol->QuerySetClientStoreMarker(0x8732523ab23aLL); 
    9971022 
    9981023#ifndef WIN32 
     
    10201045#endif 
    10211046 
    1022                 test_server_1(protocol, protocolReadOnly); 
     1047                test_server_1(*apProtocol, protocolReadOnly); 
     1048 
     1049                #define TEST_NUM_FILES(files, old, deleted, dirs) \ 
     1050                { \ 
     1051                        std::auto_ptr<BackupStoreInfo> apInfo = \ 
     1052                                BackupStoreInfo::Load(0x1234567, \ 
     1053                                "backup/01234567/", 0, true); \ 
     1054                        TEST_EQUAL_LINE(files, apInfo->GetNumFiles(), \ 
     1055                                "num files"); \ 
     1056                        TEST_EQUAL_LINE(old, apInfo->GetNumOldFiles(), \ 
     1057                                "old files"); \ 
     1058                        TEST_EQUAL_LINE(deleted, apInfo->GetNumDeletedFiles(), \ 
     1059                                "deleted files"); \ 
     1060                        TEST_EQUAL_LINE(dirs, apInfo->GetNumDirectories(), \ 
     1061                                "directories"); \ 
     1062                } 
     1063 
     1064                TEST_NUM_FILES(1, 0, 0, 1); 
     1065                run_housekeeping_and_check_account(hostname, context, 
     1066                        conn, apProtocol); 
     1067                TEST_NUM_FILES(1, 0, 0, 1); 
    10231068 
    10241069                // sleep to ensure that the timestamp on the file will change 
     
    10341079                        filename += uploads[t].fnextra; 
    10351080                        int64_t modtime = 0; 
    1036                          
     1081 
    10371082                        std::auto_ptr<IOStream> upload(BackupStoreFile::EncodeFile(filename.c_str(), BackupProtocolClientListDirectory::RootDirectory, uploads[t].name, &modtime)); 
    10381083                        TEST_THAT(modtime != 0); 
    10391084                         
    1040                         std::auto_ptr<BackupProtocolClientSuccess> stored(protocol.QueryStoreFile( 
     1085                        std::auto_ptr<BackupProtocolClientSuccess> stored(apProtocol->QueryStoreFile( 
    10411086                                BackupProtocolClientListDirectory::RootDirectory, 
    10421087                                modtime, 
    10431088                                modtime, /* use it for attr hash too */ 
    1044                                 0,                                                      /* diff from ID */ 
     1089                                0, /* diff from ID */ 
    10451090                                uploads[t].name, 
    10461091                                *upload)); 
     
    10521097                                "as object " << 
    10531098                                BOX_FORMAT_OBJECTID(stored->GetObjectID())); 
     1099                        TEST_NUM_FILES(t + 2, 0, 0, 1); 
     1100 
     1101                        run_housekeeping_and_check_account(hostname, context, 
     1102                                conn, apProtocol); 
     1103                        TEST_NUM_FILES(t + 2, 0, 0, 1); 
    10541104                } 
    10551105 
    10561106                // Add some attributes onto one of them 
    10571107                { 
     1108                        TEST_NUM_FILES(UPLOAD_NUM + 1, 0, 0, 1); 
    10581109                        MemBlockStream attrnew(attr3, sizeof(attr3)); 
    1059                         std::auto_ptr<BackupProtocolClientSuccess> set(protocol.QuerySetReplacementFileAttributes( 
     1110                        std::auto_ptr<BackupProtocolClientSuccess> set(apProtocol->QuerySetReplacementFileAttributes( 
    10601111                                BackupProtocolClientListDirectory::RootDirectory, 
    10611112                                32498749832475LL, 
     
    10631114                                attrnew)); 
    10641115                        TEST_THAT(set->GetObjectID() == uploads[UPLOAD_ATTRS_EN].allocated_objid); 
     1116                        TEST_NUM_FILES(UPLOAD_NUM + 1, 0, 0, 1); 
    10651117                } 
    10661118                 
    10671119                // Delete one of them (will implicitly delete an old version) 
    10681120                { 
    1069                         std::auto_ptr<BackupProtocolClientSuccess> del(protocol.QueryDeleteFile( 
     1121                        std::auto_ptr<BackupProtocolClientSuccess> del(apProtocol->QueryDeleteFile( 
    10701122                                BackupProtocolClientListDirectory::RootDirectory, 
    10711123                                uploads[UPLOAD_DELETE_EN].name)); 
    10721124                        TEST_THAT(del->GetObjectID() == uploads[UPLOAD_DELETE_EN].allocated_objid); 
    1073                 } 
     1125                        TEST_NUM_FILES(UPLOAD_NUM, 0, 1, 1); 
     1126                } 
     1127 
    10741128                // Check that the block index can be obtained by name even though it's been deleted 
    10751129                { 
     
    10771131                        { 
    10781132                                FileStream out("testfiles/downloaddelobj", O_WRONLY | O_CREAT); 
    1079                                 std::auto_ptr<BackupProtocolClientSuccess> getobj(protocol.QueryGetObject(uploads[UPLOAD_DELETE_EN].allocated_objid)); 
    1080                                 std::auto_ptr<IOStream> objstream(protocol.ReceiveStream()); 
     1133                                std::auto_ptr<BackupProtocolClientSuccess> getobj(apProtocol->QueryGetObject(uploads[UPLOAD_DELETE_EN].allocated_objid)); 
     1134                                std::auto_ptr<IOStream> objstream(apProtocol->ReceiveStream()); 
    10811135                                objstream->CopyStreamTo(out); 
    10821136                        } 
    10831137                        // query index and test 
    1084                         std::auto_ptr<BackupProtocolClientSuccess> getblockindex(protocol.QueryGetBlockIndexByName( 
     1138                        std::auto_ptr<BackupProtocolClientSuccess> getblockindex(apProtocol->QueryGetBlockIndexByName( 
    10851139                                BackupProtocolClientListDirectory::RootDirectory, uploads[UPLOAD_DELETE_EN].name)); 
    10861140                        TEST_THAT(getblockindex->GetObjectID() == uploads[UPLOAD_DELETE_EN].allocated_objid); 
    1087                         std::auto_ptr<IOStream> blockIndexStream(protocol.ReceiveStream()); 
     1141                        std::auto_ptr<IOStream> blockIndexStream(apProtocol->ReceiveStream()); 
    10881142                        TEST_THAT(check_block_index("testfiles/downloaddelobj", *blockIndexStream)); 
    10891143                } 
     
    10931147                { 
    10941148                        printf("%d\n", t); 
    1095                         std::auto_ptr<BackupProtocolClientSuccess> getFile(protocol.QueryGetFile(BackupProtocolClientListDirectory::RootDirectory, uploads[t].allocated_objid)); 
     1149                        std::auto_ptr<BackupProtocolClientSuccess> getFile(apProtocol->QueryGetFile(BackupProtocolClientListDirectory::RootDirectory, uploads[t].allocated_objid)); 
    10961150                        TEST_THAT(getFile->GetObjectID() == uploads[t].allocated_objid); 
    1097                         std::auto_ptr<IOStream> filestream(protocol.ReceiveStream()); 
     1151                        std::auto_ptr<IOStream> filestream(apProtocol->ReceiveStream()); 
    10981152                        test_test_file(t, *filestream); 
    10991153                } 
     
    11071161                        printf("done.\n\n"); 
    11081162                        // And on the read/write one 
    1109                         check_dir_after_uploads(protocol, attrtest); 
     1163                        check_dir_after_uploads(*apProtocol, attrtest); 
    11101164                } 
    11111165                 
     
    11291183                        ::free(buf); 
    11301184                } 
     1185 
     1186                TEST_NUM_FILES(UPLOAD_NUM, 0, 1, 1); 
     1187 
     1188                // Run housekeeping (for which we need to disconnect 
     1189                // ourselves) and check that it doesn't change the numbers 
     1190                // of files 
     1191                apProtocol->QueryFinished(); 
     1192                std::auto_ptr<BackupStoreAccountDatabase> apAccounts( 
     1193                        BackupStoreAccountDatabase::Read("testfiles/accounts.txt")); 
     1194                BackupStoreAccountDatabase::Entry account = 
     1195                        apAccounts->GetEntry(0x1234567); 
     1196                run_housekeeping(account); 
     1197 
     1198                // Also check that bbstoreaccounts doesn't change anything 
     1199                TEST_THAT_ABORTONFAIL(::system(BBSTOREACCOUNTS 
     1200                        " -c testfiles/bbstored.conf check 01234567 fix") == 0); 
     1201                TestRemoteProcessMemLeaks("bbstoreaccounts.memleaks"); 
     1202 
     1203                apProtocol = test_server_login(hostname, context, conn); 
     1204 
     1205                TEST_NUM_FILES(UPLOAD_NUM, 0, 1, 1); 
     1206 
    11311207                { 
    11321208                        // Fetch the block index for this one 
    1133                         std::auto_ptr<BackupProtocolClientSuccess> getblockindex(protocol.QueryGetBlockIndexByName( 
     1209                        std::auto_ptr<BackupProtocolClientSuccess> getblockindex(apProtocol->QueryGetBlockIndexByName( 
    11341210                                BackupProtocolClientListDirectory::RootDirectory, uploads[UPLOAD_PATCH_EN].name)); 
    11351211                        TEST_THAT(getblockindex->GetObjectID() == uploads[UPLOAD_PATCH_EN].allocated_objid); 
    1136                         std::auto_ptr<IOStream> blockIndexStream(protocol.ReceiveStream()); 
     1212                        std::auto_ptr<IOStream> blockIndexStream(apProtocol->ReceiveStream()); 
    11371213                         
    11381214                        // Do the patching 
     
    11611237                        { 
    11621238                                FileStream uploadpatch(TEST_FILE_FOR_PATCHING ".patch"); 
    1163                                 std::auto_ptr<BackupProtocolClientSuccess> stored(protocol.QueryStoreFile( 
     1239                                std::auto_ptr<BackupProtocolClientSuccess> stored(apProtocol->QueryStoreFile( 
    11641240                                        BackupProtocolClientListDirectory::RootDirectory, 
    11651241                                        modtime, 
     
    11761252 
    11771253                        // Then download it to check it's OK 
    1178                         std::auto_ptr<BackupProtocolClientSuccess> getFile(protocol.QueryGetFile(BackupProtocolClientListDirectory::RootDirectory, patchedID)); 
     1254                        std::auto_ptr<BackupProtocolClientSuccess> getFile(apProtocol->QueryGetFile(BackupProtocolClientListDirectory::RootDirectory, patchedID)); 
    11791255                        TEST_THAT(getFile->GetObjectID() == patchedID); 
    1180                         std::auto_ptr<IOStream> filestream(protocol.ReceiveStream()); 
     1256                        std::auto_ptr<IOStream> filestream(apProtocol->ReceiveStream()); 
    11811257                        BackupStoreFile::DecodeFile(*filestream, TEST_FILE_FOR_PATCHING ".downloaded", IOStream::TimeOutInfinite); 
    11821258                        // Check it's the same 
    11831259                        TEST_THAT(check_files_same(TEST_FILE_FOR_PATCHING ".downloaded", TEST_FILE_FOR_PATCHING ".mod")); 
     1260 
     1261                        TEST_NUM_FILES(UPLOAD_NUM, 1, 1, 1); 
    11841262                } 
    11851263 
     
    11901268                        // Attributes 
    11911269                        MemBlockStream attr(attr1, sizeof(attr1)); 
    1192                         std::auto_ptr<BackupProtocolClientSuccess> dirCreate(protocol.QueryCreateDirectory( 
     1270                        std::auto_ptr<BackupProtocolClientSuccess> dirCreate(apProtocol->QueryCreateDirectory( 
    11931271                                BackupProtocolClientListDirectory::RootDirectory, 
    11941272                                9837429842987984LL, dirname, attr)); 
    11951273                        subdirid = dirCreate->GetObjectID();  
    11961274                        TEST_THAT(subdirid == maxID + 1); 
     1275 
     1276                        TEST_NUM_FILES(UPLOAD_NUM, 1, 1, 2); 
    11971277                } 
    11981278 
     
    12061286                        std::auto_ptr<IOStream> upload(BackupStoreFile::EncodeFile(filename.c_str(), subdirid, uploads[0].name, &modtime)); 
    12071287 
    1208                         std::auto_ptr<BackupProtocolClientSuccess> stored(protocol.QueryStoreFile( 
     1288                        std::auto_ptr<BackupProtocolClientSuccess> stored(apProtocol->QueryStoreFile( 
    12091289                                subdirid, 
    12101290                                modtime, 
     
    12141294                                *upload)); 
    12151295                        subdirfileid = stored->GetObjectID(); 
     1296 
     1297                        TEST_NUM_FILES(UPLOAD_NUM + 1, 1, 1, 2); 
    12161298                } 
    12171299 
     
    13041386                { 
    13051387                        MemBlockStream attrnew(attr2, sizeof(attr2)); 
    1306                         std::auto_ptr<BackupProtocolClientSuccess> changereply(protocol.QueryChangeDirAttributes( 
     1388                        std::auto_ptr<BackupProtocolClientSuccess> changereply(apProtocol->QueryChangeDirAttributes( 
    13071389                                        subdirid, 
    13081390                                        329483209443598LL, 
     
    13371419                        BackupStoreFilenameClear newName("moved-files"); 
    13381420                 
    1339                         std::auto_ptr<BackupProtocolClientSuccess> rep(protocol.QueryMoveObject(uploads[UPLOAD_FILE_TO_MOVE].allocated_objid, 
     1421                        std::auto_ptr<BackupProtocolClientSuccess> rep(apProtocol->QueryMoveObject(uploads[UPLOAD_FILE_TO_MOVE].allocated_objid, 
    13401422                                BackupProtocolClientListDirectory::RootDirectory, 
    13411423                                subdirid, BackupProtocolClientMoveObject::Flags_MoveAllWithSameName, newName)); 
     
    13461428                { 
    13471429                        BackupStoreFilenameClear newName("moved-files"); 
    1348                         TEST_CHECK_THROWS(protocol.QueryMoveObject(uploads[UPLOAD_FILE_TO_MOVE].allocated_objid, 
     1430                        TEST_CHECK_THROWS(apProtocol->QueryMoveObject(uploads[UPLOAD_FILE_TO_MOVE].allocated_objid, 
    13491431                                        BackupProtocolClientListDirectory::RootDirectory, 
    13501432                                        subdirid, BackupProtocolClientMoveObject::Flags_MoveAllWithSameName, newName), 
    13511433                                ConnectionException, Conn_Protocol_UnexpectedReply); 
    1352                         TEST_CHECK_THROWS(protocol.QueryMoveObject(uploads[UPLOAD_FILE_TO_MOVE].allocated_objid, 
     1434                        TEST_CHECK_THROWS(apProtocol->QueryMoveObject(uploads[UPLOAD_FILE_TO_MOVE].allocated_objid, 
    13531435                                        subdirid, 
    13541436                                        subdirid, BackupProtocolClientMoveObject::Flags_MoveAllWithSameName, newName), 
     
    13591441                { 
    13601442                        BackupStoreFilenameClear newName("moved-files-x"); 
    1361                         protocol.QueryMoveObject(uploads[UPLOAD_FILE_TO_MOVE].allocated_objid, 
     1443                        apProtocol->QueryMoveObject(uploads[UPLOAD_FILE_TO_MOVE].allocated_objid, 
    13621444                                subdirid, 
    13631445                                subdirid, BackupProtocolClientMoveObject::Flags_MoveAllWithSameName, newName); 
     
    14241506                        // Attributes 
    14251507                        MemBlockStream attr(attr1, sizeof(attr1)); 
    1426                         std::auto_ptr<BackupProtocolClientSuccess> dirCreate(protocol.QueryCreateDirectory( 
     1508                        std::auto_ptr<BackupProtocolClientSuccess> dirCreate(apProtocol->QueryCreateDirectory( 
    14271509                                subdirid, 
    14281510                                9837429842987984LL, nd, attr)); 
     
    14311513                        FileStream upload("testfiles/file1_upload1"); 
    14321514                        BackupStoreFilenameClear nf("file2"); 
    1433                         std::auto_ptr<BackupProtocolClientSuccess> stored(protocol.QueryStoreFile( 
     1515                        std::auto_ptr<BackupProtocolClientSuccess> stored(apProtocol->QueryStoreFile( 
    14341516                                subsubdirid, 
    14351517                                0x123456789abcdefLL,            /* modification time */ 
     
    14461528                // Query names -- test that invalid stuff returns not found OK 
    14471529                { 
    1448                         std::auto_ptr<BackupProtocolClientObjectName> nameRep(protocol.QueryGetObjectName(3248972347823478927LL, subsubdirid)); 
     1530                        std::auto_ptr<BackupProtocolClientObjectName> nameRep(apProtocol->QueryGetObjectName(3248972347823478927LL, subsubdirid)); 
    14491531                        TEST_THAT(nameRep->GetNumNameElements() == 0);           
    14501532                } 
    14511533                { 
    1452                         std::auto_ptr<BackupProtocolClientObjectName> nameRep(protocol.QueryGetObjectName(subsubfileid, 2342378424LL)); 
     1534                        std::auto_ptr<BackupProtocolClientObjectName> nameRep(apProtocol->QueryGetObjectName(subsubfileid, 2342378424LL)); 
    14531535                        TEST_THAT(nameRep->GetNumNameElements() == 0);           
    14541536                } 
    14551537                { 
    1456                         std::auto_ptr<BackupProtocolClientObjectName> nameRep(protocol.QueryGetObjectName(38947234789LL, 2342378424LL)); 
     1538                        std::auto_ptr<BackupProtocolClientObjectName> nameRep(apProtocol->QueryGetObjectName(38947234789LL, 2342378424LL)); 
    14571539                        TEST_THAT(nameRep->GetNumNameElements() == 0);           
    14581540                } 
    14591541                { 
    1460                         std::auto_ptr<BackupProtocolClientObjectName> nameRep(protocol.QueryGetObjectName(BackupProtocolClientGetObjectName::ObjectID_DirectoryOnly, 2234342378424LL)); 
     1542                        std::auto_ptr<BackupProtocolClientObjectName> nameRep(apProtocol->QueryGetObjectName(BackupProtocolClientGetObjectName::ObjectID_DirectoryOnly, 2234342378424LL)); 
    14611543                        TEST_THAT(nameRep->GetNumNameElements() == 0);           
    14621544                } 
     
    14641546                // Query names... first, get info for the file 
    14651547                { 
    1466                         std::auto_ptr<BackupProtocolClientObjectName> nameRep(protocol.QueryGetObjectName(subsubfileid, subsubdirid)); 
    1467                         std::auto_ptr<IOStream> namestream(protocol.ReceiveStream()); 
     1548                        std::auto_ptr<BackupProtocolClientObjectName> nameRep(apProtocol->QueryGetObjectName(subsubfileid, subsubdirid)); 
     1549                        std::auto_ptr<IOStream> namestream(apProtocol->ReceiveStream()); 
    14681550                 
    14691551                        TEST_THAT(nameRep->GetNumNameElements() == 3); 
     
    14821564                // Query names... secondly, for the directory 
    14831565                { 
    1484                         std::auto_ptr<BackupProtocolClientObjectName> nameRep(protocol.QueryGetObjectName(BackupProtocolClientGetObjectName::ObjectID_DirectoryOnly, subsubdirid)); 
    1485                         std::auto_ptr<IOStream> namestream(protocol.ReceiveStream()); 
     1566                        std::auto_ptr<BackupProtocolClientObjectName> nameRep(apProtocol->QueryGetObjectName(BackupProtocolClientGetObjectName::ObjectID_DirectoryOnly, subsubdirid)); 
     1567                        std::auto_ptr<IOStream> namestream(apProtocol->ReceiveStream()); 
    14861568                 
    14871569                        TEST_THAT(nameRep->GetNumNameElements() == 2); 
     
    14981580//}     skip: 
    14991581 
    1500                 std::auto_ptr<BackupStoreAccountDatabase> apAccounts( 
    1501                         BackupStoreAccountDatabase::Read( 
    1502                                 "testfiles/accounts.txt")); 
    15031582                std::auto_ptr<BackupStoreRefCountDatabase> apRefCount( 
    15041583                        BackupStoreRefCountDatabase::Load( 
     
    15061585         
    15071586                // Create some nice recursive directories 
    1508                 int64_t dirtodelete = create_test_data_subdirs(protocol, 
     1587                int64_t dirtodelete = create_test_data_subdirs(*apProtocol, 
    15091588                        BackupProtocolClientListDirectory::RootDirectory, 
    15101589                        "test_delete", 6 /* depth */, *apRefCount); 
     
    15121591                // And delete them 
    15131592                { 
    1514                         std::auto_ptr<BackupProtocolClientSuccess> dirdel(protocol.QueryDeleteDirectory( 
     1593                        std::auto_ptr<BackupProtocolClientSuccess> dirdel(apProtocol->QueryDeleteDirectory( 
    15151594                                        dirtodelete)); 
    15161595                        TEST_THAT(dirdel->GetObjectID() == dirtodelete); 
     
    15501629                protocolReadOnly.QueryFinished(); 
    15511630#endif 
    1552                 protocol.QueryFinished(); 
     1631                apProtocol->QueryFinished(); 
    15531632                 
    15541633                // Close logs 
     
    17431822                TEST_CHECK_THROWS(info->RemovedDeletedDirectory(2), BackupStoreException, StoreInfoIsReadOnly); 
    17441823                TEST_CHECK_THROWS(info->AddDeletedDirectory(2), BackupStoreException, StoreInfoIsReadOnly); 
     1824                TEST_CHECK_THROWS(info->SetAccountName("hello"), BackupStoreException, StoreInfoIsReadOnly); 
    17451825        } 
    17461826        { 
     
    17591839                info->AddDeletedDirectory(4); 
    17601840                info->RemovedDeletedDirectory(3); 
     1841                info->SetAccountName("whee"); 
    17611842                TEST_CHECK_THROWS(info->RemovedDeletedDirectory(9), BackupStoreException, StoreInfoDirNotInList); 
    17621843                info->Save(); 
     
    17691850                TEST_THAT(info->GetBlocksSoftLimit() == 3461231233455433LL); 
    17701851                TEST_THAT(info->GetBlocksHardLimit() == 2934852487LL); 
     1852                TEST_THAT(info->GetAccountName() == "whee"); 
    17711853                const std::vector<int64_t> &delfiles(info->GetDeletedDirectories()); 
    17721854                TEST_THAT(delfiles.size() == 2); 
     
    18491931 
    18501932                TLSContext context; 
    1851                 std::auto_ptr<SocketStreamTLS> conn = open_conn("localhost", 
    1852                         context); 
    1853                 test_server_login(*conn)->QueryFinished(); 
     1933                std::auto_ptr<SocketStreamTLS> conn; 
     1934                test_server_login("localhost", context, conn)->QueryFinished(); 
    18541935 
    18551936                BackupStoreAccountDatabase::Entry account = 
Note: See TracChangeset for help on using the changeset viewer.