"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-6.9/tests/bugs/glusterd/add-brick-and-validate-replicated-volume-options.t" (23 Apr 2020, 3780 Bytes) of package /linux/misc/glusterfs-6.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 . $(dirname $0)/../../include.rc
    3 . $(dirname $0)/../../volume.rc
    4 
    5 cleanup;
    6 
    7 TEST glusterd
    8 TEST pidof glusterd
    9 TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1,2};
   10 TEST $CLI volume start $V0
   11 EXPECT_WITHIN $PROCESS_UP_TIMEOUT 'Started' volinfo_field $V0 'Status';
   12 
   13 #bug-1102656 - validating volume top command
   14 
   15 TEST $CLI volume top $V0 open
   16 TEST ! $CLI volume top $V0 open brick $H0:/tmp/brick
   17 TEST $CLI volume top $V0 read
   18 
   19 TEST $CLI volume status
   20 
   21 #bug- 1002556
   22 EXPECT '1 x 2 = 2' volinfo_field $V0 'Number of Bricks';
   23 
   24 TEST $CLI volume add-brick $V0 replica 3 $H0:$B0/${V0}3
   25 EXPECT '1 x 3 = 3' volinfo_field $V0 'Number of Bricks';
   26 
   27 TEST $CLI volume remove-brick $V0 replica 2 $H0:$B0/${V0}3 force
   28 EXPECT '1 x 2 = 2' volinfo_field $V0 'Number of Bricks';
   29 
   30 TEST killall glusterd
   31 TEST glusterd
   32 
   33 EXPECT '1 x 2 = 2' volinfo_field $V0 'Number of Bricks';
   34 
   35 #bug-1406411- fail-add-brick-when-replica-count-changes
   36 
   37 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}1
   38 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}2
   39 TEST kill_brick $V0 $H0 $B0/${V0}1
   40 
   41 #add-brick should fail
   42 TEST ! $CLI_NO_FORCE volume add-brick $V0 replica 3 $H0:$B0/${V0}3
   43 
   44 TEST $CLI volume start $V0 force
   45 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}1
   46 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/${V0}2
   47 TEST $CLI volume add-brick $V0 replica 3 $H0:$B0/${V0}3
   48 
   49 TEST $CLI volume create $V1 $H0:$B0/${V1}{1,2};
   50 TEST $CLI volume start $V1
   51 
   52 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V1 $H0 $B0/${V1}1
   53 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V1 $H0 $B0/${V1}2
   54 TEST kill_brick $V1 $H0 $B0/${V1}1
   55 
   56 #add-brick should fail
   57 TEST ! $CLI_NO_FORCE volume add-brick $V1 replica 2 $H0:$B0/${V1}{3,4}
   58 
   59 TEST $CLI volume start $V1 force
   60 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V1 $H0 $B0/${V1}1
   61 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V1 $H0 $B0/${V1}2
   62 
   63 TEST $CLI volume add-brick $V1 replica 2 $H0:$B0/${V1}{3,4}
   64 
   65 #bug-905307 - validate cluster.post-op-delay-secs option
   66 
   67 #Strings should not be accepted.
   68 TEST ! $CLI volume set $V0 cluster.post-op-delay-secs abc
   69 
   70 #-ve ints should not be accepted.
   71 TEST ! $CLI volume set $V0 cluster.post-op-delay-secs -1
   72 
   73 #INT_MAX+1 should not be accepted.
   74 TEST ! $CLI volume set $V0 cluster.post-op-delay-secs 2147483648
   75 
   76 #floats should not be accepted.
   77 TEST ! $CLI volume set $V0 cluster.post-op-delay-secs 1.25
   78 
   79 #min val 0 should be accepted
   80 TEST $CLI volume set $V0 cluster.post-op-delay-secs 0
   81 EXPECT "0" volume_option $V0 cluster.post-op-delay-secs
   82 
   83 #max val 2147483647 should be accepted
   84 TEST $CLI volume set $V0 cluster.post-op-delay-secs 2147483647
   85 EXPECT "2147483647" volume_option $V0 cluster.post-op-delay-secs
   86 
   87 #some middle val in range 2147 should be accepted
   88 TEST $CLI volume set $V0 cluster.post-op-delay-secs 2147
   89 EXPECT "2147" volume_option $V0 cluster.post-op-delay-secs
   90 
   91 #bug-1265479 - validate-replica-volume-options
   92 
   93 #Setting data-self-heal option on for distribute-replicate volume
   94 TEST $CLI volume set $V1 data-self-heal on
   95 EXPECT 'on' volinfo_field $V1 'cluster.data-self-heal';
   96 TEST $CLI volume set $V1 cluster.data-self-heal on
   97 EXPECT 'on' volinfo_field $V1 'cluster.data-self-heal';
   98 
   99 #Setting metadata-self-heal option on for distribute-replicate volume
  100 TEST $CLI volume set $V1 metadata-self-heal on
  101 EXPECT 'on' volinfo_field $V1 'cluster.metadata-self-heal';
  102 TEST $CLI volume set $V1 cluster.metadata-self-heal on
  103 
  104 #Setting entry-self-heal option on for distribute-replicate volume
  105 TEST $CLI volume set $V1 entry-self-heal on
  106 EXPECT 'on' volinfo_field $V1 'cluster.entry-self-heal';
  107 TEST $CLI volume set $V1 cluster.entry-self-heal on
  108 EXPECT 'on' volinfo_field $V1 'cluster.entry-self-heal';
  109 
  110 cleanup