Whamcloud - gitweb
LU-4998 lustre: unpackage several headers 15/10215/5
authorJohn L. Hammond <john.hammond@intel.com>
Tue, 6 May 2014 17:30:02 +0000 (12:30 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 15 May 2014 16:28:57 +0000 (16:28 +0000)
Remove lustre_idl.h, libiam.h and lustre_lfsck_user.h from the list of
packaged headers. Move conf-sanity 74a (checking that Lustre client
api program can compile and link) to sanity 400a. Add sanity 400b to
check that the headers installed in /usr/include/lustre/ (with the
exception liblustreapi.h) can be compiled without warning.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I0e99e3e0d18907488f2f8c94e33c58990262ee8a
Reviewed-on: http://review.whamcloud.com/10215
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: Robert Read <robert.read@intel.com>
lustre/include/lustre/Makefile.am
lustre/tests/conf-sanity.sh
lustre/tests/sanity.sh

index e0abff4..bd3dee9 100644 (file)
@@ -37,8 +37,7 @@
 #
 
 if UTILS
 #
 
 if UTILS
-pkginclude_HEADERS = lustreapi.h lustre_idl.h lustre_user.h liblustreapi.h \
-       libiam.h ll_fiemap.h lustre_lfsck_user.h
+pkginclude_HEADERS = lustreapi.h lustre_user.h liblustreapi.h ll_fiemap.h
 endif
 
 EXTRA_DIST = lustreapi.h lustre_idl.h lustre_user.h liblustreapi.h \
 endif
 
 EXTRA_DIST = lustreapi.h lustre_idl.h lustre_user.h liblustreapi.h \
index 8595230..1c8c8c0 100644 (file)
@@ -49,7 +49,6 @@ PTLDEBUG=${PTLDEBUG:--1}
 SAVE_PWD=$PWD
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 RLUSTRE=${RLUSTRE:-$LUSTRE}
 SAVE_PWD=$PWD
 LUSTRE=${LUSTRE:-`dirname $0`/..}
 RLUSTRE=${RLUSTRE:-$LUSTRE}
-LUSTRE_TESTS_API_DIR=${LUSTRE_TESTS_API_DIR:-${LUSTRE}/tests/clientapi}
 export MULTIOP=${MULTIOP:-multiop}
 
 . $LUSTRE/tests/test-framework.sh
 export MULTIOP=${MULTIOP:-multiop}
 
 . $LUSTRE/tests/test-framework.sh
@@ -4409,17 +4408,6 @@ test_73() { #LU-3006
 }
 run_test 73 "failnode to update from mountdata properly"
 
 }
 run_test 73 "failnode to update from mountdata properly"
 
-test_74() { # LU-1606
-       for TESTPROG in $LUSTRE_TESTS_API_DIR/*.c; do
-               gcc -Wall -Werror $LUSTRE_TESTS_API_DIR/simple_test.c \
-                       -I$LUSTRE/include \
-                       -L$LUSTRE/utils -llustreapi ||
-                               error "client api broken"
-       done
-       cleanup || return $?
-}
-run_test 74 "Lustre client api program can compile and link"
-
 test_75() { # LU-2374
        [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.4.1) ]] &&
                        skip "Need MDS version at least 2.4.1" && return
 test_75() { # LU-2374
        [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.4.1) ]] &&
                        skip "Need MDS version at least 2.4.1" && return
index e9e29f3..b64924c 100644 (file)
@@ -38,6 +38,7 @@ export PATH=$PATH:/sbin
 
 TMP=${TMP:-/tmp}
 
 
 TMP=${TMP:-/tmp}
 
+CC=${CC:-cc}
 CHECKSTAT=${CHECKSTAT:-"checkstat -v"}
 CREATETEST=${CREATETEST:-createtest}
 LFS=${LFS:-lfs}
 CHECKSTAT=${CHECKSTAT:-"checkstat -v"}
 CREATETEST=${CREATETEST:-createtest}
 LFS=${LFS:-lfs}
@@ -69,6 +70,7 @@ CLEANUP=${CLEANUP:-:}
 SETUP=${SETUP:-:}
 TRACE=${TRACE:-""}
 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
 SETUP=${SETUP:-:}
 TRACE=${TRACE:-""}
 LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
+LUSTRE_TESTS_API_DIR=${LUSTRE_TESTS_API_DIR:-${LUSTRE}/tests/clientapi}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/${NAME}.sh}
 . $LUSTRE/tests/test-framework.sh
 init_test_env $@
 . ${CONFIG:=$LUSTRE/tests/cfg/${NAME}.sh}
@@ -12772,6 +12774,63 @@ test_300g() {
 }
 run_test 300g "check default striped directory for striped directory"
 
 }
 run_test 300g "check default striped directory for striped directory"
 
+test_400a() { # LU-1606, was conf-sanity test_74
+       local extra_flags=''
+       local out=$TMP/$tfile
+       local prefix=/usr/include/lustre
+       local prog
+
+       if ! which $CC > /dev/null 2>&1; then
+               skip_env "$CC is not installed"
+               return 0
+       fi
+
+       if ! [[ -d $prefix ]]; then
+               # Assume we're running in tree and fixup the include path.
+               extra_flags+=" -I$LUSTRE/../libcfs/include"
+               extra_flags+=" -I$LUSTRE/include"
+               extra_flags+=" -L$LUSTRE/utils"
+       fi
+
+       for prog in $LUSTRE_TESTS_API_DIR/*.c; do
+               $CC -Wall -Werror $extra_flags -llustreapi -o $out $prog ||
+                       error "client api broken"
+       done
+}
+run_test 400a "Lustre client api program can compile and link"
+
+test_400b() { # LU-1606, LU-5011
+       local header
+       local out=$TMP/$tfile
+       local prefix=/usr/include/lustre
+
+       # We use a hard coded prefix so that this test will not fail
+       # when run in tree. There are headers in lustre/include/lustre/
+       # that are not packaged (like lustre_idl.h) and have more
+       # complicated include dependencies (like config.h and lnet/types.h).
+       # Since this test about correct packaging we just skip them when
+       # they don't exist (see below) rather than try to fixup cppflags.
+
+       if ! which $CC > /dev/null 2>&1; then
+               skip_env "$CC is not installed"
+               return 0
+       fi
+
+       for header in $prefix/*.h; do
+               if ! [[ -f "$header" ]]; then
+                       continue
+               fi
+
+               if [[ "$(basename $header)" == liblustreapi.h ]]; then
+                       continue # liblustreapi.h is deprecated.
+               fi
+
+               $CC -Wall -Werror -include $header -c -x c /dev/null -o $out ||
+                       error "cannot compile '$header'"
+       done
+}
+run_test 400b "packaged headers can be compiled"
+
 #
 # tests that do cleanup/setup should be run at the end
 #
 #
 # tests that do cleanup/setup should be run at the end
 #