1
0
mirror of https://github.com/gluster/glusterfs.git synced 2026-02-07 03:48:44 +01:00
Files
glusterfs/tests/basic/afr/arbiter-cli.t
Ravishankar N f41f7dec05 cli: syntax check for arbiter volume creation (#2207)
commit 8e7bfd6a58 changed the syntax for
arbiter volume creation to 'replica 2 arbiter 1', while still allowing
the old syntax of 'replica 3 arbiter 1'. But while doing so, it also
removed a conditional check, thereby allowing replica count > 3. This
patch fixes it.

Fixes: #2192
Change-Id: Ie109325adb6d78e287e658fd5f59c26ad002e2d3
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
2021-03-05 11:54:46 +05:30

32 lines
967 B
Bash

#!/bin/bash
. $(dirname $0)/../../include.rc
. $(dirname $0)/../../volume.rc
. $(dirname $0)/../../afr.rc
cleanup;
# Negative test cases for arbiter volume creation should not crash.
TEST glusterd;
TEST pidof glusterd
# No replica count.
TEST ! $CLI volume create $V0 arbiter 3 $H0:$B0/${V0}{0,1,2}
# replica count given after arbiter count.
TEST ! $CLI volume create $V0 arbiter 1 replica 3 $H0:$B0/${V0}{0,1,2}
# Incorrect values for replica and arbiter count.
TEST ! $CLI volume create $V0 replica 3 arbiter 2 $H0:$B0/${V0}{0,1,2}
TEST ! $CLI volume create $V0 replica 4 arbiter 1 $H0:$B0/${V0}{0,1,2,3}
# Correct setup
# Only documented value is replica=2 and arbiter=1.
TEST $CLI volume create $V0 replica 2 arbiter 1 $H0:$B0/${V0}{0,1,2}
# Earlier documents mentioned 'replica 3 arbiter 1' as the valid option
# Preserve backward compatibility till Oct, 2019.
TEST $CLI volume create ${V0}-old replica 3 arbiter 1 $H0:$B0/${V0}-old{0,1,2}
cleanup