From 155518577f4eb2a486f6638f9cf03575d8a17d84 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 26 Aug 2024 08:51:59 -0400 Subject: [PATCH] MT#55283 add tests for unsubscribe Change-Id: I06994bd36bd5e4c0eab7076b3f9c3d8302cad871 (cherry picked from commit 27fc6233b879f7212d927b43c4ce6a7a5564066c) (cherry picked from commit 4bd01d11ccd9a1033e379058ab729374bf132206) --- t/auto-daemon-tests-pubsub.pl | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/t/auto-daemon-tests-pubsub.pl b/t/auto-daemon-tests-pubsub.pl index d91c9f8b1..e0db2349c 100755 --- a/t/auto-daemon-tests-pubsub.pl +++ b/t/auto-daemon-tests-pubsub.pl @@ -622,6 +622,35 @@ rcv_no($sock_ax); rcv_no($sock_bx); rcv_no($sock_cx); +$resp = rtpe_req('unsubscribe', 'simple sub, no RTCP mirror', { 'from-tag' => ft(), 'to-tag' => $ttr }); + +snd($sock_b, $port_a, rtp(0, 2002, 4320, 0x3456, "\x00" x 160)); +rcv($sock_a, $port_b, rtpm(0, 2002, 4320, 0x3456, "\x00" x 160)); +rcv_no($sock_b); +rcv_no($sock_c); +snd($sock_a, $port_b, rtp(0, 4002, 7320, 0x6543, "\x00" x 160)); +rcv($sock_b, $port_a, rtpm(0, 4002, 7320, 0x6543, "\x00" x 160)); +rcv_no($sock_c); +rcv_no($sock_a); +snd($sock_c, $port_c, rtp(0, 5001, 8160, 0x9876, "\x00" x 160)); +rcv_no($sock_a); +rcv_no($sock_b); +rcv_no($sock_c); + +snd($sock_bx, $port_ax, "\x81\xc8\x00\x0c\x00\x00\x34\x56xxxxyyyy\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x65\x43\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x001234qwer\x81\xca\x00\x05\x00\x00\x34\x56\x01\x0cabcdefghijkl\x00\x00"); +rcv($sock_ax, $port_bx, qr/^\x81\xc8\x00\x0c\x00\x00\x34\x56xxxxyyyy\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x65\x43\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x001234qwer\x81\xca\x00\x05\x00\x00\x34\x56\x01\x0cabcdefghijkl\x00\x00$/); +rcv_no($sock_bx); +rcv_no($sock_cx); + +snd($sock_ax, $port_bx, "\x81\xc8\x00\x0c\x00\x00\x65\x43aaaabbbb\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x34\x56\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x00poiuytre\x81\xca\x00\x05\x00\x00\x65\x43\x01\x0cqwertyuiopqw\x00\x00"); +rcv($sock_bx, $port_ax, qr/^\x81\xc8\x00\x0c\x00\x00\x65\x43aaaabbbb\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x34\x56\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x00poiuytre\x81\xca\x00\x05\x00\x00\x65\x43\x01\x0cqwertyuiopqw\x00\x00$/); +rcv_no($sock_cx); +rcv_no($sock_ax); + +snd($sock_cx, $port_cx, "\x81\xc8\x00\x0c\x00\x00\x98\x76aaaabbbb\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x65\x43\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x00poiuytre\x81\xca\x00\x05\x00\x00\x98\x76\x01\x0cqwertyuiopqw\x00\x00"); +rcv_no($sock_ax); +rcv_no($sock_bx); +rcv_no($sock_cx); @@ -746,6 +775,37 @@ rcv($sock_ax, $port_bx, qr/^\x81\xc8\x00\x0c\x00\x00\x98\x76aaaabbbb\x00\x00\x22 rcv_no($sock_bx); rcv_no($sock_cx); +$resp = rtpe_req('unsubscribe', 'simple sub, RTCP mirror', { 'from-tag' => ft(), 'to-tag' => $ttr }); + +snd($sock_b, $port_a, rtp(0, 2002, 4320, 0x3456, "\x00" x 160)); +rcv($sock_a, $port_b, rtpm(0, 2002, 4320, 0x3456, "\x00" x 160)); +rcv_no($sock_b); +rcv_no($sock_c); +snd($sock_a, $port_b, rtp(0, 4002, 7320, 0x6543, "\x00" x 160)); +rcv($sock_b, $port_a, rtpm(0, 4002, 7320, 0x6543, "\x00" x 160)); +rcv_no($sock_c); +rcv_no($sock_a); +snd($sock_c, $port_c, rtp(0, 5001, 8320, 0x9876, "\x00" x 160)); +rcv_no($sock_a); +rcv_no($sock_b); +rcv_no($sock_c); + +snd($sock_bx, $port_ax, "\x81\xc8\x00\x0c\x00\x00\x34\x56xxxxyyyy\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x65\x43\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x001234qwer\x81\xca\x00\x05\x00\x00\x34\x56\x01\x0cabcdefghijkl\x00\x00"); +rcv($sock_ax, $port_bx, qr/^\x81\xc8\x00\x0c\x00\x00\x34\x56xxxxyyyy\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x65\x43\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x001234qwer\x81\xca\x00\x05\x00\x00\x34\x56\x01\x0cabcdefghijkl\x00\x00$/); +rcv_no($sock_bx); +rcv_no($sock_cx); + +snd($sock_ax, $port_bx, "\x81\xc8\x00\x0c\x00\x00\x65\x43aaaabbbb\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x34\x56\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x00poiuytre\x81\xca\x00\x05\x00\x00\x65\x43\x01\x0cqwertyuiopqw\x00\x00"); +rcv($sock_bx, $port_ax, qr/^\x81\xc8\x00\x0c\x00\x00\x65\x43aaaabbbb\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x34\x56\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x00poiuytre\x81\xca\x00\x05\x00\x00\x65\x43\x01\x0cqwertyuiopqw\x00\x00$/); +rcv_no($sock_cx); +rcv_no($sock_ax); + +snd($sock_cx, $port_cx, "\x81\xc8\x00\x0c\x00\x00\x98\x76aaaabbbb\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x65\x43\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x00poiuytre\x81\xca\x00\x05\x00\x00\x98\x76\x01\x0cqwertyuiopqw\x00\x00"); +rcv($sock_ax, $port_bx, qr/^\x81\xc8\x00\x0c\x00\x00\x98\x76aaaabbbb\x00\x00\x22\xd8\x00\x00\x00\x25\x00\x00\x18\xdc\x00\x00\x65\x43\x06\x00\x00\x01\x00\x00\x07\xf5\x00\x00\x00\x00poiuytre\x81\xca\x00\x05\x00\x00\x98\x76\x01\x0cqwertyuiopqw\x00\x00$/); +rcv_no($sock_bx); +rcv_no($sock_cx); + +