Skip to content

Commit

Permalink
Make tests HA compatible using truenas_server.ip (#13690)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeagherix committed May 9, 2024
1 parent 40d5317 commit 34a8d93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/api2/test_iscsi_auth_network.py
Expand Up @@ -3,11 +3,11 @@
import socket

import pytest
from auto_config import ip

from middlewared.test.integration.assets.iscsi import target_login_test
from middlewared.test.integration.assets.pool import dataset
from middlewared.test.integration.utils import call, ssh
from middlewared.test.integration.utils.client import truenas_server


@pytest.fixture(scope="module")
Expand All @@ -25,7 +25,7 @@ def my_ip4():
# Fall back
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(2)
result = sock.connect_ex((ip, 80))
result = sock.connect_ex((truenas_server.ip, 80))
assert result == 0
myip = sock.getsockname()[0]
sock.close()
Expand All @@ -36,7 +36,7 @@ def my_ip4():

@contextlib.contextmanager
def portal():
portal_config = call('iscsi.portal.create', {'listen': [{'ip': ip}], 'discovery_authmethod': 'NONE'})
portal_config = call('iscsi.portal.create', {'listen': [{'ip': truenas_server.ip}], 'discovery_authmethod': 'NONE'})
try:
yield portal_config
finally:
Expand Down

0 comments on commit 34a8d93

Please sign in to comment.