summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/sets/0019set_check_size_0
blob: c20970838bf98e0caabe22b9cfafa2bc01450cdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

$NFT add table x
$NFT add set x s {type ipv4_addr\; size 2\;}
$NFT add element x s {1.1.1.1}
$NFT add element x s {1.1.1.2}

$NFT add element x s { 1.1.1.3 } 2>/dev/null
if [ $? -eq 0 ]; then
        echo "E: set is full, but element was added" >&2
	exit 1
fi
#
# Try again, this helps us catch incorrect set->nelems decrement from abort path
#
$NFT add element x s { 1.1.1.3 } 2>/dev/null
if [ $? -eq 0 ]; then
        echo "E: set is full, but element was added" >&2
	exit 1
fi