def test_client_failure_isolate_one_datanode(): """ In this test, one of the datanodes is isolated from all other nodes. Expectation : Write should pass. Keys written before partition created can be read. """ test_key_name = "testkey2" ClusterUtils.put_key(FILE, TEST_BUCKET_NAME, TEST_VOLUME_NAME, "/etc/passwd", key_name=test_key_name, replication_factor='THREE') first_set = [OM[0], SCM[0], DATANODES[0], DATANODES[1], CLIENT[0]] second_set = [DATANODES[2]] Blockade.blockade_create_partition(first_set, second_set) Blockade.blockade_status() exit_code, output = \ ClusterUtils.run_freon(FILE, 1, 1, 1, 10240, "RATIS", "THREE") assert re.search("3 way commit failed", output) is not None assert re.search("Status: Success", output) is not None ClusterUtils.get_key(FILE, TEST_BUCKET_NAME, TEST_VOLUME_NAME, test_key_name, "/tmp/") key_checksum = ClusterUtils.find_checksum(FILE, "/tmp/%s" % test_key_name) assert key_checksum == ORIG_CHECKSUM
def test_client_failure_isolate_two_datanodes(): """ In this test, all datanodes are isolated from each other. two of the datanodes cannot communicate with any other node in the cluster. Expectation : Write should fail. Keys written before parition created can be read. """ test_key_name = "testkey1" ClusterUtils.put_key(FILE, TEST_BUCKET_NAME, TEST_VOLUME_NAME, "/etc/passwd", key_name=test_key_name, replication_factor='THREE') first_set = [OM[0], SCM[0], DATANODES[0], CLIENT[0]] second_set = [DATANODES[1]] third_set = [DATANODES[2]] Blockade.blockade_create_partition(first_set, second_set, third_set) Blockade.blockade_status() exit_code, output = \ ClusterUtils.run_freon(FILE, 1, 1, 1, 10240, "RATIS", "THREE") assert re.search("Status: Failed", output) is not None ClusterUtils.get_key(FILE, TEST_BUCKET_NAME, TEST_VOLUME_NAME, test_key_name, "/tmp/") key_checksum = ClusterUtils.find_checksum(FILE, "/tmp/%s" % test_key_name) assert key_checksum == ORIG_CHECKSUM