From 68e316df5969d82b79c6241003bdf39b2b96a5a3 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 24 Sep 2022 13:30:43 +0200 Subject: [PATCH] adapt error message on ENODEV test for neli 0.5+ Related to #28 which introduced this test. Since at least 0.5.3 the ENODEV is propagated, causing this test to fail: ---- missing_device_returns_sensible_error stdout ---- thread 'missing_device_returns_sensible_error' panicked at 'assertion failed: `(left == right)` left: `"Error response received from netlink: Unknown error -19 (os error -19)"`, right: `"No ack received"`', tests/enodev.rs:30:5 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace --- tests/enodev.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/enodev.rs b/tests/enodev.rs index f09b1f1..3d8146c 100644 --- a/tests/enodev.rs +++ b/tests/enodev.rs @@ -27,7 +27,12 @@ fn missing_device_returns_sensible_error() -> anyhow::Result<()> { // TODO: Ensure this library returns more sensible errors. Update the "No // ack received" string below to "No device found by interface name or // public key". - assert_eq!(existing_err_message, "No ack received"); + // As of neli 0.5.3 the library returns ENODEV instead of “No ack + // received”. + assert_eq!( + existing_err_message, + "Error response received from netlink: Unknown error -19 (os error -19)" + ); Ok(()) }