summaryrefslogtreecommitdiff
path: root/lib/backupstore/StoreTestUtils.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/backupstore/StoreTestUtils.h')
-rw-r--r--lib/backupstore/StoreTestUtils.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/backupstore/StoreTestUtils.h b/lib/backupstore/StoreTestUtils.h
index 197a3345..2fc7ca64 100644
--- a/lib/backupstore/StoreTestUtils.h
+++ b/lib/backupstore/StoreTestUtils.h
@@ -30,7 +30,10 @@ extern int bbstored_pid;
bool setUp(const char* function_name);
//! Checks account for errors and shuts down daemons at end of every test.
-void tearDown();
+bool tearDown();
+
+//! Like tearDown() but returns false, because a test failure was detected.
+bool fail();
//! Sets the expected refcount of an object, resizing vector if necessary.
void set_refcount(int64_t ObjectID, uint32_t RefCount = 1);
@@ -42,9 +45,12 @@ void init_context(TLSContext& rContext);
std::auto_ptr<SocketStream> open_conn(const char *hostname,
TLSContext& rContext);
+//! Opens a connection to the server (bbstored) without logging in.
+std::auto_ptr<BackupProtocolCallable> connect_to_bbstored(TLSContext& rContext);
+
//! Opens a connection to the server (bbstored) and logs in.
-std::auto_ptr<BackupProtocolCallable> test_server_login(const char *hostname,
- TLSContext& rContext, int flags = 0);
+std::auto_ptr<BackupProtocolCallable> connect_and_login(TLSContext& rContext,
+ int flags = 0);
//! Checks the number of files of each type in the store against expectations.
bool check_num_files(int files, int old, int deleted, int dirs);
@@ -53,6 +59,9 @@ bool check_num_files(int files, int old, int deleted, int dirs);
bool check_num_blocks(BackupProtocolCallable& Client, int Current, int Old,
int Deleted, int Dirs, int Total);
+//! Change the soft and hard limits on the test account.
+bool change_account_limits(const char* soft, const char* hard);
+
//! Checks an account for errors, returning the number of errors found and fixed.
int check_account_for_errors(Log::Level log_level = Log::WARNING);