diff options
Diffstat (limited to 'tests/basic/gfapi')
| -rwxr-xr-x | tests/basic/gfapi/anonymous_fd.t (renamed from tests/basic/gfapi/anonymous_fd.sh) | 2 | ||||
| -rw-r--r-- | tests/basic/gfapi/anonymous_fd_read_write.c | 10 | ||||
| -rw-r--r-- | tests/basic/gfapi/bug-1241104.c | 11 | ||||
| -rwxr-xr-x | tests/basic/gfapi/bug-1241104.t (renamed from tests/basic/gfapi/bug-1241104.sh) | 8 | ||||
| -rw-r--r-- | tests/basic/gfapi/bug1283983.c | 10 | ||||
| -rwxr-xr-x | tests/basic/gfapi/bug1283983.sh | 6 | ||||
| -rw-r--r-- | tests/basic/gfapi/bug1291259.c | 13 | ||||
| -rwxr-xr-x | tests/basic/gfapi/bug1291259.t (renamed from tests/basic/gfapi/bug1291259.sh) | 6 | ||||
| -rw-r--r-- | tests/basic/gfapi/gfapi-dup.c | 10 | ||||
| -rwxr-xr-x | tests/basic/gfapi/gfapi-dup.t (renamed from tests/basic/gfapi/gfapi-dup.sh) | 6 | ||||
| -rw-r--r-- | tests/basic/gfapi/libgfapi-fini-hang.c | 16 | ||||
| -rwxr-xr-x | tests/basic/gfapi/libgfapi-fini-hang.t (renamed from tests/basic/gfapi/libgfapi-fini-hang.sh) | 4 | ||||
| -rw-r--r-- | tests/basic/gfapi/seek.c | 16 | ||||
| -rw-r--r-- | tests/basic/gfapi/upcall-cache-invalidate.c | 13 | ||||
| -rwxr-xr-x | tests/basic/gfapi/upcall-cache-invalidate.t (renamed from tests/basic/gfapi/upcall-cache-invalidate.sh) | 6 | 
15 files changed, 75 insertions, 62 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 76db8d5ca09..abbe44878b3 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 a0cd821a185..7fc1a48da6e 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    callback_arg cbk;          char      *logfile = NULL;          char      *volname = NULL; +        char      *hostname = NULL;          int        cnt = 1;          int       upcall_received = 0;          struct callback_inode_arg *in_arg = NULL; @@ -52,13 +52,14 @@ main (int argc, char *argv[])          unsigned char   globjhdl2[GFAPI_HANDLE_LENGTH];          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); @@ -67,7 +68,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); @@ -89,7 +90,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 13cca69da89..2615f65764f 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    callback_arg cbk;          char      *logfile = NULL;          char      *volname = NULL; +        char      *hostname = NULL;          struct 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); @@ -81,7 +82,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  | 
