Whamcloud - gitweb
LU-6142 llite: use %pd to report dentry names.
[fs/lustre-release.git] / lustre / tests / sanity-lnet.sh
index bd8de8f..b7217e0 100755 (executable)
@@ -48,6 +48,7 @@ if module_loaded lnet ; then
 fi
 
 cleanup_testsuite() {
+       trap "" EXIT
        rm -f $TMP/sanity-dlc*
        cleanup_netns
        cleanup_lnet
@@ -108,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() {
@@ -223,6 +222,8 @@ validate_gateway_nids() {
 cleanupall -f
 setup_netns || error "setup_netns failed with $?"
 
+stack_trap 'cleanup_testsuite' EXIT
+
 test_0() {
        load_module ../lnet/lnet/lnet || error "Failed to load module rc = $?"
        do_lnetctl lnet configure || error "lnet configure failed rc = $?"
@@ -1046,7 +1047,7 @@ route:
       health_sensitivity: 1
 peer:
     - primary nid: 7.7.7.7@tcp
-      Multi-Rail: True
+      Multi-Rail: False
       peer ni:
         - nid: 7.7.7.7@tcp
 EOF
@@ -1088,15 +1089,15 @@ route:
       health_sensitivity: 1
 peer:
     - primary nid: 8.8.8.9@tcp
-      Multi-Rail: True
+      Multi-Rail: False
       peer ni:
         - nid: 8.8.8.9@tcp
     - primary nid: 8.8.8.10@tcp
-      Multi-Rail: True
+      Multi-Rail: False
       peer ni:
         - nid: 8.8.8.10@tcp
     - primary nid: 8.8.8.8@tcp
-      Multi-Rail: True
+      Multi-Rail: False
       peer ni:
         - nid: 8.8.8.8@tcp
 EOF
@@ -1176,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