From 4bc7c74d911943a9026205d6b735a0f61e60a400 Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 22 Jan 2025 14:47:33 +0800 Subject: [PATCH] test: retrieve data from half of nodes - --- src/steps/da.py | 4 ++-- tests/data_integrity/test_data_integrity.py | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/steps/da.py b/src/steps/da.py index d780686..9b2e91e 100644 --- a/src/steps/da.py +++ b/src/steps/da.py @@ -36,11 +36,11 @@ class StepsDataAvailability(StepsCommon): assert "Bad Request" in str(ex) or "Internal Server Error" in str(ex) @allure.step - def get_data_range(self, app_id, start, end): + def get_data_range(self, node, app_id, start, end): response = [] query = prepare_get_range_request(app_id, start, end) try: - response = self.node2.send_get_data_range_request(query) + response = node.send_get_data_range_request(query) except Exception as ex: assert "Bad Request" in str(ex) or "Internal Server Error" in str(ex) diff --git a/tests/data_integrity/test_data_integrity.py b/tests/data_integrity/test_data_integrity.py index f209110..738f035 100644 --- a/tests/data_integrity/test_data_integrity.py +++ b/tests/data_integrity/test_data_integrity.py @@ -13,6 +13,15 @@ class TestDataIntegrity(StepsDataAvailability): @pytest.mark.usefixtures("setup_5_node_cluster") def test_da_identify_retrieve_missing_columns(self): self.disperse_data(DATA_TO_DISPERSE[0], [0] * 31 + [1], [0] * 8) + received_data = [] + # Get data only from half of nodes + for node in self.main_nodes[2:4]: + received_data.append(self.get_data_range(node, [0] * 31 + [1], [0] * 8, [0] * 7 + [3])) + + # Use received blob data to reconstruct the original data + # nomos-cli reconstruct command required + reconstructed_data = [] + assert DATA_TO_DISPERSE[0] == bytes(reconstructed_data).decode("utf-8") @pytest.mark.usefixtures("setup_2_node_cluster") def test_da_sampling_determines_data_presence(self):