summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac3
-rw-r--r--glusterfs.spec.in23
-rwxr-xr-xrun-tests.sh3
-rwxr-xr-xrun-tests.sh.in31
-rw-r--r--tests.mk8
-rw-r--r--tests/README.md (renamed from tests/README)19
-rwxr-xr-xtests/bugs/bug-853258.t2
9 files changed, 78 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
index d3e1a01dd68..0e31d20dc19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -41,4 +41,5 @@ glusterfsd/src/glusterfsd
libglusterfs/src/spec.lex.c
libglusterfs/src/y.tab.c
libglusterfs/src/y.tab.h
-libgfchangelog.pc \ No newline at end of file
+libgfchangelog.pc
+run-tests.sh \ No newline at end of file
diff --git a/Makefile.am b/Makefile.am
index eba8ed12da6..2210492db86 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/tests.mk
+
EXTRA_DIST = autogen.sh \
COPYING-GPLV2 COPYING-LGPLV3 \
INSTALL README AUTHORS THANKS NEWS \
diff --git a/configure.ac b/configure.ac
index e723dfabcf9..940dde40c0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -167,7 +167,8 @@ AC_CONFIG_FILES([Makefile
geo-replication/Makefile
geo-replication/src/Makefile
geo-replication/syncdaemon/Makefile
- glusterfs.spec])
+ glusterfs.spec
+ run-tests.sh])
AC_CANONICAL_HOST
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
index d654c085c10..39fc23aa645 100644
--- a/glusterfs.spec.in
+++ b/glusterfs.spec.in
@@ -1,4 +1,3 @@
-
%global _hardened_build 1
%global _for_fedora_koji_builds 0
@@ -393,6 +392,19 @@ is in user space and easily manageable.
This package provides the api include files.
+%package regression-tests
+Summary: Development Tools
+Group: Development/Tools
+Requires: %{name} = %{version}-%{release}
+Requires: %{name}-fuse = %{version}-%{release}
+Requires: %{name}-server = %{version}-%{release}
+Requires: perl(App::Prove) perl(Test::Harness) gcc util-linux-ng lvm2
+Requires: python attr dbench git nfs-utils xfsprogs
+
+%description regression-tests
+The Gluster Test Framework, is a suite of scripts used for
+regression testing of Gluster.
+
%prep
%setup -q -n %{name}-%{version}%{?prereltag}
%if ( 0%{_for_fedora_koji_builds} )
@@ -776,6 +788,11 @@ fi
%{_libdir}/libgfapi.so
%{_includedir}/glusterfs/api/*
+%files regression-tests
+%defattr(-,root,root,-)
+%{_datarootdir}/glusterfs/*
+%exclude %{_datarootdir}/glusterfs/tests/basic/rpm.t
+
%post server
# Legacy server
%_init_enable glusterd
@@ -839,6 +856,10 @@ if [ $1 -ge 1 ]; then
fi
%changelog
+* Tue Sep 17 2013 Harshavardhana <fharshav@redhat.com>
+- Provide a new package called "glusterfs-regression-tests" for standalone
+ regression testing.
+
* Thu Aug 22 2013 Niels de Vos <ndevos@redhat.com>
- Correct the day/date for some entries in this changelog (#1000019)
diff --git a/run-tests.sh b/run-tests.sh
deleted file mode 100755
index d3c9af2acdb..00000000000
--- a/run-tests.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-prove -rf --timer $(dirname $0)/tests;
diff --git a/run-tests.sh.in b/run-tests.sh.in
new file mode 100755
index 00000000000..a75b68171ff
--- /dev/null
+++ b/run-tests.sh.in
@@ -0,0 +1,31 @@
+#!/bin/bash
+# Copyright (c) 2013 Red Hat, Inc. <http://www.redhat.com>
+#
+
+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
new file mode 100644
index 00000000000..4760b76c825
--- /dev/null
+++ b/tests.mk
@@ -0,0 +1,8 @@
+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
diff --git a/tests/README b/tests/README.md
index 857230acb02..2b5ed8dcd53 100644
--- a/tests/README
+++ b/tests/README.md
@@ -1,26 +1,27 @@
-How to use test script framework.
-=================================
+Regression tests framework for GlusterFS
+========================================
+## Prereq
- Build and install the version of glusterfs with your changes. Make
sure the installed version is accessible from $PATH.
+## How-To
- To mount glusterfs, NEVER use 'mount -t glusterfs', instead use
'glusterfs -s ' method. This is because with the patch build setup
doesnot install the /sbin/mount.glusterfs necessary, where as the
glusterfs binary will be accessible with $PATH, and will pick the
right version.
-
- (optional) Set environment variables to specify location of
export directories and mount points. Unless you have special
requirements, the defaults should just work. The variables
themselves can be found at the top of tests/include.rc. All
of them can be overriden with environment variables.
-- Execute run-tests.sh in the top level directory as root.
+## Usage
+- Execute `/usr/share/glusterfs/run-tests.sh` as root.
-- If some test cases fail, you can execute the failed test case script
- directly bypassing run-tests.sh. At this time it might be
- useful to set the envrionment variable DEBUG=1 before running
- the individual test script directly by hand.
+- If some test cases fail, report to GlusterFS community at
+ `gluster-devel@nongnu.org`.
-- BE WARNED THAT THE TEST CASES DELETE /var/lib/glusterd/* !!!
+## Reminder
+- BE WARNED THAT THE TEST CASES DELETE /var/lib/glusterd/* !!! \ No newline at end of file
diff --git a/tests/bugs/bug-853258.t b/tests/bugs/bug-853258.t
index 0ca99555107..faa9d4465ed 100755
--- a/tests/bugs/bug-853258.t
+++ b/tests/bugs/bug-853258.t
@@ -38,7 +38,7 @@ for i in $(seq 0 3); do
xattrs="$xattrs $(dht_get_layout $B0/${V0}$i)"
done
-overlap=$($(dirname $0)/overlap.py $xattrs)
+overlap=$(python2 $(dirname $0)/overlap.py $xattrs)
# 2863311531 = 0xaaaaaaab = 2/3 overlap
TEST [ "$overlap" -ge 2863311531 ]