summaryrefslogtreecommitdiff
path: root/test/backupstore
Commit message (Collapse)AuthorAge
* Add timeouts to network operations that are missing them.Chris Wilson2014-08-15
|
* Remove ServerException.h and the exception code aliases that it defines.Chris Wilson2014-08-15
| | | | We don't really need these, so clean up by removing them.
* Whitespace fixes.Chris Wilson2014-04-29
|
* Fix error when modifying a directory with missing entry in parent.Chris Wilson2014-04-29
| | | | This is hopefully the cause of the segfaults reported by Brendon Baumgartner.
* Remove the global logging level.Chris Wilson2014-04-09
| | | | | It's incompatible with having a logger that logs everything, regardless of the global log level.
* Directories' entries in parent directory should track current size.Chris Wilson2014-04-09
| | | | | | | | | | | | | | | | | | | | | | When entries are added to a directory by a command (BackupStoreContext), and when entries are removed from a directory (by housekeeping), update the parent directory's entry for us if our size has changed. Make BackupStoreCheck check for, report and fix errors when directory entries are directories and the size is wrong (as well as files). Conflicts: test/backupstore/testbackupstore.cpp Fix directories loaded without size being set, leading to warnings later. We can't check that the old size in the parent entry matched the old real size of the directory, unless we set the old real size in the directory. And we don't need to pass the old directory size to HousekeepStoreAccount::DeleteFile, because we can get it from the directory itself.
* Replace magic numbers with named constants for readability.Chris Wilson2014-04-09
|
* Add a Reopen method to BackupProtocolLocal2 for convenience.Chris Wilson2014-04-09
|
* Remove unnecessary link to HousekeepStoreAccount.oChris Wilson2014-03-02
|
* Always flush any incoming stream on server side.Chris Wilson2014-03-02
| | | | | | | | | | Otherwise the protocol might be broken and can't be used any more, even if we made an effort to return an Error reply instead of throwing an exception. This used to not be a problem because an Error reply would terminate the connection anyway, but it no longer does. So if the client also didn't terminate, but tried to handle the exception and keep using the connection, then it might find that its next command fails because the protocol is broken.
* Adding a directory when over limit returns an error instead of crashing.Chris Wilson2014-03-02
| | | | Just like adding a file does.
* Simplify codeChris Wilson2014-03-02
|
* Make Protocol take control of the socket object passed in.Chris Wilson2014-03-01
| | | | | | | | | | | | | We pass a std::auto_ptr<SocketStream> to every Protocol subclass when we construct it, and it takes control of this object. This reduces the risk of: * accidentally reusing the same SocketStream for multiple Protocols (it happened to me in testbackupstore); * holding onto a reference to the SocketStream; * allowing a locally-scoped SocketStream to go out of scope and be released while still being referenced by a live Protocol.
* Add extra checks for block counting during backup operations.Chris Wilson2014-02-27
| | | | | | Fix the new tests so that they mostly pass. To squash. Remove the test for nonexistent GetObject, not implemented yet. To squash.
* Test that deleting a directory doesn't leave errors in the store.Chris Wilson2014-02-27
| | | | | If it fails to clear the reference counts properly, it will leave objects still existing, and checking the account will reattach them.
* Move test utilities into a separate file, to share with testbbackupd.Chris Wilson2014-02-27
|
* Rename tests. Split up and refactor.Chris Wilson2014-02-27
| | | | | | Use SETUP macro and tearDown function in tests. Make tests return bool instead of int, and check it.
* Revert part of patch that caused compile errors.Chris Wilson2014-02-13
| | | | This reverts commit 59c3fdf8be1def3f237a4b51eb27773b4f42bbcd.
* Change some TEST_THAT assertions to TEST_EQUAL.Chris Wilson2014-02-13
| | | | | | Being able to see the actual and expected values helps with debugging. More cleanup of comments.
* White space and comment fixes.Chris Wilson2014-02-13
|
* Compile fix. Remove redefinition of ExpectedRefCounts.Chris Wilson2014-02-13
|
* Compile fix.Chris Wilson2014-02-13
| | | | Move ExpectedRefCounts definition to where it's needed.
* Add a convenience constructor to read a BackupStoreDirectory from a stream.Chris Wilson2014-02-13
| | | | Saves ~2 lines each time it's used. And we use it a lot in testbackupstore.
* Compile fix.Chris Wilson2014-02-13
|
* Add some utility methods.Chris Wilson2014-02-13
| | | | Backported from new testbackupstore, to reduce diff.
* Overwrite existing files left by previous tests.Chris Wilson2014-02-13
| | | | | | Will help to ensure that individual test cases run properly, even if a previous test didn't clear up after itself. Splitting up testbackupstore into idempotent testcases is coming soon.
* Compile fixes.Chris Wilson2014-02-11
| | | | | Backport a few new functions to simplify tests.
* Fix testbackupstore, apart from wrong accounting for old files.Chris Wilson2014-02-10
|
* Rename BackupStoreInfo variable NumFiles to NumCurrentFiles.Chris Wilson2014-02-09
| | | | | Will hopefully prevent future confusion about the meaning of this info variable.
* Fix some backupstore test failures caused by refcount db changes.Chris Wilson2014-02-08
|
* Add a test that Used block counts match expected values.Chris Wilson2013-10-22
|
* Fix test fallout from SendStream ptr to auto_ptr change.Chris Wilson2013-09-30
| | | | | You can only pass a std::auto_ptr<IOStream> to SendStream now. Nothing else will do for Clang. But you can cast a std::auto_ptr<subclass>.
* Fix testbackupstore: don't keep using a reference to a protocol objectChris Wilson2012-11-18
| | | | | that's been disposed (Windows only).
* Link to HousekeepStoreAccount.o in the right directory since the big refactor.Chris Wilson2012-11-08
|
* Ensure that newly created accounts are enabled by default.Chris Wilson2012-11-08
|
* Test that BackupStoreInfo::CreateForRegeneration saves AccountEnabledChris Wilson2012-11-08
| | | | | flag and ExtraData.
* Test that the BackupStoreInfo AccountEnabled flag works properly, and isChris Wilson2012-10-22
| | | | | | | | | loaded and saved properly, and the "bbstoreaccounts enabled" command works. Test that the conversion of historic BackupStoreInfo v1 format files works properly.
* Combine client and server protocols to make way for an offline/local protocol.Chris Wilson2011-08-27
| | | | | Rename ProtocolObject to Message.
* Fix compile error on Windows.Chris Wilson2011-01-09
|
* Test that numbers of files are adjusted correctly during normal store Chris Wilson2010-08-27
| | | | | operations.
* Test that housekeeping can recreate the refcount database if it's Chris Wilson2009-06-28
| | | | | missing.
* Link testbackupstore against HousekeepStoreAccount so that it can call Chris Wilson2009-06-28
| | | | | housekeeping directly.
* Update reference counts when files and directories are uploaded.Chris Wilson2009-06-28
|
* Change type of BackupStoreFilename not to derive from std::string, soChris Wilson2009-03-29
| | | | | | | | it can't accidentally be used as one. Fix use of encrypted filename in deleted file message, thanks to Kenny Millington for reporting.
* Fix warning about converting string constant to char * on debian lenny.Chris Wilson2008-10-17
|
* Delete bbstored PID file after killing the daemon on Windows, as the Chris Wilson2008-03-01
| | | | | daemon can't clean up after itself.
* Add a sleep after every access to the read-only connection, to ensure thatChris Wilson2008-01-31
| | | | | | subsequent changes in the other connection get a new whole-second timestamp and hopefully fix test failures reported by Alex Harper on MacOS X.
* Add some sleeps to ensure that timestamps change enough to invalidateChris Wilson2007-11-04
| | | | | | the directory cache in the store on filesystem with low timestamp resolution (e.g. OSX).
* Use #defined paths for applications to fix cross unix/win32 compatibility.Chris Wilson2007-03-25
| | | | | | | | | Fix memory leak. Reformat comments. (refs #3)
* Moved SendCommands(), HUPServer(), KillServer() to lib/server/ServerCommands.h.Chris Wilson2007-03-10
| | | | | | | | | | | | | | | | | All of these use lib/server/WinNamedPipeStream on Win32, so they don't belong in lib/common. Made LaunchServer() work on Win32. Added constants for paths to executables, for use in tests, removing the need for #ifdefs and clumsy DIRECTORY_SEPARATORs in paths. Added terminate_bbackupd() and wait_for_operation() functions. Update unit tests to #include "ServerControl.h" if they need it. (refs #3)