diff mbox series

[RFC,3/4] auto-t: add generic tx_packet function

Message ID 20220809230428.215970-4-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series Roam based on packet loss event | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Aug. 9, 2022, 11:04 p.m. UTC
This sends data over the raw sockets similar to test_ifaces_connected
---
 autotests/util/testutil.py | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/autotests/util/testutil.py b/autotests/util/testutil.py
index eae4dd89..37de49a2 100644
--- a/autotests/util/testutil.py
+++ b/autotests/util/testutil.py
@@ -53,6 +53,13 @@  def tx(fromsock, tosock, src, dst):
 
     return (frame, fromsock, tosock, src, dst)
 
+def tx_packets(if0, if1, num):
+    sock0, addr0 = raw_if_socket(if0)
+    sock1, addr1 = raw_if_socket(if1)
+
+    for i in range(num):
+        tx(sock0, sock1, addr0, addr1)
+
 def test_connected(if0=None, if1=None, group=True, expect_fail=False):
     if expect_fail:
         timeout = 0