Whamcloud - gitweb
LU-13168 tests: verify truncated xattr is handled
[fs/lustre-release.git] / lustre / tests / sanity-lnet.sh
index d9b6819..b7217e0 100755 (executable)
@@ -109,9 +109,7 @@ setup_netns() {
 
 cleanup_netns() {
        (ip netns list | grep -q $TESTNS) && ip netns del $TESTNS
-       if ip link show test1pl >/dev/null 2>&1; then
-               ip link del test1pl
-       fi
+       ip link show test1pl >& /dev/null && ip link del test1pl || return 0
 }
 
 configure_dlc() {
@@ -1179,6 +1177,39 @@ test_203() {
 }
 run_test 203 "add a network using an interface in the non-default namespace"
 
+test_300() {
+       # LU-13274
+       local header
+       local out=$TMP/$tfile
+       local prefix=/usr/include/linux/lnet
+
+       # We use a hard coded prefix so that this test will not fail
+       # when run in tree.
+       CC=${CC:-cc}
+       if ! which $CC > /dev/null 2>&1; then
+               skip_env "$CC is not installed"
+       fi
+
+       cleanup_lnet || exit 1
+       load_lnet
+
+       if ! [[ -d $prefix ]]; then
+               # Assume we're running in tree and fixup the include path.
+               prefix=$LUSTRE/../lnet/include/uapi/linux/lnet
+       fi
+
+       for header in $prefix/*.h; do
+               if ! [[ -f "$header" ]]; then
+                       continue
+               fi
+
+               $CC -Wall -Werror -std=c99 -include $header -c -x c /dev/null -o $out ||
+                       error "cannot compile '$header'"
+       done
+       rm -f $out
+}
+run_test 300 "packaged LNet UAPI headers can be compiled"
+
 complete $SECONDS
 
 cleanup_testsuite