Пример #1
0
 def test_run_cluster_action(self, cluster: Cluster):
     """Test run cluster action"""
     cluster.config_set({"required": 10})
     cluster.service_add(name="ZOOKEEPER")
     result = cluster.action().run()
     with allure.step("Check if status is running"):
         assert result.status == "running"
Пример #2
0
 def test_cluster_action_runs_task(self, cluster: Cluster):
     """Test run cluster action"""
     cluster.config_set({"required": 10})
     cluster.service_add(name="ZOOKEEPER")
     task = cluster.action(name="check-file-type").run()
     with allure.step("Check if status is running"):
         assert task.status == "running"
 def test_check_that_file_field_put_correct_data_in_file_inside_docker(
         self, cluster: Cluster):
     """Another mysterious type checking test"""
     test_data = "lorem ipsum"
     with allure.step("Create config data"):
         config_data = utils.ordered_dict_to_dict(cluster.config())
         config_data["input_file"] = test_data
         config_data["required"] = 42
     with allure.step("Create config history"):
         cluster.config_set(config_data)
     with allure.step("Check file type"):
         run_cluster_action_and_assert_result(cluster=cluster,
                                              action="check-file-type")
 def test_should_not_set_invalid_cluster_config(
     self,
     cluster: Cluster,
     cluster_config: Any,
     expected_error: Tuple[err.ADCMError, str],
 ):
     """Invalid cluster config should not be set"""
     adcm_error, expected_msg = expected_error
     with allure.step("Try to set invalid config"):
         allure.attach(json.dumps(cluster_config), "config.json",
                       allure.attachment_type.JSON)
         with pytest.raises(coreapi.exceptions.ErrorMessage) as e:
             cluster.config_set(cluster_config)
     with allure.step("Check error"):
         adcm_error.equal(e, expected_msg)
 def test_create_new_config_version_with_other_parameters(
         self, cluster: Cluster):
     """Test create new cluster config with many parameters"""
     cfg = {"required": 99, "str-key": utils.random_string()}
     expected = cluster.config_set(cfg)
     with allure.step("Check new config"):
         assert cluster.config() == expected
 def test_create_new_config_version_with_one_req_parameter(
         self, cluster: Cluster):
     """Test create new cluster config with one parameter"""
     cfg = {"required": 42}
     expected = cluster.config_set(cfg)
     with allure.step("Check new config"):
         assert cluster.config() == expected