#!/bin/sh

set -eu

# A mock of iptables(8) for the ikvswitch unit tests: it logs its
# arguments to ${IKV_NET_MOCK_LOG} (so tests can assert the forwarding
# and NAT rules) and always succeeds. Requires IKV_NET_MOCK_LOG to be
# set.

: "${IKV_NET_MOCK_LOG:?IKV_NET_MOCK_LOG must be set}"

echo "$@" >>"${IKV_NET_MOCK_LOG}"
exit 0
