MCPcopy Create free account
hub / github.com/NetSys/bess / test_nat

Method test_nat

bessctl/module_tests/placement_constraint.py:53–67  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

51 self.assertFalse(bess.check_constraints())
52
53 def test_nat(self):
54 nat_config = [{'ext_addr': '192.168.1.1'}]
55 # From nat.bess -- check that revisiting the same module works
56 # correctly.
57 nat = NAT(ext_addrs=nat_config)
58
59 # Swap src/dst MAC
60 mac = MACSwap()
61
62 # Swap src/dst IP addresses / ports
63 ip = IPSwap()
64
65 Source() -> 0:nat:0 -> mac -> ip -> 1:nat:1 -> Sink()
66
67 self.assertFalse(bess.check_constraints())
68
69 def test_nat_queue(self):
70 nat_config = [{'ext_addr': '192.168.1.1'}]

Callers

nothing calls this directly

Calls 6

NATClass · 0.85
MACSwapClass · 0.85
IPSwapClass · 0.85
SourceClass · 0.85
SinkClass · 0.85
check_constraintsMethod · 0.80

Tested by

no test coverage detected