From cf5d451adc87720753f5a85caac2c81e83550110 Mon Sep 17 00:00:00 2001 From: dylan madisetti Date: Tue, 27 Aug 2024 08:29:31 -0400 Subject: [PATCH] test: Add cache specific test --- tests/zfs-with-vdevs.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/zfs-with-vdevs.nix b/tests/zfs-with-vdevs.nix index 5f8c67d..dbca4fc 100644 --- a/tests/zfs-with-vdevs.nix +++ b/tests/zfs-with-vdevs.nix @@ -16,6 +16,15 @@ diskoLib.testLib.makeDiskoTest { out == expected_value ), f"Expected {property}={expected_value} on {ds}, got: {out}" + # These fields are 0 if l2arc is disabled + assert ( + machine.succeed( + "cat /proc/spl/kstat/zfs/arcstats" + " | grep '^l2_' | tr -s ' '" + " | cut -s -d ' ' -f3 | uniq" + ).strip() != "0" + ), "Excepted cache to be utilized." + assert_property("zroot", "compression", "zstd") assert_property("zroot/zfs_fs", "com.sun:auto-snapshot", "true") assert_property("zroot/zfs_fs", "compression", "zstd")