diff --git a/binding/example.py b/binding/example.py index 28de5c5..0a77a27 100644 --- a/binding/example.py +++ b/binding/example.py @@ -146,7 +146,7 @@ try: log.info('starting capture') drone.startCapture(rx_port) log.info('starting transmit') - drone.startTx(tx_port) + drone.startTransmit(tx_port) # wait for transmit to finish log.info('waiting for transmit to finish ...') @@ -154,7 +154,7 @@ try: # stop transmit and capture log.info('stopping transmit') - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) log.info('stopping capture') drone.stopCapture(rx_port) diff --git a/client/portgroup.cpp b/client/portgroup.cpp index 0d50228..e411652 100644 --- a/client/portgroup.cpp +++ b/client/portgroup.cpp @@ -574,7 +574,7 @@ void PortGroup::startTx(QList *portList) portId->set_id(portList->at(i)); } - serviceStub->startTx(controller, portIdList, ack, + serviceStub->startTransmit(controller, portIdList, ack, NewCallback(this, &PortGroup::processStartTxAck, controller)); } _exit: @@ -609,7 +609,7 @@ void PortGroup::stopTx(QList *portList) portId->set_id(portList->at(i)); } - serviceStub->stopTx(controller, portIdList, ack, + serviceStub->stopTransmit(controller, portIdList, ack, NewCallback(this, &PortGroup::processStopTxAck, controller)); } _exit: diff --git a/common/protocol.proto b/common/protocol.proto index 07012b5..ad9477a 100644 --- a/common/protocol.proto +++ b/common/protocol.proto @@ -237,8 +237,8 @@ service OstService { rpc deleteStream(StreamIdList) returns (Ack); rpc modifyStream(StreamConfigList) returns (Ack); - rpc startTx(PortIdList) returns (Ack); - rpc stopTx(PortIdList) returns (Ack); + rpc startTransmit(PortIdList) returns (Ack); + rpc stopTransmit(PortIdList) returns (Ack); rpc startCapture(PortIdList) returns (Ack); rpc stopCapture(PortIdList) returns (Ack); diff --git a/server/myservice.cpp b/server/myservice.cpp index 1696cba..825ab2c 100644 --- a/server/myservice.cpp +++ b/server/myservice.cpp @@ -327,7 +327,7 @@ _exit: done->Run(); } -void MyService::startTx(::google::protobuf::RpcController* /*controller*/, +void MyService::startTransmit(::google::protobuf::RpcController* /*controller*/, const ::OstProto::PortIdList* request, ::OstProto::Ack* /*response*/, ::google::protobuf::Closure* done) @@ -352,7 +352,7 @@ void MyService::startTx(::google::protobuf::RpcController* /*controller*/, done->Run(); } -void MyService::stopTx(::google::protobuf::RpcController* /*controller*/, +void MyService::stopTransmit(::google::protobuf::RpcController* /*controller*/, const ::OstProto::PortIdList* request, ::OstProto::Ack* /*response*/, ::google::protobuf::Closure* done) diff --git a/server/myservice.h b/server/myservice.h index 3508dc4..557a30f 100644 --- a/server/myservice.h +++ b/server/myservice.h @@ -69,11 +69,11 @@ public: const ::OstProto::StreamConfigList* request, ::OstProto::Ack* response, ::google::protobuf::Closure* done); - virtual void startTx(::google::protobuf::RpcController* controller, + virtual void startTransmit(::google::protobuf::RpcController* controller, const ::OstProto::PortIdList* request, ::OstProto::Ack* response, ::google::protobuf::Closure* done); - virtual void stopTx(::google::protobuf::RpcController* controller, + virtual void stopTransmit(::google::protobuf::RpcController* controller, const ::OstProto::PortIdList* request, ::OstProto::Ack* response, ::google::protobuf::Closure* done); diff --git a/test/rpctest.py b/test/rpctest.py index 759004c..cbb3f13 100644 --- a/test/rpctest.py +++ b/test/rpctest.py @@ -187,7 +187,7 @@ try: passed = False suite.test_begin('addStreamDuringTransmitFails') - drone.startTx(tx_port) + drone.startTransmit(tx_port) try: log.info('adding tx_stream %d' % sid.stream_id[0].id) drone.addStream(sid) @@ -197,7 +197,7 @@ try: else: raise finally: - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) suite.test_end(passed) passed = False @@ -209,7 +209,7 @@ try: s.protocol.add().protocol_id.id = ost_pb.Protocol.kMacFieldNumber s.protocol.add().protocol_id.id = ost_pb.Protocol.kArpFieldNumber s.protocol.add().protocol_id.id = ost_pb.Protocol.kPayloadFieldNumber - drone.startTx(tx_port) + drone.startTransmit(tx_port) try: log.info('configuring tx_stream %d' % sid.stream_id[0].id) drone.modifyStream(scfg) @@ -219,12 +219,12 @@ try: else: raise finally: - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) suite.test_end(passed) passed = False suite.test_begin('deleteStreamDuringTransmitFails') - drone.startTx(tx_port) + drone.startTransmit(tx_port) try: log.info('deleting tx_stream %d' % sid.stream_id[0].id) drone.deleteStream(sid) @@ -234,31 +234,31 @@ try: else: raise finally: - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) suite.test_end(passed) # ----------------------------------------------------------------- # - # TESTCASE: Verify invoking startTx() during transmit is a NOP, + # TESTCASE: Verify invoking startTransmit() during transmit is a NOP, # not a restart # ----------------------------------------------------------------- # passed = False - suite.test_begin('startTxDuringTransmitIsNopNotRestart') + suite.test_begin('startTransmitDuringTransmitIsNopNotRestart') drone.startCapture(rx_port) - drone.startTx(tx_port) + drone.startTransmit(tx_port) try: log.info('sleeping for 4s ...') time.sleep(4) log.info('starting transmit multiple times') - drone.startTx(tx_port) + drone.startTransmit(tx_port) time.sleep(1) - drone.startTx(tx_port) + drone.startTransmit(tx_port) time.sleep(1) - drone.startTx(tx_port) + drone.startTransmit(tx_port) time.sleep(1) log.info('waiting for transmit to finish ...') time.sleep(5) - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) drone.stopCapture(rx_port) buff = drone.getCaptureBuffer(rx_port.port_id[0]) @@ -272,7 +272,7 @@ try: except RpcError as e: raise finally: - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) suite.test_end(passed) @@ -284,7 +284,7 @@ try: suite.test_begin('startCaptureDuringTransmitIsNopNotRestart') try: drone.startCapture(rx_port) - drone.startTx(tx_port) + drone.startTransmit(tx_port) log.info('sleeping for 4s ...') time.sleep(4) log.info('starting capture multiple times') @@ -296,7 +296,7 @@ try: time.sleep(1) log.info('waiting for transmit to finish ...') time.sleep(5) - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) drone.stopCapture(rx_port) buff = drone.getCaptureBuffer(rx_port.port_id[0]) @@ -310,26 +310,26 @@ try: except RpcError as e: raise finally: - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) suite.test_end(passed) # ----------------------------------------------------------------- # - # TESTCASE: Verify invoking stopTx() when transmit is not running + # TESTCASE: Verify invoking stopTransmit() when transmit is not running # is a NOP # ----------------------------------------------------------------- # passed = False - suite.test_begin('stopTxWhenTransmitNotRunningIsNop') + suite.test_begin('stopTransmitWhenTransmitNotRunningIsNop') try: tx_stats = drone.getStats(tx_port) log.info('--> (tx_stats)' + tx_stats.__str__()) if tx_stats.port_stats[0].state.is_transmit_on: raise Exception('Unexpected transmit ON state') log.info('stopping transmit multiple times') - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) time.sleep(1) - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) time.sleep(1) - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) # if we reached here, that means there was no exception passed = True @@ -364,19 +364,19 @@ try: suite.test_end(passed) # ----------------------------------------------------------------- # - # TESTCASE: Verify startCapture(), startTx() sequence captures the + # TESTCASE: Verify startCapture(), startTransmit() sequence captures the # first packet - # TESTCASE: Verify stopTx(), stopCapture() sequence captures the + # TESTCASE: Verify stopTransmit(), stopCapture() sequence captures the # last packet # ----------------------------------------------------------------- # passed = False suite.test_begin('startStopTransmitCaptureOrderCapturesAllPackets') try: drone.startCapture(rx_port) - drone.startTx(tx_port) + drone.startTransmit(tx_port) log.info('waiting for transmit to finish ...') time.sleep(12) - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) drone.stopCapture(rx_port) log.info('getting Rx capture buffer') @@ -391,7 +391,7 @@ try: except RpcError as e: raise finally: - drone.stopTx(tx_port) + drone.stopTransmit(tx_port) suite.test_end(passed) suite.complete()