summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2018-01-03 12:02:15 -0500
committerJonathan Abrahams <jonathan@mongodb.com>2018-01-03 12:02:15 -0500
commit60799be6648b497741d029c7e641402b2a8035eb (patch)
treedc9fd8147a2b46782cff1245f93d4ab6c0355afd
parent4108212bffdad96a5be22e2fc71038f48d8740a4 (diff)
downloadmongo-60799be6648b497741d029c7e641402b2a8035eb.tar.gz
SERVER-32515 Powercycle - rsync file exclude list
-rw-r--r--etc/evergreen.yml4
-rwxr-xr-xpytests/powertest.py27
2 files changed, 23 insertions, 8 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index c40155c3d94..73344422e40 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -186,7 +186,7 @@ variables:
ec2_artifacts: ${log_path} ${backup_path_after} ${backup_path_before}
program_options: --logLevel=info --backupPathBefore=${backup_path_before} --backupPathAfter=${backup_path_after}
connection_options: --sshUserHost=${ip_address} --sshConnection=\"${ssh_identity} ${ssh_connection_options}\"
- test_options: --testLoops=15 --seedDocNum=10000 --rsync --validate=local --canary=local
+ test_options: --testLoops=15 --seedDocNum=10000 --rsync --rsyncExcludeFiles=diagnostic.data/metrics.interim* --validate=local --canary=local
crash_options: --crashMethod=internal --crashOption=${windows_crash_cmd} --crashWaitTime=45 --jitterForCrashWaitTime=5 --instanceId=${instance_id}
client_options: --numCrudClients=20 --numFsmClients=20
mongodb_options: --rootDir=${remote_dir}-${task_id} --mongodbBinDir=${remote_dir}
@@ -4368,7 +4368,7 @@ tasks:
vars:
<<: *powercycle_test
client_options: --numCrudClients=20 --numFsmClients=0
- test_options: --testLoops=15 --seedDocNum=10000 --rsync --validate=local --canary=local --removeLockFile
+ test_options: --testLoops=15 --seedDocNum=10000 --rsync --rsyncExcludeFiles=diagnostic.data/metrics.interim* --validate=local --canary=local --removeLockFile
mongod_extra_options: --mongodOptions=\"--setParameter enableTestCommands=1 --storageEngine mmapv1\"
- name: powercycle_WT
diff --git a/pytests/powertest.py b/pytests/powertest.py
index 0fc82d0effc..fca23127469 100755
--- a/pytests/powertest.py
+++ b/pytests/powertest.py
@@ -1200,7 +1200,7 @@ def remote_handler(options, operations):
ret = wait_for_mongod_shutdown(options.db_path)
elif operation == "rsync_data":
- ret, output = rsync(options.db_path, options.rsync_dest)
+ ret, output = rsync(options.db_path, options.rsync_dest, options.rsync_exclude_files)
LOGGER.info(output)
elif operation == "seed_docs":
@@ -1253,13 +1253,22 @@ def remote_handler(options, operations):
return 0
-def rsync(src_dir, dest_dir):
+def rsync(src_dir, dest_dir, exclude_files=None):
""" Rsync 'src_dir' to 'dest_dir'. """
# Note rsync on Windows requires a Unix-style directory.
- LOGGER.info("Rsync'ing %s to %s", src_dir, dest_dir)
+ exclude_options = ""
+ exclude_str = ""
+ if exclude_files:
+ exclude_str = " (excluding {})".format(exclude_files)
+ if isinstance(exclude_files, str):
+ exclude_files = [exclude_files]
+ for exclude_file in exclude_files:
+ exclude_options = "{} --exclude '{}'".format(exclude_options, exclude_file)
+
+ LOGGER.info("Rsync'ing %s to %s%s", src_dir, dest_dir, exclude_str)
if not distutils.spawn.find_executable("rsync"):
return 1, "No rsync exists on the host, not rsync'ing"
- cmds = "rsync -va --delete --quiet {} {}".format(src_dir, dest_dir)
+ cmds = "rsync -va --delete --quiet {} {} {}".format(exclude_options, src_dir, dest_dir)
ret, output = execute_cmd(cmds)
return ret, output
@@ -1664,6 +1673,12 @@ Examples:
action="store_true",
default=False)
+ test_options.add_option("--rsyncExcludeFiles",
+ dest="rsync_exclude_files",
+ help="Files excluded from rsync of the data directory",
+ action="append",
+ default=None)
+
test_options.add_option("--backupPathBefore",
dest="backup_path_before",
help="Path where the db_path is backed up before crash recovery,"
@@ -1742,8 +1757,8 @@ Examples:
crash_options.add_option("--crashOption",
dest="crash_option",
help="Secondary argument for the following --crashMethod:"
- " 'aws_ec2': specify EC2 'address_type', which is one of {} and defaults"
- " to 'public_ip_address'."
+ " 'aws_ec2': specify EC2 'address_type', which is one of {} and"
+ " defaults to 'public_ip_address'."
" 'mpower': specify output<num> to turn"
" off/on, i.e., 'output1' (REQUIRED)."
" 'internal': for Windows, optionally specify a crash method,"