diff options
Diffstat (limited to 'tests/bugs/cli')
| -rw-r--r-- | tests/bugs/cli/bug-1022905.t | 1 | ||||
| -rw-r--r-- | tests/bugs/cli/bug-1169302.c | 79 | ||||
| -rwxr-xr-x | tests/bugs/cli/bug-1169302.t | 55 | ||||
| -rwxr-xr-x | tests/bugs/cli/bug-1320388.t | 6 | ||||
| -rw-r--r-- | tests/bugs/cli/bug-1353156-get-state-cli-validations.t | 52 | ||||
| -rw-r--r-- | tests/bugs/cli/bug-1378842-volume-get-all.t | 3 | ||||
| -rwxr-xr-x | tests/bugs/cli/bug-770655.t | 168 | ||||
| -rwxr-xr-x | tests/bugs/cli/bug-822830.t | 2 | ||||
| -rw-r--r-- | tests/bugs/cli/bug-961307.t | 2 | ||||
| -rw-r--r-- | tests/bugs/cli/bug-983317-volume-get.t | 13 |
10 files changed, 187 insertions, 194 deletions
diff --git a/tests/bugs/cli/bug-1022905.t b/tests/bugs/cli/bug-1022905.t index 1d8981e0e9c..ee629e970d9 100644 --- a/tests/bugs/cli/bug-1022905.t +++ b/tests/bugs/cli/bug-1022905.t @@ -32,7 +32,6 @@ TEST $CLI volume set $V0 diagnostics.client-log-level DEBUG TEST $CLI volume reset $V0 force; TEST $CLI volume stop $V0 -EXPECT "1" get_aux TEST $CLI volume delete $V0 cleanup; diff --git a/tests/bugs/cli/bug-1169302.c b/tests/bugs/cli/bug-1169302.c new file mode 100644 index 00000000000..7c6b5fbf856 --- /dev/null +++ b/tests/bugs/cli/bug-1169302.c @@ -0,0 +1,79 @@ +#include <errno.h> +#include <stdio.h> +#include <signal.h> + +#include <glusterfs/api/glfs.h> +#include <glusterfs/api/glfs-handles.h> + +int keep_running = 1; + +void +stop_running(int sig) +{ + if (sig == SIGTERM) + keep_running = 0; +} + +int +main(int argc, char *argv[]) +{ + glfs_t *fs = NULL; + int ret = 0; + glfs_fd_t *fd = NULL; + char *filename = NULL; + char *logfile = NULL; + char *host = NULL; + + if (argc != 5) { + return -1; + } + + host = argv[2]; + logfile = argv[3]; + filename = argv[4]; + + /* setup signal handler for exiting */ + signal(SIGTERM, stop_running); + + fs = glfs_new(argv[1]); + if (!fs) { + return -1; + } + + ret = glfs_set_volfile_server(fs, "tcp", host, 24007); + if (ret < 0) { + return -1; + } + + ret = glfs_set_logging(fs, logfile, 7); + if (ret < 0) { + return -1; + } + + ret = glfs_init(fs); + if (ret < 0) { + return -1; + } + + fd = glfs_creat(fs, filename, O_RDWR, 0644); + if (!fd) { + return -1; + } + + /* sleep until SIGTERM has been received */ + while (keep_running) { + sleep(1); + } + + ret = glfs_close(fd); + if (ret < 0) { + return -1; + } + + ret = glfs_fini(fs); + if (ret < 0) { + return -1; + } + + return 0; +} diff --git a/tests/bugs/cli/bug-1169302.t b/tests/bugs/cli/bug-1169302.t new file mode 100755 index 00000000000..19660e033a8 --- /dev/null +++ b/tests/bugs/cli/bug-1169302.t @@ -0,0 +1,55 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../cluster.rc + +function check_peers { + $CLI_1 peer status | grep 'Peer in Cluster (Connected)' | wc -l +} +cleanup + +#setup cluster and test volume +TEST launch_cluster 3; # start 3-node virtual cluster +TEST $CLI_1 peer probe $H2; # peer probe server 2 from server 1 cli +TEST $CLI_1 peer probe $H3; # peer probe server 3 from server 1 cli + +EXPECT_WITHIN $PROBE_TIMEOUT 2 check_peers; + +TEST $CLI_1 volume create $V0 $H1:$B1/$V0 $H2:$B2/$V0 $H3:$B3/$V0 +TEST $CLI_1 volume start $V0 + +# test CLI parameter acceptance +TEST $CLI_1 volume statedump $V0 +TEST $CLI_2 volume statedump $V0 +TEST $CLI_3 volume statedump $V0 +TEST ! $CLI_1 volume statedump $V0 client $H2:0 +TEST ! $CLI_2 volume statedump $V0 client $H2:-1 +TEST $CLI_3 volume statedump $V0 client $H2:765 +TEST ! $CLI_1 volume statedump $V0 client $H2: +TEST ! $CLI_2 volume statedump $V0 client +TEST ! $CLI_3 volume statedump $V0 client $H2 $GFAPI_PID + +# build and run a gfapi appliction for triggering a statedump +logdir=`gluster --print-logdir` +STATEDUMP_TIMEOUT=60 + +build_tester $(dirname $0)/bug-1169302.c -lgfapi +$(dirname $0)/bug-1169302 $V0 $H1 $logdir/bug-1169302.log testfile & GFAPI_PID=$! + +cleanup_statedump + +# Take the statedump of the process connected to $H1, it should match the +# hostname or IP-address with the connection from the bug-1169302 executable. +# In our CI it seems not possible to use $H0, 'localhost', $(hostname --fqdn) +# or even "127.0.0.1".... +sleep 2 +host=`netstat -nap | grep $GFAPI_PID | grep 24007 | awk '{print $4}' | cut -d: -f1` +TEST $CLI_3 volume statedump $V0 client $host:$GFAPI_PID +EXPECT_WITHIN $STATEDUMP_TIMEOUT "Y" path_exists $statedumpdir/glusterdump.$GFAPI_PID* + +kill $GFAPI_PID + +cleanup_statedump +cleanup_tester $(dirname $0)/bug-1169302 +cleanup
\ No newline at end of file diff --git a/tests/bugs/cli/bug-1320388.t b/tests/bugs/cli/bug-1320388.t index f6ea3d6c882..e719fc59033 100755 --- a/tests/bugs/cli/bug-1320388.t +++ b/tests/bugs/cli/bug-1320388.t @@ -19,15 +19,17 @@ SSL_CA=$SSL_BASE/glusterfs.ca cleanup; rm -f $SSL_BASE/glusterfs.* -touch /var/lib/glusterd/secure-access +touch "$GLUSTERD_WORKDIR"/secure-access -TEST openssl genrsa -out $SSL_KEY 1024 +TEST openssl genrsa -out $SSL_KEY 2048 TEST openssl req -new -x509 -key $SSL_KEY -subj /CN=Anyone -out $SSL_CERT ln $SSL_CERT $SSL_CA TEST glusterd TEST pidof glusterd TEST $CLI volume create $V0 disperse 6 redundancy 2 $H0:$B0/${V0}{0..5} +TEST $CLI volume set $V0 disperse.eager-lock off +TEST $CLI volume set $V0 disperse.other-eager-lock off TEST $CLI volume start $V0 TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0 EXPECT_WITHIN $CHILD_UP_TIMEOUT "^6$" ec_child_up_count $V0 0 diff --git a/tests/bugs/cli/bug-1353156-get-state-cli-validations.t b/tests/bugs/cli/bug-1353156-get-state-cli-validations.t index 6ab7a084da0..a4556c9c997 100644 --- a/tests/bugs/cli/bug-1353156-get-state-cli-validations.t +++ b/tests/bugs/cli/bug-1353156-get-state-cli-validations.t @@ -43,7 +43,6 @@ push_trapfunc rm -rf $ODIR TEST $CLI volume create $V0 disperse $H0:$B0/b1 $H0:$B0/b2 $H0:$B0/b3 TEST $CLI volume start $V0 -TEST $CLI volume tier $V0 attach replica 2 $H0:$B1/b4 $H0:$B1/b5 TEST setup_lvm 1 TEST $CLI volume create $V1 $H0:$L1; @@ -77,7 +76,25 @@ TEST positive_test $CLI get-state odir $ODIR file gdstate TEST positive_test $CLI get-state glusterd odir $ODIR file gdstate -TEST positive_test $CLI get-state glusterd odir $ODIR file gdstate +TEST positive_test $CLI get-state detail + +TEST positive_test $CLI get-state glusterd detail + +TEST positive_test $CLI get-state odir $ODIR detail + +TEST positive_test $CLI get-state glusterd odir $ODIR detail + +TEST positive_test $CLI get-state glusterd odir $ODIR file gdstate detail + +TEST positive_test $CLI get-state volumeoptions + +TEST positive_test $CLI get-state glusterd volumeoptions + +TEST positive_test $CLI get-state odir $ODIR volumeoptions + +TEST positive_test $CLI get-state glusterd odir $ODIR volumeoptions + +TEST positive_test $CLI get-state glusterd odir $ODIR file gdstate volumeoptions TEST ! $CLI get-state glusterfsd odir $ODIR; ERRSTR=$($CLI get-state glusterfsd odir $ODIR 2>&1 >/dev/null); @@ -111,19 +128,20 @@ TEST ! $CLI get-state glusterd foo bar; ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null); EXPECT 'Problem' get_parsing_arguments_part $ERRSTR; -cleanup; +TEST ! $CLI get-state glusterd detail file gdstate; +ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null); +EXPECT 'Problem' get_parsing_arguments_part $ERRSTR; + +TEST ! $CLI get-state glusterd foo bar detail; +ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null); +EXPECT 'Problem' get_parsing_arguments_part $ERRSTR; -# I've cleaned this up as much as I can - making sure the gdstates directory -# gets cleaned up, checking whether the CLI command actually succeeded before -# parsing its output, etc. - but it still fails in Jenkins. Specifically, the -# first get-state request that hits the server (i.e. doesn't bail out with a -# parse error first) succeeds, but any others time out. They don't even get as -# far as the glusterd log message that says we received a get-state request. -# There doesn't seem to be a core file, so glusterd doesn't seem to have -# crashed, but it's not responding either. Even worse, the problem seems to be -# environment-dependent; Jenkins is the only place I've seen it, and that's -# just about the worst environment ever for debugging anything. -# -# I'm marking this test bad so progress can be made elsewhere. If anybody else -# thinks this functionality is important, and wants to make it debuggable, good -# luck to you. +TEST ! $CLI get-state glusterd volumeoptions file gdstate; +ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null); +EXPECT 'Problem' get_parsing_arguments_part $ERRSTR; + +TEST ! $CLI get-state glusterd foo bar volumeoptions; +ERRSTR=$($CLI get-state glusterd foo bar 2>&1 >/dev/null); +EXPECT 'Problem' get_parsing_arguments_part $ERRSTR; + +cleanup; diff --git a/tests/bugs/cli/bug-1378842-volume-get-all.t b/tests/bugs/cli/bug-1378842-volume-get-all.t index c798ce5ceff..be41f25b000 100644 --- a/tests/bugs/cli/bug-1378842-volume-get-all.t +++ b/tests/bugs/cli/bug-1378842-volume-get-all.t @@ -12,9 +12,6 @@ TEST $CLI volume set all server-quorum-ratio 80 # Execute volume get without having an explicit option, this should fail TEST ! $CLI volume get all -# Also volume get on an option not applicable for all volumes should fail -TEST ! $CLI volume get all cluster.tier-mode - # Execute volume get with an explicit global option TEST $CLI volume get all server-quorum-ratio EXPECT '80' volume_get_field all 'cluster.server-quorum-ratio' diff --git a/tests/bugs/cli/bug-770655.t b/tests/bugs/cli/bug-770655.t deleted file mode 100755 index 4e0b20d62da..00000000000 --- a/tests/bugs/cli/bug-770655.t +++ /dev/null @@ -1,168 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -cleanup; - -## Start and create a distribute-replicate volume -TEST glusterd; -TEST pidof glusterd; -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; - -## Verify volume is created -EXPECT "$V0" volinfo_field $V0 'Volume Name'; -EXPECT 'Created' volinfo_field $V0 'Status'; -EXPECT 'Distributed-Replicate' volinfo_field $V0 'Type'; - -## Start volume and verify -TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; - -## Setting stripe-block-size as 10MB -TEST ! $CLI volume set $V0 stripe-block-size 10MB -EXPECT '' volinfo_field $V0 'cluster.stripe-block-size'; - -## Finish up -TEST $CLI volume stop $V0; -EXPECT 'Stopped' volinfo_field $V0 'Status'; - -TEST $CLI volume delete $V0; -TEST ! $CLI volume info $V0; - -cleanup; - -## Start and create a replicate volume -TEST glusterd; -TEST pidof glusterd; -TEST $CLI volume create $V0 replica 8 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; - -## Verify volume is created -EXPECT "$V0" volinfo_field $V0 'Volume Name'; -EXPECT 'Created' volinfo_field $V0 'Status'; -EXPECT 'Replicate' volinfo_field $V0 'Type'; - -## Start volume and verify -TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; - -## Setting stripe-block-size as 10MB -TEST ! $CLI volume set $V0 stripe-block-size 10MB -EXPECT '' volinfo_field $V0 'cluster.stripe-block-size'; - -## Finish up -TEST $CLI volume stop $V0; -EXPECT 'Stopped' volinfo_field $V0 'Status'; - -TEST $CLI volume delete $V0; -TEST ! $CLI volume info $V0; - -cleanup; - -## Start and create a distribute volume -TEST glusterd; -TEST pidof glusterd; -TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; - -## Verify volume is created -EXPECT "$V0" volinfo_field $V0 'Volume Name'; -EXPECT 'Created' volinfo_field $V0 'Status'; -EXPECT 'Distribute' volinfo_field $V0 'Type'; - -## Start volume and verify -TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; - -## Setting stripe-block-size as 10MB -TEST ! $CLI volume set $V0 stripe-block-size 10MB -EXPECT '' volinfo_field $V0 'cluster.stripe-block-size'; - -## Finish up -TEST $CLI volume stop $V0; -EXPECT 'Stopped' volinfo_field $V0 'Status'; - -TEST $CLI volume delete $V0; -TEST ! $CLI volume info $V0; - -cleanup; - -## Start and create a stripe volume -TEST glusterd; -TEST pidof glusterd; -TEST $CLI volume create $V0 stripe 8 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; - -## Verify volume is created -EXPECT "$V0" volinfo_field $V0 'Volume Name'; -EXPECT 'Created' volinfo_field $V0 'Status'; -EXPECT 'Stripe' volinfo_field $V0 'Type'; - -## Start volume and verify -TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; - -## Setting stripe-block-size as 10MB -TEST $CLI volume set $V0 stripe-block-size 10MB -EXPECT '10MB' volinfo_field $V0 'cluster.stripe-block-size'; - -## Finish up -TEST $CLI volume stop $V0; -EXPECT 'Stopped' volinfo_field $V0 'Status'; - -TEST $CLI volume delete $V0; -TEST ! $CLI volume info $V0; - -cleanup; - -## Start and create a distributed stripe volume -TEST glusterd; -TEST pidof glusterd; -TEST $CLI volume create $V0 stripe 4 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; - -## Verify volume is created -EXPECT "$V0" volinfo_field $V0 'Volume Name'; -EXPECT 'Created' volinfo_field $V0 'Status'; -EXPECT 'Distributed-Stripe' volinfo_field $V0 'Type'; - -## Start volume and verify -TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; - -## Setting stripe-block-size as 10MB -TEST $CLI volume set $V0 stripe-block-size 10MB -EXPECT '10MB' volinfo_field $V0 'cluster.stripe-block-size'; - -## Finish up -TEST $CLI volume stop $V0; -EXPECT 'Stopped' volinfo_field $V0 'Status'; - -TEST $CLI volume delete $V0; -TEST ! $CLI volume info $V0; - -cleanup; - -## Start and create a distributed stripe replicate volume -TEST glusterd; -TEST pidof glusterd; -TEST $CLI volume create $V0 stripe 2 replica 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; - -## Verify volume is created -EXPECT "$V0" volinfo_field $V0 'Volume Name'; -EXPECT 'Created' volinfo_field $V0 'Status'; -EXPECT 'Distributed-Striped-Replicate' volinfo_field $V0 'Type'; - -## Start volume and verify -TEST $CLI volume start $V0; -EXPECT 'Started' volinfo_field $V0 'Status'; - -## Setting stripe-block-size as 10MB -TEST $CLI volume set $V0 stripe-block-size 10MB -EXPECT '10MB' volinfo_field $V0 'cluster.stripe-block-size'; - -## Finish up -TEST $CLI volume stop $V0; -EXPECT 'Stopped' volinfo_field $V0 'Status'; - -TEST $CLI volume delete $V0; -TEST ! $CLI volume info $V0; - -cleanup; diff --git a/tests/bugs/cli/bug-822830.t b/tests/bugs/cli/bug-822830.t index b66aa4f8981..a9904854110 100755 --- a/tests/bugs/cli/bug-822830.t +++ b/tests/bugs/cli/bug-822830.t @@ -8,7 +8,7 @@ cleanup; ## Start and create a volume TEST glusterd; TEST pidof glusterd; -TEST $CLI volume create $V0 replica 2 stripe 2 $H0:$B0/${V0}{1,2,3,4,5,6,7,8}; +TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{1,2,3,4,5,6}; ## Verify volume is is created EXPECT "$V0" volinfo_field $V0 'Volume Name'; diff --git a/tests/bugs/cli/bug-961307.t b/tests/bugs/cli/bug-961307.t index 68fc7bb6a15..602a6e34bce 100644 --- a/tests/bugs/cli/bug-961307.t +++ b/tests/bugs/cli/bug-961307.t @@ -13,7 +13,7 @@ TEST pidof glusterd TEST $CLI volume create $V0 replica $REPLICA $H0:$B0/${V0}-00 $H0:$B0/${V0}-01 $H0:$B0/${V0}-10 $H0:$B0/${V0}-11 TEST $CLI volume start $V0 -var1=$(gluster volume remove-brick $H0:$B0/${V0}-00 $H0:$B0/${V0}-01 start 2>&1) +var1=$($CLI volume remove-brick $H0:$B0/${V0}-00 $H0:$B0/${V0}-01 start 2>&1) var2="volume remove-brick start: failed: Volume $H0:$B0/${V0}-00 does not exist" EXPECT "$var2" echo "$var1" diff --git a/tests/bugs/cli/bug-983317-volume-get.t b/tests/bugs/cli/bug-983317-volume-get.t index 8f09d588565..c793bbc9f0c 100644 --- a/tests/bugs/cli/bug-983317-volume-get.t +++ b/tests/bugs/cli/bug-983317-volume-get.t @@ -7,7 +7,8 @@ cleanup; TEST glusterd TEST pidof glusterd -TEST $CLI volume create $V0 $H0:$B0/$V0 +TEST $CLI volume create $V0 $H0:$B0/${V0}{1,2}; +EXPECT 'Created' volinfo_field $V0 'Status'; # Set a volume option TEST $CLI volume set $V0 open-behind on @@ -32,3 +33,13 @@ EXPECT '80' volume_get_field $V0 'server-quorum-ratio' # Check user.* options can also be retrived using volume get EXPECT 'dummy' volume_get_field $V0 'user.metadata' + +TEST $CLI volume set all brick-multiplex enable +EXPECT 'enable' volume_get_field $V0 'brick-multiplex' + +TEST $CLI volume set all brick-multiplex disable +EXPECT 'disable' volume_get_field $V0 'brick-multiplex' + +#setting an cluster level option for single volume should fail +TEST ! $CLI volume set $V0 brick-multiplex enable + |
