Changeset 2116 for box/trunk/test


Ignore:
Timestamp:
28/03/2008 22:59:28 (4 years ago)
Author:
chris
Message:

Allow configuration of the server port that the client will connect to
(bbackupd and bbackupquery).

Redesign ConfigurationVerify? to use classes instead of structs.

Use port 22011 instead of 2201 during tests, to reduce the chances of
conflicting with a running bbstored or other process.

Ignore autogen_* in svn:ignore everywhere instead of individual per-file
ignores.

Location:
box/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • box/trunk

    • Property svn:ignore
      •  

        old new  
        1111release 
        1212runtest.pl 
         13.hg 
  • box/trunk/test/basicserver

    • Property svn:ignore
      •  

        old new  
        1 autogen_TestProtocolClient.cpp 
        2 autogen_TestProtocolClient.h 
        3 autogen_TestProtocolServer.cpp 
        4 autogen_TestProtocolServer.h 
         1autogen_* 
        52_main.cpp 
        63Makefile 
  • box/trunk/test/basicserver/testbasicserver.cpp

    r2014 r2116  
    186186        static ConfigurationVerifyKey verifyserverkeys[] =  
    187187        { 
    188                 SERVERSTREAM_VERIFY_SERVER_KEYS(0)      // no default addresses 
     188                SERVERSTREAM_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue) // no default listen addresses 
    189189        }; 
    190190 
     
    259259        static ConfigurationVerifyKey verifyserverkeys[] =  
    260260        { 
    261                 SERVERTLS_VERIFY_SERVER_KEYS(0) // no default listen addresses 
     261                SERVERTLS_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue) // no default listen addresses 
    262262        }; 
    263263 
  • box/trunk/test/bbackupd/testbbackupd.cpp

    r2107 r2116  
    515515                        // connect and log in 
    516516                        SocketStreamTLS conn; 
    517                         conn.Open(context, Socket::TypeINET, "localhost", BOX_PORT_BBSTORED); 
     517                        conn.Open(context, Socket::TypeINET, "localhost", 
     518                                22011); 
    518519                        BackupProtocolClient protocol(conn); 
    519520                        protocol.QueryVersion(BACKUP_STORE_SERVER_VERSION); 
     
    608609{ 
    609610        sSocket.Open(rContext, Socket::TypeINET,  
    610                 "localhost", BOX_PORT_BBSTORED); 
     611                "localhost", 22011); 
    611612        std::auto_ptr<BackupProtocolClient> connection; 
    612613        connection.reset(new BackupProtocolClient(sSocket)); 
     
    25602561                                == Restore_TargetExists); 
    25612562                         
    2562                         // Make sure you can't restore to a nonexistant path 
    2563                         printf("Try to restore to a path that doesn't exist\n"); 
    2564                         TEST_THAT(BackupClientRestore(*client, restoredirid,  
    2565                                 "testfiles/no-such-path/subdir",  
    2566                                 true /* print progress dots */)  
    2567                                 == Restore_TargetPathNotFound); 
    2568                          
    25692563                        // Find ID of the deleted directory 
    25702564                        deldirid = GetDirID(*client, "x1", restoredirid); 
     
    25782572                                true /* deleted files */)  
    25792573                                == Restore_Complete); 
     2574 
     2575                        // Make sure you can't restore to a nonexistant path 
     2576                        printf("\n\n==== Try to restore to a path " 
     2577                                "that doesn't exist\n"); 
     2578                        fflush(stdout); 
     2579                        TEST_THAT(BackupClientRestore(*client, restoredirid,  
     2580                                "testfiles/no-such-path/subdir",  
     2581                                true /* print progress dots */)  
     2582                                == Restore_TargetPathNotFound); 
    25802583 
    25812584                        // Log out 
  • box/trunk/test/bbackupd/testfiles

    • Property svn:ignore
      •  

        old new  
        22extcheck2.pl 
        33notifyscript.pl 
         4bbackupd.conf 
         5syncallowscript.pl 
  • box/trunk/test/bbackupd/testfiles/bbackupd-temploc.conf

    r1867 r2116  
    99 
    1010StoreHostname = localhost 
     11StorePort = 22011 
    1112AccountNumber = 0x01234567 
    1213 
  • box/trunk/test/bbackupd/testfiles/bbackupd.conf.in

    r1867 r2116  
    99 
    1010StoreHostname = localhost 
     11StorePort = 22011 
    1112AccountNumber = 0x01234567 
    1213 
  • box/trunk/test/bbackupd/testfiles/bbstored.conf

    r217 r2116  
    1010{ 
    1111        PidFile = testfiles/bbstored.pid 
    12         ListenAddresses = inet:localhost 
     12        ListenAddresses = inet:localhost:22011 
    1313        CertificateFile = testfiles/serverCerts.pem 
    1414        PrivateKeyFile = testfiles/serverPrivKey.pem 
  • box/trunk/test/common/testcommon.cpp

    r1774 r2116  
    5858ConfigurationVerifyKey verifykeys1_1_1[] = 
    5959{ 
    60         {"bing", 0, ConfigTest_Exists, 0}, 
    61         {"carrots", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, 
    62         {"terrible", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} 
     60        ConfigurationVerifyKey("bing", ConfigTest_Exists), 
     61        ConfigurationVerifyKey("carrots", ConfigTest_Exists | ConfigTest_IsInt), 
     62        ConfigurationVerifyKey("terrible", ConfigTest_Exists | ConfigTest_LastEntry) 
    6363}; 
    6464 
    6565ConfigurationVerifyKey verifykeys1_1_2[] = 
    6666{ 
    67         {"fish", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, 
    68         {"string", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} 
     67        ConfigurationVerifyKey("fish", ConfigTest_Exists | ConfigTest_IsInt), 
     68        ConfigurationVerifyKey("string", ConfigTest_Exists | ConfigTest_LastEntry) 
    6969}; 
    7070 
     
    9090ConfigurationVerifyKey verifykeys1_1[] = 
    9191{ 
    92         {"value", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, 
    93         {"string1", 0, ConfigTest_Exists, 0}, 
    94         {"string2", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} 
     92        ConfigurationVerifyKey("value", ConfigTest_Exists | ConfigTest_IsInt), 
     93        ConfigurationVerifyKey("string1", ConfigTest_Exists), 
     94        ConfigurationVerifyKey("string2", ConfigTest_Exists | ConfigTest_LastEntry) 
    9595}; 
    9696 
    9797ConfigurationVerifyKey verifykeys1_2[] =  
    9898{ 
    99         {"carrots", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, 
    100         {"string", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} 
     99        ConfigurationVerifyKey("carrots", ConfigTest_Exists | ConfigTest_IsInt), 
     100        ConfigurationVerifyKey("string", ConfigTest_Exists | ConfigTest_LastEntry) 
    101101}; 
    102102 
     
    121121ConfigurationVerifyKey verifykeys1[] = 
    122122{ 
    123                 {"notExpected", 0, 0, 0}, 
    124                 {"HasDefaultValue", "Lovely default value", 0, 0}, 
    125                 {"MultiValue", 0, ConfigTest_MultiValueAllowed, 0}, 
    126                 {"BoolTrue1", 0, ConfigTest_IsBool, 0}, 
    127                 {"BoolTrue2", 0, ConfigTest_IsBool, 0}, 
    128                 {"BoolFalse1", 0, ConfigTest_IsBool, 0}, 
    129                 {"BoolFalse2", 0, ConfigTest_IsBool, 0}, 
    130                 {"TOPlevel", 0, ConfigTest_LastEntry | ConfigTest_Exists, 0} 
     123                ConfigurationVerifyKey("notExpected", 0), 
     124                ConfigurationVerifyKey("HasDefaultValue", 0, "Lovely default value"), 
     125                ConfigurationVerifyKey("MultiValue", ConfigTest_MultiValueAllowed), 
     126                ConfigurationVerifyKey("BoolTrue1", ConfigTest_IsBool), 
     127                ConfigurationVerifyKey("BoolTrue2", ConfigTest_IsBool), 
     128                ConfigurationVerifyKey("BoolFalse1", ConfigTest_IsBool), 
     129                ConfigurationVerifyKey("BoolFalse2", ConfigTest_IsBool), 
     130                ConfigurationVerifyKey("TOPlevel",  
     131                        ConfigTest_LastEntry | ConfigTest_Exists) 
    131132}; 
    132133 
Note: See TracChangeset for help on using the changeset viewer.