"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-6.9/tests/00-geo-rep/00-georep-verify-setup.t" (23 Apr 2020, 2533 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 . $(dirname $0)/../include.rc
    4 . $(dirname $0)/../volume.rc
    5 . $(dirname $0)/../geo-rep.rc
    6 . $(dirname $0)/../env.rc
    7 
    8 SCRIPT_TIMEOUT=300
    9 
   10 ##Cleanup and start glusterd
   11 cleanup;
   12 TEST glusterd;
   13 TEST pidof glusterd
   14 
   15 
   16 ##Variables
   17 GEOREP_CLI="$CLI volume geo-replication"
   18 master=$GMV0
   19 SH0="127.0.0.1"
   20 slave=${SH0}::${GSV0}
   21 num_active=2
   22 num_passive=2
   23 master_mnt=$M0
   24 slave_mnt=$M1
   25 
   26 ############################################################
   27 #SETUP VOLUMES AND GEO-REPLICATION
   28 ############################################################
   29 
   30 ##create_and_start_master_volume
   31 TEST $CLI volume create $GMV0 replica 2 $H0:$B0/${GMV0}{1,2,3,4};
   32 TEST $CLI volume start $GMV0
   33 
   34 ##create_and_start_slave_volume
   35 TEST $CLI volume create $GSV0 replica 2 $H0:$B0/${GSV0}{1,2,3,4};
   36 TEST $CLI volume start $GSV0
   37 
   38 ##Create, start and mount meta_volume
   39 TEST $CLI volume create $META_VOL replica 3 $H0:$B0/${META_VOL}{1,2,3};
   40 TEST $CLI volume start $META_VOL
   41 TEST mkdir -p $META_MNT
   42 TEST glusterfs -s $H0 --volfile-id $META_VOL $META_MNT
   43 
   44 ##Mount master
   45 TEST glusterfs -s $H0 --volfile-id $GMV0 $M0
   46 
   47 ##Mount slave
   48 TEST glusterfs -s $H0 --volfile-id $GSV0 $M1
   49 
   50 ############################################################
   51 #BASIC GEO-REPLICATION TESTS
   52 ############################################################
   53 
   54 #Create geo-rep session
   55 TEST create_georep_session $master $slave
   56 
   57 #Config gluster-command-dir
   58 TEST $GEOREP_CLI $master $slave config gluster-command-dir ${GLUSTER_CMD_DIR}
   59 
   60 #Config gluster-command-dir
   61 TEST $GEOREP_CLI $master $slave config slave-gluster-command-dir ${GLUSTER_CMD_DIR}
   62 
   63 #Enable_metavolume
   64 TEST $GEOREP_CLI $master $slave config use_meta_volume true
   65 
   66 #Wait for common secret pem file to be created
   67 EXPECT_WITHIN $GEO_REP_TIMEOUT  0 check_common_secret_file
   68 
   69 #Verify the keys are distributed
   70 EXPECT_WITHIN $GEO_REP_TIMEOUT  0 check_keys_distributed
   71 
   72 #Start_georep
   73 TEST $GEOREP_CLI $master $slave start
   74 
   75 EXPECT_WITHIN $GEO_REP_TIMEOUT  2 check_status_num_rows "Active"
   76 EXPECT_WITHIN $GEO_REP_TIMEOUT  2 check_status_num_rows "Passive"
   77 
   78 #get-state commamd shouldn't crash glusterd when geo-rep session is configured
   79 TEST $CLI get-state
   80 TEST pidof glusterd
   81 
   82 TEST $CLI get-state detail
   83 TEST pidof glusterd
   84 
   85 #Stop Geo-rep
   86 TEST $GEOREP_CLI $master $slave stop
   87 
   88 #Delete Geo-rep
   89 TEST $GEOREP_CLI $master $slave delete
   90 
   91 #Cleanup authorized keys
   92 sed -i '/^command=.*SSH_ORIGINAL_COMMAND#.*/d' ~/.ssh/authorized_keys
   93 sed -i '/^command=.*gsyncd.*/d' ~/.ssh/authorized_keys
   94 
   95 cleanup;
   96 #G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000