From: John L. Hammond Date: Tue, 6 May 2014 17:30:02 +0000 (-0500) Subject: LU-4998 lustre: unpackage several headers X-Git-Tag: 2.5.59~1 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=34681daa268ef41230ef90ed2fb507d0607ef73e;ds=sidebyside LU-4998 lustre: unpackage several headers 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 Change-Id: I0e99e3e0d18907488f2f8c94e33c58990262ee8a Reviewed-on: http://review.whamcloud.com/10215 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Robert Read --- diff --git a/lustre/include/lustre/Makefile.am b/lustre/include/lustre/Makefile.am index e0abff4..bd3dee9 100644 --- a/lustre/include/lustre/Makefile.am +++ b/lustre/include/lustre/Makefile.am @@ -37,8 +37,7 @@ # 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 \ diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 8595230..1c8c8c0 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -49,7 +49,6 @@ PTLDEBUG=${PTLDEBUG:--1} 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 @@ -4409,17 +4408,6 @@ test_73() { #LU-3006 } 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 diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index e9e29f3..b64924c 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -38,6 +38,7 @@ export PATH=$PATH:/sbin TMP=${TMP:-/tmp} +CC=${CC:-cc} 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)} +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} @@ -12772,6 +12774,63 @@ test_300g() { } 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 #