def test_cluster_create_cluster_tmpl_node_group_mixin(self):
        ng_id = self._create_node_group_template(flavor='10')
        ctmpl_id = self._create_cluster_template(ng_id)

        data = {
            "name":
            "testtmplnodegroups",
            "plugin_name":
            "vanilla",
            "hadoop_version":
            "1.2.1",
            "cluster_template_id":
            '%s' % ctmpl_id,
            'default_image_id':
            '550e8400-e29b-41d4-a716-446655440000',
            "node_groups": [{
                "name":
                "allinone",
                "count":
                1,
                "flavor_id":
                "42",
                "node_processes":
                ["namenode", "jobtracker", "datanode", "tasktracker"]
            }]
        }
        patchers = u.start_patch(False)
        c.check_cluster_create(data)
        u.stop_patch(patchers)
 def test_cluster_create_node_group_tmpl_mixin(self):
     ng_id = self._create_node_group_template(flavor='23')
     data = {
         "name":
         "testtmplnodegroups",
         "plugin_name":
         "vanilla",
         "hadoop_version":
         "1.2.1",
         "node_groups": [
             {
                 "node_group_template_id":
                 '%s' % ng_id,
                 "name":
                 "allinone",
                 "count":
                 1,
                 "flavor_id":
                 "42",
                 "node_processes":
                 ["namenode", "jobtracker", "datanode", "tasktracker"]
             },
         ],
         'default_image_id':
         '550e8400-e29b-41d4-a716-446655440000'
     }
     with self.assertRaises(exceptions.InvalidException):
         try:
             patchers = u.start_patch(False)
             c.check_cluster_create(data)
             u.stop_patch(patchers)
         except exceptions.InvalidException as e:
             self.assertEqual("Requested flavor '23' not found", e.message)
             raise e
 def test_cluster_create_node_group_tmpl_mixin(self):
     ng_id = self._create_node_group_template(flavor='23')
     data = {
         "name": "testtmplnodegroups",
         "plugin_name": "vanilla",
         "hadoop_version": "1.2.1",
         "node_groups": [
             {
                 "node_group_template_id": '%s' % ng_id,
                 "name": "allinone",
                 "count": 1,
                 "flavor_id": "42",
                 "node_processes": [
                     "namenode",
                     "jobtracker",
                     "datanode",
                     "tasktracker"
                 ]
             },
         ],
         'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
     }
     with self.assertRaises(exceptions.InvalidException):
         try:
             patchers = u.start_patch(False)
             c.check_cluster_create(data)
             u.stop_patch(patchers)
         except exceptions.InvalidException as e:
             self.assertEqual("Requested flavor '23' not found",
                              e.message)
             raise e
    def test_cluster_create_v_correct_flavor(self):
        ng_id = self._create_node_group_template(flavor='42')
        ctmpl_id = self._create_cluster_template(ng_id)

        data = {
            "name": "testname",
            "plugin_name": "vanilla",
            "hadoop_version": "1.1.2",
            "cluster_template_id": '%s' % ctmpl_id
        }
        c.check_cluster_create(data)

        data1 = {
            "name": "testwithnodegroups",
            "plugin_name": "vanilla",
            "hadoop_version": "1.1.2",
            "node_groups": [
                {
                    "name": "allinone",
                    "count": 1,
                    "flavor_id": "42",
                    "node_processes": [
                        "namenode",
                        "jobtracker",
                        "datanode",
                        "tasktracker"
                    ]
                }
            ]
        }
        c.check_cluster_create(data1)
    def test_cluster_create_cluster_tmpl_node_group_mixin(self):
        ng_id = self._create_node_group_template(flavor='10')
        ctmpl_id = self._create_cluster_template(ng_id)

        data = {
            "name": "testtmplnodegroups",
            "plugin_name": "vanilla",
            "hadoop_version": "1.2.1",
            "cluster_template_id": '%s' % ctmpl_id,
            'default_image_id': '550e8400-e29b-41d4-a716-446655440000',
            "node_groups": [
                {
                    "name": "allinone",
                    "count": 1,
                    "flavor_id": "42",
                    "node_processes": [
                        "namenode",
                        "jobtracker",
                        "datanode",
                        "tasktracker"
                    ]
                }
            ]
        }
        patchers = u.start_patch(False)
        c.check_cluster_create(data)
        u.stop_patch(patchers)
 def test_cluster_create_node_group_tmpl_mixin(self):
     ng_id = self._create_node_group_template(flavor='23')
     data = {
         "name": "testtmplnodegroups",
         "plugin_name": "vanilla",
         "hadoop_version": "1.1.2",
         "node_groups": [
             {
                 "node_group_template_id": '%s' % ng_id,
                 "name": "allinone",
                 "count": 1,
                 "flavor_id": "42",
                 "node_processes": [
                     "namenode",
                     "jobtracker",
                     "datanode",
                     "tasktracker"
                 ]
             }
         ]
     }
     with self.assertRaises(exceptions.InvalidException):
         try:
             c.check_cluster_create(data)
         except exceptions.InvalidException as e:
             self.assertEqual("Requested flavor '23' not found",
                              e.message)
             raise e
