Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "add ppm into result of pktgen to make result clear"
[yardstick.git]
/
api
/
resources
/
v2
/
testcases.py
diff --git
a/api/resources/v2/testcases.py
b/api/resources/v2/testcases.py
index
b47a8f6
..
316ef26
100644
(file)
--- a/
api/resources/v2/testcases.py
+++ b/
api/resources/v2/testcases.py
@@
-10,6
+10,8
@@
import logging
import errno
import os
import errno
import os
+import jinja2schema
+
from api import ApiResource
from yardstick.common.utils import result_handler
from yardstick.common import constants as consts
from api import ApiResource
from yardstick.common.utils import result_handler
from yardstick.common import constants as consts
@@
-56,7
+58,10
@@
class V2Testcase(ApiResource):
if e.errno == errno.ENOENT:
return result_handler(consts.API_ERROR, 'case does not exist')
if e.errno == errno.ENOENT:
return result_handler(consts.API_ERROR, 'case does not exist')
- return result_handler(consts.API_SUCCESS, {'testcase': data})
+ options = {k: {'description': '', 'type': v.__class__.__name__}
+ for k, v in jinja2schema.infer(data).items()}
+
+ return result_handler(consts.API_SUCCESS, {'testcase': data, 'args': options})
def delete(self, case_name):
case_path = os.path.join(consts.TESTCASE_DIR, '{}.yaml'.format(case_name))
def delete(self, case_name):
case_path = os.path.join(consts.TESTCASE_DIR, '{}.yaml'.format(case_name))