-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
58 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
#!/bin/sh -e | ||
#!/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 0 | ||
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 | ||
nsexec cargo test --verbose -- --ignored $@ | ||
RET=$? | ||
|