Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
aiden3c committed Jul 25, 2024
1 parent 4f6e0ee commit 60080fb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/api2/test_005_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
apifolder = os.getcwd()
sys.path.append(apifolder)

import errno
import pytest

from middlewared.service_exception import ValidationError, ValidationErrors
from auto_config import interface, ha, netmask
from middlewared.test.integration.utils.client import client, truenas_server
from middlewared.test.integration.utils import call
Expand Down Expand Up @@ -118,3 +120,14 @@ def test_002_configure_interface(request, ws_client, get_payload):

def test_003_recheck_ipvx(request):
assert int(call('tunable.get_sysctl', f'net.ipv6.conf.{interface}.autoconf')) == 0

def test_004_remove_critical_failover_group(request):
with pytest.raises(ValidationErrors) as ve:
call('interface.update', interface, {'failover_group': None, 'failover_critical': True})
assert ve.value.errors == [
ValidationError(
'interface_update.failover_group',
'A failover group is required when configuring a critical failover interface.',
errno.EAGAIN
)
]

0 comments on commit 60080fb

Please sign in to comment.