From e1e4ab5d1b8cf31b9f1c3b0d79e697bceb42e300 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 25 Jun 2012 22:59:31 -0700 Subject: [PATCH] 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(+) diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py index aaddb08a..8eeaf2e4 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',