btrfs-progs: tests: add more API coverage to library-test

Update the library test stub to cover all the API functions we care
about (send stream, subvol search) and drop the rootid lookup that's
trivial to do via raw ioctls.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2021-09-08 16:59:18 +02:00
parent 419cb3011c
commit 7b2d6cd778

View File

@ -98,15 +98,26 @@ static int test_send_stream_api() {
return ret;
}
static int test_list_rootid() {
u64 treeid;
static int test_uuid_search() {
struct subvol_uuid_search sus = {};
u8 uuid[BTRFS_FSID_SIZE] = {};
return btrfs_list_get_path_rootid(-1, &treeid);
subvol_uuid_search_init(-1, &sus);
subvol_uuid_search(&sus, 0, uuid, -1, "/", subvol_search_by_path);
return 0;
}
static int test_subvolid_resolve() {
char path[4096] = "/";
btrfs_subvolid_resolve(-1, path, strlen(path), 0);
return 0;
}
int main() {
test_send_stream_api();
test_list_rootid();
test_uuid_search();
test_subvolid_resolve();
return 0;
}