From: Sage Weil Date: Wed, 2 Jul 2014 17:38:43 +0000 (-0700) Subject: qa/workunits/rest/test.py: make osd create test idempotent X-Git-Tag: v0.67.10~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4aa2b87385e94be0147401918c332d526029e481;p=ceph.git qa/workunits/rest/test.py: make osd create test idempotent 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 (cherry picked from commit bb3e1c92b6682ed39968dc5085b69c117f43cbb0) --- diff --git a/qa/workunits/rest/test.py b/qa/workunits/rest/test.py index c40ec916016..e6dc7c42069 100755 --- a/qa/workunits/rest/test.py +++ b/qa/workunits/rest/test.py @@ -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, '')