Esempio n. 1
0
    def setUp(self):
        super(SeamicroToolPrivateMethodTestCase, self).setUp()
        self.node = db_utils.get_test_node(
                driver='fake_seamicro',
                driver_info=db_utils.seamicro_info)
        self.info = seamicro._parse_driver_info(self.node)
	
	def test__parse_driver_info(self):
        # make sure we get back the expected things
		self.assertIsNotNone(self.info.get('address'))
		self.assertIsNotNone(self.info.get('username'))
		self.assertIsNotNone(self.info.get('password'))
		self.assertIsNotNone(self.info.get('ccard'))
		self.assertIsNotNone(self.info.get('uuid'))

        # make sure error is raised when info, eg. username, is missing
		_driver_info = json.dumps(
			{
				'seamicro': {
					"address": "1.2.3.4",
					"password": "******",
				}
			})
		node = db_utils.get_test_node(driver_info=_driver_info)
		self.assertRaises(exception.InvalidParameterValue,seamicro._parse_driver_info,node)
Esempio n. 2
0
 def setUp(self):
     super(SeamicroToolDriverTestCase, self).setUp()
     self.dbapi = db_api.get_instance()
     self.driver = mgr_utils.get_mocked_node_manager(driver='fake_seamicro')
     self.node = db_utils.get_test_node(
             driver='fake_seamicro',
             driver_info=db_utils.seamicro_info)
     self.info = seamicro._parse_driver_info(self.node)
     self.dbapi.create_node(self.node)