From bb3e1c92b6682ed39968dc5085b69c117f43cbb0 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 2 Jul 2014 10:38:43 -0700 Subject: [PATCH] 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 --- qa/workunits/rest/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qa/workunits/rest/test.py b/qa/workunits/rest/test.py index 2bf97718a4f..82dacac65ca 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') @@ -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, '') -- 2.47.3