from scapy.layers.inet import IP, UDP, TCP
from scapy.layers.inet6 import IPv6
from scapy.all import Ether, Packet, Raw
-from scapy.all import sendp
from resources.libraries.python.SFC.VerifyPacket import *
from resources.libraries.python.SFC.SFCConstants import SFCConstants as sfccon
from resources.libraries.python.TrafficScriptArg import TrafficScriptArg
+from resources.libraries.python.PacketVerifier import RxQueue, TxQueue
from robot.api import logger
frame_size = int(args.get_arg('framesize'))
test_type = args.get_arg('testtype')
+ rxq = RxQueue(rx_if)
+ txq = TxQueue(tx_if)
+ sent_packets = []
+
protocol = TCP
source_port = sfccon.DEF_SRC_PORT
destination_port = sfccon.DEF_DST_PORT
pkt_raw = pkt_header / Raw(load=pad_data)
- sendp(pkt_raw, iface=tx_if, count=3)
+ # Send created packet on one interface and receive on the other
+ sent_packets.append(pkt_raw)
+ txq.send(pkt_raw)
+
+ ether = rxq.recv(2)
- time.sleep(timeout)
+ if ether is None:
+ raise RuntimeError("No packet is received!")
# let us begin to check the proxy inbound packet
- VerifyPacket.check_the_nsh_sfc_packet(frame_size, test_type)
+ VerifyPacket.check_the_nsh_sfc_packet(ether, frame_size, test_type)
# we check all the fields about the proxy inbound, this test will pass
sys.exit(0)