summaryrefslogtreecommitdiffstats
path: root/src/rpc-server/src/commands/trex_rpc_cmd_test.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-08-20 13:51:31 +0300
committerimarom <imarom@cisco.com>2015-08-20 13:51:31 +0300
commita6be0ea727a21e24e1efb77eaf55893a545de233 (patch)
treea044166baa6aec4b1d5274dfb3cb72fec8126ca7 /src/rpc-server/src/commands/trex_rpc_cmd_test.cpp
parentda56afe25e71f4dc65ae4669889eec5b8fc43afc (diff)
added support for paramters in the python console
Diffstat (limited to 'src/rpc-server/src/commands/trex_rpc_cmd_test.cpp')
-rw-r--r--src/rpc-server/src/commands/trex_rpc_cmd_test.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rpc-server/src/commands/trex_rpc_cmd_test.cpp b/src/rpc-server/src/commands/trex_rpc_cmd_test.cpp
index e9cc4665..e2dc8959 100644
--- a/src/rpc-server/src/commands/trex_rpc_cmd_test.cpp
+++ b/src/rpc-server/src/commands/trex_rpc_cmd_test.cpp
@@ -37,11 +37,18 @@ TrexRpcCmdTestAdd::_run(const Json::Value &params, Json::Value &result) {
/* validate count */
if (params.size() != 2) {
+ generate_err_param_count(result, 2, params.size());
return (TrexRpcCommand::RPC_CMD_PARAM_COUNT_ERR);
}
/* check we have all the required paramters */
- if (!x.isInt() || !y.isInt()) {
+ if (!x.isInt()) {
+ genernate_err(result, "'x' is either missing or not an integer");
+ return (TrexRpcCommand::RPC_CMD_PARAM_PARSE_ERR);
+ }
+
+ if (!y.isInt()) {
+ genernate_err(result, "'y' is either missing or not an integer");
return (TrexRpcCommand::RPC_CMD_PARAM_PARSE_ERR);
}
@@ -62,6 +69,7 @@ TrexRpcCmdTestSub::_run(const Json::Value &params, Json::Value &result) {
/* validate count */
if (params.size() != 2) {
+ generate_err_param_count(result, 2, params.size());
return (TrexRpcCommand::RPC_CMD_PARAM_COUNT_ERR);
}
@@ -82,6 +90,7 @@ TrexRpcCmdPing::_run(const Json::Value &params, Json::Value &result) {
/* validate count */
if (params.size() != 0) {
+ generate_err_param_count(result, 0, params.size());
return (TrexRpcCommand::RPC_CMD_PARAM_COUNT_ERR);
}
@@ -98,6 +107,7 @@ TrexRpcCmdGetReg::_run(const Json::Value &params, Json::Value &result) {
/* validate count */
if (params.size() != 0) {
+ generate_err_param_count(result, 0, params.size());
return (TrexRpcCommand::RPC_CMD_PARAM_COUNT_ERR);
}