summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody P Schafer <dev@codyps.com>2021-08-04 15:41:37 -0400
committerCody P Schafer <dev@codyps.com>2021-08-04 15:41:37 -0400
commit1f3a0e3956dd80ce9f1dbd0a55d514d226e827b5 (patch)
tree70276ace31e57275830765e4a7c48d2a5a131289
parent9d8b5549d6a04316997dfe0dbe1e35491da3eeda (diff)
downloadrust-libzfs-1f3a0e3956dd80ce9f1dbd0a55d514d226e827b5.zip
zfs-core: fix tests for openzfs 2.0 on macos
-rw-r--r--zfs-core/tests/basic.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/zfs-core/tests/basic.rs b/zfs-core/tests/basic.rs
index 8154d22..d403a09 100644
--- a/zfs-core/tests/basic.rs
+++ b/zfs-core/tests/basic.rs
@@ -316,13 +316,11 @@ fn hold_not_snap() {
// variant. This might be a bug in our code, or some change in how lzc handles errors for
// single results
match e {
- // zfs 2.0.0 on linux:
- #[cfg(target_os = "linux")]
+ // openzfs 2.0.0:
zfs_core::Error::Io { source: e } => {
assert_eq!(e.kind(), io::ErrorKind::InvalidInput);
}
- // zfs 1.9.4 on macos:
- #[cfg(target_os = "macos")]
+ // openzfs 1.9.4:
zfs_core::Error::List { source: el } => {
let mut hm = std::collections::HashMap::new();
hm.insert(tmpfs.path().to_owned() + "/2", io::ErrorKind::InvalidInput);
@@ -336,10 +334,6 @@ fn hold_not_snap() {
}
}
}
-
- _ => {
- panic!("unexpected error kind: {:?}", e);
- }
}
}
@@ -364,13 +358,14 @@ fn hold_not_exist() {
e
} else {
// macos hits this for some reason
+ /*
#[cfg(target_os = "macos")]
{
eprintln!("macos zfs 1.9.4 is for some reason totally cool with creating holds on non-existent snaps");
return;
}
+ */
- #[cfg(not(target_os = "macos"))]
panic!("expected an error, got {:?}", e);
};
@@ -379,7 +374,6 @@ fn hold_not_exist() {
// linux (zfs 2.0.0) doesn't appear to return our error list, which is also concerning
match e {
// zfs 2.0.0 on linux:
- #[cfg(target_os = "linux")]
zfs_core::Error::Io { source: e } => {
assert_eq!(e.kind(), io::ErrorKind::NotFound);
}