| 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'}] |