| Commit message (Collapse) | Author | Age |
... | |
|
|
|
|
|
|
|
|
|
|
| |
NetBSD (version 6) uses ENOTSUP as the errno code to indicate missing support
for extended attribute in the filesystem. This appears to be at odds with other
Unixes: https://mail-index.netbsd.org/tech-kern/2011/12/13/msg012185.html
We need to detect and handle ENOTSUP to stop the backup daemon from killing
itself while trying to read extended attributes from the first file in the
backup set.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Allows us to catch programming errors related to use of a cached reference
to a directory after the cache may have been invalidated by requesting another
directory from the cache, which could clear it.
In DEBUG builds, the cache is no longer cleared, but any entries in it are
invalidated, which is effectively a memory leak, but these builds should only
be used for running tests, where it doesn't matter.
|
|
|
|
|
|
|
| |
Normally this will be done by housekeeping anyway, so it's not that useful,
but it's good to check for it in tests, especially when testing
BackupStoreCheck's ability to repair bad things that happened to the store
when they involve references.
|
|
|
|
|
|
|
|
|
|
| |
Add a standard method to Replyable that will be called if a recoverable
exception (a BoxException) occurs, and can return a protocol Message to be
sent to the client, such as an error code for various standard errors, or
rethrow the exception.
If you want something different, catch exceptions and return the desired
reply yourself, or you'll get the default handling.
|
| |
|
|
|
|
| |
Use them in testbackupstorefix to reduce code duplication.
|
| |
|
|
|
|
|
|
|
| |
Split single monolithic test into many smaller ones, which can be run
separately. Allows easier testing of new features in isolation.
Merged back changes from the test refactor branch to reduce diffs.
|
|
|
|
|
|
|
|
|
|
|
| |
Store the current working directory at the beginning of the first test, and
restore it at the beginning of every subsequent test.
Improve cleanup after tests: delete and recreate the bbackupd state directory.
Remove check for reference counts and account errors from tearDown, because
they are too hard to retrofit to testbbackupd, and already copied into
testbackupstore tearDown.
|
|
|
|
| |
May help to debug issues with directory cache invalidation in future.
|
|
|
|
| |
Merged back changes from the test refactor branch to reduce diffs.
|
|
|
|
| |
Merged back changes from the test refactor branch to reduce diffs.
|
|
|
|
|
|
| |
Hopefully all of these changes are inconsequential.
Merged back changes from the test refactor branch to reduce diffs.
|
|
|
|
|
|
|
|
|
| |
Merged back changes from the test refactor branch to reduce diffs.
Fix wrong setting of log level in compare() function.
We want to only show errors if we expect mismatches, and show warnings if we
didn't expect mismatches. I had it the other way around before.
|
|
|
|
|
|
|
| |
For some reason the timing changed and the test was no longer waiting for the
same length of time as bbackupd, causing it to fail.
Merged back changes from the test refactor branch to reduce diffs.
|
| |
|
|
|
|
| |
Mute the mismatch message, as there are just too many of them.
|
|
|
|
|
|
|
|
| |
If the system is suspended then it may not realise that a TCP connection has
been closed, while waiting for data to arrive on it. We didn't used to apply
a timeout to this read operation. Now we use the connection's default timeout
on all read and write operations. Network operations that don't pass a timeout
will be logged with a backtrace, so that they can be fixed.
|
| |
|
|
|
|
|
|
|
|
| |
Similar to TEST_COMMAND_RETURNS_ERROR_OR, but allows any command or sequence
to cause the error, without direct access to the command message.
Refactor so that TEST_COMMAND_RETURNS_ERROR_OR calls TEST_PROTOCOL_ERROR_OR
to make the assertion on the last error seen by the protocol.
|
| |
|
|
|
|
|
| |
Useful to help debug problems such as invalid file headers when the source
of the stream might not be too obvious.
|
|
|
|
| |
This is hopefully the cause of the segfaults reported by Brendon Baumgartner.
|
| |
|
| |
|
|
|
|
|
| |
Makes the daemon responsive to polling and commands, even during a file
upload operation.
|
| |
|
|
|
|
|
| |
It's incompatible with having a logger that logs everything, regardless of
the global log level.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
This is useful to return from a test if an assertion/check fails, instead of
throwing an exception.
Also add logging of the actual error code received (with name) to
TEST_COMMAND_RETURNS_ERROR(_OR).
|
| |
|
|
|
|
| |
Returns the number of errors found and fixed.
|
|
|
|
| |
It was hardcoded to 0x01234567 due to a copy and paste error.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
An incorrect comment led me to believe that this parameter was the new
directory's AttributesModTime, but actually it was its hash.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
Using methods instead of macros where possible makes debugging easier.
Especially long macros like this one.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Just like adding a file does.
|
|
|
|
|
| |
Allows creating a directory with a specified modtime (in the parent directory entry).
Tests to come shortly.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Was introduced by commit bc8261347880b813af58c4b873e1847cca03778d.
|
| |
|
|
|
|
| |
Fix previous changes by waiting for forked bbstored process during termination.
|