summaryrefslogtreecommitdiffstats
path: root/tests/basic/mount.t
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2012-10-17 15:51:18 -0700
committerAnand Avati <avati@redhat.com>2012-10-18 14:17:25 -0700
commitbb41c8ab88f1a3d8c54b635674d0a72133623496 (patch)
tree00d2686b4b9e31034ea9efe89d11964736208f06 /tests/basic/mount.t
parent56d1f81949fde78615cd9fec048259d261f99c40 (diff)
tests: pre-commit regression tests
Framework for writing test cases to be submitted with patches. This framework and the test cases get exercised by Jenkins in the pre-commit regression test. Jenkins is configured to give a +1 verified vote only if the regression test passes without failures (which includes test cases added/changed by the patch being tested) Every patch should include a test case (either extensions/changes to existing test cases or add new ones, as appropriate). The test case should be part of the same commit so that both code and test case get reviewed together. Test cases added are cumulative. Every new patch gets tested against its own test case and every test case previously added. A lot of new commits in the near future will be pure test cases (with no code change) which will get added in "catch up" mode. The tool used for implementing test cases is 'prove', and the framework itself is modeled similar to the POSIX compliance filesystem test suite. Under the top level directory, a new directory named 'tests/' is added. This contains top level classifier directories and framework files/scripts. Functionality tests should be created under a classifier directory below 'tests/'. For e.g: tests/basic/mount.t tests/performance/write-behind.t Bugs which get fixed should include a test case script named by the bug id, so that we are guaranteed any new change will not bring the issue back. For e.g: tests/bugs/bug-123456.t Triggering of regression tests in Jenkins is manual at this point as we do not want the entire test suite to run against every revision of a patch while it is still in the review/resubmit cycle. Signed-off-by: Anand Avati <avati@redhat.com> Change-Id: I8078244619135ccaba38e068925f8ca85141055a BUG: 764966 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4101 Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tests/basic/mount.t')
-rwxr-xr-xtests/basic/mount.t62
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/basic/mount.t b/tests/basic/mount.t
new file mode 100755
index 00000000000..0fdef65de55
--- /dev/null
+++ b/tests/basic/mount.t
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+. $(dirname $0)/../include.rc
+
+cleanup;
+
+
+## Start and create a volume
+TEST glusterd
+TEST pidof glusterd
+TEST $CLI volume info;
+
+TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8};
+
+function volinfo_field()
+{
+ local vol=$1;
+ local field=$2;
+
+ $CLI volume info $vol | grep "^$field: " | sed 's/.*: //';
+}
+
+
+## Verify volume is is created
+EXPECT "$V0" volinfo_field $V0 'Volume Name';
+EXPECT 'Created' volinfo_field $V0 'Status';
+
+
+## Start volume and verify
+TEST $CLI volume start $V0;
+EXPECT 'Started' volinfo_field $V0 'Status';
+
+
+## Make volume tightly consistent for metdata
+TEST $CLI volume set $V0 performance.stat-prefetch off;
+
+## Mount FUSE with caching disabled
+TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0;
+
+## Wait for volume to register with rpc.mountd
+sleep 5;
+
+## Mount NFS
+TEST mount -t nfs -o vers=3,nolock,soft,intr $H0:/$V0 $N0;
+
+
+## Test for consistent views between NFS and FUSE mounts
+TEST ! stat $M0/newfile;
+TEST touch $M0/newfile;
+TEST stat $N0/newfile;
+TEST rm $N0/newfile;
+TEST ! stat $M0/newfile;
+
+
+## Finish up
+TEST $CLI volume stop $V0;
+EXPECT 'Stopped' volinfo_field $V0 'Status';
+
+TEST $CLI volume delete $V0;
+TEST ! $CLI volume info $V0;
+
+cleanup;