diff --git a/reframe/core/containers.py b/reframe/core/containers.py index d108746b32..15be3766f8 100644 --- a/reframe/core/containers.py +++ b/reframe/core/containers.py @@ -255,7 +255,7 @@ def launch_command(self, stagedir): run_opts.append('--nv') if self.workdir: - run_opts.append(f'-W {self.workdir}') + run_opts.append(f'--pwd {self.workdir}') run_opts += self.options if self.command: diff --git a/unittests/test_containers.py b/unittests/test_containers.py index 6518781cb2..ea7134652e 100644 --- a/unittests/test_containers.py +++ b/unittests/test_containers.py @@ -104,15 +104,15 @@ def expected_cmd_mount_points(container_variant): elif container_variant in {'Singularity', 'Singularity+nopull'}: return ('singularity exec -B"/path/one:/one" ' '-B"/path/two:/two" -B"/foo:/rfm_workdir" ' - '-W /rfm_workdir image:tag cmd') + '--pwd /rfm_workdir image:tag cmd') elif container_variant == 'Singularity+cuda': return ('singularity exec -B"/path/one:/one" ' '-B"/path/two:/two" -B"/foo:/rfm_workdir" --nv ' - '-W /rfm_workdir image:tag cmd') + '--pwd /rfm_workdir image:tag cmd') elif container_variant == 'Singularity+nocommand': return ('singularity run -B"/path/one:/one" ' '-B"/path/two:/two" -B"/foo:/rfm_workdir" ' - '-W /rfm_workdir image:tag') + '--pwd /rfm_workdir image:tag') @pytest.fixture @@ -265,7 +265,7 @@ def expected_run_with_workdir(container_variant_noopt): '--foo image:tag cmd1' ) elif container_variant_noopt == 'Singularity': - return ('singularity exec -B\"/foo:/rfm_workdir\" -W foodir ' + return ('singularity exec -B\"/foo:/rfm_workdir\" --pwd foodir ' '--foo image:tag cmd1')