From 773869a8e2fdbe06f597036159f2717de15c7694 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 7 Jun 2021 00:21:28 +0100 Subject: [PATCH] prefs tests: Break out ssh_command, ready for adding a test Signed-off-by: Ian Jackson --- apitest/at-otter.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index a4f68041..646d9794 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -246,18 +246,23 @@ impl Ctx { .lines().nth(2).unwrap().unwrap(), STATIC_TEST.strip_suffix("\n").unwrap() ); + let ssh_command = ds.subst( + "@src@/apitest/mock-ssh-restricted @authkeys@ '@dummy_key_data@'" + )?; + let mk_restricted = |account, rhs|{ - let mut command = ds.also(&[ - ("account",account), - ("rhs", rhs), - ]).gss( + let ds = ds.also(&[ + ("account", account), + ("rhs", rhs), + ("ssh_command", ssh_command.as_str()), + ]); + let mut command = ds.gss( "--account @account@ \ --ssh nowhere \ @rhs@" )?; command.insert(0, ds.subst( - "--ssh-command=@src@/apitest/mock-ssh-restricted \ - @authkeys@ '@dummy_key_data@'" + "--ssh-command=@ssh_command@" )?); Ok::<_,Explode>(command) }; -- 2.30.2