summaryrefslogtreecommitdiffstats
path: root/tests/shell/testcases/listing/0003table_0
blob: 1b288e43ae5ff42470e2854ddc0cbd5b3ab06879 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

# list table show what is expected

EXPECTED="table ip test {
}"

set -e

$NFT add table test

GET="$($NFT list table test)"
if [ "$EXPECTED" != "$GET" ] ; then
	DIFF="$(which diff)"
	[ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
	exit 1
fi

# also this way
GET="$($NFT list table ip test)"
if [ "$EXPECTED" != "$GET" ] ; then
	DIFF="$(which diff)"
	[ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET")
	exit 1
fi