From 7f608415063f04a1035bfe7d0f8ddfb9f0215e5c Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Sun, 15 Sep 2013 19:56:25 -0700 Subject: tests: take regression tests out of autotools make run-tests.sh "location independent" and replace 'make install' with cpio in glusterfs.spec.in Change-Id: I140473c7f558e1e0af93a863b79098ced516a76b BUG: 764966 Signed-off-by: Anand Avati Reviewed-on: http://review.gluster.org/5986 Reviewed-by: Harshavardhana Tested-by: Gluster Build System --- Makefile.am | 5 ++--- configure.ac | 3 +-- glusterfs.spec.in | 6 ++++-- run-tests.sh | 30 ++++++++++++++++++++++++++++++ run-tests.sh.in | 31 ------------------------------- tests.mk | 8 -------- 6 files changed, 37 insertions(+), 46 deletions(-) create mode 100755 run-tests.sh delete mode 100755 run-tests.sh.in delete mode 100644 tests.mk diff --git a/Makefile.am b/Makefile.am index 2210492db..598ebb410 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1,10 @@ -include $(top_srcdir)/tests.mk - EXTRA_DIST = autogen.sh \ COPYING-GPLV2 COPYING-LGPLV3 \ INSTALL README AUTHORS THANKS NEWS \ glusterfs.spec glusterfs-api.pc.in libgfchangelog.pc.in \ error-codes.json gf-error-codes.h.template \ - gen-headers.py + gen-headers.py run-tests.sh \ + $(shell find $(top_srcdir)/tests -type f -print) SUBDIRS = argp-standalone libglusterfs rpc api xlators glusterfsd \ $(FUSERMOUNT_SUBDIR) doc extras cli @SYNCDAEMON_SUBDIR@ diff --git a/configure.ac b/configure.ac index 940dde40c..e723dfabc 100644 --- a/configure.ac +++ b/configure.ac @@ -167,8 +167,7 @@ AC_CONFIG_FILES([Makefile geo-replication/Makefile geo-replication/src/Makefile geo-replication/syncdaemon/Makefile - glusterfs.spec - run-tests.sh]) + glusterfs.spec]) AC_CANONICAL_HOST diff --git a/glusterfs.spec.in b/glusterfs.spec.in index 39fc23aa6..96341adf9 100644 --- a/glusterfs.spec.in +++ b/glusterfs.spec.in @@ -588,6 +588,8 @@ touch %{buildroot}%{_sharedstatedir}/glusterd/options touch %{buildroot}%{_sharedstatedir}/glusterd/nfs/nfs-server.vol touch %{buildroot}%{_sharedstatedir}/glusterd/nfs/run/nfs.pid +find ./tests ./run-tests.sh -type f | cpio -pd %{buildroot}%{_prefix}/share/glusterfs + %clean %{__rm} -rf %{buildroot} @@ -790,8 +792,8 @@ fi %files regression-tests %defattr(-,root,root,-) -%{_datarootdir}/glusterfs/* -%exclude %{_datarootdir}/glusterfs/tests/basic/rpm.t +%{_prefix}/share/glusterfs/* +%exclude %{_prefix}/share/glusterfs/tests/basic/rpm.t %post server # Legacy server diff --git a/run-tests.sh b/run-tests.sh new file mode 100755 index 000000000..128404ed5 --- /dev/null +++ b/run-tests.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Copyright (c) 2013 Red Hat, Inc. +# + +function _init() +{ + regression_testsdir=$(dirname $0); + + if [ ! -f ${regression_testsdir}/tests/include.rc ]; then + echo "Seems like GlusterFS quality tests are corrupted..aborting!!" + exit 1 + fi +} + +function main() +{ + if [ $# -lt 1 ]; then + echo "Running all the regression test cases" + prove -rf --timer ${regression_testsdir}/tests; + else + ## TODO + echo "Running single regression test.." + echo "WARNING: yet to be implemented.. exiting safely" + exit 0 + #export DEBUG=1; + #echo "Automatically setting up DEBUG=1 for this test $1"; + fi +} + +_init "$@" && main "$@" diff --git a/run-tests.sh.in b/run-tests.sh.in deleted file mode 100755 index a75b68171..000000000 --- a/run-tests.sh.in +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# Copyright (c) 2013 Red Hat, Inc. -# - -function _init() -{ - prefix="@prefix@"; - exec_prefix="@exec_prefix@"; - regression_testsdir="@datarootdir@/glusterfs"; - if [ ! -f ${regression_testsdir}/tests/include.rc ]; then - echo "Seems like GlusterFS quality tests are corrupted..aborting!!" - exit 1 - fi -} - -function main() -{ - if [ $# -lt 1 ]; then - echo "Running all the regression test cases" - prove -rf --timer ${regression_testsdir}/tests; - else - ## TODO - echo "Running single regression test.." - echo "WARNING: yet to be implemented.. exiting safely" - exit 0 - #export DEBUG=1; - #echo "Automatically setting up DEBUG=1 for this test $1"; - fi -} - -_init "$@" && main "$@" diff --git a/tests.mk b/tests.mk deleted file mode 100644 index 4760b76c8..000000000 --- a/tests.mk +++ /dev/null @@ -1,8 +0,0 @@ -ALL_TEST_FILES = $(shell find $(top_srcdir)/tests -type f -print) - -regressiontestsdir = $(datarootdir)/glusterfs - -nobase_dist_regressiontests_DATA = $(ALL_TEST_FILES) run-tests.sh - -install-data-hook: - chmod +x $(DESTDIR)$(datarootdir)/glusterfs/run-tests.sh -- cgit