diff --git a/tests/data_integrity/test_data_integrity.py b/tests/data_integrity/test_data_integrity.py index bce91f7..5f3f723 100644 --- a/tests/data_integrity/test_data_integrity.py +++ b/tests/data_integrity/test_data_integrity.py @@ -20,7 +20,7 @@ class TestDataIntegrity(StepsDataAvailability): self.disperse_data(DATA_TO_DISPERSE[1], to_app_id(1), to_index(0)) delay(5) test_results = [] - # Iterate through standard nodes to get blob data for 1/2 columns + # Iterate through standard nodes 1-3 to get blob data for 1/2 columns for node in self.main_nodes[1:4]: rcv_data = self.get_data_range(node, to_app_id(1), to_index(0), to_index(5)) rcv_data_json = json.dumps(rcv_data) @@ -34,6 +34,29 @@ class TestDataIntegrity(StepsDataAvailability): logger.info(f"Dispersed data received by : {test_results}") + @pytest.mark.usefixtures("setup_4_node_cluster") + def test_da_disperse_retrieve_one_node_stopped(self): + + # Stop nomos node 1 - dispersal and data retrieval should be still possible + self.main_nodes[1].stop() + + self.disperse_data(DATA_TO_DISPERSE[1], to_app_id(1), to_index(0)) + delay(5) + test_results = [] + # Iterate through standard nodes 2-3 to get blob data for 1/2 columns + for node in self.main_nodes[2:4]: + rcv_data = self.get_data_range(node, to_app_id(1), to_index(0), to_index(5)) + rcv_data_json = json.dumps(rcv_data) + + reconstructed_data = NomosCli(command="reconstruct").run(input_values=[rcv_data_json]) + + if DATA_TO_DISPERSE[1] == reconstructed_data: + test_results.append(node.name()) + + assert len(test_results) > 0, "Dispersed data were not received by any node" + + logger.info(f"Dispersed data received by : {test_results}") + @pytest.mark.usefixtures("setup_2_node_cluster") def test_da_sampling_determines_data_presence(self): self.disperse_data(DATA_TO_DISPERSE[1], to_app_id(1), to_index(0))