[dts] [PATCH V2] tests/bonding: fix save pcapfile method and path
Zhu, ShuaiX
shuaix.zhu at intel.com
Thu Oct 17 10:08:02 CEST 2019
Tested-by: Zhu, ShuaiX <shuaix.zhu at intel.com>
> -----Original Message-----
> From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of Xiao Qimai
> Sent: Thursday, October 17, 2019 3:30 PM
> To: dts at dpdk.org
> Cc: Xiao, QimaiX <qimaix.xiao at intel.com>
> Subject: [dts] [PATCH V2] tests/bonding: fix save pcapfile method and path
>
> fix save pcapfile method to new api
>
> Signed-off-by: Xiao Qimai <qimaix.xiao at intel.com>
> ---
> tests/bonding.py | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/tests/bonding.py b/tests/bonding.py index fb2a69e..6c136a3 100644
> --- a/tests/bonding.py
> +++ b/tests/bonding.py
> @@ -36,7 +36,7 @@ import struct
> import socket
> from socket import htonl
>
> -from packet import Packet
> +from packet import Packet, TMP_PATH
> from scapy.sendrecv import sendp
> from scapy.utils import wrpcap
>
> @@ -181,14 +181,14 @@ class PmdBonding(object):
> # create packet
> streams = []
> # keep a copy of pcap for debug
> - savePath = os.sep.join([self.target_source,
> + savePath = os.sep.join([TMP_PATH,
> "pkt_{0}.pcap".format(pkt_name)])
> pkt_type = pkt_config.get('type')
> pkt_layers = pkt_config.get('pkt_layers')
> pkt = Packet(pkt_type=pkt_type.upper())
> for layer in pkt_layers.keys():
> pkt.config_layer(layer, pkt_layers[layer])
> - pkt.pktgen.write_pcap(savePath)
> + pkt.save_pcapfile(filename=savePath)
> streams.append(pkt.pktgen.pkt)
>
> return streams
> @@ -228,14 +228,14 @@ class PmdBonding(object):
> streams = []
> for values in pkt_configs:
> # keep a copy of pcap for debug
> - savePath = os.sep.join([self.target_source,
> + savePath = os.sep.join([TMP_PATH,
> "pkt_{0}.pcap".format(stm_name)])
> pkt_type = values.get('type')
> pkt_layers = values.get('pkt_layers')
> pkt = Packet(pkt_type=pkt_type.upper())
> for layer in pkt_layers.keys():
> pkt.config_layer(layer, pkt_layers[layer])
> - pkt.pktgen.write_pcap(savePath)
> + pkt.save_pcapfile(filename=savePath)
> streams.append(pkt.pktgen.pkt)
>
> return streams
> --
> 1.8.3.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestBondingStacked.log
Type: application/octet-stream
Size: 422402 bytes
Desc: TestBondingStacked.log
URL: <http://mails.dpdk.org/archives/dts/attachments/20191017/97041f85/attachment.obj>
More information about the dts
mailing list