Skip to content

Building GlusterFS

aborkar-ibm edited this page Jun 3, 2020 · 38 revisions

Building GlusterFS

Below versions of GlusterFS are available in respective distributions at the time of creation of these build instructions:

  • RHEL (8.1, 8.2) - 6.0
  • Ubuntu 16.04 - 3.7.6
  • Ubuntu 18.04 - 3.13.2
  • Ubuntu 20.04 - 7.2

The instructions provided below specify the steps to build GlusterFS 7.4 on Linux on IBM Z for following distributions:

  • RHEL (7.6, 7.7, 7.8, 8.1, 8.2)
  • SLES (12 SP4, 12 SP5, 15 SP1)
  • Ubuntu (16.04, 18.04, 20.04)

General Notes:

  • When following the steps below please use a super user unless otherwise specified
  • A directory /<source root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it

Building and Installing GlusterFS

Step 1: Build using script

If you want to build GlusterFS using manual steps, go to Step 2.

Use the following commands to build GlusterFS using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/GlusterFS/7.4/build_glusterfs.sh
# Build GlusterFS
bash build_glusterfs.sh   [Provide -t option for executing build with tests]

If the build completes successfully, go to STEP 5. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

Step 2: Install the dependencies

export SOURCE_ROOT=/<source_root>/
  • RHEL (7.6, 7.7, 7.8)

    yum install -y autoconf automake bison bzip2 flex fuse-devel gcc git glib2-devel libacl-devel libaio-devel libibverbs-devel librdmacm-devel libtool libxml2-devel libuuid-devel lvm2 make pkgconfig python python3 readline-devel wget zlib-devel
    • Build urcu

      cd $SOURCE_ROOT
      wget https://lttng.org/files/urcu/userspace-rcu-0.10.2.tar.bz2
      tar xvjf userspace-rcu-0.10.2.tar.bz2
      cd userspace-rcu-0.10.2
      ./configure --prefix=/usr --libdir=/usr/lib64
      make
      make install
    • Build openssl

      cd $SOURCE_ROOT
      wget https://www.openssl.org/source/old/1.1.1/openssl-1.1.1d.tar.gz
      tar xvf openssl-1.1.1d.tar.gz
      cd openssl-1.1.1d
      ./config --prefix=/usr/local --openssldir=/usr/local
      make
      make install
      ldconfig /usr/local/lib64
      export PATH=/usr/local/bin:$PATH
  • RHEL (8.1, 8.2)

    yum install -y autoconf automake bison bzip2 flex fuse-devel gcc git glib2-devel libacl-devel libaio-devel libibverbs-devel librdmacm-devel libtool libxml2-devel libuuid-devel lvm2 make openssl-devel pkgconfig python3 readline-devel wget zlib-devel wget tar gzip libtirpc-devel rpcgen
    • Build urcu

      cd $SOURCE_ROOT
      wget https://lttng.org/files/urcu/userspace-rcu-0.10.2.tar.bz2
      tar xvjf userspace-rcu-0.10.2.tar.bz2
      cd userspace-rcu-0.10.2
      ./configure --prefix=/usr --libdir=/usr/lib64
      make
      make install
  • SLES (12 SP4, 12 SP5)

    zypper install -y autoconf automake bison cmake flex fuse-devel gcc git glib2-devel libacl-devel libaio-devel librdmacm1 libtool libuuid-devel libxml2-devel lvm2 make pkg-config python2 rdma-core-devel readline-devel zlib-devel which
    • Build urcu

      cd $SOURCE_ROOT
      wget https://lttng.org/files/urcu/userspace-rcu-0.10.2.tar.bz2
      tar xvjf userspace-rcu-0.10.2.tar.bz2
      cd userspace-rcu-0.10.2
      ./configure --prefix=/usr --libdir=/usr/lib64
      make
      make install
    • Build openssl

      cd $SOURCE_ROOT
      wget  https://www.openssl.org/source/old/1.1.1/openssl-1.1.1d.tar.gz
      tar xvf openssl-1.1.1d.tar.gz
      cd openssl-1.1.1d
      ./config --prefix=/usr/local --openssldir=/usr/local
      make
      make install
      ldconfig /usr/local/lib64
      export PATH=/usr/local/bin:$PATH
  • SLES 15 SP1

    zypper install -y autoconf automake bison cmake flex fuse-devel gcc git glib2-devel libacl-devel libaio-devel librdmacm1 libopenssl-devel libtool liburcu-devel libuuid-devel libxml2-devel lvm2 make pkg-config python3 python3-xattr rdma-core-devel readline-devel zlib-devel
  • Ubuntu (16.04)

    apt-get update
    apt-get install -y autoconf automake bison flex gcc git libacl1-dev libaio-dev libfuse-dev libglib2.0-dev libibverbs-dev librdmacm-dev libreadline-dev libtool liburcu-dev libxml2-dev lvm2 make openssl pkg-config python3 uuid-dev zlib1g-dev
    • Build openssl (Ubuntu 16.04 Only)

      cd $SOURCE_ROOT
      wget  https://www.openssl.org/source/old/1.1.1/openssl-1.1.1d.tar.gz
      tar xvf openssl-1.1.1d.tar.gz
      cd openssl-1.1.1d
      ./config --prefix=/usr/local --openssldir=/usr/local
      make
      make install
      ldconfig /usr/local/lib64
      export PATH=/usr/local/bin:$PATH
  • Ubuntu (18.04, 20.04)

    apt-get update
    apt-get install -y autoconf automake bison flex gcc git libacl1-dev libaio-dev libfuse-dev libglib2.0-dev libibverbs-dev librdmacm-dev libreadline-dev libssl-dev libtool liburcu-dev libxml2-dev lvm2 make openssl pkg-config python3 uuid-dev zlib1g-dev

