mirror of
https://github.com/nftables-rs/nftables-rs.git
synced 2026-10-13 16:01:18 +00:00
adds a flush command to the top of the example ruleset so that nftables rules are applied on a clean state. adds tests that check args passing to nft with get_current_ruleset and specifying invalid nft binary.
22 lines
353 B
Bash
Executable File
22 lines
353 B
Bash
Executable File
#!/bin/bash
|
|
NETNS=nft-$(cat /proc/sys/kernel/random/uuid)
|
|
RET=0
|
|
|
|
function nsexec {
|
|
ip netns exec $NETNS $@
|
|
}
|
|
|
|
function cleanup {
|
|
ip netns delete "$NETNS"
|
|
exit $RET
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
# create net namespace
|
|
(ip netns ls | grep -Fx "$NETNS" 2>/dev/null) || ip netns add "$NETNS"
|
|
|
|
nft --version;
|
|
nsexec cargo test --verbose -- --ignored $@
|
|
RET=$?
|
|
|