From bf88aba2f7c9efa46624ff0cc173d26143c632bb Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 7 Jun 2021 01:17:55 +0100 Subject: [PATCH] prefs test: Actually test that we can load some prefs Signed-off-by: Ian Jackson --- apitest/at-otter.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index 9134b918..7a422376 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -269,10 +269,28 @@ impl Ctx { Ok::<_,Explode>(command) }; + let prefs_path = ds.subst("@abstmp@/prefs.toml")?; + write!(File::create(&prefs_path)?, "{}", ds.subst(r#" + [options] + ssh="prefs.example.org" + ssh-command="@ssh_command@" + "#)?)?; + + let mk_withprefs = |account, rhs|{ + let ds = ds.also(&[ + ("account", account), + ("rhs", rhs), + ("prefs", prefs_path.as_str()), + ]); + let command = ds.gss("--prefs @prefs@ --account @account@ @rhs@")?; + Ok::<_,Explode>(command) + }; + self.otter(&mk_restricted("ssh:test:sub", "list-accounts")?)?; self.otter(&mk_restricted("ssh:other:", "list-accounts")?) .expect_err("unath"); - self.otter(&mk_restricted("ssh:test:", "list-accounts")?)?; + + self.otter(&mk_withprefs("ssh:test:", "list-accounts")?)?; self.otter(&mk_restricted( "ssh:test:", "set-ssh-keys /dev/null")?).expect_err("saw own branch"); -- 2.30.2