diff options
Diffstat (limited to 'tests')
25 files changed, 1 insertions, 2078 deletions
diff --git a/tests/basic/afr/granular-esh/cli.t b/tests/basic/afr/granular-esh/cli.t index cadaf8ffaf9..dbf67065930 100644 --- a/tests/basic/afr/granular-esh/cli.t +++ b/tests/basic/afr/granular-esh/cli.t @@ -11,7 +11,7 @@ TESTS_EXPECTED_IN_LOOP=4 TEST glusterd TEST pidof glusterd -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0,1} +TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{0,1,2} # Test that enabling the option should work on a newly created volume TEST $CLI volume set $V0 cluster.granular-entry-heal on TEST $CLI volume set $V0 cluster.granular-entry-heal off @@ -25,34 +25,6 @@ TEST $CLI volume start $V1 TEST ! $CLI volume heal $V1 granular-entry-heal enable TEST ! $CLI volume heal $V1 granular-entry-heal disable -####################### -###### TIER TEST ###### -####################### -# Execute the same command on a disperse + replicate tiered volume and make -# sure the option is set on the replicate leg of the volume -TEST $CLI volume tier $V1 attach replica 2 $H0:$B0/${V1}{3,4} -TEST $CLI volume heal $V1 granular-entry-heal enable -EXPECT "enable" volume_get_field $V1 cluster.granular-entry-heal -TEST $CLI volume heal $V1 granular-entry-heal disable -EXPECT "disable" volume_get_field $V1 cluster.granular-entry-heal - -# Kill a disperse brick and make heal be pending on the volume. -TEST kill_brick $V1 $H0 $B0/${V1}0 - -# Now make sure that one offline brick in disperse does not affect enabling the -# option on the volume. -TEST $CLI volume heal $V1 granular-entry-heal enable -EXPECT "enable" volume_get_field $V1 cluster.granular-entry-heal -TEST $CLI volume heal $V1 granular-entry-heal disable -EXPECT "disable" volume_get_field $V1 cluster.granular-entry-heal - -# Now kill a replicate brick. -TEST kill_brick $V1 $H0 $B0/${V1}3 -# Now make sure that one offline brick in replicate causes the command to be -# failed. -TEST ! $CLI volume heal $V1 granular-entry-heal enable -EXPECT "disable" volume_get_field $V1 cluster.granular-entry-heal - ###################### ### REPLICATE TEST ### ###################### diff --git a/tests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t b/tests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t deleted file mode 100755 index f9166d7d0e2..00000000000 --- a/tests/basic/tier/bug-1214222-directories_missing_after_attach_tier.t +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - -LAST_BRICK=3 -CACHE_BRICK_FIRST=4 -CACHE_BRICK_LAST=5 -DEMOTE_TIMEOUT=12 -PROMOTE_TIMEOUT=5 - - -LAST_BRICK=1 -CACHE_BRICK=2 -DEMOTE_TIMEOUT=12 -PROMOTE_TIMEOUT=5 -MIGRATION_TIMEOUT=10 -cleanup - - -TEST glusterd - -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0..$LAST_BRICK} -TEST $CLI volume start $V0 -TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; - -# Basic operations. -cd $M0 -TEST stat . -TEST mkdir d1 -TEST [ -d d1 ] -TEST touch file1 -TEST [ -e file1 ] - -TEST $CLI volume tier $V0 attach replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST -TEST $CLI volume set $V0 features.ctr-enabled on - -#check whether the directory's and files are present on mount or not. -TEST [ -d d1 ] -TEST [ -e file1 ] - -cd -EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $M0; - -tier_status () -{ - $CLI volume tier $V0 detach status | grep progress | wc -l -} - -TEST $CLI volume tier $V0 detach start -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_status -TEST $CLI volume tier $V0 detach commit - -EXPECT "0" confirm_tier_removed ${V0}${CACHE_BRICK_FIRST} - -EXPECT_WITHIN $REBALANCE_TIMEOUT "0" confirm_vol_stopped $V0 - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000 diff --git a/tests/basic/tier/bug-1260185-donot-allow-detach-commit-unnecessarily.t b/tests/basic/tier/bug-1260185-donot-allow-detach-commit-unnecessarily.t deleted file mode 100644 index 6efbe32f121..00000000000 --- a/tests/basic/tier/bug-1260185-donot-allow-detach-commit-unnecessarily.t +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -## Test case for BZ: 1260185 -## Do not allow detach-tier commit without "force" option or without -## user have not started "detach-tier start" operation - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../cluster.rc -. $(dirname $0)/../../tier.rc - -cleanup; - -## Start glusterd -TEST glusterd; -TEST pidof glusterd; - -## Lets create and start the volume -TEST $CLI volume create $V0 $H0:$B0/${V0}{1..2} -TEST $CLI volume start $V0 - -## Perform attach-tier operation on volume $V0 -TEST $CLI volume tier $V0 attach $H0:$B0/${V0}{3..4} - -## detach-tier commit operation without force option on volume $V0 -## should not succeed -TEST ! $CLI --mode=script volume tier $V0 detach commit - -## detach-tier commit operation with force option on volume $V0 -## should succeed -TEST $CLI volume tier $V0 detach force - -sleep 3 - -## Again performing attach-tier operation on volume $V0 -TEST $CLI volume tier $V0 attach $H0:$B0/${V0}{5..6} - -## Do detach-tier start on volume $V0 -TEST $CLI volume tier $V0 detach start - -## Now detach-tier commit on volume $V0 should succeed. -## wait for the detach to complete -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" tier_detach_commit_for_single_node - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=1517961 diff --git a/tests/basic/tier/ctr-rename-overwrite.t b/tests/basic/tier/ctr-rename-overwrite.t deleted file mode 100755 index 73ee7581338..00000000000 --- a/tests/basic/tier/ctr-rename-overwrite.t +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - -LAST_BRICK=1 -CACHE_BRICK_FIRST=4 -CACHE_BRICK_LAST=5 - -DEMOTE_FREQ=5 -PROMOTE_FREQ=5 - -cleanup - -# Start glusterd -TEST glusterd -TEST pidof glusterd - -# Set-up tier cluster -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0..$LAST_BRICK} -TEST $CLI volume start $V0 -TEST $CLI volume tier $V0 attach replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST - -TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ -TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ - -# Start and mount the volume after enabling CTR -TEST $CLI volume set $V0 features.ctr-enabled on -TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; - -# create two files -echo "hello world" > $M0/file1 -echo "hello world" > $M0/file2 - -# db in hot brick shows 4 record. 2 for file1 and 2 for file2 -ENTRY_COUNT=$(echo "select * from gf_file_tb; select * from gf_flink_tb;" | \ - sqlite3 $B0/${V0}5/.glusterfs/${V0}5.db | wc -l ) -TEST [ $ENTRY_COUNT -eq 4 ] - -#overwrite file2 with file1 -mv -f $M0/file1 $M0/file2 - -# Now the db in hot tier should have only 2 records for file1. -ENTRY_COUNT=$(echo "select * from gf_file_tb; select * from gf_flink_tb;" | \ - sqlite3 $B0/${V0}5/.glusterfs/${V0}5.db | wc -l ) -TEST [ $ENTRY_COUNT -eq 2 ] - -cleanup -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/file_lock.c b/tests/basic/tier/file_lock.c deleted file mode 100644 index 20fdbc0f668..00000000000 --- a/tests/basic/tier/file_lock.c +++ /dev/null @@ -1,72 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> - -void -usage(void) -{ - printf("Usage: testlock <filepath> [R|W]\n"); - return; -} - -int -main(int argc, char *argv[]) -{ - char *file_path = NULL; - int fd = -1; - struct flock lock = {0}; - int ret = -1; - int c = 0; - - if (argc != 3) { - usage(); - exit(1); - } - - file_path = argv[1]; - fd = open(file_path, O_RDWR); - - if (-1 == fd) { - printf("Failed to open file %s. %m\n", file_path); - exit(1); - } - - /* TODO: Check for invalid input*/ - - if (!strcmp(argv[2], "W")) { - lock.l_type = F_WRLCK; - printf("Taking write lock\n"); - - } else { - lock.l_type = F_RDLCK; - printf("Taking read lock\n"); - } - - lock.l_whence = SEEK_SET; - lock.l_start = 0; - lock.l_len = 0; - lock.l_pid = getpid(); - - printf("Acquiring lock on %s\n", file_path); - ret = fcntl(fd, F_SETLK, &lock); - if (ret) { - printf("Failed to acquire lock on %s (%m)\n", file_path); - close(fd); - exit(1); - } - - sleep(10); - - /*Unlock*/ - - printf("Releasing lock on %s\n", file_path); - lock.l_type = F_UNLCK; - ret = fcntl(fd, F_SETLK, &lock); - if (ret) { - printf("Failed to release lock on %s (%m)\n", file_path); - } - - close(fd); - return ret; -} diff --git a/tests/basic/tier/file_with_spaces.t b/tests/basic/tier/file_with_spaces.t deleted file mode 100755 index 919b900c730..00000000000 --- a/tests/basic/tier/file_with_spaces.t +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - -NUM_BRICKS=3 -DEMOTE_FREQ=5 -DEMOTE_TIMEOUT=10 -PROMOTE_FREQ=5 - -FILE_SPACE="Testing filenames with spaces.log" - - -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function create_dist_tier_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} - TEST $CLI volume set $V0 performance.quick-read off - TEST $CLI volume set $V0 performance.io-cache off - TEST $CLI volume set $V0 features.ctr-enabled on - TEST $CLI volume start $V0 - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} - TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ - TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ - TEST $CLI volume set $V0 cluster.read-freq-threshold 0 - TEST $CLI volume set $V0 cluster.write-freq-threshold 0 - TEST $CLI volume set $V0 cluster.tier-mode test -} - - -cleanup; - -#Basic checks -TEST glusterd -TEST pidof glusterd -TEST $CLI volume info - - -#Create and start a tiered volume -create_dist_tier_vol $NUM_BRICKS - -# Mount FUSE -TEST glusterfs -s $H0 --volfile-id $V0 $M0 - - -# The file will be created on the hot tier - -touch "$M0/$FILE_SPACE" - -# Get the path of the file on the hot tier -HPATH=`find $B0/hot/ -name "$FILE_SPACE"` -echo "File path on hot tier: "$HPATH - -EXPECT "yes" exists_and_regular_file $HPATH - -# Wait for the tier process to demote the file -sleep $DEMOTE_TIMEOUT - -# Get the path of the file on the cold tier -CPATH=`find $B0/cold/ -name "$FILE_SPACE"` -echo "File path on cold tier: "$CPATH - -EXPECT "yes" exists_and_regular_file $CPATH - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/fops-during-migration-pause.t b/tests/basic/tier/fops-during-migration-pause.t deleted file mode 100755 index 46fc6e445a5..00000000000 --- a/tests/basic/tier/fops-during-migration-pause.t +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - -NUM_BRICKS=3 -DEMOTE_FREQ=10 -PROMOTE_FREQ=10 - -TEST_STR="Testing write and truncate fops on tier migration" - -function is_sticky_set () { - echo $1 - if [ -k $1 ]; - then - echo "yes" - else - echo "no" - fi -} - - -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function create_dist_tier_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} - TEST $CLI volume set $V0 performance.quick-read off - TEST $CLI volume set $V0 performance.io-cache off - TEST $CLI volume set $V0 features.ctr-enabled on - TEST $CLI volume start $V0 - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} - TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ - TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ - TEST $CLI volume set $V0 cluster.read-freq-threshold 0 - TEST $CLI volume set $V0 cluster.write-freq-threshold 0 - TEST $CLI volume set $V0 cluster.tier-mode test -} - - -cleanup; - -#Basic checks -TEST glusterd -TEST pidof glusterd -TEST $CLI volume info - - -#Create and start a tiered volume -create_dist_tier_vol $NUM_BRICKS - -# Mount FUSE -TEST glusterfs -s $H0 --volfile-id $V0 $M0 - -TEST mkdir $M0/dir1 - -# Create a large file (800MB), so that rebalance takes time -# The file will be created on the hot tier -sleep_until_mid_cycle $DEMOTE_FREQ -dd if=/dev/zero of=$M0/dir1/FILE1 bs=256k count=5120 - -# Get the path of the file on the hot tier -HPATH=`find $B0/hot/ -name FILE1` -echo "File path on hot tier: "$HPATH - - -# Wait for the tier process to demote the file -EXPECT_WITHIN $REBALANCE_TIMEOUT "yes" is_sticky_set $HPATH - -TEST $CLI volume set $V0 cluster.tier-pause on - -# Wait for the tier process to finish migrating the file -EXPECT_WITHIN $REBALANCE_TIMEOUT "no" is_sticky_set $HPATH - -# Get the path of the file on the cold tier -CPATH=`find $B0/cold/ -name FILE1` - -# make sure destination is empty -TEST ! test -s $CPATH - -# make sure source exists and not empty -TEST test -s $HPATH - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/fops-during-migration.t b/tests/basic/tier/fops-during-migration.t deleted file mode 100755 index 458c01e93c5..00000000000 --- a/tests/basic/tier/fops-during-migration.t +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - - -NUM_BRICKS=3 -DEMOTE_FREQ=5 -PROMOTE_FREQ=5 - -TEST_STR="Testing write and truncate fops on tier migration" - - -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function create_dist_tier_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} - TEST $CLI volume set $V0 performance.quick-read off - TEST $CLI volume set $V0 performance.io-cache off - TEST $CLI volume set $V0 features.ctr-enabled on - TEST $CLI volume set $V0 cluster.force-migration on - TEST $CLI volume start $V0 - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} - TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ - TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ - TEST $CLI volume set $V0 cluster.read-freq-threshold 0 - TEST $CLI volume set $V0 cluster.write-freq-threshold 0 - TEST $CLI volume set $V0 cluster.tier-mode test -} - - -# Checks that the contents of the file matches the input string -#$1 : file_path -#$2 : comparison string - -function check_file_content () { - contents=`cat $1` - echo $contents - if [ "$contents" = "$2" ]; then - echo "1" - else - echo "0" - fi -} - - -cleanup; - -#Basic checks -TEST glusterd - -#Create and start a tiered volume -create_dist_tier_vol $NUM_BRICKS - -# Mount FUSE -TEST glusterfs -s $H0 --volfile-id $V0 $M0 - -$CLI volume set $V0 diagnostics.client-log-level DEBUG - -TEST mkdir $M0/dir1 - -# Create a large file (320MB), so that rebalance takes time -# The file will be created on the hot tier - -dd if=/dev/zero of=$M0/dir1/FILE1 bs=64k count=5120 - -# Get the path of the file on the hot tier -HPATH=`find $B0/hot/ -name FILE1` -echo "File path on hot tier: "$HPATH - - -# Wait for the tier process to demote the file -EXPECT_WITHIN $REBALANCE_TIMEOUT "yes" is_sticky_set $HPATH - -# Get the path of the file on the cold tier -CPATH=`find $B0/cold/ -name FILE1` -echo "File path on cold tier: "$CPATH - -# Test setxattr -TEST setfattr -n "user.test_xattr" -v "qwerty" $M0/dir1/FILE1 - -# Change the file contents while it is being migrated -echo $TEST_STR > $M0/dir1/FILE1 - -# The file contents should have changed even if the file -# is not done migrating -EXPECT "1" check_file_content $M0/dir1/FILE1 "$TEST_STR" - - -# Wait for the tier process to finish migrating the file -EXPECT_WITHIN $REBALANCE_TIMEOUT "no" is_sticky_set $CPATH - -# The file contents should have changed -EXPECT "1" check_file_content $M0/dir1/FILE1 "$TEST_STR" - - -TEST getfattr -n "user.test_xattr" $M0/dir1/FILE1 - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000 diff --git a/tests/basic/tier/frequency-counters.t b/tests/basic/tier/frequency-counters.t deleted file mode 100644 index 08e05df12e2..00000000000 --- a/tests/basic/tier/frequency-counters.t +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - - -NUM_BRICKS=3 -DEMOTE_FREQ=10 -PROMOTE_FREQ=10 -NUM_FILES=5 -TEST_DIR=test -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function create_dist_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} - TEST $CLI volume set $V0 performance.quick-read off - TEST $CLI volume set $V0 performance.io-cache off - TEST $CLI volume start $V0 -} - -function create_dist_tier_vol () { - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} - TEST $CLI volume set $V0 cluster.tier-mode test - TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ - TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ - TEST $CLI volume set $V0 features.record-counters on - TEST $CLI volume set $V0 cluster.read-freq-threshold 2 - TEST $CLI volume set $V0 cluster.write-freq-threshold 2 -} - -cleanup; - - -TEST glusterd - -#Create and start a tiered volume -create_dist_vol $NUM_BRICKS - -# Mount FUSE -TEST glusterfs -s $H0 --volfile-id $V0 $M0 - -# create some files -mkdir $M0/$TEST_DIR -cd $M0/${TEST_DIR} - -date > file1 -touch file2 - -# attach tier -create_dist_tier_vol $NUM_BRICKS - -sleep_until_mid_cycle $PROMOTE_FREQ - -# check if promotion on single hit, should fail -date >> file2 -cat file1 -drop_cache $M0 -sleep $PROMOTE_FREQ -EXPECT "0" check_counters 0 0 - -# check if promotion on double hit, should suceed -sleep_until_mid_cycle $PROMOTE_FREQ -date >> file2 -drop_cache $M0 -cat file1 -date >> file2 -drop_cache $M0 -cat file1 - -EXPECT_WITHIN $PROMOTE_FREQ "0" check_counters 2 0 - -TEST ! $CLI volume set $V0 features.record-counters off - -cd / - -cleanup - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/legacy-many.t b/tests/basic/tier/legacy-many.t deleted file mode 100644 index 5795428c794..00000000000 --- a/tests/basic/tier/legacy-many.t +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - - -LAST_BRICK=3 -CACHE_BRICK_FIRST=4 -CACHE_BRICK_LAST=5 -DEMOTE_TIMEOUT=12 -PROMOTE_TIMEOUT=12 -MIGRATION_TIMEOUT=10 -DEMOTE_FREQ=60 -PROMOTE_FREQ=10 -TEST_DIR="test_files" -NUM_FILES=15 - -function read_all { - for file in * - do - cat $file - done -} - -function tier_status () { - $CLI volume tier $V0 status | grep "success" | wc -l -} - -cleanup - -TEST glusterd -TEST pidof glusterd - -# Create distributed replica volume -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0..$LAST_BRICK} -TEST $CLI volume start $V0 - -TEST $CLI volume set $V0 performance.quick-read off -TEST $CLI volume set $V0 performance.io-cache off -TEST $CLI volume set $V0 features.ctr-enabled on - - -TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; - -# Create a number of "legacy" files before attaching tier -mkdir $M0/${TEST_DIR} -cd $M0/${TEST_DIR} -TEST create_many_files file $NUM_FILES -wait - -# Attach tier -TEST $CLI volume tier $V0 attach replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST - -TEST $CLI volume set $V0 cluster.tier-mode test -TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ -TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ -TEST $CLI volume set $V0 cluster.read-freq-threshold 0 -TEST $CLI volume set $V0 cluster.write-freq-threshold 0 - -# wait a little for lookup heal to finish -wait_for_tier_start - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" tier_status - -# make sure fix layout completed -CPATH=$B0/${V0}0 -echo $CPATH > /tmp/out -TEST getfattr -n "trusted.tier.fix.layout.complete" $CPATH - -# Read "legacy" files -drop_cache $M0 - -sleep_until_mid_cycle $DEMOTE_FREQ - -TEST read_all - -# Test to make sure files were promoted as expected -sleep $PROMOTE_TIMEOUT -EXPECT_WITHIN $PROMOTE_TIMEOUT "0" check_counters $NUM_FILES 0 - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" detach_start $V0 -EXPECT_WITHIN $REBALANCE_TIMEOUT "completed" remove_brick_status_completed_field "$V0 $H0:$B0/${V0}${CACHE_BRICK_FIRST}" - -TEST $CLI volume tier $V0 detach commit - -# fix layout flag should be cleared -TEST ! getfattr -n "trusted.tier.fix.layout.complete" $CPATH - -cd; -cleanup -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/locked_file_migration.t b/tests/basic/tier/locked_file_migration.t deleted file mode 100755 index 7fb17171046..00000000000 --- a/tests/basic/tier/locked_file_migration.t +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - - -NUM_BRICKS=3 -DEMOTE_FREQ=7 -PROMOTE_FREQ=30 -DEMOTE_TIMEOUT=15 - -TEST_STR="Testing write and truncate fops on tier migration" - - -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function create_dist_tier_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} - TEST $CLI volume set $V0 performance.quick-read off - TEST $CLI volume set $V0 performance.io-cache off - TEST $CLI volume set $V0 features.ctr-enabled on - TEST $CLI volume start $V0 - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} - TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ - TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ - -#We don't want promotes to happen in this test - TEST $CLI volume set $V0 cluster.read-freq-threshold 10 - TEST $CLI volume set $V0 cluster.write-freq-threshold 10 - TEST $CLI volume set $V0 cluster.tier-mode test -} - - -cleanup; - -#Basic checks -TEST glusterd -TEST pidof glusterd -TEST $CLI volume info - - -# Create and start a tiered volume -create_dist_tier_vol $NUM_BRICKS - -# Mount FUSE -TEST glusterfs -s $H0 --volfile-id $V0 $M0 - -TEST mkdir $M0/dir1 -build_tester $(dirname $0)/file_lock.c -o file_lock -cp $(dirname $0)/file_lock $M0/file_lock - -# The files will be created on the hot tier -touch $M0/dir1/FILE1 -touch $M0/dir1/FILE2 - -# For FILE1, take a POSIX write lock on the entire file. -# Don't take a lock on FILE2 - -./file_lock $M0/dir1/FILE1 W & - -sleep $DEMOTE_FREQ - -# Wait for the tier process to demote the file -# Only FILE2 and file_lock should be demoted -# FILE1 should be skipped because of the lock held -# on it - -EXPECT_WITHIN $DEMOTE_TIMEOUT "0" check_counters 0 2 - -sleep 10 - -rm $(dirname $0)/file_lock - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/new-tier-cmds.t b/tests/basic/tier/new-tier-cmds.t deleted file mode 100644 index b9c9390536f..00000000000 --- a/tests/basic/tier/new-tier-cmds.t +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc -. $(dirname $0)/../../cluster.rc - - -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function check_peers { - $CLI_1 peer status | grep 'Peer in Cluster (Connected)' | wc -l -} - -function create_dist_tier_vol () { - TEST $CLI_1 volume create $V0 disperse 6 redundancy 2 $H1:$B1/${V0}_b1 $H2:$B2/${V0}_b2 $H3:$B3/${V0}_b3 $H1:$B1/${V0}_b4 $H2:$B2/${V0}_b5 $H3:$B3/${V0}_b6 - TEST $CLI_1 volume start $V0 - TEST $CLI_1 volume tier $V0 attach replica 2 $H1:$B1/${V0}_h1 $H2:$B2/${V0}_h2 $H3:$B3/${V0}_h3 $H1:$B1/${V0}_h4 $H2:$B2/${V0}_h5 $H3:$B3/${V0}_h6 -} - -function tier_daemon_status { - local _VAR=CLI_$1 - local xpath_sel='//node[hostname="Tier Daemon"][path="localhost"]/status' - ${!_VAR} --xml volume status $V0 \ - | xmllint --xpath "$xpath_sel" - \ - | sed -n '/.*<status>\([0-9]*\).*/s//\1/p' -} - -function detach_xml_status { - $CLI_1 volume tier $V0 detach status --xml | sed -n \ - '/.*<opErrstr>Detach tier status successful/p' | wc -l -} - -cleanup; - -#setup cluster and test volume -TEST launch_cluster 3; # start 3-node virtual cluster -TEST $CLI_1 peer probe $H2; # peer probe server 2 from server 1 cli -TEST $CLI_1 peer probe $H3; # peer probe server 3 from server 1 cli - -EXPECT_WITHIN $PROBE_TIMEOUT 2 check_peers; - -#Create and start a tiered volume -create_dist_tier_vol - -########### check failure for older commands ############# - -TEST ! $CLI_1 volume rebalance $V0 tier status - -# failure for older command can be removed in 3.11 - -########################################################## - -#Issue detach tier on the tiered volume -#Will throw error saying detach tier not started - -EXPECT "Tier command failed" $CLI_1 volume tier $V0 detach status - -EXPECT "0" detach_xml_status - -#kill a node -TEST kill_node 2 - -#check if we have the rest of the node available printed in the output of detach status -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" tier_status_node_down - -TEST $glusterd_2; - -EXPECT_WITHIN $PROBE_TIMEOUT 2 check_peers; - -#after starting detach tier the detach tier status should display the status -sleep 2 -$CLI_1 volume status -TEST $CLI_1 volume tier $V0 detach start - -EXPECT "1" detach_xml_status - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" tier_detach_status - -#kill a node -TEST kill_node 2 - -#check if we have the rest of the node available printed in the output of detach status -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" tier_detach_status_node_down - -TEST $glusterd_2; - -EXPECT_WITHIN $PROBE_TIMEOUT 2 check_peers; -# Make sure we check that the *bricks* are up and not just the node. >:-( -EXPECT_WITHIN $CHILD_UP_TIMEOUT 1 cluster_brick_up_status 1 $V0 $H2 $B2/${V0}_b2 -EXPECT_WITHIN $CHILD_UP_TIMEOUT 1 cluster_brick_up_status 1 $V0 $H2 $B2/${V0}_h2 - -# Parsing normal output doesn't work because of line-wrap issues on our -# regression machines, and the version of xmllint there doesn't support --xpath -# so we can't do it that way either. In short, there's no way for us to detect -# when we can stop waiting, so we just have to wait the maximum time every time -# and hope any failures will show up later in the script. -sleep $PROCESS_UP_TIMEOUT -#XPECT_WITHIN $PROCESS_UP_TIMEOUT 1 tier_daemon_status 2 - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" tier_detach_status - -TEST $CLI_1 volume tier $V0 detach stop - -#If detach tier is stopped the detach tier command will fail - -EXPECT "Tier command failed" $CLI_1 volume tier $V0 detach status - -TEST $CLI_1 volume tier $V0 detach start - -#wait for the detach to complete -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" tier_detach_commit - -#If detach tier is committed then the detach status should fail throwing an error -#saying its not a tiered volume - -EXPECT "Tier command failed" $CLI_1 volume tier $V0 detach status - -########### check failure for older commands ############# - -TEST ! $CLI_1 volume rebalance $V0 tier start - -# failure for older command can be removed in 3.11 - -########################################################## -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/readdir-during-migration.t b/tests/basic/tier/readdir-during-migration.t deleted file mode 100644 index 292ca882b79..00000000000 --- a/tests/basic/tier/readdir-during-migration.t +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - - -NUM_BRICKS=3 -DEMOTE_FREQ=5 -PROMOTE_FREQ=5 -NUM_FILES=30 -TEST_DIR=test -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function create_dist_tier_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} - TEST $CLI volume set $V0 performance.quick-read off - TEST $CLI volume set $V0 performance.io-cache off - TEST $CLI volume start $V0 - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} - TEST $CLI volume set $V0 cluster.tier-mode test - TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ - TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ - TEST $CLI volume set $V0 cluster.read-freq-threshold 0 - TEST $CLI volume set $V0 cluster.write-freq-threshold 0 -} - -function check_file_count() { - if [ $(ls -1 | wc -l) == $1 ]; then - echo "1" - else - echo "0" - fi -} - -cleanup; - - -TEST glusterd - -#Create and start a tiered volume -create_dist_tier_vol $NUM_BRICKS - -# Mount FUSE -TEST glusterfs -s $H0 --volfile-id $V0 $M0 - -# Create a number of "legacy" files before attaching tier -mkdir $M0/${TEST_DIR} -cd $M0/${TEST_DIR} -TEST create_many_files tfile $NUM_FILES - -EXPECT "1" check_file_count $NUM_FILES - -sleep $DEMOTE_FREQ - -EXPECT "1" check_file_count $NUM_FILES - -cd / - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/record-metadata-heat.t b/tests/basic/tier/record-metadata-heat.t deleted file mode 100755 index f6f35a83744..00000000000 --- a/tests/basic/tier/record-metadata-heat.t +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - -NUM_BRICKS=3 -DEMOTE_FREQ=5 -DEMOTE_TIMEOUT=10 -PROMOTE_FREQ=5 - -FILE="file1.txt" -FILE_LINK="file2.txt" - -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function create_dist_tier_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} - TEST $CLI volume set $V0 performance.quick-read off - TEST $CLI volume set $V0 performance.io-cache off - TEST $CLI volume set $V0 features.ctr-enabled on - TEST $CLI volume start $V0 - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} - TEST $CLI volume set $V0 cluster.tier-mode test - TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ - TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ - TEST $CLI volume set $V0 cluster.read-freq-threshold 4 - TEST $CLI volume set $V0 cluster.write-freq-threshold 4 -} - - -cleanup; - -#Basic checks -TEST glusterd - -#Create and start a tiered volume -create_dist_tier_vol $NUM_BRICKS - -# Mount FUSE -TEST glusterfs -s $H0 --volfile-id $V0 $M0 - - -# The file will be created on the hot tier -touch "$M0/$FILE" - -# Get the path of the file on the hot tier -HPATH=`find $B0/hot/ -name "$FILE"` -echo "File path on hot tier: "$HPATH - -############################################ -# as per the changes on b8b050c3 -# To test the xttr set by EC -TEST ! getfattr -n "trusted.ec.size" $HPATH -############################################ - -# Expecting the file to be on the hot tier -EXPECT "yes" exists_and_regular_file $HPATH - -sleep_until_mid_cycle $DEMOTE_FREQ - -# Try to heat the file using 5 metadata operations -# WITHOUT setting ctr-record-metadata-heat on -touch "$M0/$FILE" -chmod +x "$M0/$FILE" -chown root "$M0/$FILE" -ln "$M0/$FILE" "$M0/$FILE_LINK" -rm -rf "$M0/$FILE_LINK" - -# Wait for the tier process to demote the file -sleep $DEMOTE_TIMEOUT - -# Get the path of the file on the cold tier -CPATH=`find $B0/cold/ -name "$FILE"` -echo "File path on cold tier: "$CPATH - -# Expecting the file to be on cold tier -EXPECT "yes" exists_and_regular_file $CPATH - -#Set ctr-record-metadata-heat on -TEST $CLI volume set $V0 ctr-record-metadata-heat on - -sleep_until_mid_cycle $DEMOTE_FREQ - -# Heating the file using 5 metadata operations -touch "$M0/$FILE" -chmod +x "$M0/$FILE" -chown root "$M0/$FILE" -ln "$M0/$FILE" "$M0/$FILE_LINK" -rm -rf "$M0/$FILE_LINK" - -# Wait for the tier process to demote the file -sleep $DEMOTE_TIMEOUT - -# Get the path of the file on the hot tier -echo "File path on hot tier: "$HPATH - -# Expecting the file to be on the hot tier -EXPECT "yes" exists_and_regular_file $HPATH - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000 diff --git a/tests/basic/tier/tier-heald.t b/tests/basic/tier/tier-heald.t deleted file mode 100644 index a8e634fb37b..00000000000 --- a/tests/basic/tier/tier-heald.t +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -# This test contains volume heal commands handled by glusterd. -# Covers enable/disable at the moment. Will be enhanced later to include -# the other commands as well. - -cleanup; -TEST glusterd -TEST pidof glusterd - -volfile=$(gluster system:: getwd)"/glustershd/glustershd-server.vol" - -# Commands should fail when both tiers are not of distribute type. -# Glustershd shouldn't be running as long as there are no replicate/disperse -# volumes -TEST $CLI volume create dist_tier $H0:$B0/cold -TEST $CLI volume start dist_tier -TEST $CLI volume tier dist_tier attach $H0:$B0/hot - -TEST "[ -z $(get_shd_process_pid)]" -TEST ! $CLI volume heal dist_tier enable -TEST ! $CLI volume heal dist_tier disable - -# Commands should work on replicate/disperse volume. -TEST $CLI volume create r2 replica 2 $H0:$B0/r2_0 $H0:$B0/r2_1 -TEST "[ -z $(get_shd_process_pid)]" -TEST $CLI volume start r2 - -TEST $CLI volume tier r2 attach $H0:$B0/r2_hot - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid -TEST $CLI volume heal r2 enable -EXPECT "enable" volume_option r2 "cluster.self-heal-daemon" -EXPECT "enable" volgen_volume_option $volfile r2-replicate-0 cluster replicate self-heal-daemon -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid -TEST $CLI volume heal r2 disable -EXPECT "disable" volume_option r2 "cluster.self-heal-daemon" -EXPECT "disable" volgen_volume_option $volfile r2-replicate-0 cluster replicate self-heal-daemon -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid -# Commands should work on disperse volume. -TEST $CLI volume create ec2 disperse 3 redundancy 1 $H0:$B0/ec2_0 $H0:$B0/ec2_1 $H0:$B0/ec2_2 -TEST $CLI volume start ec2 - -TEST $CLI volume tier ec2 attach replica 2 $H0:$B0/ec2_hot{1..4} -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid -TEST $CLI volume heal ec2 enable -EXPECT "enable" volume_option ec2 "cluster.disperse-self-heal-daemon" -EXPECT "enable" volgen_volume_option $volfile ec2-disperse-0 cluster disperse self-heal-daemon -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid -TEST $CLI volume heal ec2 disable -EXPECT "disable" volume_option ec2 "cluster.disperse-self-heal-daemon" -EXPECT "disable" volgen_volume_option $volfile ec2-disperse-0 cluster disperse self-heal-daemon -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "[0-9][0-9]*" get_shd_process_pid - -#Check that shd graph is rewritten correctly on volume stop/start -EXPECT "Y" volgen_volume_exists $volfile ec2-disperse-0 cluster disperse -EXPECT "Y" volgen_volume_exists $volfile r2-replicate-0 cluster replicate -TEST $CLI volume stop r2 -EXPECT "Y" volgen_volume_exists $volfile ec2-disperse-0 cluster disperse -EXPECT "N" volgen_volume_exists $volfile r2-replicate-0 cluster replicate -TEST $CLI volume stop ec2 -# When both the volumes are stopped glustershd volfile is not modified just the -# process is stopped -TEST "[ -z $(get_shd_process_pid) ]" - -TEST $CLI volume start r2 -EXPECT "N" volgen_volume_exists $volfile ec2-disperse-0 cluster disperse -EXPECT "Y" volgen_volume_exists $volfile r2-replicate-0 cluster replicate - -TEST $CLI volume start ec2 - -EXPECT "Y" volgen_volume_exists $volfile ec2-disperse-0 cluster disperse -EXPECT "Y" volgen_volume_exists $volfile ec2-replicate-0 cluster replicate - -TEST $CLI volume tier ec2 detach force - -EXPECT "Y" volgen_volume_exists $volfile ec2-disperse-0 cluster disperse -EXPECT "N" volgen_volume_exists $volfile ec2-replicate-0 cluster replicate - -TEST $CLI volume set r2 self-heal-daemon on -TEST $CLI volume set r2 cluster.self-heal-daemon off -TEST ! $CLI volume set ec2 self-heal-daemon off -TEST ! $CLI volume set ec2 cluster.self-heal-daemon on -TEST ! $CLI volume set dist self-heal-daemon off -TEST ! $CLI volume set dist cluster.self-heal-daemon on - -TEST $CLI volume set ec2 disperse-self-heal-daemon off -TEST $CLI volume set ec2 cluster.disperse-self-heal-daemon on -TEST ! $CLI volume set r2 disperse-self-heal-daemon on -TEST ! $CLI volume set r2 cluster.disperse-self-heal-daemon off -TEST ! $CLI volume set dist disperse-self-heal-daemon off -TEST ! $CLI volume set dist cluster.disperse-self-heal-daemon on - -cleanup -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/tier-snapshot.t b/tests/basic/tier/tier-snapshot.t deleted file mode 100644 index 8747c5dc05d..00000000000 --- a/tests/basic/tier/tier-snapshot.t +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../snapshot.rc - -cleanup; - -TEST init_n_bricks 4; -TEST setup_lvm 4; - -TEST glusterd; - -TEST $CLI volume create $V0 replica 2 $H0:$L1 $H0:$L2 ; - -TEST $CLI volume start $V0; - -TEST $CLI volume tier $V0 attach replica 2 $H0:$L3 $H0:$L4 ; - -TEST $GFS --volfile-server=$H0 --volfile-id=$V0 $M0; - -for i in {1..10} ; do echo "file" > $M0/file$i ; done - -TEST $CLI snapshot config activate-on-create enable - -TEST $CLI snapshot create snap1 $V0 no-timestamp; - -for i in {11..20} ; do echo "file" > $M0/file$i ; done - -TEST $CLI snapshot create snap2 $V0 no-timestamp; - -mkdir $M0/dir1; -mkdir $M0/dir2; - -for i in {1..10} ; do echo "foo" > $M0/dir1/foo$i ; done -for i in {1..10} ; do echo "foo" > $M0/dir2/foo$i ; done - -TEST $CLI snapshot create snap3 $V0 no-timestamp; - -for i in {11..20} ; do echo "foo" > $M0/dir1/foo$i ; done -for i in {11..20} ; do echo "foo" > $M0/dir2/foo$i ; done - -TEST $CLI snapshot create snap4 $V0 no-timestamp; - -TEST $CLI snapshot delete all; - -cleanup; -#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000 diff --git a/tests/basic/tier/tier.t b/tests/basic/tier/tier.t deleted file mode 100755 index 1798541becd..00000000000 --- a/tests/basic/tier/tier.t +++ /dev/null @@ -1,219 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - -LAST_BRICK=3 -CACHE_BRICK_FIRST=4 -CACHE_BRICK_LAST=5 -DEMOTE_TIMEOUT=12 -PROMOTE_TIMEOUT=5 -MIGRATION_TIMEOUT=10 -DEMOTE_FREQ=4 -PROMOTE_FREQ=12 - -function file_on_slow_tier { - found=0 - - for i in `seq 0 $LAST_BRICK`; do - test -e "$B0/${V0}${i}/$1" && found=1 && break; - done - - if [ "$found" == "1" ] - then - slow_hash1=$2 - slow_hash2=$(fingerprint "$B0/${V0}${i}/$1") - - if [ "$slow_hash1" == "$slow_hash2" ] - then - echo "0" - else - echo "2" - fi - else - echo "1" - fi - - # temporarily disable non-Linux tests. - case $OSTYPE in - NetBSD | FreeBSD | Darwin) - echo "0" - ;; - esac -} - -function file_on_fast_tier { - found=0 - - for j in `seq $CACHE_BRICK_FIRST $CACHE_BRICK_LAST`; do - test -e "$B0/${V0}${j}/$1" && found=1 && break; - done - - - if [ "$found" == "1" ] - then - fast_hash1=$2 - fast_hash2=$(fingerprint "$B0/${V0}${j}/$1") - - if [ "$fast_hash1" == "$fast_hash2" ] - then - echo "0" - else - echo "2" - fi - else - echo "1" - fi -} - - -cleanup - -TEST glusterd -TEST pidof glusterd - -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0..$LAST_BRICK} -# testing bug 1215122, ie should fail if replica count and bricks are not compatible. - -TEST ! $CLI volume tier $V0 attach replica 5 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST - -TEST $CLI volume start $V0 - -# The following two commands instigate a graph switch. Do them -# before attaching the tier. If done on a tiered volume the rebalance -# daemon will terminate and must be restarted manually. -TEST $CLI volume set $V0 performance.quick-read off -TEST $CLI volume set $V0 performance.io-cache off - -#Not a tier volume -TEST ! $CLI volume set $V0 cluster.tier-demote-frequency 4 - -#testing bug #1228112, glusterd crashed when trying to detach-tier commit force on a non-tiered volume. -TEST ! $CLI volume tier $V0 detach commit force - -TEST $CLI volume tier $V0 attach replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST - -TEST $CLI volume set $V0 cluster.tier-mode test - -# create a file, make sure it can be deleted after attach tier. -TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; -cd $M0 -TEST touch delete_me.txt -TEST rm -f delete_me.txt - -# confirm watermark CLI works -TEST $CLI volume set $V0 cluster.watermark-hi 85 -TEST $CLI volume set $V0 cluster.watermark-low 75 -TEST $CLI volume set $V0 cluster.tier-max-mb 1000 -TEST $CLI volume set $V0 cluster.tier-max-files 1000 -TEST $CLI volume set $V0 cluster.tier-max-promote-file-size 1000 -TEST ! $CLI volume set $V0 cluster.tier-max-files -3 -TEST ! $CLI volume set $V0 cluster.watermark-low 90 -TEST ! $CLI volume set $V0 cluster.watermark-hi 75 -TEST ! $CLI volume set $V0 cluster.read-freq-threshold -12 -TEST ! $CLI volume set $V0 cluster.write-freq-threshold -12 - -#check for watermark reset -TEST $CLI volume set $V0 cluster.watermark-low 10 -TEST $CLI volume set $V0 cluster.watermark-hi 30 -TEST ! $CLI volume reset $V0 cluster.watermark-low -TEST $CLI volume reset $V0 cluster.watermark-hi -TEST $CLI volume reset $V0 cluster.watermark-low - -# stop the volume and restart it. The rebalance daemon should restart. -cd /tmp -umount $M0 -TEST $CLI volume stop $V0 -TEST $CLI volume start $V0 - -wait_for_tier_start - -TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; -cd $M0 - -sleep_first_cycle $DEMOTE_FREQ -$CLI volume tier $V0 status - -#Tier options expect non-negative value -TEST ! $CLI volume set $V0 cluster.tier-promote-frequency -1 - -#Tier options expect non-negative value -TEST ! $CLI volume set $V0 cluster.read-freq-threshold qwerty - - -TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ -TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ -TEST $CLI volume set $V0 cluster.read-freq-threshold 0 -TEST $CLI volume set $V0 cluster.write-freq-threshold 0 - -# Basic operations. -TEST stat . -TEST mkdir d1 -TEST [ -d d1 ] -TEST touch d1/file1 -TEST mkdir d1/d2 -TEST [ -d d1/d2 ] -TEST find d1 -mkdir /tmp/d1 - -# Create a file. It should be on the fast tier. -uuidgen > /tmp/d1/data.txt -md5data=$(fingerprint /tmp/d1/data.txt) -mv /tmp/d1/data.txt ./d1/data.txt - -TEST file_on_fast_tier d1/data.txt $md5data - -uuidgen > /tmp/d1/data2.txt -md5data2=$(fingerprint /tmp/d1/data2.txt) -cp /tmp/d1/data2.txt ./d1/data2.txt - -#File with spaces and special characters. -SPACE_FILE="file with spaces & $peci@l ch@r@cter$ @!@$%^$#@^^*&%$#$%.txt" - -uuidgen > "/tmp/d1/$SPACE_FILE" -md5space=$(fingerprint "/tmp/d1/$SPACE_FILE") -mv "/tmp/d1/$SPACE_FILE" "./d1/$SPACE_FILE" - -# Check auto-demotion on write new. -sleep $DEMOTE_TIMEOUT - -# Check auto-promotion on write append. -UUID=$(uuidgen) -echo $UUID >> /tmp/d1/data2.txt -md5data2=$(fingerprint /tmp/d1/data2.txt) - -sleep_until_mid_cycle $DEMOTE_FREQ -drop_cache $M0 - -echo $UUID >> ./d1/data2.txt -cat "./d1/$SPACE_FILE" - -sleep $PROMOTE_TIMEOUT -sleep $DEMOTE_FREQ -EXPECT_WITHIN $DEMOTE_TIMEOUT "0" check_counters 2 6 - -# stop gluster, when it comes back info file should have tiered volume -killall glusterd -TEST glusterd - -EXPECT "0" file_on_slow_tier d1/data.txt $md5data -EXPECT "0" file_on_slow_tier d1/data2.txt $md5data2 -EXPECT "0" file_on_slow_tier "./d1/$SPACE_FILE" $md5space - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" detach_start $V0 -EXPECT_WITHIN $REBALANCE_TIMEOUT "completed" remove_brick_status_completed_field "$V0 $H0:$B0/${V0}${CACHE_BRICK_FIRST}" - -TEST $CLI volume tier $V0 detach commit - -EXPECT "0" confirm_tier_removed ${V0}${CACHE_BRICK_FIRST} - -confirm_vol_stopped $V0 - -cd; - -cleanup -rm -rf /tmp/d1 - - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/tier_lookup_heal.t b/tests/basic/tier/tier_lookup_heal.t deleted file mode 100755 index c7c7f27e8de..00000000000 --- a/tests/basic/tier/tier_lookup_heal.t +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -LAST_BRICK=1 -CACHE_BRICK_FIRST=2 -CACHE_BRICK_LAST=3 -PROMOTE_TIMEOUT=5 - -function file_on_fast_tier { - local ret="1" - - s1=$(md5sum $1) - s2=$(md5sum $B0/${V0}${CACHE_BRICK_FIRST}/$1) - - if [ -e $B0/${V0}${CACHE_BRICK_FIRST}/$1 ] && ! [ "$s1" == "$s2" ]; then - echo "0" - else - echo "1" - fi -} - -cleanup - - -TEST glusterd - -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0..$LAST_BRICK} -TEST $CLI volume start $V0 -TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; - -# Create files before CTR xlator is on. -cd $M0 -TEST stat . -TEST touch file1 -TEST stat file1 - -#Attach tier and switch ON CTR Xlator. -TEST $CLI volume tier $V0 attach replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST -TEST $CLI volume set $V0 features.ctr-enabled on -TEST $CLI volume set $V0 cluster.tier-demote-frequency 4 -TEST $CLI volume set $V0 cluster.tier-promote-frequency 4 -TEST $CLI volume set $V0 cluster.read-freq-threshold 0 -TEST $CLI volume set $V0 cluster.write-freq-threshold 0 -TEST $CLI volume set $V0 performance.quick-read off -TEST $CLI volume set $V0 performance.io-cache off -TEST $CLI volume set $V0 cluster.tier-mode test - -#The lookup should heal the database. -TEST ls file1 - -# gf_file_tb and gf_flink_tb should NOT be empty -ENTRY_COUNT=$(echo "select * from gf_file_tb; select * from gf_flink_tb;" | \ - sqlite3 $B0/${V0}$LAST_BRICK/.glusterfs/${V0}$LAST_BRICK.db | wc -l ) -TEST [ $ENTRY_COUNT -eq 2 ] - -# Heat-up the file -uuidgen > file1 -sleep 5 - -#Check if the file is promoted -EXPECT_WITHIN $PROMOTE_TIMEOUT "0" file_on_fast_tier file1 - -cd; - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=BAD_TEST,BUG=000000 diff --git a/tests/basic/tier/tierd_check.t b/tests/basic/tier/tierd_check.t deleted file mode 100644 index 5701fa98960..00000000000 --- a/tests/basic/tier/tierd_check.t +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc -. $(dirname $0)/../../cluster.rc - - -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function check_peers { - $CLI_1 peer status | grep 'Peer in Cluster (Connected)' | wc -l -} - -function create_dist_tier_vol () { - TEST $CLI_1 volume create $V0 $H1:$B1/${V0} $H2:$B2/${V0} - TEST $CLI_1 volume start $V0 - TEST $CLI_1 volume tier $V0 attach $H1:$B1/${V0}_h1 $H2:$B2/${V0}_h2 -} - -function tier_status () { - #$CLI_1 volume tier $V0 status | grep progress | wc -l - # I don't want to disable the entire test, but this part of it seems - # highly suspect. *Why* do we always expect the number of lines to be - # exactly two? What would it mean for it to be otherwise? Are we - # checking *correctness* of the result, or merely its *consistency* - # with what was observed at some unspecified time in the past? Does - # this check only serve to inhibit actual improvements? Until someone - # can answer these questions and explain why a hard-coded "2" is less - # arbitrary than what was here before, we might as well disable this - # part of the test. - echo "2" -} - -function tier_daemon_kill () { -pkill -f "tierd/$V0" -echo "$?" -} - -cleanup; - -#setup cluster and test volume -TEST launch_cluster 3; # start 3-node virtual cluster -TEST $CLI_1 peer probe $H2; # peer probe server 2 from server 1 cli -TEST $CLI_1 peer probe $H3; # peer probe server 3 from server 1 cli - -EXPECT_WITHIN $PROBE_TIMEOUT 2 check_peers; - -#Create and start a tiered volume -create_dist_tier_vol - -wait_for_tier_start - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT 0 tier_daemon_check - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" tier_status - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT 0 tier_daemon_kill - -TEST $CLI_1 volume tier $V0 start - -wait_for_tier_start - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_daemon_check - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" tier_status - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_daemon_kill - -TEST $CLI_3 volume tier $V0 start force - -wait_for_tier_start - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_daemon_check - -#The pattern progress should occur twice only. -#it shouldn't come up on the third node without tierd even -#after the tier start force is issued on the node without -#tierd - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" tier_status - -#kill the node on which tier is not supposed to run -TEST kill_node 3 - -#bring the node back, it should not have tierd running on it -TEST $glusterd_3; - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" tier_status - -#after volume restart, check for tierd - -TEST $CLI_3 volume stop $V0 - -TEST $CLI_3 volume start $V0 - -wait_for_tier_start - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" tier_status - -#check for detach start and stop - -TEST $CLI_3 volume tier $V0 detach start - -TEST $CLI_3 volume tier $V0 detach stop - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" tier_status - -TEST $CLI_1 volume tier $V0 start force - -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_daemon_check - -# To test for detach start fail while the brick is down - -TEST pkill -f "$B1/$V0" - -TEST ! $CLI_1 volume tier $V0 detach start - -cleanup -# This test isn't worth keeping. Besides the totally arbitrary tier_status -# checks mentioned above, someone direct-coded pkill to kill bricks instead of -# using the volume.rc function we already had. I can't be bothered fixing that, -# and the next thing, and the next thing, unless there's a clear benefit to -# doing so, and AFAICT the success or failure of this test tells us nothing -# useful. Therefore, it's disabled until further notice. -#G_TESTDEF_TEST_STATUS_CENTOS6=KNOWN_ISSUE,BUG=000000 -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/basic/tier/unlink-during-migration.t b/tests/basic/tier/unlink-during-migration.t deleted file mode 100755 index 1330092177f..00000000000 --- a/tests/basic/tier/unlink-during-migration.t +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - - -DEMOTE_FREQ=5 -PROMOTE_FREQ=5 - -function create_dist_rep_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 replica 2 $H0:$B0/cold/${V0}{0..3} - TEST $CLI volume set $V0 performance.quick-read off - TEST $CLI volume set $V0 performance.io-cache off - TEST $CLI volume set $V0 features.ctr-enabled on - TEST $CLI volume start $V0 -} - -function attach_dist_rep_tier () { - TEST $CLI volume tier $V0 attach replica 2 $H0:$B0/hot/${V0}{0..3} - TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ - TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ - TEST $CLI volume set $V0 cluster.read-freq-threshold 0 - TEST $CLI volume set $V0 cluster.write-freq-threshold 0 - TEST $CLI volume set $V0 cluster.tier-mode test -} - -cleanup; - -#Basic checks -TEST glusterd -TEST pidof glusterd -TEST $CLI volume info - - -#Create and start a volume -create_dist_rep_vol - -# Mount FUSE -TEST glusterfs -s $H0 --volfile-id $V0 $M0 - -# Create a large file (320MB), so that rebalance takes time -TEST dd if=/dev/zero of=$M0/foo bs=64k count=5120 - -# Get the path of the file on the cold tier -CPATH=`find $B0/cold/ -name foo` -echo "File path on cold tier: "$CPATH - -#Now attach the tier -attach_dist_rep_tier - -#Write into the file to promote it -echo "good morning">>$M0/foo - -# Wait for the tier process to promote the file -EXPECT_WITHIN $REBALANCE_TIMEOUT "yes" is_sticky_set $CPATH - -# Get the path of the file on the hot tier -HPATH=`find $B0/hot/ -name foo` - -echo "File path on hot tier: "$HPATH -TEST rm -rf $M0/foo -TEST ! stat $HPATH -TEST ! stat $CPATH - -#unlink during demotion -HPATH=""; -CPATH=""; - -# Create a large file (320MB), so that rebalance takes time -TEST dd if=/dev/zero of=$M0/foo1 bs=64k count=5120 - -# Get the path of the file on the hot tier -HPATH=`find $B0/hot/ -name foo1` -echo "File path on hot tier : "$HPATH - -EXPECT_WITHIN $REBALANCE_TIMEOUT "yes" is_sticky_set $HPATH - -# Get the path of the file on the cold tier -CPATH=`find $B0/cold/ -name foo1` -echo "File path on cold tier : "$CPATH - -TEST rm -rf $M0/foo1 - -TEST ! stat $HPATH -TEST ! stat $CPATH - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/bugs/glusterd/bug-1303028-Rebalance-glusterd-rpc-connection-issue.t b/tests/bugs/glusterd/bug-1303028-Rebalance-glusterd-rpc-connection-issue.t deleted file mode 100644 index 3b62a4547b5..00000000000 --- a/tests/bugs/glusterd/bug-1303028-Rebalance-glusterd-rpc-connection-issue.t +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - - -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function create_dist_tier_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{1..3} - TEST $CLI volume set $V0 performance.quick-read off - TEST $CLI volume set $V0 performance.io-cache off - TEST $CLI volume start $V0 - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{1..2} - TEST $CLI volume set $V0 cluster.tier-mode test -} - -function non_zero_check () { - if [ "$1" -ne 0 ] - then - echo "0" - else - echo "1" - fi -} - -function num_bricks_up { - local b - local n_up=0 - - for b in $B0/hot/${V0}{1..2} $B0/cold/${V0}{1..3}; do - if [ x"$(brick_up_status $V0 $H0 $b)" = x"1" ]; then - n_up=$((n_up+1)) - fi - done - - echo $n_up -} - -cleanup; - -#Basic checks -TEST glusterd -TEST pidof glusterd -TEST $CLI volume status - - -#Create and start a tiered volume -create_dist_tier_vol -# Wait for the bricks to come up, *then* the tier daemon. -EXPECT_WITHIN $PROCESS_UP_TIMEOUT 5 num_bricks_up -EXPECT_WITHIN $PROCESS_UP_TIMEOUT 0 tier_daemon_check -sleep 5 #wait for some time to run tier daemon -time_before_restarting=$(rebalance_run_time $V0); - -#checking for elapsed time after sleeping for two seconds. -EXPECT "0" non_zero_check $time_before_restarting; - -#Difference of elapsed time should be positive - -kill -9 $(pidof glusterd); -TEST glusterd; -sleep 2; -# Wait for the bricks to come up, *then* the tier daemon. -EXPECT_WITHIN $PROCESS_UP_TIMEOUT 5 num_bricks_up -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "0" tier_daemon_check; -sleep 1; -time1=$(rebalance_run_time $V0); -EXPECT "0" non_zero_check $time1; -sleep 2; -time2=$(rebalance_run_time $V0); -EXPECT "0" non_zero_check $time2; -diff=`expr $time2 - $time1` -EXPECT "0" non_zero_check $diff; diff --git a/tests/bugs/quota/bug-1288474.t b/tests/bugs/quota/bug-1288474.t deleted file mode 100755 index b8f4ba38d4d..00000000000 --- a/tests/bugs/quota/bug-1288474.t +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - -NUM_BRICKS=2 - -function create_dist_tier_vol () { - mkdir -p $B0/cold/${V0}{0..$1} - mkdir -p $B0/hot/${V0}{0..$1} - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} - TEST $CLI volume set $V0 nfs.disable false - TEST $CLI volume start $V0 - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} -} - -cleanup; - -#Basic checks -TEST glusterd - -#Create and start a tiered volume -create_dist_tier_vol $NUM_BRICKS - -TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0 -touch $M0/foobar - -TEST $CLI volume quota $V0 enable -TEST $CLI volume quota $V0 limit-usage / 10MB - -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5 - -#check quota list after detach tier -TEST $CLI volume tier $V0 detach start -sleep 1 -TEST $CLI volume tier $V0 detach force - -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5 - -#check quota list after attach tier -rm -rf $B0/hot -mkdir $B0/hot -TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} - -EXPECT_WITHIN $MARKER_UPDATE_TIMEOUT "10.0MB" quota_list_field "/" 5 - -TEST umount $M0 - -cleanup; - diff --git a/tests/bugs/replicate/bug-1290965-detect-bitrotten-objects.t b/tests/bugs/replicate/bug-1290965-detect-bitrotten-objects.t deleted file mode 100644 index 9863834dbb5..00000000000 --- a/tests/bugs/replicate/bug-1290965-detect-bitrotten-objects.t +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -#Self-heal tests - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -cleanup; - -TEST glusterd -TEST pidof glusterd -TEST $CLI volume create $V0 replica 2 $H0:$B0/brick{0,1} -TEST $CLI volume set $V0 self-heal-daemon off -TEST $CLI volume set $V0 entry-self-heal off -TEST $CLI volume set $V0 metadata-self-heal off -TEST $CLI volume set $V0 data-self-heal off -TEST $CLI volume set $V0 performance.stat-prefetch off -TEST $CLI volume start $V0 -TEST $CLI volume tier $V0 attach replica 2 $H0:$B0/brick{2,3} -TEST $CLI volume bitrot $V0 enable -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_bitd_count -TEST $CLI volume bitrot $V0 scrub-frequency hourly -TEST $GFS --volfile-id=$V0 --volfile-server=$H0 $M0 -TEST dd if=/dev/urandom of=$M0/FILE bs=1024 count=1 - -#Corrupt file from back-end -TEST stat $B0/brick3/FILE -echo "Corrupted data" >> $B0/brick3/FILE -#Manually set bad-file xattr since we can't wait for an hour. -TEST setfattr -n trusted.bit-rot.bad-file -v 0x3100 $B0/brick3/FILE - -TEST $CLI volume stop $V0 -TEST $CLI volume start $V0 -EXPECT 'Started' volinfo_field $V0 'Status'; -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/brick0 -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/brick1 -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/brick2 -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" brick_up_status $V0 $H0 $B0/brick3 -EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 0 -EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 1 -EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 2 -EXPECT_WITHIN $CHILD_UP_TIMEOUT "1" afr_child_up_status $V0 3 -EXPECT_WITHIN $PROCESS_UP_TIMEOUT "1" get_bitd_count -#Trigger lookup so that bitrot xlator marks file as bad in its inode context. -stat $M0/FILE -# Remove hot-tier -TEST $CLI volume tier $V0 detach start -sleep 1 -EXPECT_WITHIN $REBALANCE_TIMEOUT "completed" detach_tier_status_field_complete $V0 -TEST $CLI volume tier $V0 detach commit -#Test that file has migrated to cold tier. -EXPECT "1024" stat -c "%s" $B0/brick0/FILE -EXPECT "1024" stat -c "%s" $B0/brick1/FILE -TEST umount $M0 -cleanup diff --git a/tests/bugs/tier/bug-1205545-CTR-and-trash-integration.t b/tests/bugs/tier/bug-1205545-CTR-and-trash-integration.t deleted file mode 100644 index b2d382a2ce5..00000000000 --- a/tests/bugs/tier/bug-1205545-CTR-and-trash-integration.t +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc - -LAST_BRICK=3 -CACHE_BRICK_FIRST=4 -CACHE_BRICK_LAST=5 - -cleanup - -# Start glusterd [1-2] -TEST glusterd -TEST pidof glusterd - -# Set-up tier cluster [3-4] -TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{0..$LAST_BRICK} -TEST $CLI volume start $V0 -TEST $CLI volume tier $V0 attach replica 2 $H0:$B0/${V0}$CACHE_BRICK_FIRST $H0:$B0/${V0}$CACHE_BRICK_LAST - -# Start and mount the volume after enabling CTR and trash [5-8] -TEST $CLI volume set $V0 features.ctr-enabled on -TEST $CLI volume set $V0 features.trash on -TEST $GFS --volfile-id=/$V0 --volfile-server=$H0 $M0; - -# Create an empty file -touch $M0/foo - -# gf_file_tb and gf_flink_tb should contain one entry each [9] -ENTRY_COUNT=$(echo "select * from gf_file_tb; select * from gf_flink_tb;" | \ - sqlite3 $B0/${V0}5/.glusterfs/${V0}5.db | wc -l ) -TEST [ $ENTRY_COUNT -eq 2 ] - -# Create two hard links -ln $M0/foo $M0/lnk1 -ln $M0/foo $M0/lnk2 - -# Now gf_flink_tb should contain 3 entries [10] -ENTRY_COUNT=$(echo "select * from gf_flink_tb;" | \ - sqlite3 $B0/${V0}5/.glusterfs/${V0}5.db | wc -l ) -TEST [ $ENTRY_COUNT -eq 3 ] - -# Delete the hard link -rm -rf $M0/lnk1 - -# Corresponding hard link entry must be removed from gf_flink_tb -# but gf_file_tb should still contain the file entry [11] -ENTRY_COUNT=$(echo "select * from gf_file_tb; select * from gf_flink_tb;" | \ - sqlite3 $B0/${V0}5/.glusterfs/${V0}5.db | wc -l ) -TEST [ $ENTRY_COUNT -eq 3 ] - -# Remove the file -rm -rf $M0/foo - -# Another hardlink removed [12] -ENTRY_COUNT=$(echo "select * from gf_file_tb; select * from gf_flink_tb;" | \ - sqlite3 $B0/${V0}5/.glusterfs/${V0}5.db | wc -l ) -TEST [ $ENTRY_COUNT -eq 2 ] - -# Remove the last hardlink -rm -rf $M0/lnk2 - -# All entried must be removed from gf_flink_tb and gf_file_tb [13] -ENTRY_COUNT=$(echo "select * from gf_file_tb; select * from gf_flink_tb;" | \ - sqlite3 $B0/${V0}5/.glusterfs/${V0}5.db | wc -l ) -TEST [ $ENTRY_COUNT -eq 0 ] - -cleanup - - - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 diff --git a/tests/bugs/tier/bug-1279376-rename-demoted-file.t b/tests/bugs/tier/bug-1279376-rename-demoted-file.t deleted file mode 100755 index c4a50d9d9f7..00000000000 --- a/tests/bugs/tier/bug-1279376-rename-demoted-file.t +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash - -. $(dirname $0)/../../include.rc -. $(dirname $0)/../../volume.rc -. $(dirname $0)/../../tier.rc - - -NUM_BRICKS=2 -DEMOTE_FREQ=15 -DEMOTE_TIMEOUT=10 -PROMOTE_FREQ=500 - - -#Both src and dst files must hash to the same hot tier subvol -SRC_FILE="file1.txt" -DST_FILE="newfile1.txt" - - -# Creates a tiered volume with pure distribute hot and cold tiers -# Both hot and cold tiers will have an equal number of bricks. - -function create_dist_tier_vol () { - mkdir $B0/cold - mkdir $B0/hot - TEST $CLI volume create $V0 $H0:$B0/cold/${V0}{0..$1} - TEST $CLI volume set $V0 performance.quick-read off - TEST $CLI volume set $V0 performance.io-cache off - TEST $CLI volume start $V0 - TEST $CLI volume tier $V0 attach $H0:$B0/hot/${V0}{0..$1} - TEST $CLI volume set $V0 cluster.tier-demote-frequency $DEMOTE_FREQ - TEST $CLI volume set $V0 cluster.tier-promote-frequency $PROMOTE_FREQ - TEST $CLI volume set $V0 cluster.tier-mode test - -#We do not want any files to be promoted during this test - TEST $CLI volume set $V0 features.record-counters on - TEST $CLI volume set $V0 cluster.read-freq-threshold 50 - TEST $CLI volume set $V0 cluster.write-freq-threshold 50 -} - - -cleanup; - -#Basic checks -TEST glusterd -TEST pidof glusterd -TEST $CLI volume info - - -#Create and start a tiered volume -create_dist_tier_vol $NUM_BRICKS - -# Mount FUSE -TEST glusterfs -s $H0 --volfile-id $V0 $M0 - - -# The file will be created on the hot tier - -TEST touch "$M0/$SRC_FILE" - -# Get the path of the file on the hot tier -HPATH=`find $B0/hot/ -name "$SRC_FILE"` -echo "File path on hot tier: "$HPATH - - -EXPECT "yes" exists_and_regular_file $HPATH - -# Wait for the tier process to demote the file -sleep $DEMOTE_FREQ - -# Get the path of the file on the cold tier -CPATH=`find $B0/cold/ -name "$SRC_FILE"` -echo "File path on cold tier: "$CPATH - -EXPECT_WITHIN $DEMOTE_TIMEOUT "yes" exists_and_regular_file $CPATH - -#We don't want $DST_FILE to get demoted -TEST $CLI volume set $V0 cluster.tier-demote-frequency $PROMOTE_FREQ - -#This will be created on the hot tier - -touch "$M0/$DST_FILE" -HPATH=`find $B0/hot/ -name "$DST_FILE"` -echo "File path on hot tier: "$HPATH - -TEST mv $M0/$SRC_FILE $M0/$DST_FILE - -# We expect a single file to exist at this point -# when viewed on the mountpoint -EXPECT 1 echo $(ls -l $M0 | grep $DST_FILE | wc -l) - -cleanup; - -#G_TESTDEF_TEST_STATUS_NETBSD7=KNOWN_ISSUE,BUG=000000 |