summaryrefslogtreecommitdiffstats
path: root/tests/include.rc
Commit message (Collapse)AuthorAgeFilesLines
* tests: move all test-cases into component subdirectoriesNiels de Vos2015-01-061-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are around 300 regression tests, 250 being in tests/bugs. Running partial set of tests/bugs is not easy because this is a flat directory with almost all tests inside. It would be valuable to make partial test/bugs easier, and allow the use of mulitple build hosts for a single commit, each running a subset of the tests for a quicker result. Additional changes made: - correct the include path for *.rc shell libraries and *.py utils - make the testcases pass checkpatch - arequal-checksum in afr/self-heal.t was never executed, now it is - include.rc now complains loudly if it fails to find env.rc Change-Id: I26ffd067e9853d3be1fd63b2f37d8aa0fd1b4fea BUG: 1178685 Reported-by: Emmanuel Dreyfus <manu@netbsd.org> Reported-by: Atin Mukherjee <amukherj@redhat.com> URL: http://www.gluster.org/pipermail/gluster-devel/2014-December/043414.html Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9353 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: return non-zero value instead of exit in functions within the test runAtin Mukherjee2015-01-021-21/+21
| | | | | | | | | | | | | using 'exit 1' would terminate the test script which means cleanup will never get triggered for that test run which is incorrect. Instead use 'return 1'. Change-Id: I48c36cff4b2ddfcc2bd8ceb85484720161fe58f0 BUG: 1163543 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/9333 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
* telldir()/seekdir() portability fixesEmmanuel Dreyfus2014-12-171-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX says that an offset obtained from telldir() can only be used on the same DIR *. Linux is abls to reuse the offset accross closedir()/opendir() for a given directory, but this is not portable and such a behavior should be fixed. An incomplete fix for the posix xlator was merged in http://review.gluster.com/8926 This change set completes it. - Perform the same fix index xlator. - Use appropriate casts and variable types so that 32 bit signed offsets obtained by telldir() do not get clobbered when copied into 64 bit signed types. - modify glfs-heal.c and afr-self-heald.c so that they do not use anonymous fd, since this will cause closedir()/opendir() between each syncop_readdir(). On failure we fallback to anonymous fs only for Linux so that we can cope with updated client vs not updated brick. - Avoid sending an EINVAL when the client request for the EOF offset. Here we fix an error in previous fix for posix xlator: since we fill each directory entry with the offset of the next entry, we must consider as EOF the offset of the last entry, and not the value of telldir() after we read it. - Add checks in regression tests that we do not hit cases where offsets fed to seekdir() are wrong. Introduce log_newer() shell function to check for messages produced by the current script. This fix gather changes from http://review.gluster.org/9047 and http://review.gluster.org/8936 making them obsolete. BUG: 1129939 Change-Id: I59fb7f06a872c4f98987105792d648141c258c6a Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9071 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
* Regression test portability: statEmmanuel Dreyfus2014-12-041-52/+51
| | | | | | | | | | | | | Improve Linux stat emulation for BSD so that it can handle multiple files at once. This is required now tests/basic/afr/data-self-heal.t uses that syntax. BUG: 1129939 Change-Id: I2720d0e8a0d4dedbb8d51fcde3586b4e7d8bb492 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9232 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: stat(1)Emmanuel Dreyfus2014-12-031-0/+10
| | | | | | | | | | | | | | - Improve Linux stat(1) emulation for BSD: %t and %T should be 0 for non device nodes. - Remove what seems like a typo in entry-self-heal.t, which blocks in Linux stat(1) emulation for BSD. BUG: 1129939 Change-Id: I7635aa105e6d309cdb74608bdaba4135c7c00dd4 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9217 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: batch of bugs (volume 2)Emmanuel Dreyfus2014-11-261-3/+173
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix various regression test portability in tests/bugs. bug-861542.t - Avoid syntax specific to GNU sed. bug-860663.t - Command argument length is system dependent, and specifying 1000 file path may overflow it. Use a C program to do the job in a portable and efficient way. - Add a test that we created the specified amount of files. bug-858242.c, bug-808400-fcntl.c, bug-808400-flock.c - fstat64() is Linux-specific. Define it as fstat for other systems. bug-823081.t - Use portable tail -n instead of tail --lines In many tests: - Do not assume python interpreter name. Use $PYTHON as defined in env.rc by configure. utils/libcxattr.py - If python version is 2.6 or higher, use a portable mechanism to recover errno. The original version is retained for python version 2.5 and earlier but it only works on Linux. BUG: 1129939 Change-Id: If2fea1ffec5cc6ab2de426fb200e884450afe61b Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9097 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* gluster/uss: Handle ESTALE in snapview client when NFS server restartedvmallika2014-11-251-0/+6
| | | | | | | | | | | | | | | When NFS server is restarted inode-context is lost. Nameless lookup will be sent to regular volume. If the gfid is from virtual graph, lookup will fail with ESTALE. We need to send a lookup to snapview server Change-Id: I22920614f0d14cb90b53653fce95b6b70023eba6 BUG: 1166197 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/9153 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: wcEmmanuel Dreyfus2014-11-131-0/+5
| | | | | | | | | | | | | | NetBSD wc displays number with leading spaces, which cause arithmeric operations on values from wc -l to fail. Fix the problem by defining a wrappers that removes spaces. BUG: 1129939 Change-Id: I6fa147cf07772f58d9e19e0efd1dae5dad3a4219 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9076 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Spurious failures fix for bug-948729.t and bug-948729-mode-script.tEmmanuel Dreyfus2014-11-101-3/+22
| | | | | | | | | | | | | | | | | | Change I816b36e1d3e6933f92acf19d9be8eeaaa333356e causes sprurious failures in bug-948729.t and bug-948729-mode-script.t This seems to be caused by leftover information in /d/backends/ probably in a dot-prefixed directory. Attempt to fix this by removing /d/backends and other work directories on cleanup. While there we test and report failure to remove anything. BUG: 1129939 Change-Id: I0373c7f3c507db8ab509e8fd3aca2a386bea807e Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9081 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
* Regression test portability: batch of bugs (volume 1)Emmanuel Dreyfus2014-11-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix various regression test portability in tests/bugs. bug-1004744.t: - Slower systems really requires an increased REBALANCE_TIMEOUT in include.rc bug-1023974.t: - use the -p option to mkdir before the path for portability sake. bug-1051896.t and bug-847622.t: - skip ACL test for NetBSD as it has no POSIX 1e ACL support. bugs-1053579.t: - Override the amount of secondary groups depending of the maximum the system supports. - Specify seq(1) format to avoid having trailing .00 - Use more portable su -m USER -c COMMAND (also in bug-884597.t) - NetBSD does not fail high GID with NFS bug-1058663.c: - Depending on architecture, NetBSD can have SIGSEGV instead of SIGBUS bug-762989.t and bug-867253.t: - For non Linux systems, skip tests on features that are Linux-specific bug-765473.t; - Fix a {1} that bash is supposed to expand in 1 but does not, replace by 1. - Sync volume to make sure it imediatly knows a fd got bad BUG: 1129939 Change-Id: I5405f94ccb8f20d35b3095096b0602c43719a1ae Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9009 Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: TAPEmmanuel Dreyfus2014-10-301-1/+1
| | | | | | | | | | | | | | | | | | Even with successful tests on NetBSD, we had a failure message at the end: "No plan found in TAP output" This was caused by a white space left padded numerical variable. Stripping the white spaces fixes the problem. While there add SKIP_TEST for NetBSD on unspported tests so that it does not triger a failure. BUG: 1129939 Change-Id: I8d0bc125c4208974657977568d838ee2dd19783c Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8981 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: loopback devicesEmmanuel Dreyfus2014-10-301-0/+150
| | | | | | | | | | | | | | | | | | Introduce functions to deal with loopback devices setup, mount and umount. Remove test for xfsprogs for non Linux systems, as loopback devices can be populated with other filesystems (e.g.: FFS for NetBSD) While there, remove mount.nfs test for non Linux systems. At least NetBSD has it in base system as mount_nfs. BUG: 1129939 Change-Id: I816b36e1d3e6933f92acf19d9be8eeaaa333356e Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8914 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: useradd/userdellEmmanuel Dreyfus2014-10-301-0/+20
| | | | | | | | | | | | | Adjust useradd/userdel flags for NetBSD. Similar work will have to be done for other non Linux systems BUG: 1129939 Change-Id: I2a30819a4915d04473f0ef0c0c063de6015212a1 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8895 Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* Regression test portability: quota-anon-fd-nfs.tEmmanuel Dreyfus2014-10-281-5/+16
| | | | | | | | | | | | | | | | | | | | | | Fix portability problems in quota-anon-fd-nfs.t - Use mount_nfs wrapper and include nfs.rc to get it defined. - umount NFS before cleanup to avvoid deadlocks. - umount -l is Linux-specific, use umount -f on BSD. - wait for 1s for portmap registration before mouting NFS. - mount from $H0 instead of localhost: the later fails on NetBSD. - Test quota without filling GB of data, 20MB is enough and it will be gentle with smaller setups. - wait for write behind to complete before testing quota overflow BUG: 1129939 Change-Id: I097d5faed2fa7b6438aaa56def85172f23bbe7dc Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8969 Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Niels de Vos <ndevos@redhat.com> Tested-by: Kiran Patil <kiran@fractalio.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: statEmmanuel Dreyfus2014-10-011-17/+25
| | | | | | | | | | | | | | | Improve BSD compatibility for stat. The new version attemps to spawn less stat subprocesses. Also add translation for %X %Y and %Z BUG: 1129939 Change-Id: I2b2134f9e8336a952aee6c7679ba0491abd5a35c Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8565 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net>
* tests: regression, can't run `prove $t` in subdirsKaleb S. KEITHLEY2014-09-211-2/+7
| | | | | | | | | | | | | | | | | | | In various tests we already use the pattern: . $(dirname $0)/../include.rc to locate various .rc files. Use the same pattern we already use to also find the new env.rc Change-Id: I0d438446fa00be2c143b5cf46025866182c94814 BUG: 1142419 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/8754 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: Fix typo in M2 definitionPranith Kumar K2014-09-121-2/+2
| | | | | | | | | | | | Thanks to Anoop CS for finding the bug Change-Id: I237e3a396967096b8e49200aed279af970e0a4d5 BUG: 1141167 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8707 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Justin Clift <justin@gluster.org> Reviewed-by: Anand Avati <avati@redhat.com>
* test: cleanup should clean all left over (stale) mountsAtin Mukherjee2014-09-121-0/+3
| | | | | | | | | | | | | | | | This is a temporary work around to fix the spurious failures seen in ec testcases. As per the initial analysis it looks like quota (glusterd_quota_initiate_fs_crawl) is causing a mount point in /tmp to be stale. Once the root cause is identified this fix can be reverted as well. Change-Id: I8686f144ed298124074f749e75c13028ec00be01 BUG: 1092850 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: http://review.gluster.org/8703 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Justin Clift <justin@gluster.org> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* porting: Provide setfattr/getfattr implementationHarshavardhana2014-09-051-101/+129
| | | | | | | | | | | | | | | | - Use 'getfattr' properly avoid redundant options during xattr query - Untabify certain parts of tests (remove tabs) - Avoid backtick evaluation for certain values to make code more portable. - Use awk on FreeBSD/Darwin, since 'wc' implementation is broken and adds spurious spaces in its output. Change-Id: I7dcc0b70874e43b4cda8c306ed18a31b7a3f990a BUG: 1131713 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8520 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org>
* Regression test portability: EXPECTEmmanuel Dreyfus2014-09-041-1/+5
| | | | | | | | | | | | | | | | | | Make sure test_expect_not_footer() and test_expect_footer() work on non empty strings, otherwise it may produce errors such as in pgfid_feat.t on NetBSD: not ok 12 Got "" instead of "" This a a missing bit from previosuly merged patchset: I9cb76ba863897126534c3808fb0c9e564659835f BUG: 1129939 Change-Id: I2635b67deec9cf60295faab52e7421947b1f7bda Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8576 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: EXPECTEmmanuel Dreyfus2014-08-311-2/+10
| | | | | | | | | | | | | | Make sure test_expect_not_footer() and test_expect_footer() work on non empty strings, otherwise it may produce errors such as in pgfid_feat.t on NetBSD: not ok 12 Got "" instead of "" BUG: 1129939 Change-Id: I9cb76ba863897126534c3808fb0c9e564659835f Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8568 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* porting: various fixes regression tests OSX/FreeBSDHarshavardhana2014-08-291-5/+18
| | | | | | | | | | | | | | | | | | | | - `wc -l` on OSX/FreeBSD adds spurious spaces, this clobbers up TAP output parsers - fix it. - `umount -l` doesn't exist on OSX/FreeBSD use 'umount -f' if available. - Add check for 'file' version, to handle mime type variations across versions - Converge 'glusterfs --attribute-timeout=0 --entry-timeout=0' into '$GFS' - Modify remaining 'mount -t nfs' to use 'mount_nfs' - Update sha1sum for OSX to use 'openssl sha1'. Change-Id: Id1012faa5d67a921513d220e7fa9cebafe830d34 BUG: 1131713 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8501 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
* porting: `pidof` portability for OSX/FreeBSDHarshavardhana2014-08-261-7/+15
| | | | | | | | | | | | | | | | | | | | - Provide a portable `pidof` just to be used specifically with glusterfs regression tests on OSX and FreeBSD. This was written after countless hrs of effort to get a sane `pidof` working on either of the environments. `pidof` comes at the wake of lack of proper procfs support and also incompatible way of handling process names since glusterd/glusterfs are symbolic links to 'glusterfsd' - tests/utils/* directory should be part of 'PATH' to avoid abspath calculation using $(dirname) - cleanup() - rpcinfo command prints error on FreeBSD/OSX fix it Change-Id: I35f86273624cb279da1c8fae056ca27669e251d8 BUG: 1131713 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8499 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Regression test portability: sha1sumEmmanuel Dreyfus2014-08-201-0/+8
| | | | | | | | | | | | Provide a shell function for sha1sum if missing BUG: 764655 Change-Id: I8b232af8aab7f95ba7c7ad83e37a111d562201a5 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8450 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net>
* Regression test portability: ddEmmanuel Dreyfus2014-08-201-1/+1
| | | | | | | | | | | | Use dd msgfmt=quiet also in truncate replacement BUG: 764655 Change-Id: I5ad022c1dc65ecc98996ccbe8a3d0e9de162aa1a Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8464 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net>
* Regression test portability: mountEmmanuel Dreyfus2014-08-201-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address various portability-related problems related to mount - In order to address the non-portability of NFS mount options, use the mount_nfs shell function everywhere, and use it to translate options. - Make sure NFS mounts are unmounted before shutting down the daemons in order to avoid deadlock. The change is done in every test that did not unmounted NFS mounts at the end of the script, and in global cleanup function as well. The force_umount shell function from volume.rc was duplicated as umount_nfs in nfs.rc so that we do not have to add an include on volume.rc for all NFS tests that do not need it. - The FUSE mount type on NetBSD is puffs|perfuse|fuse.glusterfs instead of just fuse.glusterfs, make the regexp configurable in include.rc - Finding wether the mount is RO or RW in mount output needs a system-dependent command configurable in include.rc - mount options in /proc/mounts may be limited to "rw", adjust the regexp for this case where there is no comma And while there change rm into rm -f in tests/basic/mount.t for removal opearation that should fail, since rm may ask for confirmation Change-Id: I1fb708486ec350b2885e2404879561c1020fa8fd BUG: 1129939 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8494 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net>
* Regression test portability: statEmmanuel Dreyfus2014-08-181-0/+48
| | | | | | | | | | | | | | | Linux uses stat -c, stat --printf= or stat --printf NetBSD uses stat -f with different format strings. This change set changes all stat usage to stat -c and introduce a shell stat() fonction to perform the format string translation. BUG: 764655 Change-Id: I024fca7c1b736b053f5888cbf21da0a72489ef63 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8424 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net>
* build: make GLUSTERD_WORKDIR rely on localstatedirHarshavardhana2014-08-071-6/+20
| | | | | | | | | | | | | | | | | | | | | | - Break-way from '/var/lib/glusterd' hard-coded previously, instead rely on 'configure' value from 'localstatedir' - Provide 's/lib/db' as default working directory for gluster management daemon for BSD and Darwin based installations - loff_t is really off_t on Darwin - fix-off the warnings generated by clang on FreeBSD/Darwin - Now 'tests/*' use GLUSTERD_WORKDIR a common variable for all platforms. - Define proper environment for running tests, define correct PATH and LD_LIBRARY_PATH when running tests, so that the desired version of glusterfs is used, regardless where it is installed. (Thanks to manu@netbsd.org for this additional work) Change-Id: I2339a0d9275de5939ccad3e52b535598064a35e7 BUG: 1111774 Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8246 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Regression test portability: truncate, md5Emmanuel Dreyfus2014-08-061-0/+112
| | | | | | | | | | | | | | Add shell functions to replace truncate and md5, which are Linux specific Resubmit because of failed regression test with no apparent cause BUG: 764655 Change-Id: I07200cf886bd52904a5cf63c66f43f0b1cc91540 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8341 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* Regression test portability: arequal-checksumEmmanuel Dreyfus2014-08-041-1/+4
| | | | | | | | | | | | | | | | | | | | Building arequal-checksum on non Linux systems requires a few adjustments: - use __builtin_alloca() on all platforms - on systems without argp, get it from contrib/standalone-argp (this requires adding cflags support to the build_tester function) - FTW_ACTIONRETVAL option to nftw(3) is GNU libc specific, work around if it does not exist. - md5sum is Linux-specific. Use md5 -n on NetBSD and md5 -q on FreeBSD/Darwin - Use 'cc' as synonymous for all compilers, it can behave as gcc/clang depending on which is default - cleanup tabs/whitespaces BUG: 764655 Change-Id: I9090c17da596fbf00fc1fbd7593163ce8cd3b84c Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8283 Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Regression test portability: system-specific cleanupEmmanuel Dreyfus2014-08-011-5/+37
| | | | | | | | | | | | | Add NetBSD system-specific cleanup code Define killall as pkill when it is missing. BUG: 764655 Change-Id: I3a1cfa3029fd60ede334a670fc115c211700063d Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8290 Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* Regression test portability: hostnameEmmanuel Dreyfus2014-07-281-1/+8
| | | | | | | | | | | | | | The --fqdn option to hostname is Linux only This is resubmission of the same patch. I assume the regression test is a test bug BUG: 764655 Change-Id: I6437124186435f10d1ee6a847e2593554d633716 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8282 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net> Tested-by: Harshavardhana <harsha@harshavardhana.net>
* tests: make dd less noisyJeff Darcy2014-07-151-0/+11
| | | | | | | | | | | | | Also fixed one case in quota.t where error output is expected. There are probably other similar cases which can be fixed separately. Change-Id: If80fad0d9fcff6f8ca91d00f4f7b2d5f3fef4256 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/8298 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Humble Devassy Chirammal <humble.devassy@gmail.com> Reviewed-by: Prashanth Pai <ppai@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: Print EXPECT style error messages rather than 'not ok'Pranith Kumar K2014-07-091-15/+5
| | | | | | | | | | Change-Id: Ib23426c5ede0ab71387a6a112b313aa448b872cd BUG: 1092850 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8263 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* nfs: prevent assertion error with MOUNT over UDPNiels de Vos2014-07-071-0/+12
| | | | | | | | | | | | | | | | | | | | | | | The MOUNT service over UDP runs in a separate thread. This thread does not have the correct *THIS xlator set. *THIS points to the global (base) xlator structure, but GF_CALLOC() requires it to be the NFS-xlator so that assertions can get validated correctly. This is solved by passing the NFS-xlator to the pthread function, and setting the *THIS pointer explicitly in the new thread. It seems that on occasion (needs further investigation) MOUNT over UDP does not unregister itself. There can also be issues when the kernel NLM implementation has been registered at portmap/rpcbind, so adding some unregister procedures in the cleanup of the test-cases. Change-Id: I3be5a420fc800bbcc14198d0b6faf4cf2c7300b1 BUG: 1116503 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/8241 Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: Provide force_umount with 5 retriesPranith Kumar K2014-06-181-0/+1
| | | | | | | | | | | Change-Id: I2b5784c48eedcccb17690de438addd29075926bd BUG: 1092850 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8104 Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: Avoid sleepPranith Kumar K2014-06-161-0/+1
| | | | | | | | | Change-Id: I7169be3532232754b9461c4e1b27bf6bc857f7a6 BUG: 1092850 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/8083 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* storage/posix: Janitor should guard against dir renames.Pranith Kumar K2014-06-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: Directory rename while a brick is down can cause gfid handle of that directory to be deleted until next lookup happens on that directory. *) Self-heal does not have intelligence to detect renames at the moment. So it has to delete the directory 'd' using special flags, because it has to perform 'rm -rf' of that directory as it is not empty. Posix xlator implements this by renaming the directory deleted to 'landfill' directory in '.glusterfs' where janitor thread will perform actual rm -rf by traversing the directory. Janitor thread wakes up every 10 minutes to check if there are any directories to be deleted and deletes them. As part of deleting it also deletes the gfid-handles. Steps to hit the problem: 1) On a replicate volume create a directory 'd', file in 'd' called 'f' so the directory 'd' is not empty. 2) bring one of the bricks down (lets call it brick-a, the other one is brick-b 3) Rename d to d1 4) When brick-a comes online again, self-heal deletes directory 'd' and creates directory 'd1' on brick-a for performing self-heal. So on brick-a, gfid-handle of 'd' pointing to 'da is deleted and recreated to point to 'd1'. 5) This directory 'b' with all its directory hierarchy (for now just the file 'f') will be under 'landfill' directory. 6) When janitor thread wakes up and deletes directory 'd' and gfid-handle of 'd' without realizing that it is now pointing to 'd1'. Thus 'd1' loses its gfid-handle Fix: Delete gfid-handle for a directory only when the gfid-handle is stale. Change-Id: I21265b3bd3852f0967d916aaa21108ae5c9e7373 BUG: 1101143 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7879 Reviewed-by: Niels de Vos <ndevos@redhat.com> Reviewed-by: Xavier Hernandez <xhernandez@datalab.es> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* tests: Use uniform timeoutsPranith Kumar K2014-05-191-0/+10
| | | | | | | | | Change-Id: I479ab941b3b2da3b16f624400fbd300f08326268 BUG: 1092850 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/7799 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* tests: print info about failed testsJeff Darcy2014-04-231-0/+5
| | | | | | | | | | | | | | It's a bit frustrating to run a test normally (e.g. during development), see a failure, and then have to re-run it with DEBUG=1 to see what actually failed. This tiny patch prints out the command line of the test that just failed, even if DEBUG=0 (in fact only if DEBUG=0 since otherwise it would be redundant). Change-Id: Icffa096d0bcc6f35176f0e47d9d1bc538698ca2c Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/7537 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* gluster: GlusterFS Volume Snapshot FeatureAvra Sengupta2014-04-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This is the initial patch for the Snapshot feature. Current patch includes following features: * Snapshot create * Snapshot delete * Snapshot restore * Snapshot list * Snapshot info * Snapshot status * Snapshot config Change-Id: I2f46920c0d61c515f6a60e0f8b46fff886d9f6a9 BUG: 1061685 Signed-off-by: shishir gowda <sgowda@redhat.com> Signed-off-by: Sachin Pandit <spandit@redhat.com> Signed-off-by: Vijaikumar M <vmallika@redhat.com> Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Signed-off-by: Rajesh Joseph <rjoseph@redhat.com> Signed-off-by: Joseph Fernandes <josferna@redhat.com> Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7128 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* glusterd: Volume locks and transaction specific opinfosAvra Sengupta2014-02-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this patch we are replacing the existing cluster-wide lock taken on glusterds across the cluster, with volume locks which are also taken on glusterds across the cluster, but are volume specific. So with the volume locks we are able to perform more than one gluster operation at the same time, as long as the operations are being performed on different volumes. We maintain a global list of volume-locks (using a dict for a list) where the key is the volume name, and which saves the uuid of the originator glusterd. These locks are held and released per volume transaction. In order to acheive multiple gluster operations occuring at the same time, we also separate opinfos in the op-state-machine, as a part of this patch. To do so, we generate a unique transaction-id (uuid) per gluster transaction. An opinfo is then associated with this transaction id, which is used throughout the transaction. We maintain a run-time global list(using a dict) of transaction-ids, and their respective opinfos to achieve this. Upstream Feature Page: http://www.gluster.org/community/documentation/index.php/Features/glusterd-volume-locks Change-Id: Iaad505a854bac8de8f83beec0357eb6cde3f7ea8 BUG: 1011470 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/5994 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
* tests: support regex in EXPECT constructsAnand Avati2014-01-251-4/+4
| | | | | | | | | | | Instead of just strings, provide the ability to specify a regex of the pattern to expect Change-Id: I6ada978197dceecc28490a2a40de73a04ab9abcd Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/6788 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
* cli: Fail creation of bricks on root partition in script modeKrutika Dhananjay2013-12-041-1/+1
| | | | | | | | | | | | | | | Also added an option 'wignore' to save ourselves the trouble of modifying test scripts in our regression test suite as well as those that are still under review. Change-Id: Id320c03595506e9da187e766991c19640bd000c5 BUG: 1028281 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/6409 Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* features/quota: Improvements to quotaRaghavendra G2013-11-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Two stages of quota enforcement is done: Soft and hard quota Upon reaching soft quota limit on the directory it logs/alerts in the quota daemon log (ie DEFAULT_LOG_DIR/quotad.log) and no more writes allowed after hard quota limit. After reaching the soft-limit the daemon alerts the user/admin repeatively for every 'alert-time', which is configurable. * Quota enforcer is moved to server-side. It takes care of enforcing quota. Since enforcer doesn't have the cluster view, it relies on another service called quota-aggregator. Aggregator, on query can return the size of a directory based on the cluster view. Enforcer is always loaded in the server graph and is by passed if the feature is not enabled. Options specific to enforcer: server-quota - Specifies whether the feature is on/off. It is used to by pass the quota if turned off. deem-statfs - If set to on, it takes quota limits into consideration while estimating fs size. (df command). The algorithm followed is, i. Adjust statvfs based on limit configured on root. ii. If limit is set on the inode passed, use size/limits on that inode to populate statvfs. Otherwise, use size/limits configured on root. iii. Upon statvfs, update the ctx->size on the inode. iv. Don't let DHT aggregate, instead take the maximum of the usages from the subvols of the DHT, since each of it contains the complete information. Enforcer also makes use of gfid-to-path conversion functionality to work correctly when a client like nfs predominently relies on nameless lookups. * Quota Aggregator acts as a thin client to provide cluster view Its a lightweight *gluster client* process with no mount point, started upon enabling quota or restarting the volume. This is a single process run on each brick, which can answer queries on all volumes in the cluster. Its volfile stored in GLUSTERD_DEFAULT_WORKING_DIR/quotad/quotad.vol. Credits: Raghavendra Bhat <rabhat@redhat.com> Varun Shastry <vshastry@redhat.com> Shishir Gowda <sgowda@redhat.com> Kruthika Dhananjay <kdhananj@redhat.com> Brian Foster <bfoster@redhat.com> Krishnan Parthasarathi <kparthas@redhat.com> Change-Id: Id1cb25b414951da34c665a55f77385d482e0f9de BUG: 969461 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/5952 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* tests: add EXPECT_NOT macroRaghavendra G2013-11-241-1/+32
| | | | | | | | | | | | | | | | | We needed this macro while writing test cases for quota. With quota, a directory size is only guaranteed to be within some margin of quota limit, but not an accurate number. With not knowing what size to expect and EXPECT macro not complete enough to accept ranges of sizes, we can atleast write test-cases with EXPECT_NOT macro. After copying data to an empty file, it will be guaranteed the size will not be zero. This is good enough for quota test cases. Change-Id: I722ebd68044716a5eeaf0bd7e9aae61df8469017 BUG: 1022995 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/6253 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* build: sync glusterfs.spec.in with Fedora glusterfs.specKaleb S. KEITHLEY2013-04-261-1/+19
| | | | | | | | | BUG: 950083 Change-Id: I96aeb8fbe8b79bbc058ff9a45167d822abb576ed Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/4876 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
* glusterd: Removed fd leaks in glusterfs_start utility functionKrishnan Parthasarathi2013-03-251-0/+6
| | | | | | | | | | | | | | | | | | | PROBLEM: The FILE* associated with the pidfile was leaked if pmap_registry_search on the brickinfo' path failed. FIX: Eliminates the use of the FILE* that was leaked. Uses glusterd_is_service_running utility function in place of the earlier attempt to check for the same. Change-Id: I94082bd5a94b8a6340f8cc11726d3264e364efe6 BUG: 916549 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/4596 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Anand Avati <avati@redhat.com>
* tests: move common funtion definitions to include.rcRaghavendra G2013-02-221-0/+22
| | | | | | | | | | Change-Id: I3526557d0a675692e94edb71b7d92c9202e6afa4 BUG: 765473 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.org/4559 Reviewed-by: Amar Tumballi <amarts@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
* tests: Add spaces around '=' in a string comparision in TEST primitiveKaushal M2013-02-181-1/+1
| | | | | | | | | Change-Id: I0402949c8cd88cc93e073a7c8ae60b5ff4497ad2 BUG: 764966 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/4538 Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>