Пример #7
0
 def test_cluster_create_node_group_tmpl_mixin(self):
     ng_id = self._create_node_group_template(flavor='23')
     data = {
         "name":
         "testtmplnodegroups",
         "plugin_name":
         "vanilla",
         "hadoop_version":
         "1.1.2",
         "node_groups": [{
             "node_group_template_id":
             '%s' % ng_id,
             "name":
             "allinone",
             "count":
             1,
             "flavor_id":
             "42",
             "node_processes":
             ["namenode", "jobtracker", "datanode", "tasktracker"]
         }]
     }
     with self.assertRaises(exceptions.InvalidException):
         try:
             c.check_cluster_create(data)
         except exceptions.InvalidException as e:
             self.assertEqual("Requested flavor '23' not found", e.message)
             raise e
Пример #8
0
    def test_cluster_create_cluster_tmpl_node_group_mixin(self):
        ng_id = self._create_node_group_template(flavor='10')
        ctmpl_id = self._create_cluster_template(ng_id)

        data = {
            "name":
            "testtmplnodegroups",
            "plugin_name":
            "vanilla",
            "hadoop_version":
            "1.1.2",
            "cluster_template_id":
            '%s' % ctmpl_id,
            "node_groups": [{
                "name":
                "allinone",
                "count":
                1,
                "flavor_id":
                "42",
                "node_processes":
                ["namenode", "jobtracker", "datanode", "tasktracker"]
            }]
        }
        c.check_cluster_create(data)
    def test_cluster_create_v_invalid_flavor(self):
        ng_id = self._create_node_group_template(flavor='10')
        ctmpl_id = self._create_cluster_template(ng_id)

        data = {
            "name": "testname",
            "plugin_name": "vanilla",
            "hadoop_version": "1.2.1",
            "cluster_template_id": '%s' % ctmpl_id,
            'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
        }
        data1 = {
            "name":
            "testwithnodegroups",
            "plugin_name":
            "vanilla",
            "hadoop_version":
            "1.2.1",
            "node_groups": [{
                "name":
                "allinone",
                "count":
                1,
                "flavor_id":
                "10",
                "node_processes":
                ["namenode", "jobtracker", "datanode", "tasktracker"]
            }],
            'default_image_id':
            '550e8400-e29b-41d4-a716-446655440000'
        }
        for values in [data, data1]:
            with self.assertRaises(exceptions.InvalidException):
                try:
                    patchers = u.start_patch(False)
                    c.check_cluster_create(values)
                    u.stop_patch(patchers)
                except exceptions.InvalidException as e:
                    self.assertEqual("Requested flavor '10' not found",
                                     e.message)
                    raise e
    def test_cluster_create_v_invalid_flavor(self):
        ng_id = self._create_node_group_template(flavor='10')
        ctmpl_id = self._create_cluster_template(ng_id)

        data = {
            "name": "testname",
            "plugin_name": "vanilla",
            "hadoop_version": "1.2.1",
            "cluster_template_id": '%s' % ctmpl_id,
            'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
        }
        data1 = {
            "name": "testwithnodegroups",
            "plugin_name": "vanilla",
            "hadoop_version": "1.2.1",
            "node_groups": [
                {
                    "name": "allinone",
                    "count": 1,
                    "flavor_id": "10",
                    "node_processes": [
                        "namenode",
                        "jobtracker",
                        "datanode",
                        "tasktracker"
                    ]
                }
            ],
            'default_image_id': '550e8400-e29b-41d4-a716-446655440000'
        }
        for values in [data, data1]:
            with self.assertRaises(exceptions.InvalidException):
                try:
                    patchers = u.start_patch(False)
                    c.check_cluster_create(values)
                    u.stop_patch(patchers)
                except exceptions.InvalidException as e:
                    self.assertEqual("Requested flavor '10' not found",
                                     e.message)
                    raise e
    def test_cluster_create_v_invalid_flavor(self):
        ng_id = self._create_node_group_template(flavor='10')
        ctmpl_id = self._create_cluster_template(ng_id)

        data = {
            "name": "testname",
            "plugin_name": "vanilla",
            "hadoop_version": "1.1.2",
            "cluster_template_id": '%s' % ctmpl_id
        }
        data1 = {
            "name": "testwithnodegroups",
            "plugin_name": "vanilla",
            "hadoop_version": "1.1.2",
            "node_groups": [
                {
                    "name": "allinone",
                    "count": 1,
                    "flavor_id": "10",
                    "node_processes": [
                        "namenode",
                        "jobtracker",
                        "datanode",
                        "tasktracker"
                    ]
                }
            ]
        }
        for values in [data, data1]:
            with self.assertRaises(exceptions.InvalidException):
                try:
                    c.check_cluster_create(values)
                except exceptions.InvalidException as e:
                    self.assertEqual("Requested flavor '10' not found",
                                     e.message)
                    raise e
