~ubuntu-branches/ubuntu/raring/cinder/raring-updates

« back to all changes in this revision

Viewing changes to cinder/tests/api/v1/test_snapshots.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2013-10-17 13:51:14 UTC
  • mfrom: (14.1.5 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20131017135114-b7hsi3ko146he49y
* Resynchronize with stable/grizzly (6e764cb) (LP: #1241202):
  - [74a2154] ThinLVM create volume from snapshot fails LP: 1210853
  - [25be695] Failure to create tmp file in image_conversion_dir can lead to
    the creation of 3 volumes LP: 1224211
  - [f89afda] Nova and quantum don't close qpid connections after certain
    error conditions LP: 1172922
  - [f91361d] volume cloning is failing with an I/O error happening when the
    backing snapshot is wiped LP: 1191812
  - [c381a49] volume is not deleted in cinder db LP: 1209367
  - [9891bf8] Volume size is not updated when cloning a volume with SolidFire
    LP: 1219105
  - [ddec0fc] when using qpid, metadata arguments cause volume cloning to
    fail LP: 1213964
  - [d13df23] Previous change to allow SolidFire to clone different size,
    breaks create-snapshot LP: 1234970
  - [eac6ecd] Cinder-Volume Fails to Boot on Restart LP: 1212206
  - [174a985] upload-to-image fails with the NetApp NFS backend LP: 1221205
  - [a3d3fa1] "mount.nfs is not installed" is in error LP: 1212286
  - [8002421] Allow display_name for v2 snapshot-update LP: 1226398
  - [9e85d49] Cinder API v2: List Snapshots Details can not use search
    options like "offset" and "limit" as admin user LP: 1205956
  - [22c53d6] NetApp: iSCSI drivers' reserved percentage is 100 LP: 1182015
  - [84b4ad8] Incorrect tunnelling to NetApp servers in concurrent requests
    LP: 1176759
  - [ba03c32] solidfire driver crashes during ensure export if solidfire not
    available LP: 1215064
  - [6e764cb] NetApp driver should disallow very old controller OS versions
    LP: 1223474
* debian/patches/fix-secure-delete-for-lvm.patch: Dropped.
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
316
316
        self.assertTrue('snapshots' in res)
317
317
        self.assertEqual(1, len(res['snapshots']))
318
318
 
 
319
    def test_list_snapshots_with_limit_and_offset(self):
 
320
        def list_snapshots_with_limit_and_offset(is_admin):
 
321
            def stub_snapshot_get_all_by_project(context, project_id):
 
322
                return [
 
323
                    stubs.stub_snapshot(1, display_name='backup1'),
 
324
                    stubs.stub_snapshot(2, display_name='backup2'),
 
325
                    stubs.stub_snapshot(3, display_name='backup3'),
 
326
                ]
 
327
 
 
328
            self.stubs.Set(db, 'snapshot_get_all_by_project',
 
329
                           stub_snapshot_get_all_by_project)
 
330
 
 
331
            req = fakes.HTTPRequest.blank('/v1/fake/snapshots?limit=1\
 
332
                                          &offset=1',
 
333
                                          use_admin_context=is_admin)
 
334
            res = self.controller.index(req)
 
335
 
 
336
            self.assertTrue('snapshots' in res)
 
337
            self.assertEqual(1, len(res['snapshots']))
 
338
            self.assertEqual(2, res['snapshots'][0]['id'])
 
339
 
 
340
        #admin case
 
341
        list_snapshots_with_limit_and_offset(is_admin=True)
 
342
        #non_admin case
 
343
        list_snapshots_with_limit_and_offset(is_admin=False)
 
344
 
319
345
    def test_admin_list_snapshots_all_tenants(self):
320
346
        req = fakes.HTTPRequest.blank('/v1/fake/snapshots?all_tenants=1',
321
347
                                      use_admin_context=True)