"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.6/tests/bugs/ec/bug-1236065.t" (20 Aug 2021, 2132 Bytes) of package /linux/misc/glusterfs-8.6.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 and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "bug-1236065.t": 8.5_vs_8.6.

    1 #!/bin/bash
    2 
    3 . $(dirname $0)/../../include.rc
    4 . $(dirname $0)/../../volume.rc
    5 SCRIPT_TIMEOUT=400
    6 
    7 cleanup
    8 
    9 ec_test_dir=$M0/test
   10 
   11 function ec_test_generate_src()
   12 {
   13     mkdir -p $ec_test_dir
   14     for i in `seq 0 19`; do
   15         dd if=/dev/zero of=$ec_test_dir/$i.c bs=1024 count=2
   16     done
   17 }
   18 
   19 function ec_test_make()
   20 {
   21     for i in `ls *.c`; do
   22         file=`basename $i`
   23         filename=${file%.*}
   24         cp $i $filename.o
   25     done
   26 }
   27 
   28 ## step 1
   29 TEST glusterd
   30 TEST pidof glusterd
   31 TEST $CLI volume create $V0 disperse 7 redundancy 3 $H0:$B0/${V0}{0..6}
   32 TEST $CLI volume start $V0
   33 TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $M0
   34 EXPECT_WITHIN $CHILD_UP_TIMEOUT "7" ec_child_up_count $V0 0
   35 
   36 ## step 2
   37 TEST ec_test_generate_src
   38 
   39 cd $ec_test_dir
   40 TEST ec_test_make
   41 
   42 ## step 3
   43 TEST kill_brick $V0 $H0 $B0/${V0}0
   44 TEST kill_brick $V0 $H0 $B0/${V0}1
   45 EXPECT '5' online_brick_count
   46 
   47 TEST rm -f *.o
   48 TEST ec_test_make
   49 
   50 ## step 4
   51 TEST $CLI volume start $V0 force
   52 EXPECT_WITHIN $CHILD_UP_TIMEOUT "7" online_brick_count
   53 
   54 # active heal
   55 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status
   56 EXPECT_WITHIN $PROCESS_UP_TIMEOUT '7' ec_child_up_count_shd $V0 0
   57 TEST $CLI volume heal $V0 full
   58 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0
   59 
   60 TEST rm -f *.o
   61 TEST ec_test_make
   62 
   63 ## step 5
   64 TEST kill_brick $V0 $H0 $B0/${V0}2
   65 TEST kill_brick $V0 $H0 $B0/${V0}3
   66 EXPECT '5' online_brick_count
   67 
   68 TEST rm -f *.o
   69 TEST ec_test_make
   70 
   71 EXPECT '5' online_brick_count
   72 
   73 ## step 6
   74 TEST $CLI volume start $V0 force
   75 EXPECT_WITHIN $CHILD_UP_TIMEOUT "7" online_brick_count
   76 
   77 # self-healing
   78 EXPECT_WITHIN $PROCESS_UP_TIMEOUT "Y" glustershd_up_status
   79 EXPECT_WITHIN $PROCESS_UP_TIMEOUT '7' ec_child_up_count_shd $V0 0
   80 TEST $CLI volume heal $V0 full
   81 EXPECT_WITHIN $HEAL_TIMEOUT "^0$" get_pending_heal_count $V0
   82 
   83 TEST rm -f *.o
   84 TEST ec_test_make
   85 
   86 TEST pidof glusterd
   87 EXPECT "$V0" volinfo_field $V0 'Volume Name'
   88 EXPECT 'Started' volinfo_field $V0 'Status'
   89 EXPECT '7' online_brick_count
   90 ## cleanup
   91 cd
   92 EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
   93 TEST $CLI volume stop $V0
   94 TEST $CLI volume delete $V0
   95 TEST rm -rf $B0/*
   96 
   97 cleanup;