Skip to content

Commit

Permalink
adapt error message on ENODEV test for neli 0.5+
Browse files Browse the repository at this point in the history
Related to gluxon#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
  • Loading branch information
phi-gamma committed Oct 21, 2022
1 parent c9a8159 commit 3af5b3f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/enodev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

0 comments on commit 3af5b3f

Please sign in to comment.