Skip to content

Commit

Permalink
test_: skip IPV6 failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarbu15 committed Feb 26, 2025
1 parent 2049372 commit 4a86fef
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests-functional/clients/status_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,7 @@ def change_container_ip(self, new_ipv4=None, new_ipv6=None):
if not ipam_config:
raise RuntimeError("Network does not have a user-defined subnet, cannot assign a custom IP.")

# Refresh container attributes
self.container.reload()

# Get existing IPs
container_info = self.container.attrs["NetworkSettings"]["Networks"].get(self.network_name, {})
current_ipv4 = container_info.get("IPAddress", "Unknown")
current_ipv6 = container_info.get("GlobalIPv6Address", "Unknown")
Expand All @@ -390,12 +387,16 @@ def change_container_ip(self, new_ipv4=None, new_ipv6=None):
else:
network.connect(self.container, ipv4_address=new_ipv4)

# Reload to confirm changes
self.container.reload()
updated_info = self.container.attrs["NetworkSettings"]["Networks"].get(self.network_name, {})
updated_ipv4 = updated_info.get("IPAddress", "Unknown")
updated_ipv6 = updated_info.get("GlobalIPv6Address", "Unknown")

if self.ipv6 and current_ipv6 == updated_ipv6:
raise RuntimeError("IPV6 is the same after network reconnect")
if not self.ipv6 and current_ipv4 == updated_ipv4:
raise RuntimeError("IPV4 is the same after network reconnect")

logging.info(f"Changed container {self.container.name} IPs - New IPv4: {updated_ipv4}, New IPv6: {updated_ipv6}")

except Exception as e:
Expand Down
2 changes: 2 additions & 0 deletions tests-functional/tests/reliability/test_community_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from tests.test_cases import MessengerTestCase
from clients.signals import SignalType
from resources.constants import USE_IPV6


@pytest.mark.usefixtures("setup_two_privileged_nodes")
Expand Down Expand Up @@ -36,6 +37,7 @@ def test_community_messages_with_node_pause_30_seconds(self):
sleep(30)
self.receiver.find_signal_containing_pattern(SignalType.MESSAGES_NEW.value, event_pattern=message_text)

@pytest.mark.skipif(USE_IPV6 == "Yes", reason="Test works only with IPV4")
def test_community_messages_with_ip_change(self):
message_chat_id = self.create_and_join_community()

Expand Down
2 changes: 2 additions & 0 deletions tests-functional/tests/reliability/test_contact_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from tests.test_cases import MessengerTestCase
from clients.signals import SignalType
from resources.enums import MessageContentType
from resources.constants import USE_IPV6


@pytest.mark.reliability
Expand Down Expand Up @@ -38,6 +39,7 @@ def test_contact_request_with_node_pause_30_seconds(self):
receiver.find_signal_containing_pattern(SignalType.MESSAGES_NEW.value, event_pattern=expected_message.get("id"))
sender.wait_for_signal(SignalType.MESSAGE_DELIVERED.value)

@pytest.mark.skipif(USE_IPV6 == "Yes", reason="Test works only with IPV4")
def test_contact_request_with_ip_change(self):
sender = self.initialize_backend(await_signals=self.await_signals, privileged=True)
receiver = self.initialize_backend(await_signals=self.await_signals, privileged=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from tests.test_cases import MessengerTestCase
from clients.signals import SignalType
from resources.constants import USE_IPV6


@pytest.mark.usefixtures("setup_two_privileged_nodes")
Expand All @@ -25,6 +26,7 @@ def test_create_private_groups_with_node_pause_30_seconds(self):
sleep(30)
self.receiver.find_signal_containing_pattern(SignalType.MESSAGES_NEW.value, event_pattern=private_group_name)

@pytest.mark.skipif(USE_IPV6 == "Yes", reason="Test works only with IPV4")
def test_create_private_groups_with_ip_change(self):
self.make_contacts()
self.receiver.change_container_ip()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from tests.test_cases import MessengerTestCase
from clients.signals import SignalType
from resources.constants import USE_IPV6


@pytest.mark.usefixtures("setup_two_privileged_nodes")
Expand Down Expand Up @@ -35,6 +36,7 @@ def test_one_to_one_message_with_node_pause_30_seconds(self):
self.receiver.find_signal_containing_pattern(SignalType.MESSAGES_NEW.value, event_pattern=message_text)
self.sender.wait_for_signal(SignalType.MESSAGE_DELIVERED.value)

@pytest.mark.skipif(USE_IPV6 == "Yes", reason="Test works only with IPV4")
def test_one_to_one_messages_with_ip_change(self):
self.test_one_to_one_message_baseline()
self.receiver.change_container_ip()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pytest
from tests.test_cases import MessengerTestCase
from clients.signals import SignalType
from resources.constants import USE_IPV6


@pytest.mark.usefixtures("setup_two_privileged_nodes")
Expand Down Expand Up @@ -40,6 +41,7 @@ def test_private_group_messages_with_node_pause_30_seconds(self):
self.receiver.find_signal_containing_pattern(SignalType.MESSAGES_NEW.value, event_pattern=message_text)
self.sender.wait_for_signal(SignalType.MESSAGE_DELIVERED.value)

@pytest.mark.skipif(USE_IPV6 == "Yes", reason="Test works only with IPV4")
def test_private_group_messages_with_ip_change(self):
self.make_contacts()
self.private_group_id = self.join_private_group()
Expand Down

0 comments on commit 4a86fef

Please sign in to comment.