Skip to content

Commit

Permalink
updated network test to use correct interface if multiple present
Browse files Browse the repository at this point in the history
  • Loading branch information
zenmonkeykstop committed Jun 18, 2020
1 parent 2988455 commit 44829c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions molecule/testinfra/app/test_app_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ def test_app_iptables_rules(host):
# Build a dict of variables to pass to jinja for iptables comparison
kwargs = dict(
mon_ip=os.environ.get('MON_IP', securedrop_test_vars.mon_ip),
default_interface=host.check_output("ip r | head -n 1 | "
"awk '{ print $5 }'"),
app_ip=os.environ.get('APP_IP', securedrop_test_vars.app_ip),
default_interface=host.check_output("ip r | grep -v default | "
"grep {} ".format(app_ip)
"awk '{ print $3 }'"),
tor_user_id=host.check_output("id -u debian-tor"),
securedrop_user_id=host.check_output("id -u www-data"),
ssh_group_gid=host.check_output("getent group ssh | cut -d: -f3"),
Expand Down

0 comments on commit 44829c8

Please sign in to comment.