Step 3: Download, Configure and Build GlusterFS

  • Download and configure source

    cd $SOURCE_ROOT
    git clone https://github.com/gluster/glusterfs
    cd glusterfs
    git checkout v7.4
    ./autogen.sh
    ./configure --enable-gnfs                                              # For RHEL, SLES 15 SP1 and Ubuntu
    ./configure --enable-gnfs --disable-events                             # For SLES 12 SP4 and SLES 12 SP5
  • Create a patch file patch_io-threads.diff with the following contents: (For RHEL (8.1, 8.2), SLES and Ubuntu only)

    diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h
    index f54d2f491..1d9c22e8c 100644
    --- a/xlators/performance/io-threads/src/io-threads.h
    +++ b/xlators/performance/io-threads/src/io-threads.h
    @@ -34,7 +34,7 @@ struct iot_conf;
     #define IOT_DEFAULT_THREADS 16
     #define IOT_MAX_THREADS 64
    
    -#define IOT_THREAD_STACK_SIZE ((size_t)(256 * 1024))
    +#define IOT_THREAD_STACK_SIZE ((size_t)(512 * 1024))
    
     typedef struct {
         struct list_head clients;

    Apply the patch using the command below:

    git apply patch_io-threads.diff
  • Create a patch file patch_geo-rep.diff with the following contents:

    diff --git a/geo-replication/syncdaemon/monitor.py b/geo-replication/syncdaemon/monitor.py
    index 236afe70d..d34e7c037 100644
    --- a/geo-replication/syncdaemon/monitor.py
    +++ b/geo-replication/syncdaemon/monitor.py
    @@ -38,7 +38,7 @@ def get_subvol_num(brick_idx, vol, hot):
         disperse_count = vol.disperse_count(tier, hot)
         replica_count = vol.replica_count(tier, hot)
         distribute_count = vol.distribution_count(tier, hot)
    -    gconf.setconfig("master-distribution-count", distribute_count)
    +    gconf.setconfig("master-distribution-count", str(distribute_count))
    
         if (tier and not hot):
             brick_idx = brick_idx - vol.get_hot_bricks_count(tier)

    Apply the patch using the command below:

    git apply patch_geo-rep.diff
  • Build and install

    make
    make install
    ldconfig /usr/local/lib

Step 4: Run the test cases (optional)

4.1) Install the testing dependencies

  • RHEL (7.6, 7.7, 7.8)

    yum install -y acl attr bc bind-utils boost-devel docbook-style-xsl expat-devel gcc-c++ gdb net-tools nfs-utils psmisc pyxattr vim xfsprogs yajl
  • RHEL (8.1, 8.2)

    yum install -y acl attr bc bind-utils boost-devel docbook-style-xsl expat-devel gcc-c++ gdb net-tools nfs-utils psmisc vim xfsprogs yajl redhat-rpm-config python3-pip python3-devel perl-Test-Harness
  • SLES 12 SP4

    zypper install -y acl attr bc bind-utils boost-devel gcc-c++ gdb libexpat-devel libxml2-tools net-tools nfs-utils psmisc vim xfsprogs python-xattr python3 python3-pip python3-devel python3-cffi 
    pip3 install xattr
  • SLES 12 SP5

    zypper install -y acl attr bc bind-utils boost-devel gcc-c++ gdb libexpat-devel libxml2-tools net-tools nfs-utils psmisc vim xfsprogs python3-xattr
  • SLES 15 SP1

    zypper install -y acl attr bc bind-utils gdb libxml2-tools net-tools-deprecated nfs-utils psmisc thin-provisioning-tools vim xfsprogs python3-xattr
  • Ubuntu (16.04, 18.04, 20.04)

    apt-get install -y acl attr bc dbench dnsutils libxml2-utils net-tools nfs-common psmisc python3-pyxattr thin-provisioning-tools vim xfsprogs yajl-tools rpm2cpio gdb cpio
  • Install gstack command (Ubuntu only)

    cd $SOURCE_ROOT
    wget http://rpmfind.net/linux/opensuse/update/leap/15.1/oss/x86_64/gdb-8.3.1-lp151.4.3.1.x86_64.rpm
    rpm2cpio gdb-8.3.1-lp151.4.3.1.x86_64.rpm| cpio -idmv
    mv ./usr/bin/gstack /usr/bin/
    rm -r ./etc ./usr
    rm gdb-8.3.1-lp151.4.3.1.x86_64.rpm
  • Install pyxattr (RHEL 8.1 and 8.2 only)

    ln -s /usr/bin/gcc /usr/bin/s390x-linux-gnu-gcc
    pip3 install pyxattr
  • Build DBENCH (For RHEL and SLES only)

    cd $SOURCE_ROOT
    git clone https://github.com/sahlberg/dbench
    cd dbench
    ./autogen.sh
    ./configure
    make
    make install
  • Build thin-provisioning-tools (For RHEL and SLES 12 SP4 only)

    cd $SOURCE_ROOT
    git clone https://github.com/jthornber/thin-provisioning-tools
    cd thin-provisioning-tools
    git checkout v0.7.6
    autoreconf
    ./configure
    make
    make install
  • Build YAJL (For SLES only)

    cd $SOURCE_ROOT
    git clone https://github.com/lloyd/yajl
    cd yajl
    git checkout 2.1.0
    ./configure
    make install

