diff options
author | imarom <imarom@cisco.com> | 2015-09-21 18:57:01 +0300 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2015-09-21 18:57:01 +0300 |
commit | 52e2ab74873d1958c0f7ab6e598a402fe0a673c5 (patch) | |
tree | 67b6a2e33c0fb5295f9ed97e76db9c456ffe7f00 | |
parent | 14006b519bfd679227a87d0e6a2be9726774aafc (diff) |
some minor fixes
-rw-r--r-- | scripts/automation/trex_control_plane/client_utils/jsonrpc_client.py | 11 | ||||
-rwxr-xr-x | scripts/trex-console | 2 | ||||
-rw-r--r-- | src/gtest/rpc_test.cpp | 2 |
3 files changed, 8 insertions, 7 deletions
diff --git a/scripts/automation/trex_control_plane/client_utils/jsonrpc_client.py b/scripts/automation/trex_control_plane/client_utils/jsonrpc_client.py index aff3def5..8b091b5e 100644 --- a/scripts/automation/trex_control_plane/client_utils/jsonrpc_client.py +++ b/scripts/automation/trex_control_plane/client_utils/jsonrpc_client.py @@ -25,8 +25,7 @@ class BatchMessage(object): def add (self, method_name, params = {}): - id = self.rpc_client.id_gen.next() - msg = self.rpc_client.create_jsonrpc_v2(method_name, params, id) + id, msg = self.rpc_client.create_jsonrpc_v2(method_name, params, encode = False) self.batch_list.append(msg) def invoke (self, block = False): @@ -91,7 +90,7 @@ class JsonRpcClient(object): def create_batch (self): return BatchMessage(self) - def create_jsonrpc_v2 (self, method_name, params = {}): + def create_jsonrpc_v2 (self, method_name, params = {}, encode = True): msg = {} msg["jsonrpc"] = "2.0" msg["method"] = method_name @@ -100,7 +99,10 @@ class JsonRpcClient(object): msg["id"] = self.id_gen.next() - return id, json.dumps(msg) + if encode: + return id, json.dumps(msg) + else: + return id, msg def invoke_rpc_method (self, method_name, params = {}, block = False): @@ -109,7 +111,6 @@ class JsonRpcClient(object): id, msg = self.create_jsonrpc_v2(method_name, params) - msg = json.dumps(msg) return self.send_raw_msg(msg, block) diff --git a/scripts/trex-console b/scripts/trex-console index 6eab77dd..22a47eb8 100755 --- a/scripts/trex-console +++ b/scripts/trex-console @@ -1,2 +1,2 @@ #!/bin/bash -../scripts/automation/trex_control_plane/console/trex_console.py $@ +automation/trex_control_plane/console/trex_console.py $@ diff --git a/src/gtest/rpc_test.cpp b/src/gtest/rpc_test.cpp index 168ee936..38d34320 100644 --- a/src/gtest/rpc_test.cpp +++ b/src/gtest/rpc_test.cpp @@ -353,7 +353,7 @@ TEST_F(RpcTest, get_version) { EXPECT_TRUE(response["result"] != Json::nullValue); EXPECT_TRUE(response["result"]["built_by"] == "MOCK"); - EXPECT_TRUE(response["result"]["version"] == "v0.0"); + EXPECT_TRUE(response["result"]["version"] == "v1.75"); } /* get system info */ |