xfs: find libxfs api violations
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 3 Jan 2018 19:22:00 +0000 (11:22 -0800)
committerEryu Guan <eguan@redhat.com>
Tue, 9 Jan 2018 10:33:24 +0000 (18:33 +0800)
New test to run tools/find-api-violations.sh in xfsprogs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
tests/xfs/437 [new file with mode: 0755]
tests/xfs/437.out [new file with mode: 0644]
tests/xfs/group

diff --git a/tests/xfs/437 b/tests/xfs/437
new file mode 100755 (executable)
index 0000000..c249b96
--- /dev/null
@@ -0,0 +1,56 @@
+#! /bin/bash
+# FS QA Test No. 437
+#
+# find-api-violations test
+#
+# The purpose of this test is ensure that the xfsprogs programs use the
+# libxfs_ symbols (in libxfs-api-defs.h) instead of raw xfs_ functions.
+# This is for the maintainers; it's not a functionality test.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2018 Oracle, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+#-----------------------------------------------------------------------
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+[ -z "$WORKAREA" ] && \
+       _notrun "Can't run find-api-violations.sh without WORKAREA set"
+[ -f "$WORKAREA/tools/find-api-violations.sh" ] || \
+       _notrun "Can't find find-api-violations.sh tool under \"$WORKAREA\""
+
+echo "Silence is golden."
+
+# Look for API usage problems.  Old versions of the script have an improperly
+# specified grep pattern that is mistaken for a (broken) range specifier in
+# LC_ALL=C, so use English instead.
+(cd "$WORKAREA" ; LC_ALL="en_US.UTF-8" bash ./tools/find-api-violations.sh ) | tee -a $seqres.full
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/437.out b/tests/xfs/437.out
new file mode 100644 (file)
index 0000000..78e57ee
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 437
+Silence is golden.
index d23006041ea29386f096fc1c7bf0cd95a7a4db19..7de3ef0b51c8ba90ef0b9135ed48bf668cf6543d 100644 (file)
 434 auto quick clone fsr
 435 auto quick clone
 436 auto quick clone fsr
+437 auto quick other