4.2) Patch and run tests

  • Create a patch file patch_tests.diff with the following contents:

    diff --git a/tests/basic/distribute/dir-heal.t b/tests/basic/distribute/dir-heal.t
    index 851f765b2..23e107096 100644
    --- a/tests/basic/distribute/dir-heal.t
    +++ b/tests/basic/distribute/dir-heal.t
    @@ -30,8 +30,8 @@ TEST glusterfs --entry-timeout=0 --attribute-timeout=0 -s $H0 --volfile-id $V0 $
     ls $M0/
     cd $M0
    
    -TEST kill_brick $V0 $H0 $B0/$V0-1
    -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" brick_up_status $V0 $H0 $B0/$V0-1
    +TEST kill_brick $V0 $H0 $B0/$V0-2
    +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" brick_up_status $V0 $H0 $B0/$V0-2
    
     TEST mkdir dir{1..4}
    
    @@ -51,7 +51,7 @@ TEST setfattr -n "user.test" -v "test" $M0/dir4
     # Start all bricks
    
     TEST $CLI volume start $V0 force
    -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/$V0-1
    +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/$V0-2
    
     #$CLI volume status
    
    @@ -62,18 +62,18 @@ stat $M0/dir* > /dev/null
    
     # Check that directories have been created on the brick that was killed
    
    -TEST ls $B0/$V0-1/dir1
    +TEST ls $B0/$V0-2/dir1
    
    -TEST ls $B0/$V0-1/dir2
    -EXPECT "777" stat -c "%a" $B0/$V0-1/dir2
    +TEST ls $B0/$V0-2/dir2
    +EXPECT "777" stat -c "%a" $B0/$V0-2/dir2
    
    -TEST ls $B0/$V0-1/dir3
    -EXPECT "test" getfattr -n "user.test" --absolute-names --only-values $B0/$V0-1/dir3
    +TEST ls $B0/$V0-2/dir3
    +EXPECT "test" getfattr -n "user.test" --absolute-names --only-values $B0/$V0-2/dir3
    
    
    -TEST ls $B0/$V0-1/dir4
    -EXPECT "777" stat -c "%a" $B0/$V0-1/dir4
    -EXPECT "test" getfattr -n "user.test" --absolute-names --only-values $B0/$V0-1/dir4
    +TEST ls $B0/$V0-2/dir4
    +EXPECT "777" stat -c "%a" $B0/$V0-2/dir4
    +EXPECT "test" getfattr -n "user.test" --absolute-names --only-values $B0/$V0-2/dir4
    
    
     TEST rm -rf $M0/*
    @@ -97,8 +97,8 @@ ls $M0/
     cd $M0
     TEST mkdir dir{1..4}
    
    -TEST kill_brick $V0 $H0 $B0/$V0-1
    -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" brick_up_status $V0 $H0 $B0/$V0-1
    +TEST kill_brick $V0 $H0 $B0/$V0-2
    +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" brick_up_status $V0 $H0 $B0/$V0-2
    
     # No change for dir1
     # Change permissions for dir2
    @@ -116,7 +116,7 @@ TEST setfattr -n "user.test" -v "test" $M0/dir4
     # Start all bricks
    
     TEST $CLI volume start $V0 force
    -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/$V0-1
    +EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/$V0-2
    
     #$CLI volume status
    
    @@ -127,16 +127,16 @@ stat $M0/dir* > /dev/null
    
     # Check directories on the brick that was killed
    
    -TEST ls $B0/$V0-1/dir2
    -EXPECT "777" stat -c "%a" $B0/$V0-1/dir2
    +TEST ls $B0/$V0-2/dir2
    +EXPECT "777" stat -c "%a" $B0/$V0-2/dir2
    
    -TEST ls $B0/$V0-1/dir3
    -EXPECT "test" getfattr -n "user.test" --absolute-names --only-values $B0/$V0-1/dir3
    +TEST ls $B0/$V0-2/dir3
    +EXPECT "test" getfattr -n "user.test" --absolute-names --only-values $B0/$V0-2/dir3
    
    
    -TEST ls $B0/$V0-1/dir4
    -EXPECT "777" stat -c "%a" $B0/$V0-1/dir4
    -EXPECT "test" getfattr -n "user.test" --absolute-names --only-values $B0/$V0-1/dir4
    +TEST ls $B0/$V0-2/dir4
    +EXPECT "777" stat -c "%a" $B0/$V0-2/dir4
    +EXPECT "test" getfattr -n "user.test" --absolute-names --only-values $B0/$V0-2/dir4
     cd
    
    
    diff --git a/tests/volume.rc b/tests/volume.rc
    index 9f2356aa4..64c3db0ae 100644
    --- a/tests/volume.rc
    +++ b/tests/volume.rc
    @@ -955,7 +955,11 @@ function shd_count {
    
     function number_healer_threads_shd {
        local pid=$(get_shd_mux_pid $1)
    -   pstack $pid | grep $2 | wc -l
    +   if command -v pstack 2>&1 /dev/null; then
    +        pstack $pid | grep $2 | wc -l
    +   else
    +        gstack $pid | grep $2 | wc -l
    +   fi
     }
    
     function get_mtime {
    diff --git a/tests/bugs/shard/bug-1251824.t b/tests/bugs/shard/bug-1251824.t
    index d81685d01..fef2b8795 100644
    --- a/tests/bugs/shard/bug-1251824.t
    +++ b/tests/bugs/shard/bug-1251824.t
    @@ -14,7 +14,7 @@ TEST $CLI volume set $V0 features.shard-block-size 4MB
     TEST $CLI volume start $V0
    
     TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 $M0
    -TEST useradd -M test_user 2>/dev/null
    +TEST useradd -UM test_user 2>/dev/null
    
     # Create 3 files as root.
     TEST touch $M0/foo
    @@ -102,6 +102,7 @@ md5sum_foo=$(md5sum $M0/foo | awk '{print $1}')
     EXPECT "$md5sum_foo" echo `md5sum $M0/dir/quux | awk '{print $1}'`
    
     userdel test_user
    +groupdel test_user
    
     TEST $CLI volume stop $V0
     TEST $CLI volume delete $V0
    diff --git a/tests/bugs/shard/bug-1468483.t b/tests/bugs/shard/bug-1468483.t
    index e462b8d54..0ace31aa0 100644
    --- a/tests/bugs/shard/bug-1468483.t
    +++ b/tests/bugs/shard/bug-1468483.t
    @@ -35,7 +35,7 @@ TEST stat $B0/${V0}0/.shard/$gfid_foo.6
    
     EXPECT "7" echo `$CLI volume profile $V0 info incremental | grep -w FSYNC | awk '{print $8}'`
    
    -useradd -M test_user 2>/dev/null
    +useradd -UM test_user 2>/dev/null
    
     TEST touch $M0/bar
    
    @@ -52,6 +52,7 @@ EXPECT "7" echo `$CLI volume profile $V0 info incremental | grep -w FSYNC | awk
    
     EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0
     userdel test_user
    +groupdel test_user
     TEST $CLI volume stop $V0
     TEST $CLI volume delete $V0
    
    diff --git a/tests/bugs/glusterd/bug-1699339.t b/tests/bugs/glusterd/bug-1699339.t
    index bb8d4f46e..2fd5d2887 100644
    --- a/tests/bugs/glusterd/bug-1699339.t
    +++ b/tests/bugs/glusterd/bug-1699339.t
    @@ -50,17 +50,17 @@ for i in $(seq 1 $NUM_VOLS); do
            create_volume $i
     done
    
    -TEST kill_glusterd 1
    +TEST kill_glusterd 2
    
     TESTS_EXPECTED_IN_LOOP=4
     for i in `seq 1 3 15`
     do
     vol1=$(printf "%s-vol%02d" $V0 $i)
    -TEST $CLI_2 volume set $vol1 performance.readdir-ahead on
    +TEST $CLI_1 volume set $vol1 performance.readdir-ahead on
     done
    
    -# Bring back 1st glusterd
    -TEST $glusterd_1
    +# Bring back 2nd glusterd
    +TEST $glusterd_2
     EXPECT_WITHIN $PROBE_TIMEOUT 2 peer_count
    
     TESTS_EXPECTED_IN_LOOP=4
    diff --git a/tests/basic/distribute/throttle-rebal.t b/tests/basic/distribute/throttle-rebal.t
    index f4823cf4f..1cc3cac5d 100644
    --- a/tests/basic/distribute/throttle-rebal.t
    +++ b/tests/basic/distribute/throttle-rebal.t
    @@ -17,7 +17,7 @@ function set_throttle {
     }
    
     #Determine number of cores
    -cores=$(cat /proc/cpuinfo | grep processor | wc -l)
    +cores=$(cat /proc/cpuinfo | grep -w processor | wc -l)
     if [ "$cores" == "" ]; then
             echo "Could not get number of cores available"
     fi
    diff --git a/tests/bugs/nfs/bug-847622.t b/tests/bugs/nfs/bug-847622.t
    index 5ccee722e..20d5ec532 100755
    --- a/tests/bugs/nfs/bug-847622.t
    +++ b/tests/bugs/nfs/bug-847622.t
    @@ -30,7 +30,7 @@ cd $N0
    
     # simple getfacl setfacl commands
     TEST touch testfile
    -TEST setfacl -m u:14:r testfile
    +TEST setfacl -m u:14:r $B0/brick0/testfile
     TEST getfacl testfile
    
     cd
    diff --git a/tests/basic/posix/shared-statfs.t b/tests/basic/posix/shared-statfs.t
    index 33439562e..a1887bae0 100644
    --- a/tests/basic/posix/shared-statfs.t
    +++ b/tests/basic/posix/shared-statfs.t
    @@ -28,7 +28,7 @@ TEST $GFS --volfile-server=$H0 --volfile-id=$V0 $M0
     total_space=$(df -P $M0 | tail -1 | awk '{ print $2}')
     # Keeping the size less than 200M mainly because XFS will use
     # some storage in brick to keep its own metadata.
    -TEST [ $total_space -gt 194000 -a $total_space -lt 200000 ]
    +TEST [ $total_space -gt 193000 -a $total_space -lt 200000 ]
    
    
     TEST force_umount $M0
    @@ -42,7 +42,7 @@ TEST $CLI volume start $V0
     EXPECT_WITHIN $PROCESS_UP_TIMEOUT "6" online_brick_count
     TEST $GFS --volfile-server=$H0 --volfile-id=$V0 $M0
     total_space=$(df -P $M0 | tail -1 | awk '{ print $2}')
    -TEST [ $total_space -gt 194000 -a $total_space -lt 200000 ]
    +TEST [ $total_space -gt 193000 -a $total_space -lt 200000 ]
    
     TEST force_umount $M0
     TEST $CLI volume stop $V0
    diff --git a/tests/bugs/quota/bug-1293601.t b/tests/bugs/quota/bug-1293601.t
    index 741758b73..688299f78 100644
    --- a/tests/bugs/quota/bug-1293601.t
    +++ b/tests/bugs/quota/bug-1293601.t
    @@ -28,6 +28,6 @@ EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "1.0MB" quotausage "/"
     TEST $CLI volume quota $V0 disable
     TEST $CLI volume quota $V0 enable
    
    -EXPECT_WITHIN 60 "1.0MB" quotausage "/"
    +EXPECT_WITHIN 180 "1.0MB" quotausage "/"
    
     cleanup;
    diff --git a/tests/basic/ec/gfapi-ec-open-truncate.c b/tests/basic/ec/gfapi-ec-open-truncate.c
    index 22f17f436..ac8d24e5b 100644
    --- a/tests/basic/ec/gfapi-ec-open-truncate.c
    +++ b/tests/basic/ec/gfapi-ec-open-truncate.c
    @@ -114,8 +114,8 @@ main(int argc, char *argv[])
         /*CHILD_UP_TIMEOUT is 20 seconds*/
         for (i = 0; i < 20; i++) {
             ret = system(
    -            "[ $(gluster --mode=script volume status patchy | "
    -            "grep \" Y \" | awk '{print $(NF-1)}' | wc -l) == 3 ]");
    +            "bash -c \"[ $(gluster --mode=script volume status patchy | "
    +            "grep \" Y \" | awk '{print $(NF-1)}' | wc -l) == 3 ]\"");
             if (WIFEXITED(ret) && WEXITSTATUS(ret)) {
                 printf("Ret value of system: %d\n, ifexited: %d, exitstatus: %d",
                        ret, WIFEXITED(ret), WEXITSTATUS(ret));
    @@ -149,8 +149,8 @@ main(int argc, char *argv[])
         /*Check reopen happened by checking for open-fds on the brick*/
         for (i = 0; i < 20; i++) {
             ret = system(
    -            "[ $(for i in $(pgrep glusterfsd); do ls -l /proc/$i/fd | grep "
    -            "\"[.]glusterfs\" | grep -v health_check; done | wc -l) == 3 ]");
    +            "bash -c \"[ $(for i in $(pgrep glusterfsd); do ls -l /proc/$i/fd | grep "
    +            "\"[.]glusterfs\" | grep -v health_check; done | wc -l) == 3 ]\"");
             if (WIFEXITED(ret) && WEXITSTATUS(ret)) {
                 printf("Ret value of system: %d\n, ifexited: %d, exitstatus: %d",
                        ret, WIFEXITED(ret), WEXITSTATUS(ret));

    Apply the patch using the command below:

    git apply --ignore-whitespace patch_tests.diff
  • Create a patch file patch_dbench-tests.diff with the following content (Only for RHEL and SLES):

    diff --git a/tests/bugs/rpc/bug-847624.t b/tests/bugs/rpc/bug-847624.t
    index fe8fc9828..b342c93ba 100755
    --- a/tests/bugs/rpc/bug-847624.t
    +++ b/tests/bugs/rpc/bug-847624.t
    @@ -20,7 +20,7 @@ EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available;
     TEST mount_nfs $H0:/$V0 $N0 nolock
     cd $N0
     #7
    -TEST dbench -t 10 10
    +TEST dbench -c/usr/local/share/doc/loadfiles/client.txt -Bfileio -t 10 10
     TEST rm -rf $N0/*
     cd
     EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0

    Apply the patch using the command below:

    git apply --ignore-whitespace patch_dbench-tests.diff
  • Create a patch file patch_run-tests.diff with the following contents: (Only for Ubuntu 16.04 ,SLES 12 SP4 and SLES 12 SP5, reference to the issue.)

    diff --git a/run-tests.sh b/run-tests.sh
    index 5683b21..f2e8950 100755
    --- a/run-tests.sh
    +++ b/run-tests.sh
    @@ -128,10 +128,10 @@ function check_dependencies()
         fi
    
         # Check for netstat
    -    env netstat --version > /dev/null 2>&1
    -    if [ $? -ne 0 ]; then
    -        MISSING="$MISSING netstat"
    -    fi
    +    # env netstat --version > /dev/null 2>&1
    +    # if [ $? -ne 0 ]; then
    +    #     MISSING="$MISSING netstat"
    +    # fi
    
         # Check for the Perl Test Harness
         env prove --version > /dev/null 2>&1
    @@ -165,10 +165,10 @@ function check_dependencies()
         fi
    
         # Check for netstat
    -    env netstat --version > /dev/null 2>&1
    -    if [ $? -ne 0 ]; then
    -        MISSING="$MISSING netstat"
    -    fi
    +    # env netstat --version > /dev/null 2>&1
    +    # if [ $? -ne 0 ]; then
    +    #    MISSING="$MISSING netstat"
    +    # fi
    
         # check for psutil python package
         test `uname -s` == "Darwin" || test `uname -s` == "FreeBSD" && {

    Apply the patch using the command below:

    git apply patch_run-tests.diff
  • Run the test cases

    cd $SOURCE_ROOT/glusterfs
    ./run-tests.sh

Note:

  • If any of the tests fail with error volume create: patchy: failed: Host is not in 'Peer in Cluster' state, make changes to file /etc/hosts by copying the host details entry that is present in the beginning to the section IPv6 capable hosts and replace 0.0.0.0 with the IP address of the host. It should be similar to : 0.0.0.0 .xyz.com hostname

  • If you want to use the kernel NFS server or client on a Gluster storage server, make sure to disable the Gluster NFS server:

    gluster volume set <VOLUME> nfs.disable true
  • For geo-replication test case : Password-less SSH login has to be set up. Refer to the Setting Up the Environment for Geo-replication in the documentation.

  • For 00-georep-verify-non-root-setup.t test to pass, you need to install prettytable via pip install PrettyTable. Installing prettytable will make RHEL pass the test. For Ubuntu and SLES, you still need to apply the following patch because within the test

    • a: on Ubuntu and SLES, created test user does not have home directory
    • b: on Ubuntu and SLES, created test user does not inherit the parent's PATH environment variable. Applying the patch below fixes the problem
--- a/tests/00-geo-rep/00-georep-verify-non-root-setup.t
+++ b/tests/00-geo-rep/00-georep-verify-non-root-setup.t
@@ -120,7 +120,7 @@ TEST /usr/sbin/groupadd $grp
 clean_lock_files
 ##Del if exists and create non-root user and assign it to newly created group
 userdel -r -f $usr
-TEST /usr/sbin/useradd -G $grp $usr
+TEST /usr/sbin/useradd -m -G $grp $usr
 
 ##Modify password for non-root user to have control over distributing ssh-key
 echo "$usr:pass" | chpasswd
@@ -180,7 +180,7 @@ export SSH_ASKPASS=${SSH_ASKPASS_SCRIPT}
 DISPLAY=: setsid ssh-copy-id -o 'PreferredAuthentications=password' -o 'StrictHostKeyChecking=no' -i ~/.ssh/id_rsa.pub $ssh_url
 
 ##Setting up PATH for gluster binaries in case of source installation
-##ssh -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $ssh_url "echo "export PATH=$PATH:/usr/local/sbin" >> ~/.bashrc"
+ssh -oNumberOfPasswordPrompts=0 -oStrictHostKeyChecking=no $ssh_url "echo "export PATH=$PATH:/usr/local/sbin" >> ~/.bashrc"
 
 ##Creating secret pem pub file
 TEST gluster-georep-sshkey generate

For RHEL 7.7, 7.8 test, this test might hang at "Redirecting to /bin/systemctl restart sshd.service." The following patch solves the problem by running service restart sshd as a background process.

diff --git a/tests/00-geo-rep/00-georep-verify-non-root-setup.t b/tests/00-geo-rep/00-georep-verify-non-root-setup.t
index ed7e589..8488481 100644
--- a/tests/00-geo-rep/00-georep-verify-non-root-setup.t
+++ b/tests/00-geo-rep/00-georep-verify-non-root-setup.t
@@ -132,7 +132,7 @@ TEST gluster-mountbroker setup /var/mountbroker-root $grp
 TEST gluster-mountbroker add $slave_vol $usr
 
 ##Check ssh setting for clear text passwords
-sed '/^PasswordAuthentication /{s/no/yes/}' -i /etc/ssh/sshd_config && grep '^PasswordAuthentication ' /etc/ssh/sshd_config && service sshd restart
+sed '/^PasswordAuthentication /{s/no/yes/}' -i /etc/ssh/sshd_config && grep '^PasswordAuthentication ' /etc/ssh/sshd_config && service sshd restart &
 
 
 ##Restart glusterd to reflect mountbroker changages
  • The patch for io-threads.h will allow the following test cases to pass:

    • ./tests/basic/distribute/rebal-all-nodes-migrate.t
    • ./tests/features/fuse-lru-limit.t
    • ./tests/features/weighted-rebalance.t
    • ./tests/basic/ec/ec-1468261.t
  • The is_nfs_export_available function from nfs.rc used in some tests may fail intermittently. You may try to enable rpcbind as that may fix some of the test cases. The community is aware this behaviour, refer here for more info.

  • The test failures below are observed on s390x due to the little endian/big endian specific hash values calculations. Refer to issue here for further info.

    • ./tests/basic/changelog/changelog-rename.t
    • ./tests/basic/namespace.t
    • ./tests/bugs/glusterfs/bug-902610.t
    • ./tests/bugs/posix/bug-1619720.t
    • ./tests/bugs/replicate/bug-1655854-support-dist-to-rep3-arb-conversion.t
  • For ./tests/bitrot/bug-1207627-bitrot-scrub-status.t test case: This test failure is under investigation, refer to this issue for details.

  • For ./tests/bugs/glusterfs/bug-866459.t test case: This test is under investigation, refer to this issue for details.

  • For tests under ./tests/00-geo-rep/, the locale of the system must be UTF-8 for the test cases to pass.

  • For ./tests/bugs/glusterfs-server/bug-861542.t test case: If the hostname of the machine is long, the test case will fail. The hostname of the machine can be shortened temporarily to get the test case to pass.

  • For ./tests/bugs/posix/bug-990028.t and ./tests/basic/gfapi/gfapi-copy-file-range.t test case: This test fails if the file system is of type ext4, changing the file system to xfs will fix this test.

  • For ./tests/bugs/rpc/bug-954057.t and ./tests/bugs/glusterfs-server/bug-887145.t are passing on master, will pass in next release.

  • Tests under ./tests/bugs/snapshot require the snapd service to be stopped (systemctl stop snapd) if installed:.

  • Refer to this issue, mentioned test cases are failing on RHEL 8.1,8.2 and Ubuntu 20.04, failing test cases will pass in next release.

  • Following test cases pass after increasing timeout in run-tests.sh.

    • On RHEL7.7 and RHEL 7.8:
      • ./tests/basic/afr/entry-self-heal.t
      • ./tests/basic/afr/split-brain-healing-ctime.t
      • ./tests/basic/afr/split-brain-healing.t
    • On SLES12.4:
      • ./tests/basic/afr/entry-self-heal.t
      • ./tests/basic/afr/gfid-mismatch-resolution-with-cli.t
      • ./tests/basic/afr/split-brain-healing-ctime.t
      • ./tests/basic/afr/split-brain-healing.t
  • ./tests/features/ssl-ciphers.t testcase is failing on x86_64 and s390x:

  • Additional information on the GlusterFS test framework can be found here.

Step 5: Run the GlusterFS Daemon (Optional)

glusterd

Step 6: Testing the GlusterFS volume (Optional)

Refer Documentation for instructions.

Reference

https://www.gluster.org/
https://github.com/gluster/glusterfs
http://docs.gluster.org/en/latest/Developer-guide/Building-GlusterFS/

Clone this wiki locally