Revise firewalld unittests

Previously, unit tests for firewalld in
were tightly coupled with the implementation of IpTables::ApplyVpnSetup
making them difficult to maintain when changes to the daemon were
introduced. This commit augments the MockIpTables class by mocking
ExecvNonRoot and keeping track of the ip/iptables shell commands that
are issued during a test. This makes it possible to test that error
cases properly handle undo-ing the addition of any firewall rules
that are added during IpTables::ApplyVpnSetup.

Change-Id: Ibfd581ebaad55826d95bdc3b5ad98795610aee9f
Commit-Ready: Kevin Cernekee <>
Tested-by: Ian Wyszynski <>
Reviewed-by: Ian Wyszynski <>
Reviewed-by: Kevin Cernekee <>
5 files changed