Пример #12
0
    def test_cluster_create_v_invalid_flavor(self):
        ng_id = self._create_node_group_template(flavor='10')
        ctmpl_id = self._create_cluster_template(ng_id)

        data = {
            "name": "testname",
            "plugin_name": "vanilla",
            "hadoop_version": "1.1.2",
            "cluster_template_id": '%s' % ctmpl_id
        }
        data1 = {
            "name":
            "testwithnodegroups",
            "plugin_name":
            "vanilla",
            "hadoop_version":
            "1.1.2",
            "node_groups": [{
                "name":
                "allinone",
                "count":
                1,
                "flavor_id":
                "10",
                "node_processes":
                ["namenode", "jobtracker", "datanode", "tasktracker"]
            }]
        }
        for values in [data, data1]:
            with self.assertRaises(exceptions.InvalidException):
                try:
                    c.check_cluster_create(values)
                except exceptions.InvalidException as e:
                    self.assertEqual("Requested flavor '10' not found",
                                     e.message)
                    raise e
    def test_cluster_create_cluster_tmpl_node_group_mixin(self):
        ng_id = self._create_node_group_template(flavor='10')
        ctmpl_id = self._create_cluster_template(ng_id)

        data = {
            "name": "testtmplnodegroups",
            "plugin_name": "vanilla",
            "hadoop_version": "1.2.1",
            "cluster_template_id": '%s' % ctmpl_id,
            "node_groups": [
                {
                    "name": "allinone",
                    "count": 1,
                    "flavor_id": "42",
                    "node_processes": [
                        "namenode",
                        "jobtracker",
                        "datanode",
                        "tasktracker"
                    ]
                }
            ]
        }
        c.check_cluster_create(data)