]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/122: don't break on old xfsprogs
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 31 May 2016 16:43:52 +0000 (09:43 -0700)
committerEryu Guan <eguan@redhat.com>
Wed, 15 Jun 2016 07:44:49 +0000 (15:44 +0800)
If we're running against a old version of xfsprogs that lacks some
of the structures that the golden output knows about, copy the
structure size definition from the golden output to the program
output.  This way we can check for structure size mutations on old
xfsprogs without generating false error reports for structs that
don't exist in the old release.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/xfs/122
tests/xfs/122.out

index 845cdd2bdd6216f4730d5de5025a9355b9742dd7..330d3ac696c143496eb0b6acdd422c12e6058a19 100755 (executable)
@@ -73,6 +73,7 @@ _attribute_filter()
 cprog=$tmp.get_structs.c
 oprog=$tmp.get_structs
 progout=$tmp.output
+keyfile=$tmp.keys
 
 cat >$cprog <<EOF
 #define _GNU_SOURCE
@@ -226,18 +227,12 @@ cc -o $oprog $cprog >> $seqres.full 2>&1 || \
   _notrun "Could not compile test program (see end of $seqres.full)"
 $oprog | _type_size_filter | _type_name_filter > $progout
 
-#
-# add addition sizes and xfs_sb_t fields that don't exist in the version
-# being tested.
-#
+# Find all the items that only exist in the golden output
+comm -23 <(grep '=' $0.out | sed -e 's/ =.*$//g' | LC_COLLATE=POSIX sort) \
+        <(sed -e 's/ =.*$//g' < $progout | LC_COLLATE=POSIX sort) > $keyfile
 
-# xfsprogs 2.9.8: sb_bad_features2 in pv 978822
-if [ $XFSPROGS_VERSION -lt 20908 ]; then
-       echo 'offsetof(xfs_sb_t, sb_bad_features2 ) = 204' >>$progout
-fi
-if [ $XFSPROGS_VERSION -lt 30000 ]; then
-       echo 'sizeof( xfs_dsb_t ) = 208' >>$progout;
-fi
+# Copy those items to the program output
+grep -F -f $keyfile $0.out >> $progout
 
 LC_COLLATE=POSIX sort $progout
 
index 451871ebb3116e2206bc255dfe196d1e6d774c94..46d1dd4d16e927627fc7ddf5167439cd1256cc66 100644 (file)
@@ -147,3 +147,4 @@ sizeof(xfs_lookup_t) = 4
 sizeof(xfs_qoff_logformat_t) = 20
 sizeof(xfs_timestamp_t) = 8
 sizeof(xfs_trans_header_t) = 16
+sizeof(xfs_zzzz_test_the_test_program) = -47