From f23208fb60d57ab3ce7915bab1768922d1bca390 Mon Sep 17 00:00:00 2001 From: Dmitry Savintsev Date: Fri, 28 Oct 2022 14:07:52 +0000 Subject: [PATCH] improve handling of bpftool not found error --- test/integration-test/src/tests/load.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/integration-test/src/tests/load.rs b/test/integration-test/src/tests/load.rs index de01e6c2..418e00b8 100644 --- a/test/integration-test/src/tests/load.rs +++ b/test/integration-test/src/tests/load.rs @@ -56,7 +56,11 @@ fn multiple_btf_maps() -> anyhow::Result<()> { } fn is_loaded(name: &str) -> bool { - let output = Command::new("bpftool").args(["prog"]).output().unwrap(); + let output = Command::new("bpftool").args(["prog"]).output(); + let output = match output { + Err(e) => panic!("Failed to run 'bpftool prog': {e}"), + Ok(out) => out, + }; let stdout = String::from_utf8(output.stdout).unwrap(); stdout.contains(name) }