Skip to content

Commit a063873

Browse files
committed
MT#55283 fix \d escape sequences
Must double escape these in "" strings Change-Id: I896ea35928ec7a7ef4dc7709d8eb37d1f6731897 (cherry picked from commit 6eecfc0)
1 parent 23925bc commit a063873

File tree

1 file changed

+54
-54
lines changed

1 file changed

+54
-54
lines changed

t/auto-daemon-tests-websocket.py

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -501,14 +501,14 @@ def testVideoroomWebRTC(self):
501501
sdp,
502502
re.compile(
503503
"^v=0\r\n"
504-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
504+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
505505
"s=rtpengine.*?\r\n"
506506
"t=0 0\r\n"
507-
"m=audio \d+ RTP/AVP 8\r\n"
507+
"m=audio \\d+ RTP/AVP 8\r\n"
508508
"c=IN IP4 203.0.113.1\r\n"
509509
"a=rtpmap:8 PCMA/8000\r\n"
510510
"a=recvonly\r\n"
511-
"a=rtcp:\d+\r\n$",
511+
"a=rtcp:\\d+\r\n$",
512512
re.DOTALL,
513513
),
514514
)
@@ -582,7 +582,7 @@ def testVideoroomWebRTC(self):
582582
"c=IN IP4 203.0.113.1\r\n"
583583
"s=foobar\r\n"
584584
"t=0 0\r\n"
585-
"m=audio \d+ UDP/TLS/RTP/SAVPF 8\r\n"
585+
"m=audio \\d+ UDP/TLS/RTP/SAVPF 8\r\n"
586586
"a=mid:1\r\n"
587587
"a=rtpmap:8 PCMA/8000\r\n"
588588
"a=sendonly\r\n"
@@ -593,7 +593,7 @@ def testVideoroomWebRTC(self):
593593
"a=ice-ufrag:.{8}\r\n"
594594
"a=ice-pwd:.{26}\r\n"
595595
"a=ice-options:trickle\r\n"
596-
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \d+ typ host\r\n"
596+
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \\d+ typ host\r\n"
597597
"a=end-of-candidates\r\n$",
598598
re.DOTALL,
599599
),
@@ -787,14 +787,14 @@ def testVideoroomWebRTCAlt(self):
787787
sdp,
788788
re.compile(
789789
"^v=0\r\n"
790-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
790+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
791791
"s=rtpengine.*?\r\n"
792792
"t=0 0\r\n"
793-
"m=audio \d+ RTP/AVP 8\r\n"
793+
"m=audio \\d+ RTP/AVP 8\r\n"
794794
"c=IN IP4 203.0.113.1\r\n"
795795
"a=rtpmap:8 PCMA/8000\r\n"
796796
"a=recvonly\r\n"
797-
"a=rtcp:\d+\r\n$",
797+
"a=rtcp:\\d+\r\n$",
798798
re.DOTALL,
799799
),
800800
)
@@ -871,7 +871,7 @@ def testVideoroomWebRTCAlt(self):
871871
"c=IN IP4 203.0.113.1\r\n"
872872
"s=foobar\r\n"
873873
"t=0 0\r\n"
874-
"m=audio \d+ UDP/TLS/RTP/SAVPF 8\r\n"
874+
"m=audio \\d+ UDP/TLS/RTP/SAVPF 8\r\n"
875875
"a=mid:1\r\n"
876876
"a=rtpmap:8 PCMA/8000\r\n"
877877
"a=sendonly\r\n"
@@ -882,7 +882,7 @@ def testVideoroomWebRTCAlt(self):
882882
"a=ice-ufrag:.{8}\r\n"
883883
"a=ice-pwd:.{26}\r\n"
884884
"a=ice-options:trickle\r\n"
885-
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \d+ typ host\r\n"
885+
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \\d+ typ host\r\n"
886886
"a=end-of-candidates\r\n$",
887887
re.DOTALL,
888888
),
@@ -1054,14 +1054,14 @@ def testVideoroomSDESDTLS(self):
10541054
sdp,
10551055
re.compile(
10561056
"^v=0\r\n"
1057-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
1057+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
10581058
"s=rtpengine.*?\r\n"
10591059
"t=0 0\r\n"
1060-
"m=audio \d+ RTP/SAVP 8\r\n"
1060+
"m=audio \\d+ RTP/SAVP 8\r\n"
10611061
"c=IN IP4 203.0.113.1\r\n"
10621062
"a=rtpmap:8 PCMA/8000\r\n"
10631063
"a=recvonly\r\n"
1064-
"a=rtcp:\d+\r\n"
1064+
"a=rtcp:\\d+\r\n"
10651065
"a=setup:active\r\n"
10661066
"a=fingerprint:sha-256 .{95}\r\n"
10671067
"a=tls-id:[0-9a-f]{32}\r\n$",
@@ -1154,14 +1154,14 @@ def testVideoroomSDES(self):
11541154
sdp,
11551155
re.compile(
11561156
"^v=0\r\n"
1157-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
1157+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
11581158
"s=rtpengine.*?\r\n"
11591159
"t=0 0\r\n"
1160-
"m=audio \d+ RTP/SAVP 8\r\n"
1160+
"m=audio \\d+ RTP/SAVP 8\r\n"
11611161
"c=IN IP4 203.0.113.1\r\n"
11621162
"a=rtpmap:8 PCMA/8000\r\n"
11631163
"a=recvonly\r\n"
1164-
"a=rtcp:\d+\r\n"
1164+
"a=rtcp:\\d+\r\n"
11651165
"a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:.{40}\r\n",
11661166
re.DOTALL,
11671167
),
@@ -1251,15 +1251,15 @@ def testVideoroomDTLS(self):
12511251
sdp,
12521252
re.compile(
12531253
"^v=0\r\n"
1254-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
1254+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
12551255
"s=rtpengine.*?\r\n"
12561256
"t=0 0\r\n"
1257-
"m=audio \d+ UDP/TLS/RTP/SAVPF 8\r\n"
1257+
"m=audio \\d+ UDP/TLS/RTP/SAVPF 8\r\n"
12581258
"c=IN IP4 203.0.113.1\r\n"
12591259
"a=mid:audio\r\n"
12601260
"a=rtpmap:8 PCMA/8000\r\n"
12611261
"a=recvonly\r\n"
1262-
"a=rtcp:\d+\r\n"
1262+
"a=rtcp:\\d+\r\n"
12631263
"a=setup:active\r\n"
12641264
"a=fingerprint:sha-256 .{95}\r\n"
12651265
"a=tls-id:[0-9a-f]{32}\r\n$",
@@ -1347,15 +1347,15 @@ def testVideoroomWebrtcup(self):
13471347
self.assertIsInstance(sdp, str)
13481348
match_re = re.compile(
13491349
"^v=0\r\n"
1350-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
1350+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
13511351
"s=rtpengine.*?\r\n"
13521352
"t=0 0\r\n"
1353-
"m=audio (\d+) RTP/AVP 8\r\n"
1353+
"m=audio (\\d+) RTP/AVP 8\r\n"
13541354
"c=IN IP4 203.0.113.1\r\n"
13551355
"a=mid:audio\r\n"
13561356
"a=rtpmap:8 PCMA/8000\r\n"
13571357
"a=recvonly\r\n"
1358-
"a=rtcp:\d+\r\n$",
1358+
"a=rtcp:\\d+\r\n$",
13591359
re.DOTALL,
13601360
)
13611361
self.assertRegex(sdp, match_re)
@@ -1617,27 +1617,27 @@ def testVideoroomWebRTCVideo(self):
16171617
sdp,
16181618
re.compile(
16191619
"^v=0\r\n"
1620-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
1620+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
16211621
"s=rtpengine.*?\r\n"
16221622
"t=0 0\r\n"
1623-
"m=audio \d+ UDP/TLS/RTP/SAVPF 111\r\n"
1623+
"m=audio \\d+ UDP/TLS/RTP/SAVPF 111\r\n"
16241624
"c=IN IP4 203.0.113.1\r\n"
16251625
"a=mid:0\r\n"
16261626
"a=rtpmap:111 opus/48000/2\r\n"
16271627
"a=fmtp:111 useinbandfec=1; minptime=10\r\n"
16281628
"a=rtcp-fb:111 transport-cc\r\n"
16291629
"a=recvonly\r\n"
1630-
"a=rtcp:\d+\r\n"
1630+
"a=rtcp:\\d+\r\n"
16311631
"a=rtcp-mux\r\n"
16321632
"a=setup:active\r\n"
16331633
"a=fingerprint:sha-256 .{95}\r\n"
16341634
"a=tls-id:[0-9a-f]{32}\r\n"
16351635
"a=ice-ufrag:.{8}\r\n"
16361636
"a=ice-pwd:.{26}\r\n"
16371637
"a=ice-options:trickle\r\n"
1638-
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \d+ typ host\r\n"
1638+
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \\d+ typ host\r\n"
16391639
"a=end-of-candidates\r\n"
1640-
"m=video \d+ UDP/TLS/RTP/SAVPF 96\r\n"
1640+
"m=video \\d+ UDP/TLS/RTP/SAVPF 96\r\n"
16411641
"c=IN IP4 203.0.113.1\r\n"
16421642
"a=mid:1\r\n"
16431643
"a=rtpmap:96 VP8/90000\r\n"
@@ -1647,15 +1647,15 @@ def testVideoroomWebRTCVideo(self):
16471647
"a=rtcp-fb:96 nack\r\n"
16481648
"a=rtcp-fb:96 nack pli\r\n"
16491649
"a=recvonly\r\n"
1650-
"a=rtcp:\d+\r\n"
1650+
"a=rtcp:\\d+\r\n"
16511651
"a=rtcp-mux\r\n"
16521652
"a=setup:active\r\n"
16531653
"a=fingerprint:sha-256 .{95}\r\n"
16541654
"a=tls-id:[0-9a-f]{32}\r\n"
16551655
"a=ice-ufrag:.{8}\r\n"
16561656
"a=ice-pwd:.{26}\r\n"
16571657
"a=ice-options:trickle\r\n"
1658-
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \d+ typ host\r\n"
1658+
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \\d+ typ host\r\n"
16591659
"a=end-of-candidates\r\n$",
16601660
re.DOTALL,
16611661
),
@@ -1727,7 +1727,7 @@ def testVideoroomWebRTCVideo(self):
17271727
"t=0 0\r\n"
17281728
"a=extmap-allow-mixed\r\n"
17291729
"a=msid-semantic: WMS hJifdaJwqEqHxSG0pVbs1DrLAwiHqz7fKlqC\r\n"
1730-
"m=audio \d+ UDP/TLS/RTP/SAVPF 111\r\n"
1730+
"m=audio \\d+ UDP/TLS/RTP/SAVPF 111\r\n"
17311731
"c=IN IP4 203.0.113.1\r\n"
17321732
"a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level\r\n"
17331733
"a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\n"
@@ -1752,9 +1752,9 @@ def testVideoroomWebRTCVideo(self):
17521752
"a=ice-ufrag:.{8}\r\n"
17531753
"a=ice-pwd:.{26}\r\n"
17541754
"a=ice-options:trickle\r\n"
1755-
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \d+ typ host\r\n"
1755+
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \\d+ typ host\r\n"
17561756
"a=end-of-candidates\r\n"
1757-
"m=video \d+ UDP/TLS/RTP/SAVPF 96\r\n"
1757+
"m=video \\d+ UDP/TLS/RTP/SAVPF 96\r\n"
17581758
"c=IN IP4 203.0.113.1\r\n"
17591759
"a=extmap:14 urn:ietf:params:rtp-hdrext:toffset\r\n"
17601760
"a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\r\n"
@@ -1793,7 +1793,7 @@ def testVideoroomWebRTCVideo(self):
17931793
"a=ice-ufrag:.{8}\r\n"
17941794
"a=ice-pwd:.{26}\r\n"
17951795
"a=ice-options:trickle\r\n"
1796-
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \d+ typ host\r\n"
1796+
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \\d+ typ host\r\n"
17971797
"a=end-of-candidates\r\n$",
17981798
re.DOTALL,
17991799
),
@@ -1875,20 +1875,20 @@ def testVideoroomICE(self):
18751875
sdp,
18761876
re.compile(
18771877
"^v=0\r\n"
1878-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
1878+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
18791879
"s=rtpengine.*?\r\n"
18801880
"t=0 0\r\n"
1881-
"m=audio \d+ RTP/AVP 8\r\n"
1881+
"m=audio \\d+ RTP/AVP 8\r\n"
18821882
"c=IN IP4 203.0.113.1\r\n"
18831883
"a=mid:audio\r\n"
18841884
"a=rtpmap:8 PCMA/8000\r\n"
18851885
"a=recvonly\r\n"
1886-
"a=rtcp:\d+\r\n"
1886+
"a=rtcp:\\d+\r\n"
18871887
"a=rtcp-mux\r\n"
18881888
"a=ice-ufrag:.{8}\r\n"
18891889
"a=ice-pwd:.{26}\r\n"
18901890
"a=ice-options:trickle\r\n"
1891-
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \d+ typ host\r\n"
1891+
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \\d+ typ host\r\n"
18921892
"a=end-of-candidates\r\n$",
18931893
re.DOTALL,
18941894
),
@@ -1994,7 +1994,7 @@ def testVideoroomICE(self):
19941994
"c=IN IP4 203.0.113.1\r\n"
19951995
"s=foobar\r\n"
19961996
"t=0 0\r\n"
1997-
"m=audio \d+ UDP/TLS/RTP/SAVPF 8\r\n"
1997+
"m=audio \\d+ UDP/TLS/RTP/SAVPF 8\r\n"
19981998
"a=mid:audio\r\n"
19991999
"a=rtpmap:8 PCMA/8000\r\n"
20002000
"a=sendonly\r\n"
@@ -2005,7 +2005,7 @@ def testVideoroomICE(self):
20052005
"a=ice-ufrag:.{8}\r\n"
20062006
"a=ice-pwd:.{26}\r\n"
20072007
"a=ice-options:trickle\r\n"
2008-
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \d+ typ host\r\n"
2008+
"a=candidate:.{16} 1 UDP 2130706431 203.0.113.1 \\d+ typ host\r\n"
20092009
"a=end-of-candidates\r\n$",
20102010
re.DOTALL,
20112011
),
@@ -2605,15 +2605,15 @@ def testVideoroomMultiConn(self):
26052605

