diff --git a/src/tests/ftest/launch.py b/src/tests/ftest/launch.py index 81314358f6e..ad5b034301d 100755 --- a/src/tests/ftest/launch.py +++ b/src/tests/ftest/launch.py @@ -370,7 +370,7 @@ def _run(self, args): logger, self.result, self.repeat, self.slurm_setup, args.sparse, args.failfast, not args.disable_stop_daos, args.archive, args.rename, args.jenkinslog, core_files, args.logs_threshold, args.user_create, code_coverage, self.job_results_dir, - self.logdir) + self.logdir, args.clear_mounts) # Convert the test status to a launch.py status status |= summarize_run(logger, self.mode, test_status) @@ -438,6 +438,28 @@ def __arg_type_find_size(val): return val +def __arg_type_mount_point(val): + """Parse a mount point argument. + + The mount point does not need to exist on this host. + + Args: + val (str): the mount point to parse + + Raises: + ArgumentTypeError: if the value is not a string starting with '/' + + Returns: + str: the mount point + """ + try: + if not val.startswith(os.sep): + raise ValueError(f'Mount point does not start with {os.sep}') + except Exception as err: # pylint: disable=broad-except + raise ArgumentTypeError(f'Invalid mount point: {val}') from err + return val + + def main(): """Launch DAOS functional tests.""" # Parse the command line arguments @@ -507,6 +529,12 @@ def main(): "-a", "--archive", action="store_true", help="archive host log files in the avocado job-results directory") + parser.add_argument( + "-c", "--clear_mounts", + action="append", + default=[], + type=__arg_type_mount_point, + help="mount points to remove before running each test") parser.add_argument( "-dsd", "--disable_stop_daos", action="store_true", @@ -705,6 +733,9 @@ def main(): args.slurm_install = True args.slurm_setup = True args.user_create = True + args.clear_mounts.append("/mnt/daos") + args.clear_mounts.append("/mnt/daos0") + args.clear_mounts.append("/mnt/daos1") # Setup the Launch object launch = Launch(args.name, args.mode, args.slurm_install, args.slurm_setup) diff --git a/src/tests/ftest/scripts/setup_nodes.sh b/src/tests/ftest/scripts/setup_nodes.sh index b8fd2851e60..a812e717071 100755 --- a/src/tests/ftest/scripts/setup_nodes.sh +++ b/src/tests/ftest/scripts/setup_nodes.sh @@ -43,30 +43,6 @@ cat /etc/security/limits.d/80_daos_limits.conf ulimit -a echo \"/var/tmp/core.%e.%t.%p\" > /proc/sys/kernel/core_pattern" sudo rm -f /var/tmp/core.* -if [ "${HOSTNAME%%.*}" != "$FIRST_NODE" ]; then - if grep /mnt/daos\ /proc/mounts; then - sudo umount /mnt/daos - else - if [ ! -d /mnt/daos ]; then - sudo mkdir -p /mnt/daos - fi - fi - - tmpfs_size=16777216 - memsize="$(sed -ne '/MemTotal:/s/.* \([0-9][0-9]*\) kB/\1/p' \ - /proc/meminfo)" - if [ "$memsize" -gt "32000000" ]; then - # make it twice as big on the hardware cluster - tmpfs_size=$((tmpfs_size*2)) - fi - sudo ed <