]>
git.proxmox.com Git - ceph.git/blob - ceph/qa/workunits/suites/cephfs_journal_tool_smoke.sh
fe9b60ab57e4b914c536c1330554140aa32ad94b
6 export BIN
="${BIN:-cephfs-journal-tool}"
7 export JOURNAL_FILE
=/tmp
/journal.bin
8 export JSON_OUTPUT
=/tmp
/json.tmp
9 export BINARY_OUTPUT
=/tmp
/binary.tmp
11 if [ -d $BINARY_OUTPUT ] ; then
15 # Check that the import/export stuff really works as expected
16 # first because it's used as the reset method between
18 echo "Testing that export/import cycle preserves state"
19 HEADER_STATE
=`$BIN header get`
20 EVENT_LIST
=`$BIN event get list`
21 $BIN journal
export $JOURNAL_FILE
22 $BIN journal import
$JOURNAL_FILE
23 NEW_HEADER_STATE
=`$BIN header get`
24 NEW_EVENT_LIST
=`$BIN event get list`
26 if [ ! "$HEADER_STATE" = "$NEW_HEADER_STATE" ] ; then
27 echo "Import failed to preserve header state"
29 echo $NEW_HEADER_STATE
33 if [ ! "$EVENT_LIST" = "$NEW_EVENT_LIST" ] ; then
34 echo "Import failed to preserve event state"
40 echo "Testing 'journal' commands..."
42 # Simplest thing: print the vital statistics of the journal
46 # Make a copy of the journal in its original state
47 $BIN journal
export $JOURNAL_FILE
48 if [ ! -s $JOURNAL_FILE ] ; then
49 echo "Export to $JOURNAL_FILE failed"
53 # Can we execute a journal reset?
58 # Can we import what we exported?
59 $BIN journal import
$JOURNAL_FILE
61 echo "Testing 'event' commands..."
62 $BIN event get summary
63 $BIN event get
--type=UPDATE
--path=/ --inode=0 --frag=0x100 summary
64 $BIN event get json
--path $JSON_OUTPUT
65 if [ ! -s $JSON_OUTPUT ] ; then
66 echo "Export to $JSON_OUTPUT failed"
69 $BIN event get binary
--path $BINARY_OUTPUT
70 if [ ! -s $BINARY_OUTPUT ] ; then
71 echo "Export to $BINARY_OUTPUT failed"
74 $BIN event apply summary
75 $BIN event splice summary
77 echo "Rolling back journal to original state..."
78 $BIN journal import
$JOURNAL_FILE
80 echo "Testing 'header' commands..."
83 $BIN header
set write_pos
123
84 $BIN header
set expire_pos
123
85 $BIN header
set trimmed_pos
123
87 echo "Rolling back journal to original state..."
88 $BIN journal import
$JOURNAL_FILE