interfaces_file: Add test for pre-up/post-up with inet/inet6

This commit is contained in:
Jocelyn Jaubert 2018-08-17 11:10:27 +02:00 committed by Michael Scherer
parent bd7001cdb6
commit 4352a4e54d
56 changed files with 1008 additions and 10 deletions

View file

@ -230,7 +230,7 @@ class TestInterfacesFileModule(unittest.TestCase):
# Restore backup
move(backupp, path)
def test_change_address(self):
def test_inet_inet6(self):
testcases = {
"change_ipv4": [
{
@ -250,6 +250,42 @@ class TestInterfacesFileModule(unittest.TestCase):
'state': 'present',
}
],
"change_ipv4_pre_up": [
{
'iface': 'eth0',
'address_family': 'inet',
'option': 'pre-up',
'value': 'XXXX_ipv4',
'state': 'present',
}
],
"change_ipv6_pre_up": [
{
'iface': 'eth0',
'address_family': 'inet6',
'option': 'pre-up',
'value': 'XXXX_ipv6',
'state': 'present',
}
],
"change_ipv4_post_up": [
{
'iface': 'eth0',
'address_family': 'inet',
'option': 'post-up',
'value': 'XXXX_ipv4',
'state': 'present',
}
],
"change_ipv6_post_up": [
{
'iface': 'eth0',
'address_family': 'inet6',
'option': 'post-up',
'value': 'XXXX_ipv6',
'state': 'present',
}
],
}
for testname, options_list in testcases.items():
for testfile in self.getTestFiles():