|
Packit Service |
e080da |
#!/bin/bash
|
|
Packit Service |
e080da |
#This test tests that self-heals don't perform fsync when durability is turned
|
|
Packit Service |
e080da |
#off
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
. $(dirname $0)/../include.rc
|
|
Packit Service |
e080da |
. $(dirname $0)/../traps.rc
|
|
Packit Service |
e080da |
. $(dirname $0)/../volume.rc
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
function count_processes {
|
|
Packit Service |
e080da |
# It would generally be a good idea to use "pgrep -x" to ensure an
|
|
Packit Service |
e080da |
# exact match, but the version of pgrep we have on NetBSD (a.k.a.
|
|
Packit Service |
e080da |
# the worst operating system ever) doesn't support that option.
|
|
Packit Service |
e080da |
# Fortunately, "glusterfsd" isn't the prefix of any other name,
|
|
Packit Service |
e080da |
# so this works anyway. For now.
|
|
Packit Service |
e080da |
pgrep glusterfsd | wc -w
|
|
Packit Service |
e080da |
}
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
function count_brick_pids {
|
|
Packit Service |
e080da |
$CLI --xml volume status all | sed -n '/.*<pid>\([^<]*\).*/s//\1/p' \
|
|
Packit Service |
e080da |
| grep -v "N/A" | sort | uniq | wc -l
|
|
Packit Service |
e080da |
}
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
cleanup
|
|
Packit Service |
e080da |
TEST glusterd
|
|
Packit Service |
e080da |
TEST $CLI volume set all cluster.brick-multiplex yes
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# Create two vanilla volumes.
|
|
Packit Service |
e080da |
TEST $CLI volume create $V0 $H0:$B0/brick-${V0}-{0,1}
|
|
Packit Service |
e080da |
TEST $CLI volume create $V1 $H0:$B0/brick-${V1}-{0,1}
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# Enable brick log-level to DEBUG
|
|
Packit Service |
e080da |
gluster v set $V0 diagnostics.brick-log-level DEBUG
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# Start both.
|
|
Packit Service |
e080da |
TEST $CLI volume start $V0
|
|
Packit Service |
e080da |
TEST $CLI volume start $V1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# There should be only one process for compatible volumes. We can't use
|
|
Packit Service |
e080da |
# EXPECT_WITHIN here because it could transiently see one process as two are
|
|
Packit Service |
e080da |
# coming up, and yield a false positive.
|
|
Packit Service |
e080da |
sleep $PROCESS_UP_TIMEOUT
|
|
Packit Service |
e080da |
EXPECT "1" count_processes
|
|
Packit Service |
e080da |
EXPECT 1 count_brick_pids
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# Make the second volume incompatible with the first.
|
|
Packit Service |
e080da |
TEST $CLI volume stop $V1
|
|
Packit Service |
e080da |
TEST $CLI volume set $V1 server.manage-gids no
|
|
Packit Service |
e080da |
TEST $CLI volume start $V1
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
# There should be two processes this time (can't share protocol/server).
|
|
Packit Service |
e080da |
EXPECT_WITHIN $PROCESS_UP_TIMEOUT "2" count_processes
|
|
Packit Service |
e080da |
|
|
Packit Service |
e080da |
cleanup;
|