]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rest/test.py: make osd create test idempotent 2061/head
authorSage Weil <sage@inktank.com>
Wed, 2 Jul 2014 17:38:43 +0000 (10:38 -0700)
committerSage Weil <sage@inktank.com>
Wed, 2 Jul 2014 17:39:17 +0000 (10:39 -0700)
Avoid possibility that we create multiple OSDs do to retries by passing in
the optional uuid arg.  (A stray osd id will make the osd tell tests a
few lines down fail.)

Fixes: #8728
Signed-off-by: Sage Weil <sage@inktank.com>
qa/workunits/rest/test.py

index 2bf97718a4fc190fbdf7ce70f2043820aacfc5e4..82dacac65ca8e27dab393f5553ceb4823eaf3b54 100755 (executable)
@@ -7,6 +7,7 @@ import requests
 import subprocess
 import sys
 import time
+import uuid
 import xml.etree.ElementTree
 
 BASEURL = os.environ.get('BASEURL', 'http://localhost:5000/api/v0.1')
@@ -293,7 +294,8 @@ if __name__ == '__main__':
     r = expect('osd/getmaxosd', 'GET', 200, 'json', JSONHDR)
     assert(r.myjson['output']['max_osd'] == saved_maxosd)
 
-    r = expect('osd/create', 'PUT', 200, 'json', JSONHDR)
+    osd_uuid=uuid.uuid1()
+    r = expect('osd/create?uuid={0}'.format(osd_uuid), 'PUT', 200, 'json', JSONHDR)
     assert('osdid' in r.myjson['output'])
     osdid = r.myjson['output']['osdid']
     expect('osd/lost?id={0}'.format(osdid), 'PUT', 400, '')