From 37bcc937c32211e631b9e5b4341407ba8d5465b1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 3 May 2021 13:41:18 +0100 Subject: [PATCH] apitest: Capture and return the output from otter(1) in at-* Signed-off-by: Ian Jackson --- apitest/apitest.rs | 1 + apitest/at-otter.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apitest/apitest.rs b/apitest/apitest.rs index 421ce708..09bbca59 100644 --- a/apitest/apitest.rs +++ b/apitest/apitest.rs @@ -632,6 +632,7 @@ _ = "error" # rocket #[error("wait status: {0}")] pub struct ExitStatusError(pub std::process::ExitStatus); +#[derive(Debug)] pub struct OtterOutput { output: Option, } diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index aa4afc3e..c273ec57 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -484,12 +484,12 @@ pub use GrabHow as GH; impl Ctx { #[throws(AE)] - pub fn otter>(&mut self, args: &[S]) { + pub fn otter>(&mut self, args: &[S]) -> OtterOutput { let args: Vec = ["--account", "server:"].iter().cloned().map(Into::into) .chain(args.iter().map(|s| s.as_ref().to_owned())) .collect(); - self.su().ds.otter_prctx(&self.prctx, &args)?; + self.su().ds.otter_prctx(&self.prctx, &args)? } #[throws(AE)] -- 2.30.2