test_suite: current state

This commit is contained in:
Frank Liepold 2013-12-10 12:03:46 +01:00 committed by Thomas Schoebel-Theuer
parent a9cfd8b95b
commit 2d62180de9
24 changed files with 92 additions and 245 deletions

2
.gitignore vendored
View File

@ -12,3 +12,5 @@ kernel/mars_config.h
*.orig
*.rej
*.bak
*alternate*.conf
*internal*.conf

View File

@ -18,14 +18,12 @@ Contents
2. Naming conventions
3. Error handling
4. Signal handling
5. Configuration of the local build environment
6. Configuration of the test hosts on which the tests are running
6.1. Access
6.2. Installation kernel and mars module on the test hosts
7. Configuration of logical volumes
8. Resources
9. Starting the whole test suite via cronjob
10. Concurrent test runs
5. Configuration of the build environment
6. Installing the software on the hosts on which the tests are running
attention for grub!
7. Basic configuration of logical volumes
8. Starting the whole test suite via cronjob
9. Concurrent test runs
1. Running a test
-----------------
@ -36,13 +34,8 @@ of one of the both directories build_test_environment and test_cases.
The scope and configuration of a test is completely described by this
subdirectory (we call it start directory) as follows:
- All leaf subdirectories of the start directory define one test case.
If the test specified by one leaf subdirectory fails the tests belonging to
other leaf subdirectories of the start directory will not be executed.
Though only tests which are likely not to fail should be executed by only
one call to start_test.sh. The simple and recommended way is to call
start_test.sh for each leaf directory once.
- For each leaf subdirectory xyz there exists a configuration file named
- all leaf subdirectories of the start directory define one test case
- for each leaf subdirectory xyz there exists a configuration file named
xyz.conf which contains (among others) in the variables prepare_list,
setup_list, run_list, cleanup_list and finish_list names of shell
functions defined in scripts/modules/*.sh.
@ -50,7 +43,7 @@ subdirectory (we call it start directory) as follows:
*list variables.
The file xyz.conf may reside in the leaf directory or any of it's parent
directories (up to 20 levels higher in the directory tree).
- The configuration of the test case belonging to a leaf directory is defined
- the configuration of the test case belonging to a leaf directory is defined
by a set of *.conf files which are included by start_test.sh in the
following order:
-- default-*.conf: These are the configuration files belonging to the
@ -86,7 +79,6 @@ subdirectory (we call it start directory) as follows:
- All variables used in *.conf files should be "defined" (the shell has no
explicit definition) and explained in a default-*.conf file. If a variable is
"defined" in default-xyz.conf it's name is prefixed by xyz.
- WIP
3. Error handling
@ -99,8 +91,8 @@ WIP
WIP
5. Configuration of the local build environment
-----------------------------------------------
5. Configuration of the build environment
-----------------------------------------
To build the mars module and userspace tools you need:
- a directory containing a git repository which contains the kernel sources
@ -141,75 +133,17 @@ To build the mars module and userspace tools you need:
to be specified in file : default-checkout_mars.conf
6. Configuration of the test hosts on which the tests are running
6. Configuration of the hosts on which the tests are running
------------------------------------------------------------
The test hosts are given in main_host_list (default-main.conf).
6.1. Access
-----------
The tests are executed by ssh commands from your work station to the
test hosts. These commands must not prompt for a password. Though a
id file (for ssh -i <id-file>) with null password must be specified in
main_ssh_idfile_opt (default-main.conf)
All test hosts must have ssh access to each other without prompt for passwords.
6.2. Installation kernel and mars module on the test hosts
----------------------------------------------------------
This is done by executing the tests
build_test_environment/checkout
build_test_environment/make/make_mars/grub
build_test_environment/install_mars
It's a must to read default-checkout_mars.conf, default-make_mars.conf,
default-install_mars.conf and the *.conf files in the directories above
otherwise you risk damage of the boot information on your work station and/or the test hosts.
After these three tests (which you should call one after the other!) you can
reboot the test hosts with the new kernel.
7. Configuration of logical volumes
-----------------------------------
This is done by the test
build_test_environment/lv_config
The configuration options are contained in default-lv_config.conf
8. Resources
------------
Cluster and Resources are created by
build_test_environment/cluster
build_test_environment/resource/create_resource
Initially the first host in main_host_list is the primary, the following hosts
secondaries.
If you do not change any configuration variables after the
build_test_environment/resource/create_resource Test you will have created one
resource lv-1-2 on all hosts with underlying data devices /dev/vg-mars/lv-1-2.
/mars will be mounted on /dev/vg-mars/lv-6-100.
For further information please read default-cluster.conf and
default-resource.conf.
9. Starting the whole test suite via cronjob
--------------------------------------------
This can be done mars_test_cronjob.sh. The variable tests_to_execute contains
all tests to be executed.
10. Concurrent test runs
------------------------
To avoid concurrent run of tests on the same host each run creates temporary
files (/tmp/test-suite_on.<host>, see main_lock_file_list) and deletes them
afterwards.
1. The cron script mars_test_cronjob.sh
Configuration

View File

@ -1,12 +0,0 @@
#!/bin/bash
src_dir=/home/fl/mars/test_suite-readonly-1
host_list='("istore-test-bs4" "istore-test-bap4")'
checkout_dir=/home/fl/mars/mars-git-hub
branches_to_test="schoebel/WIP-connections"
base_dir=/home/fl/mars/test_suite-readonly-1
install_mars_src_dir=/home/fl/mars/mars-git-hub
make_mars_src_dir=/home/fl/mars/mars-git-hub
mars_kernel_src_dir=/home/fl/mars/linux-infong-3.2-readonly-1
make_mars_kernel_src_dir=/home/fl/mars/linux-infong-3.2-readonly-1
tests_to_skip="build_test_environment/checkout build_test_environment/make build_test_environment/install_mars build_test_environment/lv_config build_test_environment/cluster build_test_environment/resource/create_resource test_cases/admin/apply_fetch/apply test_cases/admin/apply_fetch/fetch test_cases/destroy_secondary_logfile test_cases/admin/resizing test_cases/admin/logrotate test_cases/admin/logdelete test_cases/admin/three_nodes test_cases/bugs/memleak test_cases/admin/switch2primary test_cases/admin/datadev_full test_cases/hardcore/mars_dir_full/write_other_file test_cases/hardcore/mars_dir_full/write_data_dev test_cases/stabil/net_failure/connection_cut test_cases/stabil/crash/crash_primary test_cases/stabil/crash/crash_primary_logger_comletion_semantics__aio_sync_mode test_cases/stabil/crash/crash_primary_logger_completion_semantics test_cases/stabil/crash/crash_primary_aio_sync_mode test_cases/bugs/aio_filehandle build_test_environment/resource/leave_resource test_cases/perf"
tests_to_skip="test_cases/admin/three_nodes"

View File

@ -1,12 +0,0 @@
#!/bin/bash
src_dir=/home/fl/mars/test_suite
host_list='("istore-test-bs4" "istore-test-bap4")'
checkout_dir=/home/fl/mars/mars-testing
branches_to_test="schoebel/WIP-try-blocking-net"
base_dir=/home/fl/mars/test_suite
install_mars_src_dir=/home/fl/mars/mars-testing
make_mars_src_dir=/home/fl/mars/mars-testing
mars_kernel_src_dir=/home/fl/mars/linux-infong-3.2
make_mars_kernel_src_dir=/home/fl/mars/linux-infong-3.2
tests_to_skip="build_test_environment/checkout build_test_environment/make build_test_environment/install_mars build_test_environment/lv_config build_test_environment/cluster build_test_environment/resource/create_resource test_cases/admin/apply_fetch/apply test_cases/admin/apply_fetch/fetch test_cases/destroy_secondary_logfile test_cases/admin/resizing test_cases/admin/logrotate test_cases/admin/logdelete test_cases/admin/three_nodes test_cases/bugs/memleak test_cases/admin/switch2primary test_cases/admin/datadev_full test_cases/hardcore/mars_dir_full/write_other_file test_cases/hardcore/mars_dir_full/write_data_dev test_cases/stabil/net_failure/connection_cut test_cases/stabil/crash/crash_primary test_cases/stabil/crash/crash_primary_logger_comletion_semantics__aio_sync_mode test_cases/stabil/crash/crash_primary_logger_completion_semantics test_cases/stabil/crash/crash_primary_aio_sync_mode test_cases/bugs/aio_filehandle build_test_environment/resource/leave_resource test_cases/perf"
tests_to_skip="build_test_environment/checkout build_test_environment/make build_test_environment/install_mars build_test_environment/lv_config build_test_environment/cluster test_cases/admin/resizing test_cases/admin/logrotate test_cases/admin/logdelete test_cases/admin/three_nodes test_cases/bugs/memleak test_cases/admin/switch2primary test_cases/admin/datadev_full test_cases/hardcore/mars_dir_full/write_other_file test_cases/hardcore/mars_dir_full/write_data_dev test_cases/stabil/net_failure/connection_cut test_cases/stabil/crash/crash_primary test_cases/stabil/crash/crash_primary_logger_comletion_semantics__aio_sync_mode test_cases/stabil/crash/crash_primary_logger_completion_semantics test_cases/stabil/crash/crash_primary_aio_sync_mode test_cases/bugs/aio_filehandle build_test_environment/resource/leave_resource test_cases/perf"

View File

@ -12,7 +12,7 @@ function check_config_variables
{
local config_file=$1 varname
source $(pwd)/$config_file || lib_exit 1
source $config_file || lib_exit 1
for varname in "${!config_variables[@]}"; do
local val

View File

@ -1,7 +1,4 @@
#!/bin/bash
## checks out the branches/tags in the involved git repositories.
## see default-checkout_mars.conf
verbose_script=1
checkout_mars_git_tag=

View File

@ -1,8 +1,4 @@
#!/bin/bash
## installs the kernel, mars module and userpace tools on all test hosts
## (main_host_list)
## source and target directories must be specified in default-install_mars.conf
verbose_script=1
prepare_list="install_mars_prepare"

View File

@ -16,10 +16,6 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
## Generates logical volume groups and logical volumes as specified in
## default-lv_config.conf
verbose_script=1
prepare_list="lv_config_prepare"

View File

@ -1,16 +1,5 @@
#!/bin/bash
## builds the kernel and the mars module in the
## directories specified in default-make_mars.conf
## and installs in in /boot resp. /lib/modules of your
## work station
## WIP: the make install call in the kernel source directory
## modifies grub.cfg of your work station. Though
## we save and restore this file by calls to grub_prepare and grub_finish
## If your work station does not use grub, you have to provide a *.conf file
## to restore the boot information changed by "make install"
verbose_script=1
run_list="grub_prepare make_mars_run grub_finish"
prepare_list=grub_prepare
finish_list=grub_finish

View File

@ -1 +1,4 @@
#!/bin/bash
run_list=make_mars_run

View File

@ -25,7 +25,7 @@ enable_checkout_mars=0
# not used up to now
checkout_mars_git_repository="checkout_mars_git_repository_not_set"
checkout_mars_git_branch=schoebel/WIP-try-blocking-net
checkout_mars_git_branch=schoebel/WIP-compress
checkout_mars_git_tag=

View File

@ -8,15 +8,12 @@
#####################################################################
## host indexed list of logical volume names (see also lv_config_lv_name_list)
## to be used for main_mars_directory.
## The list is filled in main_set_globals_depending_on_main_host_list
## (default-main.conf).
## As default we use the logical volume name cluster_mars_dir_lv for all hosts
## To change this setting you have to edit default-main.conf
# the list of lvm devices (corresponding to main_host_list) to be mounted on
# cluster_mars_directory
# The corresponding device is given bei lv_config_get_lv_device
## using lv-6-100 for all hosts
## (constructing the expression ([host1]=lv-6-100 [host2]=lv-6-100))
declare -g -A cluster_mars_dir_lv_name_list
cluster_mars_dir_lv=lv-6-100
main_set_globals_depending_on_main_host_list
#

View File

@ -12,14 +12,17 @@
##
## installs the mars module on given hosts.
## root access without password request to each host is required.
## see also variable main_ssh_idfile_opt (default-main.conf)
## directory (in general = checkout_mars_src_directory) to copy
## userpace tools from
## enable_install_mars
## Set to 0 or 1. Enable / disable this module.
enable_install_mars=0
## directory to copy mars module from
install_mars_src_directory="/home/fl/mars/mars-testing"
## directory to copy contributed tools from
## (in general = checkout_mars_contrib_src_directory)
install_mars_contrib_src_directory="/home/fl/mars/mars-contrib"
## install_mars_method_list
@ -35,7 +38,7 @@ install_mars_method="kernel_and_modules_via_sync_from_host_to_host"
## method kernel_and_modules_via_sync_from_host_to_host
##
## installs kernel and mars module from your work station on the target hosts
## installs kernel and mars module from given (source) host on the target hosts
##
## it is assumed that the kernel and the corresponding moduls could be
## identified on the source host by a string (e.g. 3.2.41-generic). This
@ -48,8 +51,8 @@ install_mars_method="kernel_and_modules_via_sync_from_host_to_host"
## /boot/initrd.img-<kernel name>
## /lib/modules/<kernel name>
##
## userspace tools are copied to directories
## install_mars_userspace_target_dir_list on every target host
## userspace tools (see install_mars_userspace_src_file_list are copied to
## directories install_mars_userspace_target_dir_list on every target host
install_mars_source_host="$(hostname)"
install_mars_kernel_release="3.2.47-grsec+"

View File

@ -10,25 +10,18 @@
## defaults for module lv_config
##
## the existence of one volume group (see lv_config_lvg_name) with size >
## lv_config_min_lvg_size is assumed.
## the name of the logical volume group which contains all logical volumes
## needed for the tests
lv_config_lvg_name="vg-mars"
## minimal size of the logical volume group. The group must be able to contain
## /mars and all data devices.
lv_config_min_lvg_size=200 # GB
## prefix for the logical volume names used. The full name is formed by
## appending (separated by -) a serial number (starting bei 1) and the volumes
## size in G (eg. lv-2-100 denotes the second lv with 100GB space on it).
## appending the volumes size in G.
lv_config_lv_name_prefix="lv-"
## per host flag to indicate, whether the volume group may be recreated
## if set to 0 the volume group lv_config_lvg_name must exist otherwise an
## existing volume group of this name will be recreated.
## Attention: In the latter case all existing data will be lost.
declare -g -A lv_config_vg_recreatable_list
lv_config_vg_recreatable_list=(\
[istore-test-bs7]=1 \
@ -40,6 +33,7 @@ lv_config_vg_recreatable_list=(\
[ovzd-test-bap1]=0 \
)
##
## The names and sizes of the logical volumes to be created within the volume
## group are derived from the array lv_config_lv_name_list
## Only logical volumes which do not exist or which have a wrong size will
@ -48,30 +42,39 @@ lv_config_vg_recreatable_list=(\
## the names are built due to the pattern lv-<i>-<size>
lv_config_lv_name_list=(lv-1-2 lv-2-2 lv-3-2 lv-4-2 lv-5-10 lv-6-100)
## host indexed list of partitions to be used for the logical volumes
lv_config_min_lvg_size=100 # GB
declare -g -A lv_config_partition_count_list
lv_config_partition_count_list=(\
[istore-test-bs7]=3 \
[istore-test-bap7]=3 \
[istore-test-bs4]=1 \
[istore-test-bap4]=1 \
[istore-test-bs2]=1 \
[ovzd-test-bs1]=1 \
[ovzd-test-bap1]=1 \
)
declare -g -A lv_config_partition_list
lv_config_partition_list=(\
[istore-test-bs7]="/dev/cciss/c1d0 /dev/cciss/c1d0 /dev/cciss/c1d0 /dev/cciss/c1d0" \
[istore-test-bap7]="/dev/cciss/c1d0 /dev/cciss/c1d0 /dev/cciss/c1d0 /dev/cciss/c1d0" \
[istore-test-bs7]="$(eval echo /dev/cciss/c1d{0..${lv_config_partition_count_list["istore-test-bs7"]}})" \
[istore-test-bap7]="$(eval echo /dev/cciss/c1d{0..${lv_config_partition_count_list["istore-test-bap7"]}})" \
[istore-test-bs4]="/dev/sdb" \
[istore-test-bap4]="/dev/sdb" \
[istore-test-bs2]="/dev/sdb" \
[ovzd-test-bs1]="/dev/sda2" \
[ovzd-test-bap1]="/dev/sda2" \
)
## stripesize for -I option of lvcreate cmd.
lv_config_stripesize=64K
## filesystem specific list of options for mkfs.<fs_type> call
## option for mkfs.<fs_type> call
declare -g -A lv_config_mkfs_option_list
lv_config_mkfs_option_list=([xfs]="-f" [ext3]="" [ext4]="")
## filesystem specific list of tune commands
## the string <dev> will be replaced during runtime by the actual device name
## filesystem specific tune commands
## the string <dev> will be replaced by the actual device name
declare -g -A lv_config_fs_type_tune_cmd_list
lv_config_fs_type_tune_cmd_list=([xfs]="" [ext3]="tune2fs -c 0 <dev>" [ext4]="tune2fs -c 0 <dev>")
## filesystem specific list of commmands to growing the fs.
declare -g -A lv_config_fs_type_grow_cmd_list
lv_config_fs_type_grow_cmd_list=([xfs]="xfs_growfs" [ext3]="resize2fs" [ext4]="resize2fs")
## filesystem specific extension commmands
declare -g -A lv_config_fs_type_extension_cmd_list
lv_config_fs_type_extension_cmd_list=([xfs]="xfs_growfs" [ext3]="resize2fs" [ext4]="resize2fs")

View File

@ -11,31 +11,22 @@ main_host_list=("istore-test-bs4" "istore-test-bap4")
## of the test suite on the same host
declare -g -A main_lock_file_list
## if main_host_list is changed in a *.conf file we need to recompute the values
## of all dependent globals.
function main_set_globals_depending_on_main_host_list
{
eval main_lock_file_list=($(for h in "${main_host_list[@]}";do printf "[$h]=/tmp/test-suite_on.$h ";done))
# see default-cluster.conf
# we construct the expression cluster_mars_dir_lv_name_list=([host-1]=$cluster_mars_dir_lv [host-2]=$cluster_mars_dir_lv ...)
if declare -p cluster_mars_dir_lv_name_list 2>/dev/null |\
grep 'declare -A' >/dev/null
then
eval cluster_mars_dir_lv_name_list=($(x=(${main_host_list[@]/#/[}); y=(${x[@]/%/]=$cluster_mars_dir_lv}); echo ${y[@]}))
eval cluster_mars_dir_lv_name_list=($(x=(${main_host_list[@]/#/[}); y=(${x[@]/%/]=lv-6-100}); echo ${y[@]}))
fi
}
main_set_globals_depending_on_main_host_list
## errorcode to prevent lib_exit from removing lock files
## (main_lock_file_list)
main_prevent_remove_lock_files_code=42
## host indexed list of bootloaders. In case of lilo we check after installing
## a kernel, that the label given in main_host_bootloader_label_list exists
## in /etc/lilo.conf and call lilo -R <label>. For all other bootloaders we do
## nothing. It's your responsibility to boot the correct kernel.
declare -g -A main_host_bootloader_list
main_host_bootloader_list=(\
[istore-test-bs7]=grub \
@ -64,18 +55,16 @@ main_host_bootloader_label_list=(\
declare -g -A main_error_recovery_functions
## for batch ssh access from our work station to the involved hosts we need a
## id file without password.
## to access others hosts without password
## see also lib_remote_idfile
main_ssh_idfile_opt="-i $HOME/.ssh/id_dsa_no_pw"
main_mars_directory="/mars"
## filesystem type of /mars
main_mars_fs_type="ext4"
## egrep patterns to check for messsage categories
main_mars_errmsg_prefix='(XIO|MARS)_error'
main_mars_wrnmsg_prefix='(XIO|MARS)_warn'
@ -83,7 +72,7 @@ main_mars_wrnmsg_prefix='(XIO|MARS)_warn'
## must have a fixed pattern in their name
main_prefix_scripts='MARS-TEST-SCRIPT'
## results of checks of symlinks
# results of checks of links
declare -g -A main_link_status
main_link_status=(["link_ok"]=0 ["link_does_not_exist"]=1 \
["link_has_wrong_value"]=2)

View File

@ -17,4 +17,4 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
marsadm_timeout=240
marsadm_timeout=60

View File

@ -12,27 +12,22 @@
##
## this module administrates the test resources
## the names of the resources used in the current test. Must be a subset of
## lv_config_lv_name_list (default-lv_config.conf)
## These resource are created on all hosts in main_host_list using the first
## host as primary and the followings as secondaries
## the names of the resources used in the current test
resource_name_list=(lv-1-2)
## mount points of the data devices
## resource_set_globals_depending_on_resource_name_list fills the list
## directories used for attempts to mount certain devices
## maps resource name lv-<i>-<size> to /mnt/mars-test-<i>
declare -g -A resource_mount_point_list
## resource indexed list of resource directories in main_mars_directory
## resource_set_globals_depending_on_resource_name_list fills the list
## resource dir of resource res is given by
## $main_mars_directory/resource-$res
declare -g -A resource_dir_list
## resource indexed list of filesystem types of the data devices
## resource_set_globals_depending_on_resource_name_list fills the list
## filesystem type of resource devices is set to xfs
declare -g -A resource_fs_type_list
## resource indexed list of resource specific messages to be grepped for in
## abnormal situations
## resource_set_globals_depending_on_resource_name_list fills the list
## messages to be grepped for in abnormal situations
declare -g -A resource_mars_dir_full_err_pattern_list
## because some global variable depend from other global variables
@ -44,13 +39,10 @@ declare -g -A resource_mars_dir_full_err_pattern_list
function resource_set_globals_depending_on_resource_name_list
{
# maps resource name lv-<i>-<size> to /mnt/mars-test-<i>
eval resource_mount_point_list=($(for i in ${!resource_name_list[*]};do printf "[${resource_name_list[$i]}]=/mnt/mars-test-$(($i + 1)) ";done))
# the resource dir of resource <res> is $main_mars_directory/resource-<res>
eval resource_dir_list=($(for i in ${!resource_name_list[*]};do printf "[${resource_name_list[$i]}]=$main_mars_directory/resource-${resource_name_list[$i]} ";done))
# use xfs for all data devices
eval resource_fs_type_list=($(for i in ${!resource_name_list[*]};do printf "[${resource_name_list[$i]}]=xfs ";done))
## messages to be grepped for in abnormal situations

View File

@ -30,9 +30,6 @@ switch2primary_time_constant_sync=10
## repl state = Replicating
switch2primary_maxtime_state_constant=60
## flag, whether switch should use --force
switch2primary_force=0
## switch to primary may need some tries ..
switch2primary_max_tries=10

View File

@ -114,7 +114,7 @@ start_script=$test_suite_dir/scripts/start_test.sh
tests_to_execute=(\
build_test_environment/checkout \
build_test_environment/make/make_mars/grub \
build_test_environment/make \
build_test_environment/install_mars \
build_test_environment/lv_config \
build_test_environment/cluster \
@ -131,7 +131,6 @@ test_cases/admin/datadev_full \
test_cases/hardcore/mars_dir_full/write_other_file \
test_cases/hardcore/mars_dir_full/write_data_dev \
test_cases/stabil/net_failure/connection_cut \
test_cases/admin/three_nodes \
test_cases/stabil/crash/crash_primary \
test_cases/stabil/crash/crash_primary_logger_comletion_semantics__aio_sync_mode \
test_cases/stabil/crash/crash_primary_logger_completion_semantics \

View File

@ -25,7 +25,6 @@ function lv_config_prepare
{
lv_config_check_variables
resource_leave_all
cluster_rmmod_mars_all
cluster_clear_and_umount_mars_dir_all
lv_config_delete_vg
}
@ -105,8 +104,8 @@ function lv_config_check_variables
for lv_name in ${lv_config_lv_name_list[@]}; do
let sum=$(($sum + $(lv_config_get_lv_size_from_name $lv_name)))
done
if [ $sum -gt $lv_config_min_lvg_size ];then
lib_exit 1 "sum of sizes in lv_config_lv_name_list = $sum greater than $lv_config_min_lvg_size"
if [ $sum -le $lv_config_min_lvg_size ];then
lib_exit 1 "sum of sizes in lv_config_lv_name_list = $sum smaller than $lv_config_min_lvg_size"
fi
local host
@ -212,9 +211,9 @@ function lv_config_create_lv
{
local host=$1 lv_name=$2
local size=$(lv_config_get_lv_size_from_name $lv_name)
local partition_count=$(echo ${lv_config_partition_list[$host]} | wc -w)
if [ -z "$partition_count" -o "$partition_count" = "0" ]; then
lib_exit 1 "missing value in lv_config_partition_list for host $host"
local partition_count=${lv_config_partition_count_list[$host]}
if [ -z "$partition_count" ]; then
lib_exit 1 "missing value in lv_config_partition_count_list for host $host"
fi
lib_vmsg " creating lv $lv_name (size $size G) on $host"
lib_remote_idfile $host \

View File

@ -87,7 +87,7 @@ function cluster_clear_and_umount_mars_dir_all
for host in "${main_host_list[@]}"; do
cluster_clear_mars_dir $host
if mount_is_dir_mountpoint $host $main_mars_directory; then
mount_umount $host "device_does_not_matter" $main_mars_directory || lib_exit 1
mount_umount $host "device_does_not_matter" $main_mars_directory
fi
done
}

View File

@ -184,7 +184,7 @@ function resize_extend_fs
fi
lib_vmsg " extending $host:$dev (type $fs_type)"
lib_remote_idfile $primary_host \
${lv_config_fs_type_grow_cmd_list[$fs_type]} $dev \
${lv_config_fs_type_extension_cmd_list[$fs_type]} $dev \
|| lib_exit 1
}

View File

@ -42,15 +42,11 @@ function switch2primary_run
lib_rw_start_writing_data_device "writer_pid" "writer_script" 0 0 $res
if [ $switch2primary_force -eq 1 ]; then
switch2primary_force $primary_host $secondary_host $res
else
lib_vmsg " marsadm primary on $secondary_host must fail"
marsadm_do_cmd $secondary_host "primary" "$res"
rc=$?
if [ $rc -eq 0 ]; then
lib_exit 1 "$secondary_host must not become primary"
fi
lib_vmsg " marsadm primary on $secondary_host must fail"
marsadm_do_cmd $secondary_host "primary" "$res"
rc=$?
if [ $rc -eq 0 ]; then
lib_exit 1 "$secondary_host must not become primary"
fi
lib_rw_stop_writing_data_device $writer_script "write_count"
@ -103,25 +99,3 @@ function switch2primary_run
marsadm_do_cmd $secondary_host "secondary" "$res" || lib_exit 1
}
function switch2primary_force
{
local primary_host=$1 secondary_host=$2 res=$3
# replace string remote_host with $secondary_host
declare -A impact_cmd
eval impact_cmd=(\
$(for x in ${!net_impact_cmd[@]};do
printf "[$x]='${net_impact_cmd[$x]//remote_host/$primary_host}' ";
done)\
)
lib_vmsg "sleep 10"
sleep 10
net_do_impact_cmd $host "impact_cmd" "off"
marsadm_do_cmd $secondary_host "--force primary" "$res"
# stop script primary
# network on
# marsadm invalidate on primary
# checks
lib_exit 0
}

View File

@ -46,3 +46,4 @@ verbose_script=1
resource_fs_on_data_device_necessary=0
run_list="lv_config_prepare lv_config_run resource_prepare resource_run_all"
run_list="lv_config_run resource_prepare resource_run_all"