Ejemplo n.º 1
0
    def test_build_datanode_decommission_request(self):
        c_name = "c1"
        instances = [self.i1, self.i2]

        res = decomission_helper.build_datanode_decommission_request(
            c_name, instances)
        self.assertEqual("i1,i2",
                         res["RequestInfo"]["parameters"]["excluded_hosts"])
        self.assertEqual("c1",
                         res["RequestInfo"]["operation_level"]["cluster_name"])
Ejemplo n.º 2
0
    def test_build_datanode_decommission_request(self):
        c_name = "c1"
        instances = [self.i1, self.i2]

        res = decomission_helper.build_datanode_decommission_request(c_name,
                                                                     instances)
        self.assertEqual("i1,i2",
                         res["RequestInfo"]["parameters"]["excluded_hosts"])
        self.assertEqual("c1",
                         res["RequestInfo"]["operation_level"]["cluster_name"])
Ejemplo n.º 3
0
 def decommission_datanodes(self, cluster_name, instances):
     url = self._base_url + "/clusters/%s/requests" % cluster_name
     data = d_helper.build_datanode_decommission_request(cluster_name,
                                                         instances)
     resp = self.post(url, data=jsonutils.dumps(data))
     self.wait_ambari_request(self.req_id(resp), cluster_name)