]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
unit tests for PGLog::proc_replica_log 364/head
authorLoic Dachary <loic@dachary.org>
Mon, 17 Jun 2013 09:45:22 +0000 (11:45 +0200)
committerLoic Dachary <loic@dachary.org>
Wed, 19 Jun 2013 18:52:23 +0000 (20:52 +0200)
commit4d77443d87a45991d70e4e58322711c707b351bc
treeb5d2a81e1615b366d731a85288fea57c87db95d4
parente11cc1c8c3412127f4ce686c0146c2c3dcc2aea3
unit tests for PGLog::proc_replica_log

The tests covers 100% of the LOC of proc_replica_log. It is broken down
in 7 cases to enumerate all the situations it must address. Each case
is isolated in a independant code block where the conditions are
reproduced.

All tests are done on omissing and oinfo because they are the only
data structures that can be modified by proc_replica_log.

The first case is a noop and checks that only last_complete gets
updated when there are no logs.

The following case includes entries that are supposed to be ignored (
x7, x8 and xa ), however this is not an actual proof that the code
ignoring them is actually run : it only shows in the code coverage
report.

   The log entry (1,3) modifies the object x9 but the olog entry
   (2,3) deletes it : log is authoritative and the object is added
   to missing. x7 is divergent and ignored. x8 has a more recent
   version in the log and the olog entry is ignored. xa is past
   last_backfill and ignored.

The other cases are a variation of the first case with minimal changes
to make them easier to understand and adapt. For instance most of them
start with a tail that is the same ( object with hash x5 and both at
version 1,1 ).

http://tracker.ceph.com/issues/5213 refs #5213

Signed-off-by: Loic Dachary <loic@dachary.org>
src/test/osd/TestPGLog.cc