| **cephadm** **run** [-h] --name NAME --fsid FSID
| **cephadm** **shell** [-h] [--fsid FSID] [--name NAME] [--config CONFIG]
- [--keyring KEYRING] [--mount MOUNT] [--env ENV]
+ [--keyring KEYRING] --mount [MOUNT [MOUNT ...]] [--env ENV]
[--] [command [command ...]]
| **cephadm** **enter** [-h] [--fsid FSID] --name NAME [command [command ...]]
# TMPDIR for test data
[ -d "$TMPDIR" ] || TMPDIR=$(mktemp -d tmp.$SCRIPT_NAME.XXXXXX)
+[ -d "$TMPDIR_TEST_MULTIPLE_MOUNTS" ] || TMPDIR_TEST_MULTIPLE_MOUNTS=$(mktemp -d tmp.$SCRIPT_NAME.XXXXXX)
function cleanup()
{
$CEPHADM shell --fsid $FSID -- test -d /var/log/ceph
expect_false $CEPHADM --timeout 10 shell --fsid $FSID -- sleep 60
$CEPHADM --timeout 60 shell --fsid $FSID -- sleep 10
-$CEPHADM shell --fsid $FSID --mount $TMPDIR -- stat /mnt/$(basename $TMPDIR)
+$CEPHADM shell --fsid $FSID --mount $TMPDIR $TMPDIR_TEST_MULTIPLE_MOUNTS -- stat /mnt/$(basename $TMPDIR)
## enter
expect_false $CEPHADM enter
if args.keyring:
mounts[pathify(args.keyring)] = '/etc/ceph/ceph.keyring:z'
if args.mount:
- mount = pathify(args.mount)
- filename = os.path.basename(mount)
- mounts[mount] = '/mnt/{}:z'.format(filename)
+ for _mount in args.mount:
+ split_src_dst = _mount.split(':')
+ mount = pathify(split_src_dst[0])
+ filename = os.path.basename(split_src_dst[0])
+ if len(split_src_dst) > 1:
+ dst = split_src_dst[1] + ':z' if len(split_src_dst) == 3 else split_src_dst[1]
+ mounts[mount] = dst
+ else:
+ mounts[mount] = '/mnt/{}:z'.format(filename)
if args.command:
command = args.command
else:
help='ceph.keyring to pass through to the container')
parser_shell.add_argument(
'--mount', '-m',
- help='mount a file or directory under /mnt in the container')
+ help=("mount a file or directory in the container. "
+ "Support multiple mounts. "
+ "ie: `--mount /foo /bar:/bar`. "
+ "When no destination is passed, default is /mnt"),
+ nargs='+')
parser_shell.add_argument(
'--env', '-e',
action='append',