alex-plekhanov commented on code in PR #11260:
URL: https://github.com/apache/ignite/pull/11260#discussion_r1523230759


##########
modules/ducktests/tests/ignitetest/tests/dns_failure_test.py:
##########
@@ -0,0 +1,136 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""
+Module contains DNS service failure test.
+"""
+import os
+import socket
+
+from ducktape.mark import defaults
+from ignitetest.services.ignite import IgniteService
+from ignitetest.services.ignite_app import IgniteApplicationService
+from ignitetest.services.utils.control_utility import ControlUtility
+from ignitetest.services.utils.ignite_aware import IgniteAwareService
+from ignitetest.services.utils.ignite_configuration import 
IgniteConfiguration, DataStorageConfiguration
+from ignitetest.services.utils.ignite_configuration.data_storage import 
DataRegionConfiguration
+from ignitetest.services.utils.ignite_configuration.discovery import 
from_ignite_cluster
+from ignitetest.utils import ignite_versions
+from ignitetest.utils.ignite_test import IgniteTest
+from ignitetest.utils.version import IgniteVersion, DEV_BRANCH
+from ignitetest.utils import cluster
+
+
+class DnsFailureTest(IgniteTest):
+    """
+    Test DNS service failure.
+    """
+
+    @cluster(num_nodes=4)
+    @ignite_versions(str(DEV_BRANCH))
+    @defaults(fail=[True, False])
+    def dns_failure_test(self, ignite_version, fail):
+        """
+        DNS failure test.
+        """
+        # Replace hosts with IP addresses.
+        for node in self.test_context.cluster.nodes:
+            node.account.externally_routable_ip = 
socket.gethostbyname(node.account.externally_routable_ip)
+
+        version = IgniteVersion(ignite_version)
+
+        ignite_config = IgniteConfiguration(
+            version=version,
+            data_storage=DataStorageConfiguration(
+                default=DataRegionConfiguration(
+                    persistence_enabled=True
+                )
+            )
+        )
+
+        ignites = self.__prepare_service(ignite_config, 3)
+
+        self.__unblock_dns(ignites)
+
+        # Start nodes one-by-one to reproduce the problem.
+        ignites.start_node(ignites.nodes[0])
+        ignites.await_started([ignites.nodes[0]])
+        ignites.start_node(ignites.nodes[1])
+        ignites.await_started([ignites.nodes[0], ignites.nodes[1]])
+        ignites.start_node(ignites.nodes[2])
+        ignites.await_started()
+
+        control_utility = ControlUtility(ignites)
+        control_utility.activate()
+
+        self.__block_dns(ignites, 20000, fail)
+
+        ignites.stop_node(ignites.nodes[1])
+
+        ignites.await_event("Node left topology", 60, from_the_beginning=True,
+                            nodes=[ignites.nodes[0], ignites.nodes[2]])
+
+        assert ignites.alive(ignites.nodes[0]), 'Node 0 should be alive'
+        assert ignites.alive(ignites.nodes[2]), 'Node 2 should be alive'
+
+        self.__unblock_dns(ignites, [ignites.nodes[1]])
+
+        ignites.start_node(ignites.nodes[1])
+        ignites.await_started()
+
+        assert len(ignites.alive_nodes) == 3, 'All nodes should be alive'
+
+        # Smoke test on full topology.

Review Comment:
   Here we check that communication protocol has not problems with DNS (node 
leave/join tests discovery protocol)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to