summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinayak Hegde <vinayak@gluster.com>2009-11-26 01:46:24 -0800
committerVijay Bellur <vijay@gluster.com>2009-12-01 19:10:18 +0530
commita128d1b9ad23b6c1b855401844cf133a492e0bca (patch)
tree4927e5931c4add55a5f76ba199f498a5894970e6
parent407beff649bae9e61b2994167699f0c737884aad (diff)
Regression test case for bug 143.
Signed-off-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--143/regr/ctestfun.c38
-rw-r--r--143/regr/spec_files/client1.vol33
-rw-r--r--143/regr/spec_files/server1.vol24
-rw-r--r--143/regr/spec_files/server2.vol24
-rwxr-xr-x143/regr/testcase20
5 files changed, 139 insertions, 0 deletions
diff --git a/143/regr/ctestfun.c b/143/regr/ctestfun.c
new file mode 100644
index 0000000..4184a21
--- /dev/null
+++ b/143/regr/ctestfun.c
@@ -0,0 +1,38 @@
+#include <unistd.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <malloc.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main (int argc,char *argv[]) {
+ char *n0 = NULL;
+ struct stat *buf1 = NULL;
+ int ret = 0;
+
+ n0 = argv[1];
+ buf1 = calloc (1, sizeof (*buf1));
+ gid_t list[3] = {65533, 65532, 65531};
+
+ creat (n0, 0644);
+ chown (n0, 65534, 65533);
+ chmod (n0, 06555);
+
+ setgroups (3, &list);
+ setuid (65534);
+
+ chown (n0, 65534, 65532);
+ ret = stat (n0, buf1);
+ if (ret == -1) {
+ printf ("stat error, error no = %d",errno);
+ exit (EXIT_FAILURE);
+ }
+ if (buf1->st_gid != 65532)
+ exit (EXIT_FAILURE);
+
+ free (buf1);
+
+ exit (EXIT_SUCCESS);
+}
diff --git a/143/regr/spec_files/client1.vol b/143/regr/spec_files/client1.vol
new file mode 100644
index 0000000..b46dbbe
--- /dev/null
+++ b/143/regr/spec_files/client1.vol
@@ -0,0 +1,33 @@
+volume remote1
+ type protocol/client
+ option transport-type tcp
+ option remote-port 9346
+ option remote-host 127.0.0.1
+ option remote-subvolume brick
+end-volume
+
+volume remote2
+ type protocol/client
+ option transport-type tcp
+ option remote-port 9347
+ option remote-host 127.0.0.1
+ option remote-subvolume brick
+end-volume
+
+volume replicate
+ type cluster/replicate
+ subvolumes remote1 remote2
+end-volume
+
+volume writebehind
+ type performance/write-behind
+ option window-size 1MB
+ subvolumes replicate
+end-volume
+
+volume cache
+ type performance/io-cache
+ option cache-size 512MB
+ subvolumes writebehind
+end-volume
+
diff --git a/143/regr/spec_files/server1.vol b/143/regr/spec_files/server1.vol
new file mode 100644
index 0000000..c66f7e1
--- /dev/null
+++ b/143/regr/spec_files/server1.vol
@@ -0,0 +1,24 @@
+volume posix
+ type storage/posix
+ option directory /share/tickets/143/regr/export/export1
+end-volume
+
+volume locks
+ type features/locks
+ subvolumes posix
+end-volume
+
+volume brick
+ type performance/io-threads
+ option thread-count 8
+ subvolumes locks
+end-volume
+
+volume server
+ type protocol/server
+ option transport-type tcp
+ option listen-port 9346
+ option auth.addr.brick.allow *
+ subvolumes brick
+end-volume
+
diff --git a/143/regr/spec_files/server2.vol b/143/regr/spec_files/server2.vol
new file mode 100644
index 0000000..45909a4
--- /dev/null
+++ b/143/regr/spec_files/server2.vol
@@ -0,0 +1,24 @@
+volume posix
+ type storage/posix
+ option directory /share/tickets/143/regr/export/export2
+end-volume
+
+volume locks
+ type features/locks
+ subvolumes posix
+end-volume
+
+volume brick
+ type performance/io-threads
+ option thread-count 8
+ subvolumes locks
+end-volume
+
+volume server
+ type protocol/server
+ option transport-type tcp
+ option listen-port 9347
+ option auth.addr.brick.allow *
+ subvolumes brick
+end-volume
+
diff --git a/143/regr/testcase b/143/regr/testcase
new file mode 100755
index 0000000..695156f
--- /dev/null
+++ b/143/regr/testcase
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+description="# (143) Mysterious lost chown call"
+comments="# Fix will be by adding setattr() fop to glusterfs."
+
+source ../../init
+
+start_glusterfs
+
+gcc -o ctestfun ctestfun.c
+./ctestfun $MOUNTDIR/client1/1
+
+if [ $? -ne 0 ];then
+ not_ok $description
+ comment $comments
+else
+ ok $description
+fi
+
+cleanup_glusterfs