File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Sets up the environment needed for running the DNS test
4+ OUTWARD_FACING_INTERFACE=ens3
5+ BRIDGE_INTERFACE=bridge43
6+
7+ # Enable ip forwarding
8+ sudo sysctl -w net.ipv4.ip_forward=1
9+
10+ # Create iptables rules for NATing all DNS requests
11+
12+ # Masks the source address
13+ sudo iptables -t nat -A POSTROUTING -o $OUTWARD_FACING_INTERFACE -j MASQUERADE
14+
15+ # Udp packets coming from bridge43 should be natted
16+ sudo iptables -t nat -A PREROUTING -i $BRIDGE_INTERFACE -p udp -m udp
Original file line number Diff line number Diff line change 22
33import sys
44import os
5+ import subprocess
56
67includeos_src = os .environ .get ('INCLUDEOS_SRC' ,
78 os .path .realpath (os .path .join (os .getcwd (), os .path .dirname (__file__ ))).split ('/test' )[0 ])
1011from vmrunner import vmrunner
1112from vmrunner .prettify import color
1213
14+ # Install build dependencies, ip forwarding
15+ subprocess .call (["bash" , "setup.sh" ])
16+
1317# Get an auto-created VM from the vmrunner
1418vm = vmrunner .vms [0 ]
1519
Original file line number Diff line number Diff line change 11{
22 "image" : " test_dns.img" ,
33 "net" : [{"device" : " virtio" , "mac" : " c0:01:0a:00:00:2a" }],
4- "mem" : 128
4+ "mem" : 128 ,
5+ "intrusive" : " True"
56}
You can’t perform that action at this time.
0 commit comments