summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2013-08-21 00:50:41 -0700
committerAnand Avati <avati@redhat.com>2013-09-19 09:28:44 -0700
commit5d94695e9ad42343e72918024c046f22fe4941a0 (patch)
tree2b4c915eaa7ad53bfc731c0779c8aeb9ebcba877
parent66747c96e6446da3da1c75ee7641fd75d1ed768c (diff)
tests: Create a regression-tests package for distribution
As of today regression tests are an in-house breed, by making it a new package and distributing it ensures larger set of people use it and contribute to it. This can also be used by any consumer/user to build their own environment for glusterfs regression testing which is today limited only to 'upstream' 'glusterfs' releases and build.gluster.org Change-Id: I4f7e9fd1c49982dcf0d788ef6a83ffe895a956ac BUG: 764966 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/5674 Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-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 d3e1a01..0e31d20 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 eba8ed1..2210492 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 e723dfa..940dde4 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 d654c08..39fc23a 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 d3c9af2..0000000
--- 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 0000000..a75b681
--- /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 0000000..4760b76
--- /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 857230a..2b5ed8d 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 0ca9955..faa9d44 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 ]