From a128d1b9ad23b6c1b855401844cf133a492e0bca Mon Sep 17 00:00:00 2001 From: Vinayak Hegde Date: Thu, 26 Nov 2009 01:46:24 -0800 Subject: Regression test case for bug 143. Signed-off-by: Vijay Bellur --- 143/regr/ctestfun.c | 38 ++++++++++++++++++++++++++++++++++++++ 143/regr/spec_files/client1.vol | 33 +++++++++++++++++++++++++++++++++ 143/regr/spec_files/server1.vol | 24 ++++++++++++++++++++++++ 143/regr/spec_files/server2.vol | 24 ++++++++++++++++++++++++ 143/regr/testcase | 20 ++++++++++++++++++++ 5 files changed, 139 insertions(+) create mode 100644 143/regr/ctestfun.c create mode 100644 143/regr/spec_files/client1.vol create mode 100644 143/regr/spec_files/server1.vol create mode 100644 143/regr/spec_files/server2.vol create mode 100755 143/regr/testcase (limited to '143') 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 +#include +#include +#include +#include +#include +#include +#include + +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 -- cgit