summaryrefslogtreecommitdiff
path: root/test/bbackupd/testbbackupd.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-03-28 22:59:28 +0000
committerChris Wilson <chris+github@qwirx.com>2008-03-28 22:59:28 +0000
commit732bdbdaacb429c94c4120070e531038e3d6f132 (patch)
treeecd16d380ae1d2dcd0d65e089177eb16cca6d47f /test/bbackupd/testbbackupd.cpp
parent4fca88ed02c1f0b5208abf2420f73023de54c23e (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/bbackupd/testbbackupd.cpp')
-rw-r--r--test/bbackupd/testbbackupd.cpp21
1 files changed, 12 insertions, 9 deletions
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();