コード例 #1
0
ファイル: test_db_api.py プロジェクト: matiu2/nova
 def test_sm_backend_conf_get(self):
     ctxt = context.get_admin_context()
     params = _get_sm_backend_params()
     beconf = db.sm_backend_conf_create(ctxt,
                                        params)
     val = db.sm_backend_conf_get(ctxt, beconf['id'])
     self.assertDictMatch(dict(val), dict(beconf))
コード例 #2
0
 def test_sm_backend_conf_get(self):
     ctxt = context.get_admin_context()
     params = _get_sm_backend_params()
     beconf = db.sm_backend_conf_create(ctxt,
                                        params)
     val = db.sm_backend_conf_get(ctxt, beconf['id'])
     self.assertDictMatch(dict(val), dict(beconf))
コード例 #3
0
ファイル: test_xensm.py プロジェクト: grwl/nova
 def test_initialize_connection(self):
     ctxt = context.get_admin_context()
     beconf = self._setup_step(ctxt)
     beconf = db.sm_backend_conf_get(ctxt, beconf["id"])
     volume = self._create_volume()
     self.driver.create_volume(volume)
     expected = self._get_expected_conn(beconf, volume)
     conn = self.driver.initialize_connection(volume, "fakeConnector")
     res = {}
     for key in ["volume_id", "flavor_id", "sr_uuid", "sr_type"]:
         res[key] = conn["data"][key]
     self.assertDictMatch(expected, res)
     self.assertEqual(set(conn["data"]["introduce_sr_keys"]), set([u"sr_type", u"server", u"serverpath"]))
コード例 #4
0
ファイル: test_xensm.py プロジェクト: OpenStack-Kha/nova
 def test_initialize_connection(self):
     ctxt = context.get_admin_context()
     beconf = self._setup_step(ctxt)
     beconf = db.sm_backend_conf_get(ctxt, beconf['id'])
     volume = self._create_volume()
     self.driver.create_volume(volume)
     expected = self._get_expected_conn(beconf, volume)
     conn = self.driver.initialize_connection(volume, 'fakeConnector')
     res = {}
     for key in ['volume_id', 'flavor_id', 'sr_uuid', 'sr_type']:
         res[key] = conn['data'][key]
     self.assertDictMatch(expected, res)
     self.assertEqual(set(conn['data']['introduce_sr_keys']),
                      set([u'sr_type', u'server', u'serverpath']))
コード例 #5
0
ファイル: test_xensm.py プロジェクト: OpenStack-Kha/nova
 def test_do_setup(self):
     ctxt = context.get_admin_context()
     beconf = self._setup_step(ctxt)
     beconf = db.sm_backend_conf_get(ctxt, beconf['id'])
     self.assertIsInstance(beconf['sr_uuid'], basestring)