diff options
author | Toomas Soome <[email protected]> | 2020-09-16 01:42:27 +0300 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-15 15:42:27 -0700 |
commit | 1db9e6e4e4c355a89e52f156f63843d01f84866e (patch) | |
tree | 1bfd632036c2caf3a2c6e0089635073ae6be5bde /tests/zfs-tests | |
parent | 37325e47499ccdb4eeabfaa61d06a4075390b960 (diff) |
zfs label bootenv should store data as nvlist
nvlist does allow us to support different data types and systems.
To encapsulate user data to/from nvlist, the libzfsbootenv library is
provided.
Reviewed-by: Arvind Sankar <[email protected]>
Reviewed-by: Allan Jude <[email protected]>
Reviewed-by: Paul Dagnelie <[email protected]>
Reviewed-by: Igor Kozhukhov <[email protected]>
Signed-off-by: Toomas Soome <[email protected]>
Closes #10774
Diffstat (limited to 'tests/zfs-tests')
-rw-r--r-- | tests/zfs-tests/cmd/libzfs_input_check/Makefile.am | 7 | ||||
-rw-r--r-- | tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am b/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am index ba02f93fe..cd4622089 100644 --- a/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am +++ b/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am @@ -4,6 +4,13 @@ pkgexecdir = $(datadir)/@PACKAGE@/zfs-tests/bin pkgexec_PROGRAMS = libzfs_input_check +if BUILD_FREEBSD +DEFAULT_INCLUDES += -I$(top_srcdir)/include/os/freebsd/zfs +endif +if BUILD_LINUX +DEFAULT_INCLUDES += -I$(top_srcdir)/include/os/linux/zfs +endif + libzfs_input_check_SOURCES = libzfs_input_check.c libzfs_input_check_LDADD = \ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \ diff --git a/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c b/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c index 9fee37357..63217104f 100644 --- a/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c +++ b/tests/zfs-tests/cmd/libzfs_input_check/libzfs_input_check.c @@ -25,7 +25,9 @@ #include <libzutil.h> #include <sys/nvpair.h> +#include <sys/vdev_impl.h> #include <sys/zfs_ioctl.h> +#include <sys/zfs_bootenv.h> /* * Test the nvpair inputs for the non-legacy zfs ioctl commands. @@ -762,9 +764,10 @@ test_set_bootenv(const char *pool) { nvlist_t *required = fnvlist_alloc(); - fnvlist_add_string(required, "envmap", "test"); + fnvlist_add_uint64(required, "version", VB_RAW); + fnvlist_add_string(required, GRUB_ENVMAP, "test"); - IOC_INPUT_TEST(ZFS_IOC_SET_BOOTENV, pool, required, NULL, 0); + IOC_INPUT_TEST_WILD(ZFS_IOC_SET_BOOTENV, pool, required, NULL, 0); nvlist_free(required); } |