26062606
match_re = re.compile(
26072607
"^v=0\r\n"
2608-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
2608+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
26092609
"s=rtpengine.*?\r\n"
26102610
"t=0 0\r\n"
2611-
"m=audio (\d+) RTP/AVP 96\r\n"
2611+
"m=audio (\\d+) RTP/AVP 96\r\n"
26122612
"c=IN IP4 203.0.113.1\r\n"
26132613
"a=mid:a\r\n"
26142614
"a=rtpmap:96 opus/48000/2\r\n"
26152615
"a=recvonly\r\n"
2616-
"a=rtcp:\d+\r\n$",
2616+
"a=rtcp:\\d+\r\n$",
26172617
re.DOTALL,
26182618
)
26192619
self.assertRegex(sdp, match_re)
@@ -2731,15 +2731,15 @@ def testVideoroomMultiConn(self):
27312731

27322732
match_re = re.compile(
27332733
"^v=0\r\n"
2734-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
2734+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
27352735
"s=rtpengine.*?\r\n"
27362736
"t=0 0\r\n"
2737-
"m=audio (\d+) RTP/AVP 96\r\n"
2737+
"m=audio (\\d+) RTP/AVP 96\r\n"
27382738
"c=IN IP4 203.0.113.1\r\n"
27392739
"a=mid:a\r\n"
27402740
"a=rtpmap:96 opus/48000/2\r\n"
27412741
"a=recvonly\r\n"
2742-
"a=rtcp:\d+\r\n$",
2742+
"a=rtcp:\\d+\r\n$",
27432743
re.DOTALL,
27442744
)
27452745
self.assertRegex(sdp, match_re)
@@ -2982,21 +2982,21 @@ def testVideoroomMute(self):
29822982

