diff options
author | Chris Wilson <chris+github@qwirx.com> | 2008-03-28 22:59:28 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2008-03-28 22:59:28 +0000 |
commit | 732bdbdaacb429c94c4120070e531038e3d6f132 (patch) | |
tree | ecd16d380ae1d2dcd0d65e089177eb16cca6d47f /test | |
parent | 4fca88ed02c1f0b5208abf2420f73023de54c23e (diff) |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/basicserver/testbasicserver.cpp | 4 | ||||
-rw-r--r-- | test/bbackupd/testbbackupd.cpp | 21 | ||||
-rw-r--r-- | test/bbackupd/testfiles/bbackupd-temploc.conf | 1 | ||||
-rw-r--r-- | test/bbackupd/testfiles/bbackupd.conf.in | 1 | ||||
-rw-r--r-- | test/bbackupd/testfiles/bbstored.conf | 2 | ||||
-rw-r--r-- | test/common/testcommon.cpp | 37 |
6 files changed, 36 insertions, 30 deletions
diff --git a/test/basicserver/testbasicserver.cpp b/test/basicserver/testbasicserver.cpp index 18329441..18bc0aa8 100644 --- a/test/basicserver/testbasicserver.cpp +++ b/test/basicserver/testbasicserver.cpp @@ -185,7 +185,7 @@ const ConfigurationVerify *testserver::GetConfigVerify() const { static ConfigurationVerifyKey verifyserverkeys[] = { - SERVERSTREAM_VERIFY_SERVER_KEYS(0) // no default addresses + SERVERSTREAM_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue) // no default listen addresses }; static ConfigurationVerify verifyserver[] = @@ -258,7 +258,7 @@ const ConfigurationVerify *testTLSserver::GetConfigVerify() const { static ConfigurationVerifyKey verifyserverkeys[] = { - SERVERTLS_VERIFY_SERVER_KEYS(0) // no default listen addresses + SERVERTLS_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue) // no default listen addresses }; static ConfigurationVerify verifyserver[] = diff --git a/test/bbackupd/testbbackupd.cpp b/test/bbackupd/testbbackupd.cpp index 3f165dc2..27ca4ecb 100644 --- a/test/bbackupd/testbbackupd.cpp +++ b/test/bbackupd/testbbackupd.cpp @@ -514,7 +514,8 @@ void do_interrupted_restore(const TLSContext &context, int64_t restoredirid) { // connect and log in SocketStreamTLS conn; - conn.Open(context, Socket::TypeINET, "localhost", BOX_PORT_BBSTORED); + conn.Open(context, Socket::TypeINET, "localhost", + 22011); BackupProtocolClient protocol(conn); protocol.QueryVersion(BACKUP_STORE_SERVER_VERSION); std::auto_ptr<BackupProtocolClientLoginConfirmed> loginConf(protocol.QueryLogin(0x01234567, BackupProtocolClientLogin::Flags_ReadOnly)); @@ -607,7 +608,7 @@ SocketStreamTLS sSocket; std::auto_ptr<BackupProtocolClient> Connect(TLSContext& rContext) { sSocket.Open(rContext, Socket::TypeINET, - "localhost", BOX_PORT_BBSTORED); + "localhost", 22011); std::auto_ptr<BackupProtocolClient> connection; connection.reset(new BackupProtocolClient(sSocket)); connection->Handshake(); @@ -2559,13 +2560,6 @@ int test_bbackupd() true /* print progress dots */) == Restore_TargetExists); - // Make sure you can't restore to a nonexistant path - printf("Try to restore to a path that doesn't exist\n"); - TEST_THAT(BackupClientRestore(*client, restoredirid, - "testfiles/no-such-path/subdir", - true /* print progress dots */) - == Restore_TargetPathNotFound); - // Find ID of the deleted directory deldirid = GetDirID(*client, "x1", restoredirid); TEST_THAT(deldirid != 0); @@ -2578,6 +2572,15 @@ int test_bbackupd() true /* deleted files */) == Restore_Complete); + // Make sure you can't restore to a nonexistant path + printf("\n\n==== Try to restore to a path " + "that doesn't exist\n"); + fflush(stdout); + TEST_THAT(BackupClientRestore(*client, restoredirid, + "testfiles/no-such-path/subdir", + true /* print progress dots */) + == Restore_TargetPathNotFound); + // Log out client->QueryFinished(); sSocket.Close(); diff --git a/test/bbackupd/testfiles/bbackupd-temploc.conf b/test/bbackupd/testfiles/bbackupd-temploc.conf index 86901298..57d66bca 100644 --- a/test/bbackupd/testfiles/bbackupd-temploc.conf +++ b/test/bbackupd/testfiles/bbackupd-temploc.conf @@ -8,6 +8,7 @@ KeysFile = testfiles/bbackupd.keys DataDirectory = testfiles/bbackupd-data StoreHostname = localhost +StorePort = 22011 AccountNumber = 0x01234567 UpdateStoreInterval = 3 diff --git a/test/bbackupd/testfiles/bbackupd.conf.in b/test/bbackupd/testfiles/bbackupd.conf.in index aecb3884..712b58b2 100644 --- a/test/bbackupd/testfiles/bbackupd.conf.in +++ b/test/bbackupd/testfiles/bbackupd.conf.in @@ -8,6 +8,7 @@ KeysFile = testfiles/bbackupd.keys DataDirectory = testfiles/bbackupd-data StoreHostname = localhost +StorePort = 22011 AccountNumber = 0x01234567 UpdateStoreInterval = 3 diff --git a/test/bbackupd/testfiles/bbstored.conf b/test/bbackupd/testfiles/bbstored.conf index 18c73a40..87f4fe6b 100644 --- a/test/bbackupd/testfiles/bbstored.conf +++ b/test/bbackupd/testfiles/bbstored.conf @@ -9,7 +9,7 @@ TimeBetweenHousekeeping = 5 Server { PidFile = testfiles/bbstored.pid - ListenAddresses = inet:localhost + ListenAddresses = inet:localhost:22011 CertificateFile = testfiles/serverCerts.pem PrivateKeyFile = testfiles/serverPrivKey.pem TrustedCAsFile = testfiles/serverTrustedCAs.pem diff --git a/test/common/testcommon.cpp b/test/common/testcommon.cpp index eb057228..46d36c73 100644 --- a/test/common/testcommon.cpp +++ b/test/common/testcommon.cpp @@ -57,15 +57,15 @@ void test_conversions() ConfigurationVerifyKey verifykeys1_1_1[] = { - {"bing", 0, ConfigTest_Exists, 0}, - {"carrots", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, - {"terrible", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} + ConfigurationVerifyKey("bing", ConfigTest_Exists), + ConfigurationVerifyKey("carrots", ConfigTest_Exists | ConfigTest_IsInt), + ConfigurationVerifyKey("terrible", ConfigTest_Exists | ConfigTest_LastEntry) }; ConfigurationVerifyKey verifykeys1_1_2[] = { - {"fish", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, - {"string", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} + ConfigurationVerifyKey("fish", ConfigTest_Exists | ConfigTest_IsInt), + ConfigurationVerifyKey("string", ConfigTest_Exists | ConfigTest_LastEntry) }; @@ -89,15 +89,15 @@ ConfigurationVerify verifysub1_1[] = ConfigurationVerifyKey verifykeys1_1[] = { - {"value", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, - {"string1", 0, ConfigTest_Exists, 0}, - {"string2", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} + ConfigurationVerifyKey("value", ConfigTest_Exists | ConfigTest_IsInt), + ConfigurationVerifyKey("string1", ConfigTest_Exists), + ConfigurationVerifyKey("string2", ConfigTest_Exists | ConfigTest_LastEntry) }; ConfigurationVerifyKey verifykeys1_2[] = { - {"carrots", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, - {"string", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} + ConfigurationVerifyKey("carrots", ConfigTest_Exists | ConfigTest_IsInt), + ConfigurationVerifyKey("string", ConfigTest_Exists | ConfigTest_LastEntry) }; ConfigurationVerify verifysub1[] = @@ -120,14 +120,15 @@ ConfigurationVerify verifysub1[] = ConfigurationVerifyKey verifykeys1[] = { - {"notExpected", 0, 0, 0}, - {"HasDefaultValue", "Lovely default value", 0, 0}, - {"MultiValue", 0, ConfigTest_MultiValueAllowed, 0}, - {"BoolTrue1", 0, ConfigTest_IsBool, 0}, - {"BoolTrue2", 0, ConfigTest_IsBool, 0}, - {"BoolFalse1", 0, ConfigTest_IsBool, 0}, - {"BoolFalse2", 0, ConfigTest_IsBool, 0}, - {"TOPlevel", 0, ConfigTest_LastEntry | ConfigTest_Exists, 0} + ConfigurationVerifyKey("notExpected", 0), + ConfigurationVerifyKey("HasDefaultValue", 0, "Lovely default value"), + ConfigurationVerifyKey("MultiValue", ConfigTest_MultiValueAllowed), + ConfigurationVerifyKey("BoolTrue1", ConfigTest_IsBool), + ConfigurationVerifyKey("BoolTrue2", ConfigTest_IsBool), + ConfigurationVerifyKey("BoolFalse1", ConfigTest_IsBool), + ConfigurationVerifyKey("BoolFalse2", ConfigTest_IsBool), + ConfigurationVerifyKey("TOPlevel", + ConfigTest_LastEntry | ConfigTest_Exists) }; ConfigurationVerify verify = |