diff options
author | Susant Sahani <ssahani@gmail.com> | 2018-11-26 17:20:09 +0530 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-11-27 11:04:42 +0900 |
commit | 2266864b04257d7a92d1f2064797ec239068895b (patch) | |
tree | 6aa37cde244d083bb2ce2c3b7060dd423b3a03c8 /test/test-network | |
parent | First restructuration of Logitech mice in 70-mouse.hwdb (diff) | |
download | systemd-2266864b04257d7a92d1f2064797ec239068895b.tar.gz systemd-2266864b04257d7a92d1f2064797ec239068895b.tar.bz2 systemd-2266864b04257d7a92d1f2064797ec239068895b.zip |
networkd: Add support for ERSPAN tunnel
Please see: https://patchwork.ozlabs.org/patch/800327/
```
[NetDev]
Name=erspan-test
Kind=erspan
[Tunnel]
Independent=true
ERSPANIndex=123
Local = 172.16.1.200
Remote = 172.16.1.100
Key=101
SerializeTunneledPackets=true
```
Diffstat (limited to 'test/test-network')
-rw-r--r-- | test/test-network/conf/25-erspan-tunnel.netdev | 11 | ||||
-rwxr-xr-x | test/test-network/systemd-networkd-tests.py | 25 |
2 files changed, 30 insertions, 6 deletions
diff --git a/test/test-network/conf/25-erspan-tunnel.netdev b/test/test-network/conf/25-erspan-tunnel.netdev new file mode 100644 index 000000000..746b7ac64 --- /dev/null +++ b/test/test-network/conf/25-erspan-tunnel.netdev @@ -0,0 +1,11 @@ +[NetDev] +Name=erspan-test +Kind=erspan + +[Tunnel] +Independent=true +ERSPANIndex=123 +Local = 172.16.1.200 +Remote = 172.16.1.100 +Key=101 +SerializeTunneledPackets=true diff --git a/test/test-network/systemd-networkd-tests.py b/test/test-network/systemd-networkd-tests.py index 48640068b..73ecf6f73 100755 --- a/test/test-network/systemd-networkd-tests.py +++ b/test/test-network/systemd-networkd-tests.py @@ -153,17 +153,18 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): links =['bridge99', 'bond99', 'bond99', 'vlan99', 'test1', 'macvtap99', 'macvlan99', 'ipvlan99', 'vxlan99', 'veth99', 'vrf99', 'tun99', 'tap99', 'vcan99', 'geneve99', 'dummy98', 'ipiptun99', 'sittun99', '6rdtun99', - 'gretap99', 'vtitun99', 'vti6tun99','ip6tnl99', 'gretun99', 'ip6gretap99', 'wg99', 'dropin-test'] + 'gretap99', 'vtitun99', 'vti6tun99','ip6tnl99', 'gretun99', 'ip6gretap99', + 'wg99', 'dropin-test', 'erspan-test'] units = ['25-bridge.netdev', '25-bond.netdev', '21-vlan.netdev', '11-dummy.netdev', '21-vlan.network', '21-macvtap.netdev', 'macvtap.network', '21-macvlan.netdev', 'macvlan.network', 'vxlan.network', '25-vxlan.netdev', '25-ipvlan.netdev', 'ipvlan.network', '25-veth.netdev', '25-vrf.netdev', '25-tun.netdev', '25-tun.netdev', '25-vcan.netdev', '25-geneve.netdev', '25-ipip-tunnel.netdev', - '25-ip6tnl-tunnel.netdev', '25-ip6gre-tunnel.netdev','25-sit-tunnel.netdev', '25-6rd-tunnel.netdev', - '25-gre-tunnel.netdev', '25-gretap-tunnel.netdev', '25-vti-tunnel.netdev', '25-vti6-tunnel.netdev', - '12-dummy.netdev', 'gre.network', 'ipip.network', 'ip6gretap.network', 'gretun.network', - 'ip6tnl.network', '25-tap.netdev', 'vti6.network', 'vti.network', 'gretap.network', 'sit.network', - '25-ipip-tunnel-independent.netdev', '25-wireguard.netdev', '6rd.network', '10-dropin-test.netdev'] + '25-ip6tnl-tunnel.netdev', '25-ip6gre-tunnel.netdev', '25-sit-tunnel.netdev', '25-6rd-tunnel.netdev', + '25-erspan-tunnel.netdev', '25-gre-tunnel.netdev', '25-gretap-tunnel.netdev', '25-vti-tunnel.netdev', + '25-vti6-tunnel.netdev', '12-dummy.netdev', 'gre.network', 'ipip.network', 'ip6gretap.network', + 'gretun.network', 'ip6tnl.network', '25-tap.netdev', 'vti6.network', 'vti.network', 'gretap.network', + 'sit.network', '25-ipip-tunnel-independent.netdev', '25-wireguard.netdev', '6rd.network', '10-dropin-test.netdev'] def setUp(self): self.link_remove(self.links) @@ -383,6 +384,18 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities): self.assertTrue(self.link_exits('dummy98')) self.assertTrue(self.link_exits('sittun99')) + def test_erspan_tunnel(self): + self.copy_unit_to_networkd_unit_path('25-erspan-tunnel.netdev') + self.start_networkd() + + self.assertTrue(self.link_exits('erspan-test')) + + output = subprocess.check_output(['ip', '-d', 'link', 'show', 'erspan-test']).rstrip().decode('utf-8') + print(output) + self.assertTrue(output, '172.16.1.200') + self.assertTrue(output, '172.16.1.100') + self.assertTrue(output, '101') + def test_tunnel_independent(self): self.copy_unit_to_networkd_unit_path('25-ipip-tunnel-independent.netdev') |