summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2016-06-17 01:27:31 -0400
committerRaghavendra Talur <rtalur@redhat.com>2016-07-20 23:15:55 -0700
commit0a8b85e3a8228c399dde807c3ca781a452a1fc90 (patch)
tree2c0d75324ef3bf2339c188929e4cfb9177e8f110 /tests
parentdcf75f7dac091cdb8ab0af2e8f2ca30f6272f8d1 (diff)
tests: Enable all gfapi test cases
Change-Id: I32bfec4af91348d96dc3e81a9d5c9cad599f821b Bug: 1358594 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/14748 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/basic/gfapi/anonymous_fd.t (renamed from tests/basic/gfapi/anonymous_fd.sh)2
-rw-r--r--tests/basic/gfapi/anonymous_fd_read_write.c10
-rw-r--r--tests/basic/gfapi/bug-1241104.c11
-rwxr-xr-xtests/basic/gfapi/bug-1241104.t (renamed from tests/basic/gfapi/bug-1241104.sh)8
-rw-r--r--tests/basic/gfapi/bug1283983.c10
-rwxr-xr-xtests/basic/gfapi/bug1283983.sh6
-rw-r--r--tests/basic/gfapi/bug1291259.c13
-rwxr-xr-xtests/basic/gfapi/bug1291259.t (renamed from tests/basic/gfapi/bug1291259.sh)6
-rw-r--r--tests/basic/gfapi/gfapi-dup.c10
-rwxr-xr-xtests/basic/gfapi/gfapi-dup.t (renamed from tests/basic/gfapi/gfapi-dup.sh)6
-rw-r--r--tests/basic/gfapi/libgfapi-fini-hang.c16
-rwxr-xr-xtests/basic/gfapi/libgfapi-fini-hang.t (renamed from tests/basic/gfapi/libgfapi-fini-hang.sh)4
-rw-r--r--tests/basic/gfapi/seek.c16
-rw-r--r--tests/basic/gfapi/upcall-cache-invalidate.c13
-rwxr-xr-xtests/basic/gfapi/upcall-cache-invalidate.t (renamed from tests/basic/gfapi/upcall-cache-invalidate.sh)6
-rw-r--r--tests/bugs/disperse/bug-1161886.c4
-rw-r--r--tests/bugs/disperse/bug-1161886.t2
-rw-r--r--tests/bugs/gfapi/bug-1032894.t (renamed from tests/bugs/libgfapi/bug-1032894.t)0
-rw-r--r--tests/bugs/gfapi/bug-1093594.c (renamed from tests/bugs/libgfapi/bug-1093594.c)18
-rwxr-xr-xtests/bugs/gfapi/bug-1093594.t (renamed from tests/bugs/libgfapi/bug-1093594.sh)4
-rwxr-xr-xtests/bugs/gfapi/bug-1319374-THIS-crash.t (renamed from tests/bugs/libgfapi/bug-1319374-THIS-crash.sh)4
-rw-r--r--tests/bugs/gfapi/bug-1319374.c (renamed from tests/bugs/libgfapi/bug-1319374.c)20
-rw-r--r--tests/bugs/gfapi/glfs_vol_set_IO_ERR.c (renamed from tests/bugs/libgfapi/glfs_vol_set_IO_ERR.c)12
-rwxr-xr-xtests/bugs/gfapi/glfs_vol_set_IO_ERR.t (renamed from tests/bugs/libgfapi/glfs_vol_set_IO_ERR.sh)4
-rw-r--r--tests/bugs/shard/bug-shard-discard.c4
-rw-r--r--tests/bugs/shard/bug-shard-discard.t2
-rw-r--r--tests/bugs/shard/bug-shard-zerofill.c4
-rw-r--r--tests/bugs/shard/bug-shard-zerofill.t2
-rw-r--r--tests/bugs/shard/shard-fallocate.c4
-rw-r--r--tests/bugs/shard/zero-flag.t2
-rw-r--r--tests/env.rc.in10
-rw-r--r--tests/include.rc4
32 files changed, 134 insertions, 103 deletions
diff --git a/tests/basic/gfapi/anonymous_fd.sh b/tests/basic/gfapi/anonymous_fd.t
index 2184f8efc8e..bc0fb0fa2f0 100755
--- a/tests/basic/gfapi/anonymous_fd.sh
+++ b/tests/basic/gfapi/anonymous_fd.t
@@ -16,7 +16,7 @@ EXPECT 'Started' volinfo_field $V0 'Status';
logdir=`gluster --print-logdir`
TEST build_tester $(dirname $0)/anonymous_fd_read_write.c -lgfapi -o $(dirname $0)/anonymous_fd
-TEST ./$(dirname $0)/anonymous_fd $V0 $logdir/anonymous_fd.log
+TEST ./$(dirname $0)/anonymous_fd $H0 $V0 $logdir/anonymous_fd.log
cleanup_tester $(dirname $0)/anonymous_fd
diff --git a/tests/basic/gfapi/anonymous_fd_read_write.c b/tests/basic/gfapi/anonymous_fd_read_write.c
index 885f0a2b26f..6945dd634f0 100644
--- a/tests/basic/gfapi/anonymous_fd_read_write.c
+++ b/tests/basic/gfapi/anonymous_fd_read_write.c
@@ -30,14 +30,16 @@ main (int argc, char *argv[])
char *filename = "file.txt";
char *logfile = NULL;
char *volname = NULL;
+ char *hostname = NULL;
- if (argc != 3) {
+ if (argc != 4) {
fprintf (stderr, "Invalid argument\n");
exit(1);
}
- volname = argv[1];
- logfile = argv[2];
+ hostname = argv[1];
+ volname = argv[2];
+ logfile = argv[3];
fs = glfs_new (volname);
if (!fs) {
@@ -45,7 +47,7 @@ main (int argc, char *argv[])
ret = -1;
}
- ret = glfs_set_volfile_server (fs, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs, "tcp", hostname, 24007);
LOG_ERR("glfs_set_volfile_server", ret);
ret = glfs_set_logging (fs, logfile, 7);
diff --git a/tests/basic/gfapi/bug-1241104.c b/tests/basic/gfapi/bug-1241104.c
index 0f1a616bd39..311323f672a 100644
--- a/tests/basic/gfapi/bug-1241104.c
+++ b/tests/basic/gfapi/bug-1241104.c
@@ -2,7 +2,6 @@
#include <unistd.h>
#include <time.h>
#include <limits.h>
-#include <alloca.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -32,15 +31,17 @@ main (int argc, char *argv[])
char *filename = "file_tmp";
char *volname = NULL;
char *logfile = NULL;
+ char *hostname = NULL;
struct flock lock = {0, };
- if (argc != 3) {
+ if (argc != 4) {
fprintf (stderr, "Invalid argument\n");
exit(1);
}
- volname = argv[1];
- logfile = argv[2];
+ hostname = argv[1];
+ volname = argv[2];
+ logfile = argv[3];
fs = glfs_new (volname);
if (!fs) {
@@ -48,7 +49,7 @@ main (int argc, char *argv[])
return -1;
}
- ret = glfs_set_volfile_server (fs, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs, "tcp", hostname, 24007);
LOG_ERR("glfs_set_volfile_server", ret);
ret = glfs_set_logging (fs, logfile, 7);
diff --git a/tests/basic/gfapi/bug-1241104.sh b/tests/basic/gfapi/bug-1241104.t
index e071835758d..e7f4759c3d5 100755
--- a/tests/basic/gfapi/bug-1241104.sh
+++ b/tests/basic/gfapi/bug-1241104.t
@@ -7,7 +7,7 @@ cleanup;
TEST glusterd
-TEST $CLI volume create $V0 localhost:$B0/brick1;
+TEST $CLI volume create $V0 $H0:$B0/brick1;
EXPECT 'Created' volinfo_field $V0 'Status';
TEST $CLI volume start $V0;
@@ -18,11 +18,11 @@ logdir=`gluster --print-logdir`
## Enable Upcall cache-invalidation feature
TEST $CLI volume set $V0 features.cache-invalidation on;
-build_tester $(dirname $0)/bug-1241104.c -lgfapi -o $(dirname $0)/bug-1241104
+TEST build_tester $(dirname $0)/bug-1241104.c -lgfapi
-TEST ./$(dirname $0)/bug-1241104 $V0 $logdir/bug-1241104.log
+TEST ./$(dirname $0)/bug-1241104 $H0 $V0 $logdir/bug-1241104.log
-cleanup_tester $(dirname $0)/bug1241104
+cleanup_tester $(dirname $0)/bug-1241104
TEST $CLI volume stop $V0
TEST $CLI volume delete $V0
diff --git a/tests/basic/gfapi/bug1283983.c b/tests/basic/gfapi/bug1283983.c
index ba0f954cb17..6583097697b 100644
--- a/tests/basic/gfapi/bug1283983.c
+++ b/tests/basic/gfapi/bug1283983.c
@@ -2,7 +2,6 @@
#include <unistd.h>
#include <time.h>
#include <limits.h>
-#include <alloca.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
@@ -48,13 +47,14 @@ main (int argc, char *argv[])
cbk.reason = 0;
fprintf (stderr, "Starting libgfapi_fini\n");
- if (argc != 3) {
+ if (argc != 4) {
fprintf (stderr, "Invalid argument\n");
exit(1);
}
- volname = argv[1];
- logfile = argv[2];
+ hostname = argv[1]
+ volname = argv[2];
+ logfile = argv[3];
fs = glfs_new (volname);
@@ -63,7 +63,7 @@ main (int argc, char *argv[])
return 1;
}
- ret = glfs_set_volfile_server (fs, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs, "tcp", hostname, 24007);
LOG_ERR("glfs_set_volfile_server", ret);
ret = glfs_set_logging (fs, logfile, 7);
diff --git a/tests/basic/gfapi/bug1283983.sh b/tests/basic/gfapi/bug1283983.sh
index 97f1b01150c..931a0b55935 100755
--- a/tests/basic/gfapi/bug1283983.sh
+++ b/tests/basic/gfapi/bug1283983.sh
@@ -7,7 +7,7 @@ cleanup;
TEST glusterd
-TEST $CLI volume create $V0 localhost:$B0/brick1;
+TEST $CLI volume create $V0 $H0:$B0/brick1;
EXPECT 'Created' volinfo_field $V0 'Status';
TEST $CLI volume start $V0;
@@ -18,9 +18,9 @@ logdir=`gluster --print-logdir`
## Enable Upcall cache-invalidation feature
TEST $CLI volume set $V0 features.cache-invalidation on;
-build_tester $(dirname $0)/bug1283983.c -lgfapi -o $(dirname $0)/bug1283983
+build_tester $(dirname $0)/bug1283983.c -lgfapi
-TEST ./$(dirname $0)/bug1283983 $V0 $logdir/bug1283983.log
+TEST ./$(dirname $0)/bug1283983 $H0 $V0 $logdir/bug1283983.log
## There shouldn't be any NULL gfid messages logged
TEST ! cat $logdir/bug1283983.log | grep "upcall" | grep "00000000-0000-0000-0000-000000000000"
diff --git a/tests/basic/gfapi/bug1291259.c b/tests/basic/gfapi/bug1291259.c
index 333da20f557..98e3b13c63d 100644
--- a/tests/basic/gfapi/bug1291259.c
+++ b/tests/basic/gfapi/bug1291259.c
@@ -2,7 +2,6 @@
#include <unistd.h>
#include <time.h>
#include <limits.h>
-#include <alloca.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
@@ -44,6 +43,7 @@ main (int argc, char *argv[])
struct glfs_callback_arg cbk;
char *logfile = NULL;
char *volname = NULL;
+ char *hostname = NULL;
int cnt = 1;
int upcall_received = 0;
struct glfs_callback_inode_arg *in_arg = NULL;
@@ -54,13 +54,14 @@ main (int argc, char *argv[])
cbk.reason = 0;
fprintf (stderr, "Starting libgfapi_fini\n");
- if (argc != 3) {
+ if (argc != 4) {
fprintf (stderr, "Invalid argument\n");
exit(1);
}
- volname = argv[1];
- logfile = argv[2];
+ hostname = argv[1];
+ volname = argv[2];
+ logfile = argv[3];
fs = glfs_new (volname);
@@ -69,7 +70,7 @@ main (int argc, char *argv[])
return 1;
}
- ret = glfs_set_volfile_server (fs, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs, "tcp", hostname, 24007);
LOG_ERR("glfs_set_volfile_server", ret);
ret = glfs_set_logging (fs, logfile, 7);
@@ -84,7 +85,7 @@ main (int argc, char *argv[])
return 1;
}
- ret = glfs_set_volfile_server (fs2, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs2, "tcp", hostname, 24007);
LOG_ERR("glfs_set_volfile_server", ret);
ret = glfs_set_logging (fs2, logfile, 7);
diff --git a/tests/basic/gfapi/bug1291259.sh b/tests/basic/gfapi/bug1291259.t
index edbac7e6b12..2247c567ffc 100755
--- a/tests/basic/gfapi/bug1291259.sh
+++ b/tests/basic/gfapi/bug1291259.t
@@ -7,7 +7,7 @@ cleanup;
TEST glusterd
-TEST $CLI volume create $V0 localhost:$B0/brick1;
+TEST $CLI volume create $V0 $H0:$B0/brick1;
EXPECT 'Created' volinfo_field $V0 'Status';
TEST $CLI volume start $V0;
@@ -18,9 +18,9 @@ logdir=`gluster --print-logdir`
## Enable Upcall cache-invalidation feature
TEST $CLI volume set $V0 features.cache-invalidation on;
-build_tester $(dirname $0)/bug1291259.c -lgfapi -o $(dirname $0)/bug1291259
+TEST build_tester $(dirname $0)/bug1291259.c -lgfapi
-TEST ./$(dirname $0)/bug1291259 $V0 $logdir/bug1291259.log
+TEST ./$(dirname $0)/bug1291259 $H0 $V0 $logdir/bug1291259.log
cleanup_tester $(dirname $0)/bug1291259
diff --git a/tests/basic/gfapi/gfapi-dup.c b/tests/basic/gfapi/gfapi-dup.c
index 450fbdc4186..96f133eae33 100644
--- a/tests/basic/gfapi/gfapi-dup.c
+++ b/tests/basic/gfapi/gfapi-dup.c
@@ -22,23 +22,25 @@ main (int argc, char *argv[])
glfs_fd_t *fd2 = NULL;
char *volname = NULL;
char *logfile = NULL;
+ char *hostname = NULL;
const char *filename = "file_tmp";
const char *buff = "An opinion should be the result of thought, "
"not a substitute for it.";
- if (argc != 3) {
+ if (argc != 4) {
fprintf (stderr, "Invalid argument\n");
return 1;
}
- volname = argv[1];
- logfile = argv[2];
+ hostname = argv[1];
+ volname = argv[2];
+ logfile = argv[3];
fs = glfs_new (volname);
if (!fs)
VALIDATE_AND_GOTO_LABEL_ON_ERROR ("glfs_new", ret, out);
- ret = glfs_set_volfile_server (fs, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs, "tcp", hostname, 24007);
VALIDATE_AND_GOTO_LABEL_ON_ERROR ("glfs_set_volfile_server", ret, out);
ret = glfs_set_logging (fs, logfile, 7);
diff --git a/tests/basic/gfapi/gfapi-dup.sh b/tests/basic/gfapi/gfapi-dup.t
index 6c89e0e473d..849b106f90f 100755
--- a/tests/basic/gfapi/gfapi-dup.sh
+++ b/tests/basic/gfapi/gfapi-dup.t
@@ -7,7 +7,7 @@ cleanup;
TEST glusterd
-TEST $CLI volume create $V0 localhost:$B0/brick1;
+TEST $CLI volume create $V0 $H0:$B0/brick1;
EXPECT 'Created' volinfo_field $V0 'Status';
TEST $CLI volume start $V0;
@@ -15,9 +15,9 @@ EXPECT 'Started' volinfo_field $V0 'Status';
logdir=`gluster --print-logdir`
-build_tester $(dirname $0)/gfapi-dup.c -lgfapi -o $(dirname $0)/gfapi-dup
+TEST build_tester $(dirname $0)/gfapi-dup.c -lgfapi
-TEST ./$(dirname $0)/gfapi-dup $V0 $logdir/gfapi-dup.log
+TEST ./$(dirname $0)/gfapi-dup $H0 $V0 $logdir/gfapi-dup.log
cleanup_tester $(dirname $0)/gfapi-dup
diff --git a/tests/basic/gfapi/libgfapi-fini-hang.c b/tests/basic/gfapi/libgfapi-fini-hang.c
index ee16bd7ce58..81b065ca924 100644
--- a/tests/basic/gfapi/libgfapi-fini-hang.c
+++ b/tests/basic/gfapi/libgfapi-fini-hang.c
@@ -2,12 +2,11 @@
#include <unistd.h>
#include <time.h>
#include <limits.h>
-#include <alloca.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include "api/glfs.h"
-#include "api/glfs-handles.h"
+#include <glusterfs/api/glfs.h>
+#include <glusterfs/api/glfs-handles.h>
#define LOG_ERR(func, ret) do { \
if (ret != 0) { \
@@ -26,21 +25,26 @@ main (int argc, char *argv[])
glfs_fd_t *fd = NULL;
char readbuf[32];
char *filename = "a1";
+ char *hostname = NULL;
+ char *volname = NULL;
fprintf (stderr, "Starting libgfapi_fini\n");
- if (argc < 2) {
+ if (argc < 3) {
fprintf (stderr, "Invalid argument\n");
exit(1);
}
- fs = glfs_new (argv[1]);
+ hostname = argv[1];
+ volname = argv[2];
+
+ fs = glfs_new (volname);
if (!fs) {
fprintf (stderr, "glfs_new: returned NULL\n");
exit(1);
}
- ret = glfs_set_volfile_server (fs, "tcp", "localhost", 0);
+ ret = glfs_set_volfile_server (fs, "tcp", hostname, 0);
LOG_ERR("glfs_set_volfile_server", ret);
ret = glfs_set_logging (fs, "/dev/stderr", 7);
diff --git a/tests/basic/gfapi/libgfapi-fini-hang.sh b/tests/basic/gfapi/libgfapi-fini-hang.t
index 56633288020..8bbeb848122 100755
--- a/tests/basic/gfapi/libgfapi-fini-hang.sh
+++ b/tests/basic/gfapi/libgfapi-fini-hang.t
@@ -21,9 +21,9 @@ EXPECT 'Created' volinfo_field $V0 'Status';
TEST $CLI volume start $V0;
EXPECT 'Started' volinfo_field $V0 'Status';
-build_tester -lgfapi $(dirname $0)/libgfapi-fini-hang.c -o $M0/libgfapi-fini-hang
+TEST build_tester -lgfapi $(dirname $0)/libgfapi-fini-hang.c -o $M0/libgfapi-fini-hang
TEST cd $M0
- ./libgfapi-fini-hang $V0 &
+ ./libgfapi-fini-hang $H0 $V0 &
lpid=$!
# check if the process "libgfapi-fini-hang" exits with in $PROCESS_UP_TIMEOUT
diff --git a/tests/basic/gfapi/seek.c b/tests/basic/gfapi/seek.c
index a0fec7d990a..fb2f6361bf3 100644
--- a/tests/basic/gfapi/seek.c
+++ b/tests/basic/gfapi/seek.c
@@ -14,8 +14,8 @@
#include <stdlib.h>
#include <unistd.h>
-#include <api/glfs.h>
-#include <api/glfs-handles.h>
+#include <glusterfs/api/glfs.h>
+#include <glusterfs/api/glfs-handles.h>
int
main (int argc, char **argv)
@@ -25,18 +25,20 @@ main (int argc, char **argv)
glfs_fd_t *fd = NULL;
char *filename = NULL;
char *volname = NULL;
+ char *hostname = NULL;
struct stat st = { 0, };
off_t hole_start = 0;
off_t hole_end = 0;
- if (argc != 3) {
- fprintf (stderr, "Invalid argument, use %s <vol> <file>\n",
+ if (argc != 4) {
+ fprintf (stderr, "Invalid argument, use %s <hostname> <vol> <file>\n",
argv[0]);
exit (1);
}
- volname = argv[1];
- filename = argv[2];
+ hostname = argv[1];
+ volname = argv[2];
+ filename = argv[3];
fs = glfs_new (volname);
if (!fs) {
@@ -44,7 +46,7 @@ main (int argc, char **argv)
return 1;
}
- if (glfs_set_volfile_server (fs, "tcp", "localhost", 24007)) {
+ if (glfs_set_volfile_server (fs, "tcp", hostname, 24007)) {
perror ("glfs_set_volfile_server");
return 1;
}
diff --git a/tests/basic/gfapi/upcall-cache-invalidate.c b/tests/basic/gfapi/upcall-cache-invalidate.c
index deec691bf8e..ea1b5c4a88b 100644
--- a/tests/basic/gfapi/upcall-cache-invalidate.c
+++ b/tests/basic/gfapi/upcall-cache-invalidate.c
@@ -2,7 +2,6 @@
#include <unistd.h>
#include <time.h>
#include <limits.h>
-#include <alloca.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -41,17 +40,19 @@ main (int argc, char *argv[])
struct glfs_callback_arg cbk;
char *logfile = NULL;
char *volname = NULL;
+ char *hostname = NULL;
struct glfs_callback_inode_arg *in_arg = NULL;
cbk.reason = 0;
- if (argc != 3) {
+ if (argc != 4) {
fprintf (stderr, "Invalid argument\n");
exit(1);
}
- volname = argv[1];
- logfile = argv[2];
+ hostname = argv[1];
+ volname = argv[2];
+ logfile = argv[3];
fs = glfs_new (volname);
if (!fs) {
@@ -59,7 +60,7 @@ main (int argc, char *argv[])
return -1;
}
- ret = glfs_set_volfile_server (fs, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs, "tcp", hostname, 24007);
LOG_ERR("glfs_set_volfile_server", ret);
ret = glfs_set_logging (fs, logfile, 7);
@@ -74,7 +75,7 @@ main (int argc, char *argv[])
return 1;
}
- ret = glfs_set_volfile_server (fs2, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs2, "tcp", hostname, 24007);
LOG_ERR("glfs_set_volfile_server-fs2", ret);
ret = glfs_set_logging (fs2, logfile, 7);
diff --git a/tests/basic/gfapi/upcall-cache-invalidate.sh b/tests/basic/gfapi/upcall-cache-invalidate.t
index f6f59bea752..6acbab2c51a 100755
--- a/tests/basic/gfapi/upcall-cache-invalidate.sh
+++ b/tests/basic/gfapi/upcall-cache-invalidate.t
@@ -14,7 +14,7 @@ exit 0
TEST glusterd
-TEST $CLI volume create $V0 localhost:$B0/brick1;
+TEST $CLI volume create $V0 $H0:$B0/brick1;
EXPECT 'Created' volinfo_field $V0 'Status';
TEST $CLI volume start $V0;
@@ -25,9 +25,9 @@ logdir=`gluster --print-logdir`
## Enable Upcall cache-invalidation feature
TEST $CLI volume set $V0 features.cache-invalidation on;
-build_tester $(dirname $0)/upcall-cache-invalidate.c -lgfapi -o $(dirname $0)/upcall-cache-invalidate
+TEST build_tester $(dirname $0)/upcall-cache-invalidate.c -lgfapi
-TEST ./$(dirname $0)/upcall-cache-invalidate $V0 $logdir/upcall-cache-invalidate.log
+TEST ./$(dirname $0)/upcall-cache-invalidate $H0 $V0 $logdir/upcall-cache-invalidate.log
cleanup_tester $(dirname $0)/upcall-cache-invalidate
diff --git a/tests/bugs/disperse/bug-1161886.c b/tests/bugs/disperse/bug-1161886.c
index 036f4ad1cc7..e8093e48a7a 100644
--- a/tests/bugs/disperse/bug-1161886.c
+++ b/tests/bugs/disperse/bug-1161886.c
@@ -1,7 +1,7 @@
#include <stdio.h>
-#include "glfs.h"
-#include "glfs-handles.h"
+#include <glusterfs/api/glfs.h>
+#include <glusterfs/api/glfs-handles.h>
int
main (int argc, char *argv[])
diff --git a/tests/bugs/disperse/bug-1161886.t b/tests/bugs/disperse/bug-1161886.t
index 73b75619f28..e7322210a3e 100644
--- a/tests/bugs/disperse/bug-1161886.t
+++ b/tests/bugs/disperse/bug-1161886.t
@@ -34,7 +34,7 @@ TEST mv $M0/file1 $M0/file2
TEST ! stat $M0/file1
TEST stat $M0/file2
-TEST gcc -Wall -O2 -I api/src -o $(dirname $0)/bug-1161886 $(dirname $0)/bug-1161886.c -lgfapi
+TEST build_tester $(dirname $0)/bug-1161886.c -lgfapi -Wall -O2
TEST $(dirname $0)/bug-1161886 $H0 $V0 /file2
EXPECT "^0$" stat -c "%s" $M0/file2
EXPECT "^Y$" check_ec_size file2 0
diff --git a/tests/bugs/libgfapi/bug-1032894.t b/tests/bugs/gfapi/bug-1032894.t
index 88d110136e2..88d110136e2 100644
--- a/tests/bugs/libgfapi/bug-1032894.t
+++ b/tests/bugs/gfapi/bug-1032894.t
diff --git a/tests/bugs/libgfapi/bug-1093594.c b/tests/bugs/gfapi/bug-1093594.c
index 8f5aa9be66c..aff271e4caf 100644
--- a/tests/bugs/libgfapi/bug-1093594.c
+++ b/tests/bugs/gfapi/bug-1093594.c
@@ -1,5 +1,5 @@
-#include "../../api/src/glfs.h"
-#include "../../api/src/glfs-handles.h"
+#include <glusterfs/api/glfs.h>
+#include <glusterfs/api/glfs-handles.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -245,25 +245,27 @@ main (int argc, char *argv[])
char *topdir = "topdir", *filename = "file1";
char *buf = NULL;
char *logfile = NULL;
+ char *hostname = NULL;
- if (argc != 3) {
+ if (argc != 4) {
fprintf (stderr,
- "Expect following args %s <Vol> <log file>\n"
+ "Expect following args %s <hostname> <Vol> <log file>\n"
, argv[0]);
return -1;
}
- logfile = argv[2];
+ hostname = argv[1];
+ logfile = argv[3];
for (i = 0; i < TEST_CASE_LOOP; i++) {
- fs = glfs_new (argv[1]);
+ fs = glfs_new (argv[2]);
if (!fs) {
fprintf (stderr, "glfs_new: returned NULL (%s)\n",
strerror (errno));
return -1;
}
- ret = glfs_set_volfile_server (fs, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs, "tcp", hostname, 24007);
if (ret < 0) {
fprintf (stderr, "glfs_set_volfile_server failed ret:%d (%s)\n",
ret, strerror (errno));
@@ -292,7 +294,7 @@ main (int argc, char *argv[])
if (ret < 0)
return -1;
- ret = volfile_change (argv[1]);
+ ret = volfile_change (argv[2]);
if (ret < 0)
return -1;
diff --git a/tests/bugs/libgfapi/bug-1093594.sh b/tests/bugs/gfapi/bug-1093594.t
index 444319b8e63..3f7223be15e 100755
--- a/tests/bugs/libgfapi/bug-1093594.sh
+++ b/tests/bugs/gfapi/bug-1093594.t
@@ -13,8 +13,8 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2};
TEST $CLI volume start $V0;
logdir=`gluster --print-logdir`
-build_tester $(dirname $0)/bug-1093594.c -lgfapi
-TEST $(dirname $0)/bug-1093594 $V0 $logdir/bug-1093594.log
+TEST build_tester $(dirname $0)/bug-1093594.c -lgfapi
+TEST $(dirname $0)/bug-1093594 $H0 $V0 $logdir/bug-1093594.log
cleanup_tester $(dirname $0)/bug-1093594
cleanup;
diff --git a/tests/bugs/libgfapi/bug-1319374-THIS-crash.sh b/tests/bugs/gfapi/bug-1319374-THIS-crash.t
index 9aea739377b..8d3db421c88 100755
--- a/tests/bugs/libgfapi/bug-1319374-THIS-crash.sh
+++ b/tests/bugs/gfapi/bug-1319374-THIS-crash.t
@@ -19,8 +19,8 @@ TEST $CLI volume set $V0 diagnostics.client-log-flush-timeout 30
logdir=`gluster --print-logdir`
-build_tester $(dirname $0)/bug-1319374.c -lgfapi
-TEST $(dirname $0)/bug-1319374 $V0 $logdir/bug-1319374.log
+TEST build_tester $(dirname $0)/bug-1319374.c -lgfapi
+TEST $(dirname $0)/bug-1319374 $H0 $V0 $logdir/bug-1319374.log
cleanup_tester $(dirname $0)/bug-1319374
diff --git a/tests/bugs/libgfapi/bug-1319374.c b/tests/bugs/gfapi/bug-1319374.c
index 878d897dde6..bf2da998d6e 100644
--- a/tests/bugs/libgfapi/bug-1319374.c
+++ b/tests/bugs/gfapi/bug-1319374.c
@@ -7,7 +7,7 @@
#define NO_INIT 1
glfs_t *
-setup_new_client(char *volname, char *log_file, int flag)
+setup_new_client(char *hostname, char *volname, char *log_file, int flag)
{
int ret = 0;
glfs_t *fs = NULL;
@@ -19,7 +19,7 @@ setup_new_client(char *volname, char *log_file, int flag)
goto error;
}
- ret = glfs_set_volfile_server (fs, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs, "tcp", hostname, 24007);
if (ret < 0) {
fprintf (stderr, "\nglfs_set_volfile_server failed ret:%d (%s)\n",
ret, strerror (errno));
@@ -58,32 +58,34 @@ main (int argc, char *argv[])
glfs_t *fs3 = NULL;
char *volname = NULL;
char *log_file = NULL;
+ char *hostname = NULL;
- if (argc != 3) {
+ if (argc != 4) {
fprintf (stderr,
- "Expect following args %s <Vol> <log file location>\n"
+ "Expect following args %s <hostname> <Vol> <log file location>\n"
, argv[0]);
return -1;
}
- volname = argv[1];
- log_file = argv[2];
+ hostname = argv[1];
+ volname = argv[2];
+ log_file = argv[3];
- fs1 = setup_new_client (volname, log_file, NO_INIT);
+ fs1 = setup_new_client (hostname, volname, log_file, NO_INIT);
if (!fs1) {
fprintf (stderr, "\nsetup_new_client: returned NULL (%s)\n",
strerror (errno));
goto error;
}
- fs2 = setup_new_client (volname, log_file, 0);
+ fs2 = setup_new_client (hostname, volname, log_file, 0);
if (!fs2) {
fprintf (stderr, "\nsetup_new_client: returned NULL (%s)\n",
strerror (errno));
goto error;
}
- fs3 = setup_new_client (volname, log_file, 0);
+ fs3 = setup_new_client (hostname, volname, log_file, 0);
if (!fs3) {
fprintf (stderr, "\nsetup_new_client: returned NULL (%s)\n",
strerror (errno));
diff --git a/tests/bugs/libgfapi/glfs_vol_set_IO_ERR.c b/tests/bugs/gfapi/glfs_vol_set_IO_ERR.c
index 4cf849484a6..68011171744 100644
--- a/tests/bugs/libgfapi/glfs_vol_set_IO_ERR.c
+++ b/tests/bugs/gfapi/glfs_vol_set_IO_ERR.c
@@ -8,7 +8,7 @@
#define WRITE_SIZE (128)
glfs_t *
-setup_new_client(char *volname, char *log_fileile)
+setup_new_client(char *hostname, char *volname, char *log_fileile)
{
int ret = 0;
glfs_t *fs = NULL;
@@ -20,7 +20,7 @@ setup_new_client(char *volname, char *log_fileile)
goto error;
}
- ret = glfs_set_volfile_server (fs, "tcp", "localhost", 24007);
+ ret = glfs_set_volfile_server (fs, "tcp", hostname, 24007);
if (ret < 0) {
fprintf (stderr, "\nglfs_set_volfile_server failed ret:%d (%s)\n",
ret, strerror (errno));
@@ -127,18 +127,18 @@ main (int argc, char *argv[])
char buf[100];
glfs_fd_t *fd = NULL;
- if (argc != 3) {
+ if (argc != 4) {
fprintf (stderr,
- "Expect following args %s <Vol> <log file location>\n"
+ "Expect following args %s <hostname> <Vol> <log file location>\n"
, argv[0]);
return -1;
}
- fs = setup_new_client (argv[1], argv[2]);
+ fs = setup_new_client (argv[1], argv[2], argv[3]);
if (!fs)
goto error;
- ret = volfile_change (argv[1]);
+ ret = volfile_change (argv[2]);
if (ret < 0)
goto error;
diff --git a/tests/bugs/libgfapi/glfs_vol_set_IO_ERR.sh b/tests/bugs/gfapi/glfs_vol_set_IO_ERR.t
index 43cad2b15ee..5893ef273bd 100755
--- a/tests/bugs/libgfapi/glfs_vol_set_IO_ERR.sh
+++ b/tests/bugs/gfapi/glfs_vol_set_IO_ERR.t
@@ -13,8 +13,8 @@ TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2};
TEST $CLI volume start $V0;
logdir=`gluster --print-logdir`
-build_tester $(dirname $0)/glfs_vol_set_IO_ERR.c -lgfapi
-TEST $(dirname $0)/glfs_vol_set_IO_ERR $V0 $logdir/glfs_vol_set_IO_ERR.log
+TEST build_tester $(dirname $0)/glfs_vol_set_IO_ERR.c -lgfapi
+TEST $(dirname $0)/glfs_vol_set_IO_ERR $H0 $V0 $logdir/glfs_vol_set_IO_ERR.log
cleanup_tester $(dirname $0)/glfs_vol_set_IO_ERR
cleanup;
diff --git a/tests/bugs/shard/bug-shard-discard.c b/tests/bugs/shard/bug-shard-discard.c
index d51b07f9314..645bacf7d83 100644
--- a/tests/bugs/shard/bug-shard-discard.c
+++ b/tests/bugs/shard/bug-shard-discard.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "glfs.h"
-#include "glfs-handles.h"
+#include <glusterfs/api/glfs.h>
+#include <glusterfs/api/glfs-handles.h>
int
main (int argc, char *argv[])
diff --git a/tests/bugs/shard/bug-shard-discard.t b/tests/bugs/shard/bug-shard-discard.t
index 4c4e9417b5b..a7aff6dff40 100644
--- a/tests/bugs/shard/bug-shard-discard.t
+++ b/tests/bugs/shard/bug-shard-discard.t
@@ -28,7 +28,7 @@ EXPECT '10485760' stat -c %s $M0/foo
gfid_foo=$(get_gfid_string $M0/foo)
-TEST gcc -Wall -O2 -I api/src -o $(dirname $0)/bug-shard-discard $(dirname $0)/bug-shard-discard.c -lgfapi
+TEST build_tester $(dirname $0)/bug-shard-discard.c -lgfapi -Wall -O2
#Call discard on the file at off=7M and len=3M
TEST $(dirname $0)/bug-shard-discard $H0 $V0 /foo 7340032 3145728 `gluster --print-logdir`/glfs-$V0.log
diff --git a/tests/bugs/shard/bug-shard-zerofill.c b/tests/bugs/shard/bug-shard-zerofill.c
index f88c2e2fd02..838a656b3bb 100644
--- a/tests/bugs/shard/bug-shard-zerofill.c
+++ b/tests/bugs/shard/bug-shard-zerofill.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-#include "glfs.h"
-#include "glfs-handles.h"
+#include <glusterfs/api/glfs.h>
+#include <glusterfs/api/glfs-handles.h>
int
main (int argc, char *argv[])
diff --git a/tests/bugs/shard/bug-shard-zerofill.t b/tests/bugs/shard/bug-shard-zerofill.t
index ad508c83236..29b836df323 100644
--- a/tests/bugs/shard/bug-shard-zerofill.t
+++ b/tests/bugs/shard/bug-shard-zerofill.t
@@ -18,7 +18,7 @@ TEST touch $M0/foo
gfid_foo=$(get_gfid_string $M0/foo)
-TEST gcc -Wall -O2 -I api/src -o $(dirname $0)/bug-shard-zerofill $(dirname $0)/bug-shard-zerofill.c -lgfapi
+TEST build_tester $(dirname $0)/bug-shard-zerofill.c -lgfapi -Wall -O2
TEST $(dirname $0)/bug-shard-zerofill $H0 $V0 /foo `gluster --print-logdir`/glfs-$V0.log
# This should ensure /.shard is created on the bricks.
diff --git a/tests/bugs/shard/shard-fallocate.c b/tests/bugs/shard/shard-fallocate.c
index 5365c74ef86..e16620964c9 100644
--- a/tests/bugs/shard/shard-fallocate.c
+++ b/tests/bugs/shard/shard-fallocate.c
@@ -2,8 +2,8 @@
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
-#include "glfs.h"
-#include "glfs-handles.h"
+#include <glusterfs/api/glfs.h>
+#include <glusterfs/api/glfs-handles.h>
enum fallocate_flag {
TEST_FALLOCATE_NONE,
diff --git a/tests/bugs/shard/zero-flag.t b/tests/bugs/shard/zero-flag.t
index fabf83040f0..6996150cd0e 100644
--- a/tests/bugs/shard/zero-flag.t
+++ b/tests/bugs/shard/zero-flag.t
@@ -17,7 +17,7 @@ TEST $CLI volume set $V0 features.shard on
TEST $CLI volume start $V0
TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0
-TEST gcc -Wall -O2 -I api/src -o $(dirname $0)/zero-flag $(dirname $0)/shard-fallocate.c -lgfapi
+TEST build_tester $(dirname $0)/shard-fallocate.c -lgfapi -Wall -O2
# On file1 confirm that when fallocate's offset + len > cur file size,
# the new file size will increase.
diff --git a/tests/env.rc.in b/tests/env.rc.in
index acd8f061fcd..82971c4a8de 100644
--- a/tests/env.rc.in
+++ b/tests/env.rc.in
@@ -1,5 +1,6 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
+libdir=@libdir@
PATH=@sbindir@:$PATH
export PATH
@@ -7,9 +8,18 @@ export PATH
LD_LIBRARY_PATH=@libdir@:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
+LIBRARY_PATH=@libdir@:$LIBRARY_PATH
+export LIBRARY_PATH
+
+CPATH=@includedir@:$CPATH
+export CPATH
+
GLUSTERD_WORKDIR=@GLUSTERD_WORKDIR@
export GLUSTERD_WORKDIR
+PKG_CONFIG_PATH=@pkgconfigdir@:$PKG_CONFIG_PATH
+export PKG_CONFIG_PATH
+
PYTHONPATH=@BUILD_PYTHON_SITE_PACKAGES@:$PYTHON_PATH
export PYTHONPATH
diff --git a/tests/include.rc b/tests/include.rc
index 61dd6ba59f9..f088a8d7e4a 100644
--- a/tests/include.rc
+++ b/tests/include.rc
@@ -617,6 +617,10 @@ function build_tester ()
local execname="${fname%.*}"
shift
local cflags=$*
+ if [ `echo $cflags | grep -c "lgfapi" ` -gt 0 ]
+ then
+ cflags="$cflags $(pkg-config glusterfs-api --cflags-only-I --libs-only-L)"
+ fi
$CC -g -o $(dirname $cfile)/$execname $cfile $cflags
}