summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Don't require passing the object ID into BackupStoreContext::SaveDirectory.Chris Wilson2014-04-09
| | | | | | | Passing the wrong object ID would just result in an assertion being thrown (in debug builds) or silently doing the wrong thing (in release builds). I can't see any useful use for this extra parameter, since we can get the container ID from the directory anyway.
* Add a static GetMessage() to BackupProtocolError.Chris Wilson2014-04-09
| | | | | | | | | Allows retrieving the error message for a given code, when we no longer have the protocol object handy. Conflicts: lib/server/makeprotocol.pl.in
* Support microsecond timestamps for files on Linux.Chris Wilson2014-04-09
|
* Don't pass AttributesModTime as the hash of the new directory's attributes.Chris Wilson2014-04-09
| | | | | An incorrect comment led me to believe that this parameter was the new directory's AttributesModTime, but actually it was its hash.
* Fix an exception checking refcounts in housekeeping.Chris Wilson2014-03-02
| | | | | | | | | If the old refcount database was shorter than the new one, then we could end up trying to access a nonexistent refcount, triggering an exception, which prevented all comparison of the old and new refcount databases. Also, from now on, a mismatch between old and new refcounts is treated as a housekeeping error, which is detectable in tests.
* Whitespace, comments and log messages cleanups.Chris Wilson2014-03-02
|
* Replace most of APPLY_DELTA macro with a new method.Chris Wilson2014-03-02
| | | | | Using methods instead of macros where possible makes debugging easier. Especially long macros like this one.
* 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.
* Use static_cast instead of C-style casts, for C++ style and safety.Chris Wilson2014-03-02
|
* Fix whitespace and comments, remove redundant code in protocol generator.Chris Wilson2014-03-02
|
* Add convenience macro for testing commands that return errors.Chris Wilson2014-03-02
|
* Fix memory leak in local protocol.Chris Wilson2014-03-02
| | | | | When a command fails with an error, and CheckReply throws an exception, the mStreamsToSend were not deleted.
* Add information about last exchange when wrong type of object received.Chris Wilson2014-03-02
| | | | | | | | | | Helps with debugging ConnectionException::Protocol_StreamWhenObjExpected and ConnectionException::Protocol_ObjWhenStreamExpected errors, which may be caused by a command returning an error message and failing to consume any uploaded streams first. Add extra debugging in ProtocolLocal objects to detect when this happens during the command itself, which helps with debugging.
* SpellingChris Wilson2014-03-02
|
* Adding a directory when over limit returns an error instead of crashing.Chris Wilson2014-03-02
| | | | Just like adding a file does.
* Add QueryCreateDirectory2 command.Chris Wilson2014-03-02
| | | | | Allows creating a directory with a specified modtime (in the parent directory entry). Tests to come shortly.
* 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.
* Fix Clang warning about passing NULL as a string.Chris Wilson2014-02-27
|
* Check number of blocks used before the test that was failing.Chris Wilson2014-02-27
|
* Use an in-process BackupDaemon for some intercept tests.Chris Wilson2014-02-27
| | | | It's much easier to debug these tests if we can step into them.
* Don't throw a wobbly while backing up if files don't exist.Chris Wilson2014-02-27
| | | | | | | Reading extended attributes may fail with an error if the file was removed (race condition) or in tests when generating random nonexistent directory entries. Handle this more gracefully by not backing up the extended attributes instead of dying completely.
* Start converting MinGW instructions to 64-bit Cygwin.Chris Wilson2014-02-27
|
* Simplify exception handling by using std::auto_ptr.Chris Wilson2014-02-27
| | | | | Will result in the directory automatically being freed, whether or not an exception occurs.
* 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.
* Fix crash in BackupStoreContext with no HousekeepingInterface pointer.Chris Wilson2014-02-27
| | | | | | Rename mrDaemon to mpHousekeeping and make it a pointer, so that it can officially be NULL, and don't crash if it is, and we fail to get a lock on the account.
* Shorthand check for deleted flag.Chris Wilson2014-02-27
|
* Fix buggy directory deletion by housekeeping.Chris Wilson2014-02-27
| | | | Was introduced by commit bc8261347880b813af58c4b873e1847cca03778d.
* Allow read-only account check without taking a write lock on account.Chris Wilson2014-02-27
|
* 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.
* Use the new test utilities to remove some duplicate code.Chris Wilson2014-02-27
| | | | Fix previous changes by waiting for forked bbstored process during termination.
* Move test utilities into a separate file, to share with testbbackupd.Chris Wilson2014-02-27
|
* Fix memory leak in bbackupquery readline completion.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.
* Check that adding a new directory doesn't exceed store limits.Chris Wilson2014-02-13
|
* Add a shortcut interface to uploading a new file.Chris Wilson2014-02-13
| | | | Useful in tests.
* 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.
* The new backupstore check detects 4 errors instead of 3, adjust test to match.Chris Wilson2014-02-11
|
* Re-enable the disabled test_dir_fixingChris Wilson2014-02-11
|
* Remove unnecessary importChris Wilson2014-02-11
|
* Don't consider it an error if LastObjectIDUsed changes during check.Chris Wilson2014-02-11
| | | | | There could be many reasons for this, including an invalid object being deleted during the previous check run. And it's definitely not serious.