From 4a3a9c5be5732d448c3c2d255b5b779918442f5d Mon Sep 17 00:00:00 2001 From: Richard Henwood Date: Fri, 26 Apr 2013 10:39:09 -0500 Subject: [PATCH] LU-1606 api: compile and build lustreapi test To avoid regression of the client api conf-sanity includes a new test 73 to verify the lustreapi can be compiled and linked against. All the files in the directory $LUSTRE_TESTS_API_DIR with the extension .c are compiled and linked. The directory is located in the build tree at ./lustre/tests/clientapi. Signed-off-by: Richard Henwood Change-Id: I0ad6a1671bf7033ec2ad5bc7a82d82e468cd31c2 Reviewed-on: http://review.whamcloud.com/3440 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/Makefile.am | 1 + lustre/tests/clientapi/simple_test.c | 37 ++++++++++++++++++++++++++++++++++++ lustre/tests/conf-sanity.sh | 12 ++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 lustre/tests/clientapi/simple_test.c diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index 11a22c2..d6db98a 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -44,6 +44,7 @@ nobase_noinst_SCRIPTS += racer/file_link.sh racer/file_rename.sh racer/file_syml nobase_noinst_SCRIPTS += racer/dir_remote.sh nobase_noinst_SCRIPTS += rmtacl/make-tree rmtacl/run nobase_noinst_SCRIPTS += posix/posix.cfg +nobase_noinst_SCRIPTS += clientapi/simple_test.c nobase_noinst_DATA = acl/cp.test acl/getfacl-noacl.test acl/inheritance.test nobase_noinst_DATA += acl/misc.test acl/permissions.test acl/setfacl.test nobase_noinst_DATA += rmtacl/misc.test rmtacl/permissions.test diff --git a/lustre/tests/clientapi/simple_test.c b/lustre/tests/clientapi/simple_test.c new file mode 100644 index 0000000..1205632 --- /dev/null +++ b/lustre/tests/clientapi/simple_test.c @@ -0,0 +1,37 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will 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 version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ + +/* Copyright (c) 2012 Intel Corporporation. All rights reserved. + * Use is subject to license terms. */ + +/* A simple program to test the headers and libraray are + * available. + */ + +#include + +int main(int argc, char *argv[]) +{ + struct lov_user_md lum; + + return llapi_file_get_stripe(argv[1], &lum); +} diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index 12deabb..ae77611 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -49,6 +49,7 @@ 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 @@ -4006,6 +4007,17 @@ 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" + if ! combined_mgs_mds ; then stop mgs fi -- 1.8.3.1