From d69adf946caeea1202a52fa9229b7c636c12a81d Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 25 Jun 2012 22:59:31 -0700 Subject: Fix db calls for snaphsot and volume mapping * Fix misuse of project_only * Includes failing tests * Adds missing call to db/api.py * Fixes bug 1017816 Change-Id: I993089ba031a05e7ab0ea91c279a2ac47593eda3 --- nova/tests/test_db_api.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'nova/tests') diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py index aaddb08a6..8eeaf2e40 100644 --- a/nova/tests/test_db_api.py +++ b/nova/tests/test_db_api.py @@ -401,6 +401,16 @@ class DbApiTestCase(test.TestCase): result = db.fixed_ip_disassociate_all_by_timeout(ctxt, 'bar', now) self.assertEqual(result, 0) + def test_get_vol_mapping_non_admin(self): + ref = db.ec2_volume_create(self.context, 'fake-uuid') + ec2_id = db.get_ec2_volume_id_by_uuid(self.context, 'fake-uuid') + self.assertEqual(ref['id'], ec2_id) + + def test_get_snap_mapping_non_admin(self): + ref = db.ec2_snapshot_create(self.context, 'fake-uuid') + ec2_id = db.get_ec2_snapshot_id_by_uuid(self.context, 'fake-uuid') + self.assertEqual(ref['id'], ec2_id) + def _get_fake_aggr_values(): return {'name': 'fake_aggregate', -- cgit