]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/workunits/rest/test.py: make osd create test idempotent
authorSage Weil <sage@inktank.com>
Wed, 2 Jul 2014 17:38:43 +0000 (10:38 -0700)
committerSage Weil <sage@redhat.com>
Fri, 1 Aug 2014 22:57:55 +0000 (15:57 -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>
(cherry picked from commit bb3e1c92b6682ed39968dc5085b69c117f43cbb0)

qa/workunits/rest/test.py

index c40ec916016b44e5b6c95238b62d41e2a0066e62..e6dc7c42069b5fb8a01cf825fee3ce4b882e560e 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')
@@ -285,7 +286,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, '')