diff options
Diffstat (limited to 'tests/shell/testcases/import')
-rwxr-xr-x | tests/shell/testcases/import/vm_json_import_0 | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tests/shell/testcases/import/vm_json_import_0 b/tests/shell/testcases/import/vm_json_import_0 index e5ecbcc4..a8d546ff 100755 --- a/tests/shell/testcases/import/vm_json_import_0 +++ b/tests/shell/testcases/import/vm_json_import_0 @@ -1,14 +1,5 @@ #!/bin/bash -tmpfile=$(mktemp) - -if [ ! -w $tmpfile ] ; then - echo "Failed to create tmp file" >&2 - exit 0 -fi - -trap "rm -rf $tmpfile" EXIT # cleanup if aborted - RULESET="table ip mangle { set blackhole { type ipv4_addr @@ -56,8 +47,7 @@ table ip6 x { } }" -echo "$RULESET" > $tmpfile -$NFT -f $tmpfile -$NFT export vm json > $tmpfile +$NFT -f - <<< $RULESET +RULESET_JSON=$($NFT export vm json) $NFT flush ruleset -cat $tmpfile | $NFT import vm json +$NFT import vm json <<< $RULESET_JSON |