"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-6.9/tests/bugs/bitrot/1207029-bitrot-daemon-should-start-on-valid-node.t" (23 Apr 2020, 1732 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 
    3 ## Test case for bitrot
    4 ## bitd daemon should not start on the node which dont have any brick
    5 
    6 
    7 . $(dirname $0)/../../include.rc
    8 . $(dirname $0)/../../volume.rc
    9 . $(dirname $0)/../../cluster.rc
   10 
   11 cleanup;
   12 
   13 function get_bitd_count {
   14         ps auxw | grep glusterfs | grep bitd.pid | grep -v grep | wc -l
   15 }
   16 
   17 ## Start a 2 node virtual cluster
   18 TEST launch_cluster 2;
   19 
   20 ## Peer probe server 2 from server 1 cli
   21 TEST $CLI_1 peer probe $H2;
   22 
   23 EXPECT_WITHIN $PROBE_TIMEOUT 1 peer_count
   24 
   25 ## Creating a volume which is having brick only on one node
   26 TEST $CLI_1 volume create $V0 $H1:$B1/${V0}0 $H1:$B1/${V0}1
   27 
   28 ## Start the volume
   29 TEST $CLI_1 volume start $V0
   30 
   31 ## Enable bitrot on volume from 2nd node.
   32 TEST $CLI_2 volume bitrot $V0 enable
   33 
   34 ## Bitd daemon should be running on the node which is having brick. Here node1
   35 ## only have brick so bitrot daemon count value should be 1.
   36 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_bitd_count
   37 
   38 ## Bitd daemon should not run on 2nd node and it should not create bitrot
   39 ## volfile on this node. Below test case it to check whether its creating bitrot
   40 ## volfile or not for 2nd node which dont have any brick.
   41 ## Get current working directory of 2nd node which dont have any brick and do
   42 ## stat on bitrot volfile.
   43 
   44 cur_wrk_dir2=$($CLI_2 system:: getwd)
   45 TEST ! stat $cur_wrk_dir2/bitd/bitd-server.vol
   46 
   47 
   48 ## Bitd daemon should run on 1st node and it should create bitrot
   49 ## volfile on this node. Below test case it to check whether its creating bitrot
   50 ## volfile or not for 1st node which is having brick.
   51 ## Get current working directory of 1st node which have brick and do
   52 ## stat on bitrot volfile.
   53 
   54 cur_wrk_dir1=$($CLI_1 system:: getwd)
   55 TEST stat $cur_wrk_dir1/bitd/bitd-server.vol
   56 
   57 cleanup;