29832983
match_re = re.compile(
29842984
"^v=0\r\n"
2985-
"o=- \d+ \d+ IN IP4 203.0.113.1\r\n"
2985+
"o=- \\d+ \\d+ IN IP4 203.0.113.1\r\n"
29862986
"s=rtpengine.*?\r\n"
29872987
"t=0 0\r\n"
2988-
"m=audio (\d+) RTP/AVP 96\r\n"
2988+
"m=audio (\\d+) RTP/AVP 96\r\n"
29892989
"c=IN IP4 203.0.113.1\r\n"
29902990
"a=mid:a\r\n"
29912991
"a=rtpmap:96 opus/48000/2\r\n"
29922992
"a=recvonly\r\n"
2993-
"a=rtcp:\d+\r\n"
2994-
"m=video (\d+) RTP/AVP 97\r\n"
2993+
"a=rtcp:\\d+\r\n"
2994+
"m=video (\\d+) RTP/AVP 97\r\n"
29952995
"c=IN IP4 203.0.113.1\r\n"
29962996
"a=mid:v\r\n"
29972997
"a=rtpmap:97 VP9/90000\r\n"
29982998
"a=recvonly\r\n"
2999-
"a=rtcp:\d+\r\n$",
2999+
"a=rtcp:\\d+\r\n$",
30003000
re.DOTALL,
30013001
)
30023002
self.assertRegex(sdp, match_re)
@@ -3135,16 +3135,16 @@ def testVideoroomMute(self):
31353135
"c=IN IP4 203.0.113.1\r\n"
31363136
"s=foobar\r\n"
31373137
"t=0 0\r\n"
3138-
"m=audio (\d+) RTP/AVP 96\r\n"
3138+
"m=audio (\\d+) RTP/AVP 96\r\n"
31393139
"a=mid:a\r\n"
31403140
"a=rtpmap:96 opus/48000/2\r\n"
31413141
"a=sendonly\r\n"
3142-
"a=rtcp:\d+\r\n"
3143-
"m=video (\d+) RTP/AVP 97\r\n"
3142+
"a=rtcp:\\d+\r\n"
3143+
"m=video (\\d+) RTP/AVP 97\r\n"
31443144
"a=mid:v\r\n"
31453145
"a=rtpmap:97 VP9/90000\r\n"
31463146
"a=sendonly\r\n"
3147-
"a=rtcp:\d+\r\n$",
3147+
"a=rtcp:\\d+\r\n$",
31483148
re.DOTALL,
31493149
)
31503150
self.assertRegex(sdp, match_re)

0 commit comments

Comments
 (0)