Skip to content

Commit

Permalink
test:common: fixup merging of gateway tests
Browse files Browse the repository at this point in the history
  • Loading branch information
slyon committed Sep 8, 2021
1 parent a4c27ba commit 4d5df9b
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion tests/generator/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,41 @@ def test_eth_ignore_carrier_true(self):
ConfigureWithoutCarrier=yes
'''})

def test_gateway(self):
def test_gateway4(self):
err = self.generate('''network:
version: 2
ethernets:
engreen:
addresses: ["192.168.14.2/24"]
gateway4: 192.168.14.1''')
self.assertIn("`gateway4` has been deprecated, use default routes instead.", err)
self.assert_networkd({'engreen.network': '''[Match]
Name=engreen
[Network]
LinkLocalAddressing=ipv6
Address=192.168.14.2/24
Gateway=192.168.14.1
'''})

def test_gateway6(self):
err = self.generate('''network:
version: 2
ethernets:
engreen:
addresses: ["2001:FFfe::1/64"]
gateway6: 2001:FFfe::2''')
self.assertIn("`gateway6` has been deprecated, use default routes instead.", err)
self.assert_networkd({'engreen.network': '''[Match]
Name=engreen
[Network]
LinkLocalAddressing=ipv6
Address=2001:FFfe::1/64
Gateway=2001:FFfe::2
'''})

def test_gateway_full(self):
self.generate('''network:
version: 2
ethernets:
Expand Down

0 comments on commit 4d5df9b

Please sign in to comment.