xref: /illumos-gate/usr/src/test/zfs-tests/tests/functional/btree/btree_negative.ksh (revision 7a6d80f1660abd4755c68cbd094d4a914681d26e)
1#!/usr/bin/ksh -p
2
3#
4# This file and its contents are supplied under the terms of the
5# Common Development and Distribution License ("CDDL"), version 1.0.
6# You may only use this file in accordance with the terms of version
7# 1.0 of the CDDL.
8#
9# A full copy of the text of the CDDL should have accompanied this
10# source.  A copy of the CDDL is also available via the Internet at
11# http://www.illumos.org/license/CDDL.
12#
13
14#
15# Copyright (c) 2019 by Delphix. All rights reserved.
16#
17
18. $STF_SUITE/include/libtest.shlib
19
20#
21# Description:
22# Verify that the btree functions don't allow bad inputs
23#
24# insert_duplicate - Callers may not add values that are already in the tree
25# remove_missing   - Callers may not remove values that are not in the tree
26#
27# Note: These invocations cause btree_test to crash, but the program disables
28# core dumps first. As such, we can't use log_mustnot because it explicitly
29# looks for return values that correspond to a core dump and cause a test
30# failure.
31
32btree_test -n insert_duplicate
33[[ $? -eq 0 ]] && log_fail "Failure from insert_duplicate"
34
35btree_test -n remove_missing
36[[ $? -eq 0 ]] && log_fail "Failure from remove_missing"
37
38log_pass "Btree negative tests passed"
39