Renamed RPCs start/stopTx as start/stopTransmit
This commit is contained in:
parent
3b546637e4
commit
1ea635bcfb
@ -146,7 +146,7 @@ try:
|
|||||||
log.info('starting capture')
|
log.info('starting capture')
|
||||||
drone.startCapture(rx_port)
|
drone.startCapture(rx_port)
|
||||||
log.info('starting transmit')
|
log.info('starting transmit')
|
||||||
drone.startTx(tx_port)
|
drone.startTransmit(tx_port)
|
||||||
|
|
||||||
# wait for transmit to finish
|
# wait for transmit to finish
|
||||||
log.info('waiting for transmit to finish ...')
|
log.info('waiting for transmit to finish ...')
|
||||||
@ -154,7 +154,7 @@ try:
|
|||||||
|
|
||||||
# stop transmit and capture
|
# stop transmit and capture
|
||||||
log.info('stopping transmit')
|
log.info('stopping transmit')
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
log.info('stopping capture')
|
log.info('stopping capture')
|
||||||
drone.stopCapture(rx_port)
|
drone.stopCapture(rx_port)
|
||||||
|
|
||||||
|
@ -574,7 +574,7 @@ void PortGroup::startTx(QList<uint> *portList)
|
|||||||
portId->set_id(portList->at(i));
|
portId->set_id(portList->at(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
serviceStub->startTx(controller, portIdList, ack,
|
serviceStub->startTransmit(controller, portIdList, ack,
|
||||||
NewCallback(this, &PortGroup::processStartTxAck, controller));
|
NewCallback(this, &PortGroup::processStartTxAck, controller));
|
||||||
}
|
}
|
||||||
_exit:
|
_exit:
|
||||||
@ -609,7 +609,7 @@ void PortGroup::stopTx(QList<uint> *portList)
|
|||||||
portId->set_id(portList->at(i));
|
portId->set_id(portList->at(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
serviceStub->stopTx(controller, portIdList, ack,
|
serviceStub->stopTransmit(controller, portIdList, ack,
|
||||||
NewCallback(this, &PortGroup::processStopTxAck, controller));
|
NewCallback(this, &PortGroup::processStopTxAck, controller));
|
||||||
}
|
}
|
||||||
_exit:
|
_exit:
|
||||||
|
@ -237,8 +237,8 @@ service OstService {
|
|||||||
rpc deleteStream(StreamIdList) returns (Ack);
|
rpc deleteStream(StreamIdList) returns (Ack);
|
||||||
rpc modifyStream(StreamConfigList) returns (Ack);
|
rpc modifyStream(StreamConfigList) returns (Ack);
|
||||||
|
|
||||||
rpc startTx(PortIdList) returns (Ack);
|
rpc startTransmit(PortIdList) returns (Ack);
|
||||||
rpc stopTx(PortIdList) returns (Ack);
|
rpc stopTransmit(PortIdList) returns (Ack);
|
||||||
|
|
||||||
rpc startCapture(PortIdList) returns (Ack);
|
rpc startCapture(PortIdList) returns (Ack);
|
||||||
rpc stopCapture(PortIdList) returns (Ack);
|
rpc stopCapture(PortIdList) returns (Ack);
|
||||||
|
@ -327,7 +327,7 @@ _exit:
|
|||||||
done->Run();
|
done->Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyService::startTx(::google::protobuf::RpcController* /*controller*/,
|
void MyService::startTransmit(::google::protobuf::RpcController* /*controller*/,
|
||||||
const ::OstProto::PortIdList* request,
|
const ::OstProto::PortIdList* request,
|
||||||
::OstProto::Ack* /*response*/,
|
::OstProto::Ack* /*response*/,
|
||||||
::google::protobuf::Closure* done)
|
::google::protobuf::Closure* done)
|
||||||
@ -352,7 +352,7 @@ void MyService::startTx(::google::protobuf::RpcController* /*controller*/,
|
|||||||
done->Run();
|
done->Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyService::stopTx(::google::protobuf::RpcController* /*controller*/,
|
void MyService::stopTransmit(::google::protobuf::RpcController* /*controller*/,
|
||||||
const ::OstProto::PortIdList* request,
|
const ::OstProto::PortIdList* request,
|
||||||
::OstProto::Ack* /*response*/,
|
::OstProto::Ack* /*response*/,
|
||||||
::google::protobuf::Closure* done)
|
::google::protobuf::Closure* done)
|
||||||
|
@ -69,11 +69,11 @@ public:
|
|||||||
const ::OstProto::StreamConfigList* request,
|
const ::OstProto::StreamConfigList* request,
|
||||||
::OstProto::Ack* response,
|
::OstProto::Ack* response,
|
||||||
::google::protobuf::Closure* done);
|
::google::protobuf::Closure* done);
|
||||||
virtual void startTx(::google::protobuf::RpcController* controller,
|
virtual void startTransmit(::google::protobuf::RpcController* controller,
|
||||||
const ::OstProto::PortIdList* request,
|
const ::OstProto::PortIdList* request,
|
||||||
::OstProto::Ack* response,
|
::OstProto::Ack* response,
|
||||||
::google::protobuf::Closure* done);
|
::google::protobuf::Closure* done);
|
||||||
virtual void stopTx(::google::protobuf::RpcController* controller,
|
virtual void stopTransmit(::google::protobuf::RpcController* controller,
|
||||||
const ::OstProto::PortIdList* request,
|
const ::OstProto::PortIdList* request,
|
||||||
::OstProto::Ack* response,
|
::OstProto::Ack* response,
|
||||||
::google::protobuf::Closure* done);
|
::google::protobuf::Closure* done);
|
||||||
|
@ -187,7 +187,7 @@ try:
|
|||||||
|
|
||||||
passed = False
|
passed = False
|
||||||
suite.test_begin('addStreamDuringTransmitFails')
|
suite.test_begin('addStreamDuringTransmitFails')
|
||||||
drone.startTx(tx_port)
|
drone.startTransmit(tx_port)
|
||||||
try:
|
try:
|
||||||
log.info('adding tx_stream %d' % sid.stream_id[0].id)
|
log.info('adding tx_stream %d' % sid.stream_id[0].id)
|
||||||
drone.addStream(sid)
|
drone.addStream(sid)
|
||||||
@ -197,7 +197,7 @@ try:
|
|||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
suite.test_end(passed)
|
suite.test_end(passed)
|
||||||
|
|
||||||
passed = False
|
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.kMacFieldNumber
|
||||||
s.protocol.add().protocol_id.id = ost_pb.Protocol.kArpFieldNumber
|
s.protocol.add().protocol_id.id = ost_pb.Protocol.kArpFieldNumber
|
||||||
s.protocol.add().protocol_id.id = ost_pb.Protocol.kPayloadFieldNumber
|
s.protocol.add().protocol_id.id = ost_pb.Protocol.kPayloadFieldNumber
|
||||||
drone.startTx(tx_port)
|
drone.startTransmit(tx_port)
|
||||||
try:
|
try:
|
||||||
log.info('configuring tx_stream %d' % sid.stream_id[0].id)
|
log.info('configuring tx_stream %d' % sid.stream_id[0].id)
|
||||||
drone.modifyStream(scfg)
|
drone.modifyStream(scfg)
|
||||||
@ -219,12 +219,12 @@ try:
|
|||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
suite.test_end(passed)
|
suite.test_end(passed)
|
||||||
|
|
||||||
passed = False
|
passed = False
|
||||||
suite.test_begin('deleteStreamDuringTransmitFails')
|
suite.test_begin('deleteStreamDuringTransmitFails')
|
||||||
drone.startTx(tx_port)
|
drone.startTransmit(tx_port)
|
||||||
try:
|
try:
|
||||||
log.info('deleting tx_stream %d' % sid.stream_id[0].id)
|
log.info('deleting tx_stream %d' % sid.stream_id[0].id)
|
||||||
drone.deleteStream(sid)
|
drone.deleteStream(sid)
|
||||||
@ -234,31 +234,31 @@ try:
|
|||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
suite.test_end(passed)
|
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
|
# not a restart
|
||||||
# ----------------------------------------------------------------- #
|
# ----------------------------------------------------------------- #
|
||||||
passed = False
|
passed = False
|
||||||
suite.test_begin('startTxDuringTransmitIsNopNotRestart')
|
suite.test_begin('startTransmitDuringTransmitIsNopNotRestart')
|
||||||
drone.startCapture(rx_port)
|
drone.startCapture(rx_port)
|
||||||
drone.startTx(tx_port)
|
drone.startTransmit(tx_port)
|
||||||
try:
|
try:
|
||||||
log.info('sleeping for 4s ...')
|
log.info('sleeping for 4s ...')
|
||||||
time.sleep(4)
|
time.sleep(4)
|
||||||
log.info('starting transmit multiple times')
|
log.info('starting transmit multiple times')
|
||||||
drone.startTx(tx_port)
|
drone.startTransmit(tx_port)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
drone.startTx(tx_port)
|
drone.startTransmit(tx_port)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
drone.startTx(tx_port)
|
drone.startTransmit(tx_port)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
log.info('waiting for transmit to finish ...')
|
log.info('waiting for transmit to finish ...')
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
drone.stopCapture(rx_port)
|
drone.stopCapture(rx_port)
|
||||||
|
|
||||||
buff = drone.getCaptureBuffer(rx_port.port_id[0])
|
buff = drone.getCaptureBuffer(rx_port.port_id[0])
|
||||||
@ -272,7 +272,7 @@ try:
|
|||||||
except RpcError as e:
|
except RpcError as e:
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
suite.test_end(passed)
|
suite.test_end(passed)
|
||||||
|
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ try:
|
|||||||
suite.test_begin('startCaptureDuringTransmitIsNopNotRestart')
|
suite.test_begin('startCaptureDuringTransmitIsNopNotRestart')
|
||||||
try:
|
try:
|
||||||
drone.startCapture(rx_port)
|
drone.startCapture(rx_port)
|
||||||
drone.startTx(tx_port)
|
drone.startTransmit(tx_port)
|
||||||
log.info('sleeping for 4s ...')
|
log.info('sleeping for 4s ...')
|
||||||
time.sleep(4)
|
time.sleep(4)
|
||||||
log.info('starting capture multiple times')
|
log.info('starting capture multiple times')
|
||||||
@ -296,7 +296,7 @@ try:
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
log.info('waiting for transmit to finish ...')
|
log.info('waiting for transmit to finish ...')
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
drone.stopCapture(rx_port)
|
drone.stopCapture(rx_port)
|
||||||
|
|
||||||
buff = drone.getCaptureBuffer(rx_port.port_id[0])
|
buff = drone.getCaptureBuffer(rx_port.port_id[0])
|
||||||
@ -310,26 +310,26 @@ try:
|
|||||||
except RpcError as e:
|
except RpcError as e:
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
suite.test_end(passed)
|
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
|
# is a NOP
|
||||||
# ----------------------------------------------------------------- #
|
# ----------------------------------------------------------------- #
|
||||||
passed = False
|
passed = False
|
||||||
suite.test_begin('stopTxWhenTransmitNotRunningIsNop')
|
suite.test_begin('stopTransmitWhenTransmitNotRunningIsNop')
|
||||||
try:
|
try:
|
||||||
tx_stats = drone.getStats(tx_port)
|
tx_stats = drone.getStats(tx_port)
|
||||||
log.info('--> (tx_stats)' + tx_stats.__str__())
|
log.info('--> (tx_stats)' + tx_stats.__str__())
|
||||||
if tx_stats.port_stats[0].state.is_transmit_on:
|
if tx_stats.port_stats[0].state.is_transmit_on:
|
||||||
raise Exception('Unexpected transmit ON state')
|
raise Exception('Unexpected transmit ON state')
|
||||||
log.info('stopping transmit multiple times')
|
log.info('stopping transmit multiple times')
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
|
|
||||||
# if we reached here, that means there was no exception
|
# if we reached here, that means there was no exception
|
||||||
passed = True
|
passed = True
|
||||||
@ -364,19 +364,19 @@ try:
|
|||||||
suite.test_end(passed)
|
suite.test_end(passed)
|
||||||
|
|
||||||
# ----------------------------------------------------------------- #
|
# ----------------------------------------------------------------- #
|
||||||
# TESTCASE: Verify startCapture(), startTx() sequence captures the
|
# TESTCASE: Verify startCapture(), startTransmit() sequence captures the
|
||||||
# first packet
|
# first packet
|
||||||
# TESTCASE: Verify stopTx(), stopCapture() sequence captures the
|
# TESTCASE: Verify stopTransmit(), stopCapture() sequence captures the
|
||||||
# last packet
|
# last packet
|
||||||
# ----------------------------------------------------------------- #
|
# ----------------------------------------------------------------- #
|
||||||
passed = False
|
passed = False
|
||||||
suite.test_begin('startStopTransmitCaptureOrderCapturesAllPackets')
|
suite.test_begin('startStopTransmitCaptureOrderCapturesAllPackets')
|
||||||
try:
|
try:
|
||||||
drone.startCapture(rx_port)
|
drone.startCapture(rx_port)
|
||||||
drone.startTx(tx_port)
|
drone.startTransmit(tx_port)
|
||||||
log.info('waiting for transmit to finish ...')
|
log.info('waiting for transmit to finish ...')
|
||||||
time.sleep(12)
|
time.sleep(12)
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
drone.stopCapture(rx_port)
|
drone.stopCapture(rx_port)
|
||||||
|
|
||||||
log.info('getting Rx capture buffer')
|
log.info('getting Rx capture buffer')
|
||||||
@ -391,7 +391,7 @@ try:
|
|||||||
except RpcError as e:
|
except RpcError as e:
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
drone.stopTx(tx_port)
|
drone.stopTransmit(tx_port)
|
||||||
suite.test_end(passed)
|
suite.test_end(passed)
|
||||||
|
|
||||||
suite.complete()
|
suite.complete()
|
||||||
|
Loading…
Reference in New Issue
Block a user