]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: extend cephfs_journal_tool_smoke 1947/head
authorJohn Spray <jspray@redhat.com>
Thu, 12 Jun 2014 13:44:04 +0000 (14:44 +0100)
committerJohn Spray <john.spray@redhat.com>
Fri, 13 Jun 2014 10:39:56 +0000 (11:39 +0100)
To provide coverage for the 'import' command
resulting in the same contents as before an
export/import cycle.

Signed-off-by: John Spray <john.spray@redhat.com>
qa/workunits/suites/cephfs_journal_tool_smoke.sh

index 91ec952f4d44107193059c6aff234fae4d790c20..fddcf2e2d9ef0529365ec3ad86c89ed1557a93e7 100755 (executable)
@@ -12,6 +12,31 @@ if [ -d $BINARY_OUTPUT ] ; then
     rm -rf $BINARY_OUTPUT
 fi
 
+# Check that the import/export stuff really works as expected
+# first because it's used as the reset method between
+# following checks.
+echo "Testing that export/import cycle preserves state"
+HEADER_STATE=`$BIN header get`
+EVENT_LIST=`$BIN event get list 2>&1`
+$BIN journal export $JOURNAL_FILE
+$BIN journal import $JOURNAL_FILE
+NEW_HEADER_STATE=`$BIN header get`
+NEW_EVENT_LIST=`$BIN event get list 2>&1`
+
+if [ ! "$HEADER_STATE" = "$NEW_HEADER_STATE" ] ; then
+    echo "Import failed to preserve header state"
+    echo $HEADER_STATE
+    echo $NEW_HEADER_STATE
+    exit -1
+fi
+
+if [ ! "$EVENT_LIST" = "$NEW_EVENT_LIST" ] ; then
+    echo "Import failed to preserve event state"
+    echo $EVENT_LIST
+    echo $NEW_EVENT_LIST
+    exit -1
+fi
+
 echo "Testing 'journal' commands..."
 
 # Simplest thing: print the vital statistics of the journal