repair ack, refactor e2e tests
This commit is contained in:
1 parent
9e5357eaa8
commit
88a0b5f1b9
42 files changed
+1732
-792
No files matched your search
@@ -0,0 +1,41 @@
|
||||
module headless-bitrix-joiner
|
||||
|
||||
go 1.26.1
|
||||
|
||||
require whitelist-bypass/relay v0.0.0
|
||||
|
||||
require (
|
||||
github.com/google/uuid v1.6.0 // indirect
|
||||
github.com/gorilla/websocket v1.5.3 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
|
||||
github.com/klauspost/reedsolomon v1.12.0 // indirect
|
||||
github.com/pion/datachannel v1.6.0 // indirect
|
||||
github.com/pion/dtls/v3 v3.1.2 // indirect
|
||||
github.com/pion/ice/v4 v4.2.1 // indirect
|
||||
github.com/pion/interceptor v0.1.44 // indirect
|
||||
github.com/pion/logging v0.2.4 // indirect
|
||||
github.com/pion/mdns/v2 v2.1.0 // indirect
|
||||
github.com/pion/randutil v0.1.0 // indirect
|
||||
github.com/pion/rtcp v1.2.16 // indirect
|
||||
github.com/pion/rtp v1.10.1 // indirect
|
||||
github.com/pion/sctp v1.9.2 // indirect
|
||||
github.com/pion/sdp/v3 v3.0.18 // indirect
|
||||
github.com/pion/srtp/v3 v3.0.10 // indirect
|
||||
github.com/pion/stun/v3 v3.1.1 // indirect
|
||||
github.com/pion/transport/v4 v4.0.1 // indirect
|
||||
github.com/pion/turn/v4 v4.1.4 // indirect
|
||||
github.com/pion/webrtc/v4 v4.2.9 // indirect
|
||||
github.com/pkg/errors v0.9.1 // indirect
|
||||
github.com/quic-go/qpack v0.6.0 // indirect
|
||||
github.com/quic-go/quic-go v0.60.0 // indirect
|
||||
github.com/tjfoc/gmsm v1.4.1 // indirect
|
||||
github.com/wlynxg/anet v0.0.5 // indirect
|
||||
github.com/xtaci/kcp-go/v5 v5.6.72 // indirect
|
||||
golang.org/x/crypto v0.51.0 // indirect
|
||||
golang.org/x/net v0.55.0 // indirect
|
||||
golang.org/x/sys v0.45.0 // indirect
|
||||
golang.org/x/text v0.37.0 // indirect
|
||||
golang.org/x/time v0.14.0 // indirect
|
||||
)
|
||||
|
||||
replace whitelist-bypass/relay => ../../relay
|
||||
@@ -0,0 +1,148 @@
|
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
|
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
|
||||
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
||||
github.com/klauspost/reedsolomon v1.12.0 h1:I5FEp3xSwVCcEh3F5A7dofEfhXdF/bWhQWPH+XwBFno=
|
||||
github.com/klauspost/reedsolomon v1.12.0/go.mod h1:EPLZJeh4l27pUGC3aXOjheaoh1I9yut7xTURiW3LQ9Y=
|
||||
github.com/pion/datachannel v1.6.0 h1:XecBlj+cvsxhAMZWFfFcPyUaDZtd7IJvrXqlXD/53i0=
|
||||
github.com/pion/datachannel v1.6.0/go.mod h1:ur+wzYF8mWdC+Mkis5Thosk+u/VOL287apDNEbFpsIk=
|
||||
github.com/pion/dtls/v3 v3.1.2 h1:gqEdOUXLtCGW+afsBLO0LtDD8GnuBBjEy6HRtyofZTc=
|
||||
github.com/pion/dtls/v3 v3.1.2/go.mod h1:Hw/igcX4pdY69z1Hgv5x7wJFrUkdgHwAn/Q/uo7YHRo=
|
||||
github.com/pion/ice/v4 v4.2.1 h1:XPRYXaLiFq3LFDG7a7bMrmr3mFr27G/gtXN3v/TVfxY=
|
||||
github.com/pion/ice/v4 v4.2.1/go.mod h1:2quLV1S5v1tAx3VvAJaH//KGitRXvo4RKlX6D3tnN+c=
|
||||
github.com/pion/interceptor v0.1.44 h1:sNlZwM8dWXU9JQAkJh8xrarC0Etn8Oolcniukmuy0/I=
|
||||
github.com/pion/interceptor v0.1.44/go.mod h1:4atVlBkcgXuUP+ykQF0qOCGU2j7pQzX2ofvPRFsY5RY=
|
||||
github.com/pion/logging v0.2.4 h1:tTew+7cmQ+Mc1pTBLKH2puKsOvhm32dROumOZ655zB8=
|
||||
github.com/pion/logging v0.2.4/go.mod h1:DffhXTKYdNZU+KtJ5pyQDjvOAh/GsNSyv1lbkFbe3so=
|
||||
github.com/pion/mdns/v2 v2.1.0 h1:3IJ9+Xio6tWYjhN6WwuY142P/1jA0D5ERaIqawg/fOY=
|
||||
github.com/pion/mdns/v2 v2.1.0/go.mod h1:pcez23GdynwcfRU1977qKU0mDxSeucttSHbCSfFOd9A=
|
||||
github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA=
|
||||
github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
|
||||
github.com/pion/rtcp v1.2.16 h1:fk1B1dNW4hsI78XUCljZJlC4kZOPk67mNRuQ0fcEkSo=
|
||||
github.com/pion/rtcp v1.2.16/go.mod h1:/as7VKfYbs5NIb4h6muQ35kQF/J0ZVNz2Z3xKoCBYOo=
|
||||
github.com/pion/rtp v1.10.1 h1:xP1prZcCTUuhO2c83XtxyOHJteISg6o8iPsE2acaMtA=
|
||||
github.com/pion/rtp v1.10.1/go.mod h1:rF5nS1GqbR7H/TCpKwylzeq6yDM+MM6k+On5EgeThEM=
|
||||
github.com/pion/sctp v1.9.2 h1:HxsOzEV9pWoeggv7T5kewVkstFNcGvhMPx0GvUOUQXo=
|
||||
github.com/pion/sctp v1.9.2/go.mod h1:OTOlsQ5EDQ6mQ0z4MUGXt2CgQmKyafBEXhUVqLRB6G8=
|
||||
github.com/pion/sdp/v3 v3.0.18 h1:l0bAXazKHpepazVdp+tPYnrsy9dfh7ZbT8DxesH5ZnI=
|
||||
github.com/pion/sdp/v3 v3.0.18/go.mod h1:ZREGo6A9ZygQ9XkqAj5xYCQtQpif0i6Pa81HOiAdqQ8=
|
||||
github.com/pion/srtp/v3 v3.0.10 h1:tFirkpBb3XccP5VEXLi50GqXhv5SKPxqrdlhDCJlZrQ=
|
||||
github.com/pion/srtp/v3 v3.0.10/go.mod h1:3mOTIB0cq9qlbn59V4ozvv9ClW/BSEbRp4cY0VtaR7M=
|
||||
github.com/pion/stun/v3 v3.1.1 h1:CkQxveJ4xGQjulGSROXbXq94TAWu8gIX2dT+ePhUkqw=
|
||||
github.com/pion/stun/v3 v3.1.1/go.mod h1:qC1DfmcCTQjl9PBaMa5wSn3x9IPmKxSdcCsxBcDBndM=
|
||||
github.com/pion/transport/v3 v3.1.1 h1:Tr684+fnnKlhPceU+ICdrw6KKkTms+5qHMgw6bIkYOM=
|
||||
github.com/pion/transport/v3 v3.1.1/go.mod h1:+c2eewC5WJQHiAA46fkMMzoYZSuGzA/7E2FPrOYHctQ=
|
||||
github.com/pion/transport/v4 v4.0.1 h1:sdROELU6BZ63Ab7FrOLn13M6YdJLY20wldXW2Cu2k8o=
|
||||
github.com/pion/transport/v4 v4.0.1/go.mod h1:nEuEA4AD5lPdcIegQDpVLgNoDGreqM/YqmEx3ovP4jM=
|
||||
github.com/pion/turn/v4 v4.1.4 h1:EU11yMXKIsK43FhcUnjLlrhE4nboHZq+TXBIi3QpcxQ=
|
||||
github.com/pion/turn/v4 v4.1.4/go.mod h1:ES1DXVFKnOhuDkqn9hn5VJlSWmZPaRJLyBXoOeO/BmQ=
|
||||
github.com/pion/webrtc/v4 v4.2.9 h1:DZIh1HAhPIL3RvwEDFsmL5hfPSLEpxsQk9/Jir2vkJE=
|
||||
github.com/pion/webrtc/v4 v4.2.9/go.mod h1:9EmLZve0H76eTzf8v2FmchZ6tcBXtDgpfTEu+drW6SY=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/quic-go/go-ossfuzz-seeds v0.1.0 h1:APacT+iIaNF6fd8AGEiN3bT/Jtkd2jz4v4TzM7MFjy0=
|
||||
github.com/quic-go/go-ossfuzz-seeds v0.1.0/go.mod h1:3IOHRbJIc+L6YKMwfDtJAM9Vj9k0YY4muhuyUYk5tbk=
|
||||
github.com/quic-go/qpack v0.6.0 h1:g7W+BMYynC1LbYLSqRt8PBg5Tgwxn214ZZR34VIOjz8=
|
||||
github.com/quic-go/qpack v0.6.0/go.mod h1:lUpLKChi8njB4ty2bFLX2x4gzDqXwUpaO1DP9qMDZII=
|
||||
github.com/quic-go/quic-go v0.60.0 h1:xcQioE8OM66UQLeUMHltK1CCcOu3JbVB4JAQdDQSB+0=
|
||||
github.com/quic-go/quic-go v0.60.0/go.mod h1:wpKpjmPpftl30sL6pFh7REVpjbcCVy4zt2vDyK1TuJk=
|
||||
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
|
||||
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
|
||||
github.com/tjfoc/gmsm v1.4.1 h1:aMe1GlZb+0bLjn+cKTPEvvn9oUEBlJitaZiiBwsbgho=
|
||||
github.com/tjfoc/gmsm v1.4.1/go.mod h1:j4INPkHWMrhJb38G+J6W4Tw0AbuN8Thu3PbdVYhVcTE=
|
||||
github.com/wlynxg/anet v0.0.5 h1:J3VJGi1gvo0JwZ/P1/Yc/8p63SoW98B5dHkYDmpgvvU=
|
||||
github.com/wlynxg/anet v0.0.5/go.mod h1:eay5PRQr7fIVAMbTbchTnO9gG65Hg/uYGdc7mguHxoA=
|
||||
github.com/xtaci/kcp-go/v5 v5.6.72 h1:FLaQPalgpufJYQRk0OK+gErEhXGLUPjv6FSRPrFR8Lk=
|
||||
github.com/xtaci/kcp-go/v5 v5.6.72/go.mod h1:9O3D8WR+cyyUjGiTILYfg17vn72otWuXK2AFfqIe6CM=
|
||||
github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae h1:J0GxkO96kL4WF+AIT3M4mfUVinOCPgf2uUWYFUzN0sM=
|
||||
github.com/xtaci/lossyconn v0.0.0-20190602105132-8df528c0c9ae/go.mod h1:gXtu8J62kEgmN++bm9BVICuT/e8yiLI2KFobd/TRFsE=
|
||||
go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko=
|
||||
go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI=
|
||||
golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
|
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
|
||||
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
|
||||
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
|
||||
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
|
||||
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
|
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
@@ -0,0 +1,123 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net"
|
||||
"os"
|
||||
"os/signal"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"whitelist-bypass/relay/common"
|
||||
joiner "whitelist-bypass/relay/pion/headless-joiner-common"
|
||||
"whitelist-bypass/relay/tunnel"
|
||||
)
|
||||
|
||||
type cliStatusEmitter struct{}
|
||||
|
||||
func (cliStatusEmitter) EmitStatus(status string) { log.Printf("[status] %s", status) }
|
||||
func (cliStatusEmitter) EmitStatusError(msg string) { log.Printf("[status] ERROR: %s", msg) }
|
||||
|
||||
func resolveHostname(hostname string) (string, error) {
|
||||
if ip := net.ParseIP(hostname); ip != nil {
|
||||
return hostname, nil
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
if ips, err := net.DefaultResolver.LookupIP(ctx, "ip4", hostname); err == nil && len(ips) > 0 {
|
||||
return ips[0].String(), nil
|
||||
}
|
||||
if ips, err := net.DefaultResolver.LookupIP(ctx, "ip6", hostname); err == nil && len(ips) > 0 {
|
||||
return ips[0].String(), nil
|
||||
}
|
||||
return "", fmt.Errorf("no IPs for %s", hostname)
|
||||
}
|
||||
|
||||
func main() {
|
||||
common.MaybePrintVersion()
|
||||
link := flag.String("link", "", "Bitrix conference link https://portal/video/CODE (required)")
|
||||
displayName := flag.String("name", "Joiner", "display name in the conference")
|
||||
socksHost := flag.String("socks-host", common.SocksLocalhostIP, "SOCKS5 listen address (use 0.0.0.0 to expose on LAN)")
|
||||
socksPort := flag.Int("socks-port", 1080, "SOCKS5 listen port")
|
||||
socksUser := flag.String("socks-user", "", "SOCKS5 username (optional)")
|
||||
socksPass := flag.String("socks-pass", "", "SOCKS5 password (optional)")
|
||||
resources := flag.String("resources", "default", "resource mode: moderate, default, unlimited")
|
||||
tunnelMode := flag.String("tunnel-mode", "video", "tunnel mode: video, dc")
|
||||
vp8FPS := flag.Int("vp8-fps", 24, "VP8 frame rate (video mode only)")
|
||||
vp8Batch := flag.Int("vp8-batch", 30, "VP8 batch multiplier (video mode only)")
|
||||
dualTrack := flag.Bool("dual-track", false, "request a second screenshare download track for 2x recv throughput (video mode only)")
|
||||
reliable := flag.Bool("reliable", false, "wrap the video tunnel with KCP reliability (video mode only)")
|
||||
debugFlag := flag.Bool("debug", false, "verbose debug logging")
|
||||
flag.Parse()
|
||||
common.Debug = *debugFlag
|
||||
|
||||
if *link == "" {
|
||||
log.Fatal("--link is required")
|
||||
}
|
||||
|
||||
var memLimit int64
|
||||
switch *resources {
|
||||
case "moderate":
|
||||
memLimit = 64 << 20
|
||||
case "default":
|
||||
memLimit = 128 << 20
|
||||
case "unlimited":
|
||||
memLimit = 256 << 20
|
||||
default:
|
||||
log.Fatalf("[config] unknown resources mode: %s", *resources)
|
||||
}
|
||||
if memLimit > 0 {
|
||||
debug.SetMemoryLimit(memLimit)
|
||||
}
|
||||
|
||||
inner := joiner.NewBitrixHeadlessJoiner(log.Printf, resolveHostname, cliStatusEmitter{}, nil)
|
||||
inner.OnConnected = func(tun tunnel.DataTunnel) {
|
||||
readBuf := common.VP8BufSize
|
||||
switch tun.(type) {
|
||||
case *tunnel.DCTunnel, *tunnel.MultiTrackKCPTunnel:
|
||||
readBuf = common.DCBufSize
|
||||
}
|
||||
bridge := tunnel.NewRelayBridgeWithAuth(tun, "joiner", readBuf, log.Printf, *socksUser, *socksPass)
|
||||
bridge.SetOnConfigAck(inner.MarkConfigAcked)
|
||||
bridge.MarkReady()
|
||||
addr := fmt.Sprintf("%s:%d", *socksHost, *socksPort)
|
||||
go func() {
|
||||
if err := bridge.ListenSOCKS(addr); err != nil {
|
||||
log.Printf("socks listen: %v", err)
|
||||
}
|
||||
}()
|
||||
fmt.Printf("\n TUNNEL CONNECTED mode=%s\n socks5 -> %s\n\n", *tunnelMode, addr)
|
||||
}
|
||||
|
||||
params, _ := json.Marshal(struct {
|
||||
JoinLink string `json:"joinLink"`
|
||||
DisplayName string `json:"displayName"`
|
||||
TunnelMode string `json:"tunnelMode"`
|
||||
VP8FPS int `json:"vp8Fps"`
|
||||
VP8Batch int `json:"vp8Batch"`
|
||||
Reliable bool `json:"reliable"`
|
||||
DualTrack bool `json:"dualTrack"`
|
||||
}{
|
||||
JoinLink: strings.TrimSpace(*link),
|
||||
DisplayName: *displayName,
|
||||
TunnelMode: *tunnelMode,
|
||||
VP8FPS: *vp8FPS,
|
||||
VP8Batch: *vp8Batch,
|
||||
Reliable: *reliable,
|
||||
DualTrack: *dualTrack,
|
||||
})
|
||||
|
||||
go inner.RunWithParams(string(params))
|
||||
|
||||
sig := make(chan os.Signal, 1)
|
||||
signal.Notify(sig, os.Interrupt, syscall.SIGTERM)
|
||||
<-sig
|
||||
log.Printf("[main] shutting down")
|
||||
inner.Close()
|
||||
}
|
||||
@@ -160,6 +160,30 @@ func main() {
|
||||
}
|
||||
defer sig.Close()
|
||||
|
||||
selfID, sidErr := c.SelfUserID()
|
||||
if sidErr != nil {
|
||||
log.Printf("[bx] self user id unavailable, kick disabled: %v", sidErr)
|
||||
}
|
||||
if selfID != "" {
|
||||
if pc, perr := c.PullConfig(); perr != nil {
|
||||
log.Printf("[bx] pull config failed, kick disabled: %v", perr)
|
||||
} else {
|
||||
km := bitrix.NewKickManager(c.KickUser, selfID, log.Printf)
|
||||
pull := bitrix.NewPullClient(pc, userAgent, portal, log.Printf)
|
||||
pull.SetOnUsersAnswered(func(ids []string) {
|
||||
for _, id := range ids {
|
||||
km.OnUserJoined(id)
|
||||
}
|
||||
})
|
||||
defer pull.Close()
|
||||
go func() {
|
||||
if err := pull.Run(); err != nil {
|
||||
log.Printf("[bx] subws2 pull ended: %v", err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
ms, err := bitrix.NewMediaSession(bitrix.MediaParams{
|
||||
Signal: sig,
|
||||
Alias: alias,
|
||||
|
||||
@@ -14,7 +14,7 @@ services:
|
||||
# don't use, or remove the corresponding line.
|
||||
- ./cookies-vk.json:/data/cookies-vk.json:ro
|
||||
- ./cookies-yandex.json:/data/cookies-yandex.json:ro
|
||||
- ./cookies-wbstream.json:/data/cookies-wbstream.json:ro
|
||||
- ./cookies-wbstream.json:/data/cookies-wbstream.json
|
||||
- ./cookies-dion.json:/data/cookies-dion.json
|
||||
- ./cookies-bitrix.json:/data/cookies-bitrix.json
|
||||
# Per-session creator logs persist here.
|
||||
|
||||
@@ -986,6 +986,11 @@ func main() {
|
||||
cookieStr = strings.TrimSpace(line)
|
||||
}
|
||||
|
||||
if common.CookieValue(cookieStr, "Session_id") == "" {
|
||||
common.EmitAuthError(common.AuthErrorSessionExpired)
|
||||
log.Fatalf("[auth] cookies missing Session_id; log into Yandex and re-export via creator-app's 'Export Cookies' button")
|
||||
}
|
||||
|
||||
log.Println("[config] Fetching live config from Telemost bundle...")
|
||||
cfg, err := fetchConfig()
|
||||
if err != nil {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# e2e room reuse. Copy to .env and fill with existing conference links.
|
||||
# Empty room = platform is SKIPPED (harness refuses to create a new call).
|
||||
# To allow creating fresh rooms per run, set ALLOW_NEW_ROOMS=1.
|
||||
|
||||
ROOM_TELEMOST=""
|
||||
ROOM_WBSTREAM=""
|
||||
ROOM_DION=""
|
||||
ROOM_BITRIX=""
|
||||
|
||||
ALLOW_NEW_ROOMS=0
|
||||
@@ -0,0 +1,77 @@
|
||||
# headless e2e tests
|
||||
|
||||
End-to-end tests for the headless creators and joiners.
|
||||
|
||||
Each run starts one creator per platform and keeps it running. Joiners then
|
||||
connect to that creator one at a time, using different parameters. This tests how
|
||||
the creator adapts when joiner parameters change.
|
||||
|
||||
Each test sends a unique string through the joiner's SOCKS5 proxy, over the
|
||||
tunnel, to a listener on the creator side. The test passes if the string arrives.
|
||||
No external network is used.
|
||||
|
||||
## Platforms and scenarios
|
||||
|
||||
Platforms: telemost, wbstream, dion, bitrix. VK is not supported because it has no
|
||||
headless SOCKS joiner. A platform skips the scenarios it does not support. For
|
||||
example, dion supports only connect and kick.
|
||||
|
||||
| Scenario | Joiner |
|
||||
|----------|--------|
|
||||
| connect | Default video tunnel. |
|
||||
| dc | `--tunnel-mode dc`. |
|
||||
| kcp | `--reliable` (KCP). |
|
||||
| dual | `--dual-track`. |
|
||||
| kick | Two joiners. The first is expected to be kicked. |
|
||||
|
||||
## Rooms
|
||||
|
||||
Copy `.env.example` to `.env`. Set `ROOM_<PLATFORM>` to an existing conference link
|
||||
for each platform you want to test.
|
||||
|
||||
If a room is empty, the harness skips that platform. It does not create a new
|
||||
conference. To create new conferences, set `ALLOW_NEW_ROOMS=1`.
|
||||
|
||||
## Cookies
|
||||
|
||||
Each platform reads `cookies-<platform>.json` from the repository root. Export
|
||||
these from the desktop creator app. If a cookie file is missing, the harness skips
|
||||
that platform.
|
||||
|
||||
## Run in Docker
|
||||
|
||||
The creator and joiner run in separate network namespaces so their WebRTC ICE does
|
||||
not collide. This requires Docker.
|
||||
|
||||
cd headless/tests/stand
|
||||
./stand.sh build
|
||||
./stand.sh run
|
||||
./stand.sh run bitrix dc kick
|
||||
./stand.sh sh
|
||||
|
||||
`build` cross-compiles the Linux binaries and builds the image. `run` runs the
|
||||
tests; with no arguments it runs every supported platform and scenario. `run`
|
||||
mounts the cookie files from the repository root, so refreshed tokens are written
|
||||
back to them. `sh` opens a shell in the container.
|
||||
|
||||
## Run on the host
|
||||
|
||||
./build-headless.sh
|
||||
./headless/tests/run.sh
|
||||
./headless/tests/run.sh bitrix
|
||||
|
||||
Run `build-headless.sh` from the repository root first. Same-host WebRTC video can
|
||||
fail because the creator and joiner share an IP address. Use the Docker method for
|
||||
the video scenarios.
|
||||
|
||||
## Environment variables
|
||||
|
||||
| Variable | Description |
|
||||
|----------|-------------|
|
||||
| `FAIL_FAST` | Stop at the first failure. Default `1`. Set to `0` to run all tests. |
|
||||
| `CREATE_TIMEOUT` | Seconds to wait for the creator to start. |
|
||||
| `CONNECT_TIMEOUT` | Seconds to wait for a joiner's SOCKS port. |
|
||||
| `PROBE_TIMEOUT` | Seconds to wait for tunnel traffic. |
|
||||
| `KICK_TIMEOUT` | Seconds to wait for a kick to take effect. |
|
||||
| `PORT_BASE` | First local port to allocate. |
|
||||
| `COOKIES_DIR` | Directory that holds the cookie files. |
|
||||
@@ -0,0 +1,182 @@
|
||||
set -u
|
||||
|
||||
PASS_N=0
|
||||
FAIL_N=0
|
||||
SKIP_N=0
|
||||
RESULTS=""
|
||||
FAIL_FAST="${FAIL_FAST:-1}"
|
||||
ABORT_RUN=0
|
||||
CHILD_PIDS=""
|
||||
JOINER_PIDS=""
|
||||
SINK_PID=""
|
||||
SINK_PORT=""
|
||||
SINK_FILE=""
|
||||
SINK_WRAP="${SINK_WRAP:-}"
|
||||
SINK_BIND="${SINK_BIND:-127.0.0.1}"
|
||||
SINK_TARGET="${SINK_TARGET:-127.0.0.1}"
|
||||
PROBE_HOST="${PROBE_HOST:-127.0.0.1}"
|
||||
PORT_CURSOR="${PORT_BASE:-21080}"
|
||||
|
||||
PROBE_CAP=""
|
||||
if command -v timeout >/dev/null 2>&1; then
|
||||
PROBE_CAP="timeout 5"
|
||||
elif command -v gtimeout >/dev/null 2>&1; then
|
||||
PROBE_CAP="gtimeout 5"
|
||||
fi
|
||||
ALLOC_PORT=""
|
||||
PROBE_SEQ=0
|
||||
|
||||
log() { printf '%s\n' "$*" >&2; }
|
||||
|
||||
die() {
|
||||
log "FATAL: $*"
|
||||
exit 2
|
||||
}
|
||||
|
||||
require_bin() {
|
||||
[ -x "$1" ] || die "missing binary $1 (run ./build-headless.sh)"
|
||||
}
|
||||
|
||||
require_cmd() {
|
||||
command -v "$1" >/dev/null 2>&1 || die "missing command $1"
|
||||
}
|
||||
|
||||
track_pid() { CHILD_PIDS="$CHILD_PIDS $1"; }
|
||||
|
||||
proc_alive() { kill -0 "$1" 2>/dev/null; }
|
||||
|
||||
track_joiner() { JOINER_PIDS="$JOINER_PIDS $1"; }
|
||||
|
||||
alloc_port() {
|
||||
while nc -z 127.0.0.1 "$PORT_CURSOR" 2>/dev/null; do
|
||||
PORT_CURSOR=$((PORT_CURSOR + 1))
|
||||
done
|
||||
ALLOC_PORT="$PORT_CURSOR"
|
||||
PORT_CURSOR=$((PORT_CURSOR + 1))
|
||||
}
|
||||
|
||||
start_sink() {
|
||||
alloc_port
|
||||
SINK_PORT="$ALLOC_PORT"
|
||||
SINK_FILE=$(mktemp -t e2e-sink.XXXXXX)
|
||||
$SINK_WRAP ncat -l -k "$SINK_BIND" "$SINK_PORT" >"$SINK_FILE" 2>/dev/null &
|
||||
SINK_PID=$!
|
||||
track_pid "$SINK_PID"
|
||||
sleep 1
|
||||
}
|
||||
|
||||
stop_sink() {
|
||||
[ -n "$SINK_PID" ] && kill "$SINK_PID" 2>/dev/null
|
||||
SINK_PID=""
|
||||
}
|
||||
|
||||
kill_joiners() {
|
||||
for _p in $JOINER_PIDS; do kill "$_p" 2>/dev/null; done
|
||||
for _p in $JOINER_PIDS; do wait "$_p" 2>/dev/null; done
|
||||
JOINER_PIDS=""
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
stop_sink
|
||||
for _p in $CHILD_PIDS; do kill "$_p" 2>/dev/null; done
|
||||
wait 2>/dev/null
|
||||
}
|
||||
|
||||
now() { date +%s; }
|
||||
|
||||
wait_join_link() {
|
||||
_lf="$1"
|
||||
_to="$2"
|
||||
_pid="${3:-}"
|
||||
_end=$(($(now) + _to))
|
||||
while [ "$(now)" -lt "$_end" ]; do
|
||||
_l=$(grep -m1 "join_link:" "$_lf" 2>/dev/null | sed 's/.*join_link:[[:space:]]*//')
|
||||
if [ -n "$_l" ]; then
|
||||
echo "$_l"
|
||||
return 0
|
||||
fi
|
||||
if [ -n "$_pid" ] && ! proc_alive "$_pid"; then
|
||||
return 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_log_re() {
|
||||
_lf="$1"
|
||||
_re="$2"
|
||||
_to="$3"
|
||||
_pid="${4:-}"
|
||||
_end=$(($(now) + _to))
|
||||
while [ "$(now)" -lt "$_end" ]; do
|
||||
grep -qE "$_re" "$_lf" 2>/dev/null && return 0
|
||||
if [ -n "$_pid" ] && ! proc_alive "$_pid"; then
|
||||
return 1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
wait_socks() {
|
||||
_port="$1"
|
||||
_to="$2"
|
||||
_end=$(($(now) + _to))
|
||||
while [ "$(now)" -lt "$_end" ]; do
|
||||
nc -z "$PROBE_HOST" "$_port" 2>/dev/null && return 0
|
||||
sleep 1
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
probe_once() {
|
||||
_sp="$1"
|
||||
_nonce="ping-$_sp-$PROBE_SEQ"
|
||||
PROBE_SEQ=$((PROBE_SEQ + 1))
|
||||
printf '%s\n' "$_nonce" | $PROBE_CAP ncat --send-only -w 4 --proxy "$PROBE_HOST:$_sp" --proxy-type socks5 "$SINK_TARGET" "$SINK_PORT" >/dev/null 2>&1
|
||||
sleep 1
|
||||
grep -q "$_nonce" "$SINK_FILE" 2>/dev/null
|
||||
}
|
||||
|
||||
probe_ready() {
|
||||
_sp="$1"
|
||||
_to="$2"
|
||||
_end=$(($(now) + _to))
|
||||
while [ "$(now)" -lt "$_end" ]; do
|
||||
probe_once "$_sp" && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
probe_dies() {
|
||||
_sp="$1"
|
||||
_to="$2"
|
||||
_end=$(($(now) + _to))
|
||||
while [ "$(now)" -lt "$_end" ]; do
|
||||
probe_once "$_sp" || return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
record() {
|
||||
case "$1" in
|
||||
PASS) PASS_N=$((PASS_N + 1)) ;;
|
||||
FAIL)
|
||||
FAIL_N=$((FAIL_N + 1))
|
||||
[ "$FAIL_FAST" = "1" ] && ABORT_RUN=1
|
||||
;;
|
||||
SKIP) SKIP_N=$((SKIP_N + 1)) ;;
|
||||
esac
|
||||
RESULTS="$RESULTS
|
||||
$1 $2"
|
||||
}
|
||||
|
||||
summary() {
|
||||
log ""
|
||||
log "=== summary ==="
|
||||
printf '%s\n' "$RESULTS" | sed '/^[[:space:]]*$/d' >&2
|
||||
log ""
|
||||
log "passed=$PASS_N failed=$FAIL_N skipped=$SKIP_N"
|
||||
[ "$FAIL_N" -eq 0 ]
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
set -u
|
||||
|
||||
cookies_path() {
|
||||
_p="$1"
|
||||
case "$_p" in
|
||||
telemost) _f="cookies-yandex.json" ;;
|
||||
wbstream) _f="cookies-wbstream.json" ;;
|
||||
dion) _f="cookies-dion.json" ;;
|
||||
bitrix) _f="cookies-bitrix.json" ;;
|
||||
*) _f="cookies-$_p.json" ;;
|
||||
esac
|
||||
_envname=$(printf 'COOKIES_%s' "$(echo "$_p" | tr 'a-z' 'A-Z')")
|
||||
eval "_override=\${$_envname:-}"
|
||||
if [ -n "$_override" ]; then
|
||||
echo "$_override"
|
||||
else
|
||||
echo "${COOKIES_DIR:-$E2E_ROOT}/$_f"
|
||||
fi
|
||||
}
|
||||
|
||||
room_value() {
|
||||
_envname=$(printf 'ROOM_%s' "$(echo "$1" | tr 'a-z' 'A-Z')")
|
||||
eval "_v=\${$_envname:-}"
|
||||
echo "$_v"
|
||||
}
|
||||
|
||||
pf_select() {
|
||||
PF_NAME="$1"
|
||||
case "$1" in
|
||||
telemost)
|
||||
PF_CREATOR="$HEADLESS/telemost/headless-telemost-creator"
|
||||
PF_JOINER="$HEADLESS/telemost-joiner/headless-telemost-joiner"
|
||||
PF_LINK_FLAG="--tm-link"
|
||||
PF_CREATOR_ROOM_FLAG="--tm-link"
|
||||
PF_READY_RE="\[tm-ws\] Connected"
|
||||
PF_CAPS="connect kcp dual kick"
|
||||
;;
|
||||
wbstream)
|
||||
PF_CREATOR="$HEADLESS/wbstream/headless-wbstream-creator"
|
||||
PF_JOINER="$HEADLESS/wbstream-joiner/headless-wbstream-joiner"
|
||||
PF_LINK_FLAG="--room"
|
||||
PF_CREATOR_ROOM_FLAG="--room"
|
||||
PF_READY_RE="pub PC state: connected"
|
||||
PF_CAPS="connect dc kcp dual kick"
|
||||
;;
|
||||
dion)
|
||||
PF_CREATOR="$HEADLESS/dion/headless-dion-creator"
|
||||
PF_JOINER="$HEADLESS/dion-joiner/headless-dion-joiner"
|
||||
PF_LINK_FLAG="--room"
|
||||
PF_CREATOR_ROOM_FLAG="--room"
|
||||
PF_READY_RE="\[ice\] connected"
|
||||
PF_CAPS="connect kick"
|
||||
;;
|
||||
bitrix)
|
||||
PF_CREATOR="$HEADLESS/bitrix/headless-bitrix-creator"
|
||||
PF_JOINER="$HEADLESS/bitrix-joiner/headless-bitrix-joiner"
|
||||
PF_LINK_FLAG="--link"
|
||||
PF_CREATOR_ROOM_FLAG="--room"
|
||||
PF_READY_RE="pub PC state: connected"
|
||||
PF_CAPS="connect dc kcp dual kick"
|
||||
;;
|
||||
*)
|
||||
die "unknown platform: $1"
|
||||
;;
|
||||
esac
|
||||
PF_COOKIES=$(cookies_path "$1")
|
||||
PF_ROOM=$(room_value "$1")
|
||||
}
|
||||
|
||||
pf_variant_flags() {
|
||||
case "$1" in
|
||||
dc) echo "--tunnel-mode dc" ;;
|
||||
kcp) echo "--reliable" ;;
|
||||
dual) echo "--dual-track" ;;
|
||||
*) echo "" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
pf_has_cap() {
|
||||
for _c in $PF_CAPS; do
|
||||
[ "$_c" = "$1" ] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
#!/bin/sh
|
||||
set -u
|
||||
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
E2E_ROOT="$(cd "$DIR/../.." && pwd)"
|
||||
HEADLESS="$E2E_ROOT/headless"
|
||||
|
||||
[ -f "$DIR/.env" ] && . "$DIR/.env"
|
||||
|
||||
. "$DIR/lib.sh"
|
||||
. "$DIR/platforms.sh"
|
||||
. "$DIR/scenarios.sh"
|
||||
|
||||
CREATE_TIMEOUT="${CREATE_TIMEOUT:-45}"
|
||||
CONNECT_TIMEOUT="${CONNECT_TIMEOUT:-45}"
|
||||
PROBE_TIMEOUT="${PROBE_TIMEOUT:-20}"
|
||||
KICK_TIMEOUT="${KICK_TIMEOUT:-30}"
|
||||
|
||||
ALL_PLATFORMS="telemost wbstream dion bitrix"
|
||||
ALL_SCENARIOS="connect dc kcp dual kick"
|
||||
|
||||
usage() {
|
||||
cat >&2 <<EOF
|
||||
Usage: $0 [platform...] [scenario...]
|
||||
|
||||
Live end-to-end harness: brings up a headless creator, connects one or more
|
||||
headless joiners, and proves each tunnel by echoing a nonce through the joiner's
|
||||
SOCKS5 to a local sink (no external network, no rate limits).
|
||||
|
||||
Platforms: $ALL_PLATFORMS
|
||||
Scenarios: $ALL_SCENARIOS
|
||||
connect one joiner, default video tunnel
|
||||
dc one joiner, --tunnel-mode dc
|
||||
kcp one joiner, --reliable (KCP)
|
||||
dual one joiner, --dual-track
|
||||
kick two joiners on one room, expect the first to be kicked
|
||||
|
||||
No args runs every applicable scenario on every platform. Unsupported
|
||||
platform/scenario pairs are skipped.
|
||||
|
||||
Cookies: COOKIES_DIR (default repo root) holds cookies-<platform>.json, or set
|
||||
COOKIES_<PLATFORM> to a explicit path. Missing cookies skip that platform.
|
||||
|
||||
Env: CREATE_TIMEOUT CONNECT_TIMEOUT PROBE_TIMEOUT KICK_TIMEOUT PORT_BASE
|
||||
|
||||
Examples:
|
||||
$0
|
||||
$0 bitrix
|
||||
$0 wbstream dc kick
|
||||
EOF
|
||||
}
|
||||
|
||||
RUN_PLATFORMS=""
|
||||
RUN_SCENARIOS=""
|
||||
|
||||
for _arg in "$@"; do
|
||||
case "$_arg" in
|
||||
-h | --help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
telemost | wbstream | dion | bitrix)
|
||||
RUN_PLATFORMS="$RUN_PLATFORMS $_arg"
|
||||
;;
|
||||
connect | dc | kcp | dual | kick)
|
||||
RUN_SCENARIOS="$RUN_SCENARIOS $_arg"
|
||||
;;
|
||||
*)
|
||||
log "unknown argument: $_arg"
|
||||
usage
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ -n "$RUN_PLATFORMS" ] || RUN_PLATFORMS="$ALL_PLATFORMS"
|
||||
[ -n "$RUN_SCENARIOS" ] || RUN_SCENARIOS="$ALL_SCENARIOS"
|
||||
|
||||
require_cmd nc
|
||||
require_cmd ncat
|
||||
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
start_sink
|
||||
log "sink on 127.0.0.1:$SINK_PORT"
|
||||
|
||||
for _pf in $RUN_PLATFORMS; do
|
||||
run_platform "$_pf"
|
||||
[ "$ABORT_RUN" = "1" ] && break
|
||||
done
|
||||
|
||||
summary
|
||||
@@ -0,0 +1,188 @@
|
||||
set -u
|
||||
|
||||
CREATOR_WRAP="${CREATOR_WRAP:-}"
|
||||
JOINER_WRAP="${JOINER_WRAP:-}"
|
||||
JOINER_SOCKS_HOST="${JOINER_SOCKS_HOST:-127.0.0.1}"
|
||||
|
||||
run_platform() {
|
||||
pf_select "$1"
|
||||
require_bin "$PF_CREATOR"
|
||||
require_bin "$PF_JOINER"
|
||||
if [ ! -f "$PF_COOKIES" ]; then
|
||||
log "=== $1 SKIP (cookies not found at $PF_COOKIES) ==="
|
||||
record SKIP "$1 (cookies missing)"
|
||||
return
|
||||
fi
|
||||
if [ -z "$PF_ROOM" ] && [ "${ALLOW_NEW_ROOMS:-0}" != "1" ]; then
|
||||
log "=== $1 SKIP (no ROOM_$(echo "$1" | tr 'a-z' 'A-Z') set; refusing to create a new room. Set it in .env or pass ALLOW_NEW_ROOMS=1) ==="
|
||||
record SKIP "$1 (no room)"
|
||||
return
|
||||
fi
|
||||
if ! start_creator; then
|
||||
record FAIL "$1 (creator)"
|
||||
return
|
||||
fi
|
||||
for _s in $RUN_SCENARIOS; do
|
||||
if ! proc_alive "$CREATOR_PID"; then
|
||||
log "=== $1 ABORT: creator died mid-run ==="
|
||||
record FAIL "$1 (creator died)"
|
||||
break
|
||||
fi
|
||||
case "$_s" in
|
||||
connect) sc_connect ;;
|
||||
dc) sc_params dc ;;
|
||||
kcp) sc_params kcp ;;
|
||||
dual) sc_params dual ;;
|
||||
kick) sc_kick ;;
|
||||
esac
|
||||
kill_joiners
|
||||
[ "$ABORT_RUN" = "1" ] && {
|
||||
log "=== $1 ABORT: scenario failed (fail-fast); stopping ==="
|
||||
break
|
||||
}
|
||||
sleep 1
|
||||
done
|
||||
stop_creator
|
||||
}
|
||||
|
||||
start_creator() {
|
||||
CREATOR_LOG=$(mktemp -t e2e-creator.XXXXXX)
|
||||
_room_args=""
|
||||
if [ -n "$PF_ROOM" ]; then
|
||||
_room_args="$PF_CREATOR_ROOM_FLAG $PF_ROOM"
|
||||
log " reusing room: $PF_ROOM"
|
||||
fi
|
||||
$CREATOR_WRAP "$PF_CREATOR" --cookies "$PF_COOKIES" $_room_args --allow-private-dst >"$CREATOR_LOG" 2>&1 &
|
||||
CREATOR_PID=$!
|
||||
track_pid "$CREATOR_PID"
|
||||
if ! JOIN_LINK=$(wait_join_link "$CREATOR_LOG" "$CREATE_TIMEOUT" "$CREATOR_PID"); then
|
||||
if proc_alive "$CREATOR_PID"; then
|
||||
log " creator did not print join_link in ${CREATE_TIMEOUT}s"
|
||||
else
|
||||
log " creator exited before join_link (fatal)"
|
||||
fi
|
||||
tail -15 "$CREATOR_LOG" >&2
|
||||
return 1
|
||||
fi
|
||||
log " join_link=$JOIN_LINK"
|
||||
if ! wait_log_re "$CREATOR_LOG" "$PF_READY_RE" "$CREATE_TIMEOUT" "$CREATOR_PID"; then
|
||||
if proc_alive "$CREATOR_PID"; then
|
||||
log " creator did not reach ready state ($PF_READY_RE) in ${CREATE_TIMEOUT}s"
|
||||
else
|
||||
log " creator exited before ready state (fatal)"
|
||||
fi
|
||||
tail -15 "$CREATOR_LOG" >&2
|
||||
return 1
|
||||
fi
|
||||
log " creator up on SFU, room stays for all scenarios"
|
||||
sleep 1
|
||||
return 0
|
||||
}
|
||||
|
||||
stop_creator() {
|
||||
[ -n "${CREATOR_PID:-}" ] && kill "$CREATOR_PID" 2>/dev/null
|
||||
CREATOR_PID=""
|
||||
}
|
||||
|
||||
dump_logs() {
|
||||
log " --- creator tail ---"
|
||||
tail -20 "$CREATOR_LOG" >&2
|
||||
log " --- joiner tail ---"
|
||||
tail -20 "$JOINER_LOG" >&2
|
||||
}
|
||||
|
||||
dump_kick_logs() {
|
||||
log " --- creator kick events ---"
|
||||
grep -nE '\[kick\]|kicked previous|active call guest|kick failed|usersAnswered|kicked stale peer|kick_one' "$CREATOR_LOG" 2>/dev/null | tail -20 >&2
|
||||
log " --- joiner A kick-watch ---"
|
||||
grep -nE 'subws2|pull config|kick-detect|kicked from|shutting down|chatUserLeave|you_kicked|server kicked' "$_log_a" 2>/dev/null | tail -20 >&2
|
||||
}
|
||||
|
||||
start_joiner() {
|
||||
_variant="$1"
|
||||
alloc_port
|
||||
JOINER_PORT="$ALLOC_PORT"
|
||||
JOINER_LOG=$(mktemp -t e2e-joiner.XXXXXX)
|
||||
_flags=$(pf_variant_flags "$_variant")
|
||||
$JOINER_WRAP "$PF_JOINER" "$PF_LINK_FLAG" "$JOIN_LINK" --socks-host "$JOINER_SOCKS_HOST" --socks-port "$JOINER_PORT" $_flags >"$JOINER_LOG" 2>&1 &
|
||||
JOINER_PID=$!
|
||||
track_pid "$JOINER_PID"
|
||||
track_joiner "$JOINER_PID"
|
||||
}
|
||||
|
||||
joiner_up() {
|
||||
wait_socks "$1" "$CONNECT_TIMEOUT" && probe_ready "$1" "$PROBE_TIMEOUT"
|
||||
}
|
||||
|
||||
sc_connect() {
|
||||
_name="$PF_NAME/connect"
|
||||
log "=== $_name ==="
|
||||
start_joiner connect
|
||||
if joiner_up "$JOINER_PORT"; then
|
||||
record PASS "$_name"
|
||||
else
|
||||
log " joiner did not carry traffic"
|
||||
dump_logs
|
||||
record FAIL "$_name"
|
||||
fi
|
||||
}
|
||||
|
||||
sc_params() {
|
||||
_variant="$1"
|
||||
_name="$PF_NAME/params:$_variant"
|
||||
if ! pf_has_cap "$_variant"; then
|
||||
log "=== $_name SKIP (unsupported) ==="
|
||||
record SKIP "$_name"
|
||||
return
|
||||
fi
|
||||
log "=== $_name ==="
|
||||
start_joiner "$_variant"
|
||||
if joiner_up "$JOINER_PORT"; then
|
||||
record PASS "$_name"
|
||||
else
|
||||
log " joiner did not carry traffic"
|
||||
dump_logs
|
||||
record FAIL "$_name"
|
||||
fi
|
||||
}
|
||||
|
||||
sc_kick() {
|
||||
_name="$PF_NAME/kick"
|
||||
if ! pf_has_cap kick; then
|
||||
log "=== $_name SKIP ==="
|
||||
record SKIP "$_name"
|
||||
return
|
||||
fi
|
||||
log "=== $_name ==="
|
||||
_kv=connect
|
||||
pf_has_cap dc && _kv=dc
|
||||
start_joiner "$_kv"
|
||||
_port_a="$JOINER_PORT"
|
||||
_log_a="$JOINER_LOG"
|
||||
if ! joiner_up "$_port_a"; then
|
||||
log " joiner A never carried traffic; tail:"
|
||||
tail -15 "$_log_a" >&2
|
||||
dump_kick_logs
|
||||
record FAIL "$_name (A up)"
|
||||
return
|
||||
fi
|
||||
log " joiner A up on $_port_a, joining second joiner"
|
||||
start_joiner "$_kv"
|
||||
_port_b="$JOINER_PORT"
|
||||
_log_b="$JOINER_LOG"
|
||||
if ! joiner_up "$_port_b"; then
|
||||
log " joiner B never carried traffic; tail:"
|
||||
tail -15 "$_log_b" >&2
|
||||
dump_kick_logs
|
||||
record FAIL "$_name (B up)"
|
||||
return
|
||||
fi
|
||||
log " joiner B up on $_port_b, expecting A to be kicked"
|
||||
if probe_dies "$_port_a" "$KICK_TIMEOUT" && probe_once "$_port_b"; then
|
||||
record PASS "$_name"
|
||||
else
|
||||
log " expected A kicked while B holds the tunnel"
|
||||
dump_kick_logs
|
||||
record FAIL "$_name"
|
||||
fi
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
iproute2 iptables ncat ca-certificates procps \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY work /work
|
||||
RUN chmod +x /work/headless/*/headless-* \
|
||||
/work/headless/tests/*.sh \
|
||||
/work/headless/tests/stand/*.sh
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
Executable
+68
@@ -0,0 +1,68 @@
|
||||
#!/bin/sh
|
||||
set -u
|
||||
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
E2E_ROOT="${E2E_ROOT:-/work}"
|
||||
HEADLESS="$E2E_ROOT/headless"
|
||||
E2E_DIR="$HEADLESS/tests"
|
||||
|
||||
[ -f "$E2E_DIR/.env" ] && . "$E2E_DIR/.env"
|
||||
|
||||
. "$E2E_DIR/lib.sh"
|
||||
. "$E2E_DIR/platforms.sh"
|
||||
. "$E2E_DIR/scenarios.sh"
|
||||
. "$DIR/netns.sh"
|
||||
|
||||
CREATE_TIMEOUT="${CREATE_TIMEOUT:-45}"
|
||||
CONNECT_TIMEOUT="${CONNECT_TIMEOUT:-45}"
|
||||
PROBE_TIMEOUT="${PROBE_TIMEOUT:-25}"
|
||||
KICK_TIMEOUT="${KICK_TIMEOUT:-30}"
|
||||
|
||||
ALL_PLATFORMS="telemost wbstream dion bitrix"
|
||||
ALL_SCENARIOS="connect dc kcp dual kick"
|
||||
|
||||
RUN_PLATFORMS=""
|
||||
RUN_SCENARIOS=""
|
||||
for _arg in "$@"; do
|
||||
case "$_arg" in
|
||||
telemost | wbstream | dion | bitrix) RUN_PLATFORMS="$RUN_PLATFORMS $_arg" ;;
|
||||
connect | dc | kcp | dual | kick) RUN_SCENARIOS="$RUN_SCENARIOS $_arg" ;;
|
||||
*)
|
||||
log "unknown argument: $_arg"
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
[ -n "$RUN_PLATFORMS" ] || RUN_PLATFORMS="$ALL_PLATFORMS"
|
||||
[ -n "$RUN_SCENARIOS" ] || RUN_SCENARIOS="$ALL_SCENARIOS"
|
||||
|
||||
require_cmd nc
|
||||
require_cmd ncat
|
||||
require_cmd ip
|
||||
require_cmd iptables
|
||||
|
||||
CREATOR_WRAP="ip netns exec creator"
|
||||
JOINER_WRAP="ip netns exec joiner"
|
||||
JOINER_SOCKS_HOST="0.0.0.0"
|
||||
PROBE_HOST="10.201.2.2"
|
||||
SINK_WRAP="ip netns exec creator"
|
||||
SINK_BIND="127.0.0.1"
|
||||
SINK_TARGET="127.0.0.1"
|
||||
|
||||
cleanup_all() {
|
||||
cleanup
|
||||
teardown_ns
|
||||
}
|
||||
trap cleanup_all EXIT INT TERM
|
||||
|
||||
setup_ns creator 1
|
||||
setup_ns joiner 2
|
||||
start_sink
|
||||
log "netns creator=10.201.1.2 joiner=10.201.2.2 sink=creator:$SINK_PORT"
|
||||
|
||||
for _pf in $RUN_PLATFORMS; do
|
||||
run_platform "$_pf"
|
||||
[ "$ABORT_RUN" = "1" ] && break
|
||||
done
|
||||
|
||||
summary
|
||||
@@ -0,0 +1,37 @@
|
||||
set -u
|
||||
|
||||
NETNS_CREATED=""
|
||||
|
||||
setup_ns() {
|
||||
_name="$1"
|
||||
_sub="$2"
|
||||
_gw="10.201.$_sub.1"
|
||||
_addr="10.201.$_sub.2"
|
||||
ip netns add "$_name"
|
||||
ip link add "veth-$_name" type veth peer name "peer-$_name"
|
||||
ip link set "peer-$_name" netns "$_name"
|
||||
ip addr add "$_gw/30" dev "veth-$_name"
|
||||
ip link set "veth-$_name" up
|
||||
ip netns exec "$_name" ip link set "peer-$_name" name eth0
|
||||
ip netns exec "$_name" ip link set lo up
|
||||
ip netns exec "$_name" ip addr add "$_addr/30" dev eth0
|
||||
ip netns exec "$_name" ip link set eth0 up
|
||||
ip netns exec "$_name" ip route add default via "$_gw"
|
||||
iptables -t nat -A POSTROUTING -s "$_addr/32" -j MASQUERADE
|
||||
mkdir -p "/etc/netns/$_name"
|
||||
_ns=$(grep '^nameserver' /etc/resolv.conf | grep -v ' 127\.' || true)
|
||||
[ -n "$_ns" ] || _ns="nameserver 1.1.1.1"
|
||||
printf '%s\n' "$_ns" >"/etc/netns/$_name/resolv.conf"
|
||||
NETNS_CREATED="$NETNS_CREATED $_name:$_addr"
|
||||
}
|
||||
|
||||
teardown_ns() {
|
||||
for _entry in $NETNS_CREATED; do
|
||||
_name="${_entry%%:*}"
|
||||
_addr="${_entry#*:}"
|
||||
iptables -t nat -D POSTROUTING -s "$_addr/32" -j MASQUERADE 2>/dev/null
|
||||
ip netns delete "$_name" 2>/dev/null
|
||||
rm -rf "/etc/netns/$_name"
|
||||
done
|
||||
NETNS_CREATED=""
|
||||
}
|
||||
Executable
+89
@@ -0,0 +1,89 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
REPO="$(cd "$DIR/../../.." && pwd)"
|
||||
E2E="$REPO/headless/tests"
|
||||
CTX="$DIR/.context"
|
||||
IMAGE=wlb-e2e-stand
|
||||
|
||||
COMPONENTS="\
|
||||
telemost/headless-telemost-creator \
|
||||
wbstream/headless-wbstream-creator \
|
||||
dion/headless-dion-creator \
|
||||
bitrix/headless-bitrix-creator \
|
||||
telemost-joiner/headless-telemost-joiner \
|
||||
wbstream-joiner/headless-wbstream-joiner \
|
||||
dion-joiner/headless-dion-joiner \
|
||||
bitrix-joiner/headless-bitrix-joiner"
|
||||
|
||||
usage() {
|
||||
cat >&2 <<EOF
|
||||
Usage: stand.sh build | run [platform...] [scenario...] | sh
|
||||
|
||||
Dockerized live e2e: each of creator and joiner runs in its own network
|
||||
namespace (distinct IP), so same-host WebRTC ICE does not collide. Traffic is
|
||||
proved by echoing a nonce through the joiner's SOCKS5 to a sink on the creator's
|
||||
loopback - no external network, no rate limits.
|
||||
|
||||
build cross-build linux binaries, stage cookies, docker build
|
||||
run run the netns harness in a privileged container
|
||||
sh drop into a shell in the container for debugging
|
||||
|
||||
Platforms: telemost wbstream dion bitrix (VK has no headless SOCKS joiner)
|
||||
Scenarios: connect dc kcp dual kick
|
||||
|
||||
Cookies are taken from cookies-<platform>.json at the repo root at build time.
|
||||
Rebuild after refreshing cookies. Examples:
|
||||
stand.sh build
|
||||
stand.sh run
|
||||
stand.sh run bitrix dc kick
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
|
||||
build_context() {
|
||||
arch=$(docker version --format '{{.Server.Arch}}' 2>/dev/null || echo arm64)
|
||||
rm -rf "$CTX"
|
||||
mkdir -p "$CTX/work/headless/tests/stand"
|
||||
for spec in $COMPONENTS; do
|
||||
d="${spec%%/*}"
|
||||
b="${spec##*/}"
|
||||
mkdir -p "$CTX/work/headless/$d"
|
||||
echo "building $b (linux/$arch)..."
|
||||
GOOS=linux GOARCH="$arch" CGO_ENABLED=0 \
|
||||
go -C "$REPO/headless/$d" build -trimpath -ldflags="-s -w" -o "$CTX/work/headless/$d/$b" .
|
||||
done
|
||||
cp "$E2E/lib.sh" "$E2E/platforms.sh" "$E2E/scenarios.sh" "$CTX/work/headless/tests/"
|
||||
[ -f "$E2E/.env" ] && cp "$E2E/.env" "$CTX/work/headless/tests/"
|
||||
cp "$DIR/netns.sh" "$DIR/netns-run.sh" "$CTX/work/headless/tests/stand/"
|
||||
cp "$DIR/Dockerfile" "$CTX/Dockerfile"
|
||||
}
|
||||
|
||||
case "${1:-}" in
|
||||
build)
|
||||
build_context
|
||||
docker build -t "$IMAGE" "$CTX"
|
||||
echo "built $IMAGE"
|
||||
;;
|
||||
run)
|
||||
shift
|
||||
cookie_mounts=""
|
||||
for c in vk yandex wbstream dion bitrix; do
|
||||
f="$REPO/cookies-$c.json"
|
||||
[ -f "$f" ] && cookie_mounts="$cookie_mounts -v $f:/cookies/cookies-$c.json"
|
||||
done
|
||||
docker run --rm --cap-add=NET_ADMIN --cap-add=SYS_ADMIN \
|
||||
-e FAIL_FAST="${FAIL_FAST:-1}" \
|
||||
-e COOKIES_DIR=/cookies \
|
||||
$cookie_mounts \
|
||||
"$IMAGE" /work/headless/tests/stand/netns-run.sh "$@"
|
||||
;;
|
||||
sh)
|
||||
docker run --rm -it --cap-add=NET_ADMIN --cap-add=SYS_ADMIN \
|
||||
"$IMAGE" /bin/bash
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
@@ -1,93 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Smoke test for headless-telemost-creator -tm-link: create a conference,
|
||||
# then a second creator joins the same conference URI.
|
||||
#
|
||||
# Usage: ./test-telemost-join-existing.sh <path-to-cookies.json>
|
||||
|
||||
set -u
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
CREATOR="$ROOT/headless/telemost/headless-telemost-creator"
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <path-to-cookies.json>" >&2
|
||||
exit 2
|
||||
fi
|
||||
COOKIES="$1"
|
||||
SETTLE_TIMEOUT=30
|
||||
|
||||
[ -x "$CREATOR" ] || { echo "FAIL: $CREATOR not built, run ./build-headless.sh" >&2; exit 2; }
|
||||
[ -f "$COOKIES" ] || { echo "FAIL: cookies not found at: $COOKIES" >&2; exit 2; }
|
||||
echo "cookies: $COOKIES"
|
||||
|
||||
PHASE1_LOG=$(mktemp -t tm-create.XXXXXX.log)
|
||||
PHASE2_LOG=$(mktemp -t tm-join.XXXXXX.log)
|
||||
P1_PID=""
|
||||
P2_PID=""
|
||||
|
||||
cleanup() {
|
||||
[ -n "$P2_PID" ] && kill "$P2_PID" 2>/dev/null
|
||||
[ -n "$P1_PID" ] && kill "$P1_PID" 2>/dev/null
|
||||
wait 2>/dev/null
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
echo "=== phase 1: create conference ==="
|
||||
"$CREATOR" -cookies "$COOKIES" > "$PHASE1_LOG" 2>&1 &
|
||||
P1_PID=$!
|
||||
|
||||
waited=0
|
||||
JOIN_LINK=""
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
JOIN_LINK=$(grep -m1 -oE "https://telemost\.yandex\.[a-z]+/j/[A-Za-z0-9_-]+" "$PHASE1_LOG" | head -1)
|
||||
[ -n "$JOIN_LINK" ] && break
|
||||
if ! kill -0 "$P1_PID" 2>/dev/null; then
|
||||
echo "FAIL: phase 1 process died" >&2
|
||||
tail -20 "$PHASE1_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
if [ -z "$JOIN_LINK" ]; then
|
||||
echo "FAIL: phase 1 did not print join_link within ${SETTLE_TIMEOUT}s" >&2
|
||||
tail -20 "$PHASE1_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "phase 1 join_link: $JOIN_LINK"
|
||||
|
||||
sleep 3
|
||||
|
||||
echo ""
|
||||
echo "=== phase 2: join existing conference via -tm-link ==="
|
||||
"$CREATOR" -cookies "$COOKIES" -tm-link "$JOIN_LINK" > "$PHASE2_LOG" 2>&1 &
|
||||
P2_PID=$!
|
||||
|
||||
waited=0
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
if grep -q "media_server=" "$PHASE2_LOG"; then
|
||||
break
|
||||
fi
|
||||
if grep -qE "Failed to join existing conference|empty conference URI" "$PHASE2_LOG"; then
|
||||
break
|
||||
fi
|
||||
if ! kill -0 "$P2_PID" 2>/dev/null; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "--- phase 2 log tail ---"
|
||||
tail -25 "$PHASE2_LOG"
|
||||
|
||||
if grep -q "media_server=" "$PHASE2_LOG" && grep -q "Joining existing conference" "$PHASE2_LOG"; then
|
||||
echo ""
|
||||
echo "PASS: phase 2 joined the existing conference"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "FAIL: phase 2 did not reach media_server stage" >&2
|
||||
exit 1
|
||||
@@ -1,93 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Smoke test: headless-telemost-creator creates a conference, headless-telemost-joiner
|
||||
# joins it via -tm-link and exposes a SOCKS5 listener.
|
||||
#
|
||||
# Usage: ./test-telemost-joiner.sh <path-to-cookies.json>
|
||||
|
||||
set -u
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
CREATOR="$ROOT/headless/telemost/headless-telemost-creator"
|
||||
JOINER="$ROOT/headless/telemost-joiner/headless-telemost-joiner"
|
||||
SOCKS_PORT=11080
|
||||
SETTLE_TIMEOUT=45
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <path-to-cookies.json>" >&2
|
||||
exit 2
|
||||
fi
|
||||
COOKIES="$1"
|
||||
|
||||
[ -x "$CREATOR" ] || { echo "FAIL: $CREATOR not built (run ./build-headless.sh)" >&2; exit 2; }
|
||||
[ -x "$JOINER" ] || { echo "FAIL: $JOINER not built (run ./build-headless.sh)" >&2; exit 2; }
|
||||
[ -f "$COOKIES" ] || { echo "FAIL: cookies not found at: $COOKIES" >&2; exit 2; }
|
||||
|
||||
PHASE1_LOG=$(mktemp -t tm-create.XXXXXX.log)
|
||||
PHASE2_LOG=$(mktemp -t tm-joiner.XXXXXX.log)
|
||||
P1_PID=""
|
||||
P2_PID=""
|
||||
|
||||
cleanup() {
|
||||
[ -n "$P2_PID" ] && kill "$P2_PID" 2>/dev/null
|
||||
[ -n "$P1_PID" ] && kill "$P1_PID" 2>/dev/null
|
||||
wait 2>/dev/null
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
echo "=== phase 1: create conference ==="
|
||||
"$CREATOR" -cookies "$COOKIES" > "$PHASE1_LOG" 2>&1 &
|
||||
P1_PID=$!
|
||||
|
||||
waited=0
|
||||
JOIN_LINK=""
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
JOIN_LINK=$(grep -m1 -oE "https://telemost\.yandex\.[a-z]+/j/[A-Za-z0-9_-]+" "$PHASE1_LOG" | head -1)
|
||||
[ -n "$JOIN_LINK" ] && break
|
||||
if ! kill -0 "$P1_PID" 2>/dev/null; then
|
||||
echo "FAIL: phase 1 process died" >&2
|
||||
tail -20 "$PHASE1_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
if [ -z "$JOIN_LINK" ]; then
|
||||
echo "FAIL: phase 1 did not print join_link within ${SETTLE_TIMEOUT}s" >&2
|
||||
tail -20 "$PHASE1_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "phase 1 join_link: $JOIN_LINK"
|
||||
|
||||
sleep 3
|
||||
|
||||
echo ""
|
||||
echo "=== phase 2: join via headless-telemost-joiner ==="
|
||||
"$JOINER" -tm-link "$JOIN_LINK" -socks-port "$SOCKS_PORT" > "$PHASE2_LOG" 2>&1 &
|
||||
P2_PID=$!
|
||||
|
||||
waited=0
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
if grep -q "TUNNEL CONNECTED" "$PHASE2_LOG"; then
|
||||
break
|
||||
fi
|
||||
if ! kill -0 "$P2_PID" 2>/dev/null; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "--- phase 2 log tail ---"
|
||||
tail -25 "$PHASE2_LOG"
|
||||
|
||||
if grep -q "TUNNEL CONNECTED" "$PHASE2_LOG" && grep -q "socks5 -> 127.0.0.1:${SOCKS_PORT}" "$PHASE2_LOG"; then
|
||||
echo ""
|
||||
echo "PASS: joiner reached TUNNEL CONNECTED on socks port ${SOCKS_PORT}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "FAIL: joiner did not reach TUNNEL CONNECTED within ${SETTLE_TIMEOUT}s" >&2
|
||||
exit 1
|
||||
@@ -1,116 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -u
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
CREATOR="$ROOT/headless/telemost/headless-telemost-creator"
|
||||
JOINER="$ROOT/headless/telemost-joiner/headless-telemost-joiner"
|
||||
|
||||
RATES="${RATES:-0 62500 125000 250000 625000}"
|
||||
PHASE_SECS="${PHASE_SECS:-100}"
|
||||
SOCKS_PORT="${SOCKS_PORT:-11080}"
|
||||
SINK_PORT="${SINK_PORT:-19099}"
|
||||
SETTLE_TIMEOUT="${SETTLE_TIMEOUT:-60}"
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage: $0 <cookies.json> <telemost-join-link>" >&2
|
||||
exit 2
|
||||
fi
|
||||
COOKIES="$1"
|
||||
TM_LINK="$2"
|
||||
|
||||
[ -x "$CREATOR" ] || { echo "FAIL: $CREATOR not built (run ./build-headless.sh)" >&2; exit 2; }
|
||||
[ -x "$JOINER" ] || { echo "FAIL: $JOINER not built (run ./build-headless.sh)" >&2; exit 2; }
|
||||
[ -f "$COOKIES" ] || { echo "FAIL: cookies not found: $COOKIES" >&2; exit 2; }
|
||||
command -v ncat >/dev/null 2>&1 || { echo "FAIL: ncat not found (brew install nmap)" >&2; exit 2; }
|
||||
|
||||
CREATOR_LOG=$(mktemp -t tm-reap-creator.XXXXXX.log)
|
||||
JOINER_LOG=$(mktemp -t tm-reap-joiner.XXXXXX.log)
|
||||
C_PID=""; J_PID=""; SINK_PID=""
|
||||
|
||||
cleanup() {
|
||||
[ -n "$SINK_PID" ] && kill "$SINK_PID" 2>/dev/null
|
||||
[ -n "$J_PID" ] && kill "$J_PID" 2>/dev/null
|
||||
[ -n "$C_PID" ] && kill "$C_PID" 2>/dev/null
|
||||
wait 2>/dev/null
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
echo "room: $TM_LINK"
|
||||
echo "rates: $RATES phase: ${PHASE_SECS}s socks: $SOCKS_PORT sink: $SINK_PORT"
|
||||
|
||||
echo "=== creator joins named room ==="
|
||||
"$CREATOR" -cookies "$COOKIES" -tm-link "$TM_LINK" > "$CREATOR_LOG" 2>&1 &
|
||||
C_PID=$!
|
||||
|
||||
echo "=== joiner joins named room, exposes SOCKS5 ==="
|
||||
"$JOINER" -tm-link "$TM_LINK" -socks-port "$SOCKS_PORT" > "$JOINER_LOG" 2>&1 &
|
||||
J_PID=$!
|
||||
|
||||
waited=0
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
grep -q "TUNNEL CONNECTED" "$JOINER_LOG" && break
|
||||
kill -0 "$C_PID" 2>/dev/null || { echo "FAIL: creator died" >&2; tail -20 "$CREATOR_LOG" >&2; exit 1; }
|
||||
kill -0 "$J_PID" 2>/dev/null || { echo "FAIL: joiner died" >&2; tail -20 "$JOINER_LOG" >&2; exit 1; }
|
||||
sleep 1; waited=$((waited + 1))
|
||||
done
|
||||
grep -q "TUNNEL CONNECTED" "$JOINER_LOG" || { echo "FAIL: no TUNNEL CONNECTED in ${SETTLE_TIMEOUT}s" >&2; tail -25 "$JOINER_LOG" >&2; exit 1; }
|
||||
echo "tunnel up."
|
||||
|
||||
# discard sink reached through the tunnel egress; creator and joiner share this host's loopback
|
||||
ncat -k -l --recv-only 127.0.0.1 "$SINK_PORT" > /dev/null 2>&1 &
|
||||
SINK_PID=$!
|
||||
sleep 1
|
||||
|
||||
# emit ~rate bytes/sec into stdout for dur seconds, in 10 chunks/sec (coarse token bucket, no pv dep)
|
||||
pump_rate() {
|
||||
rate=$1; dur=$2
|
||||
[ "$rate" -le 0 ] && { sleep "$dur"; return; }
|
||||
chunk=$((rate / 10)); [ "$chunk" -lt 1 ] && chunk=1
|
||||
end=$(( $(date +%s) + dur ))
|
||||
while [ "$(date +%s)" -lt "$end" ]; do
|
||||
dd if=/dev/zero bs="$chunk" count=1 2>/dev/null
|
||||
sleep 0.1
|
||||
done
|
||||
}
|
||||
|
||||
# count reap markers currently in both logs
|
||||
reap_count() {
|
||||
c1=$(grep -cE "\[bind\] UNBOUND|forcing reconnect: slot binding killed" "$JOINER_LOG" 2>/dev/null || echo 0)
|
||||
c2=$(grep -cE "\[bind\] UNBOUND|forcing reconnect: slot binding killed" "$CREATOR_LOG" 2>/dev/null || echo 0)
|
||||
echo $((c1 + c2))
|
||||
}
|
||||
|
||||
echo ""
|
||||
echo "=== reap sweep ==="
|
||||
printf "%-10s %-14s %-12s\n" "rate_Bps" "first_reap_s" "reaps_in_phase"
|
||||
RESULTS=""
|
||||
for RATE in $RATES; do
|
||||
base=$(reap_count)
|
||||
start=$(date +%s)
|
||||
# drive the load in the background so we can poll for the reap during the phase
|
||||
( pump_rate "$RATE" "$PHASE_SECS" | ncat --proxy 127.0.0.1:"$SOCKS_PORT" --proxy-type socks5 127.0.0.1 "$SINK_PORT" ) >/dev/null 2>&1 &
|
||||
LOAD_PID=$!
|
||||
first_reap="-"
|
||||
while kill -0 "$LOAD_PID" 2>/dev/null; do
|
||||
if [ "$first_reap" = "-" ] && [ "$(reap_count)" -gt "$base" ]; then
|
||||
first_reap=$(( $(date +%s) - start ))
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
wait "$LOAD_PID" 2>/dev/null
|
||||
# one final check after the phase ends
|
||||
if [ "$first_reap" = "-" ] && [ "$(reap_count)" -gt "$base" ]; then
|
||||
first_reap=$(( $(date +%s) - start ))
|
||||
fi
|
||||
total=$(( $(reap_count) - base ))
|
||||
printf "%-10s %-14s %-12s\n" "$RATE" "$first_reap" "$total"
|
||||
RESULTS="$RESULTS$RATE=$first_reap,${total} "
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "--- joiner reap lines ---"
|
||||
grep -nE "\[bind\] (BOUND|UNBOUND)|forcing reconnect" "$JOINER_LOG" | tail -20
|
||||
echo ""
|
||||
echo "summary (rate_Bps=first_reap_s,reaps): $RESULTS"
|
||||
echo "logs: creator=$CREATOR_LOG joiner=$JOINER_LOG"
|
||||
@@ -1,149 +0,0 @@
|
||||
#!/bin/sh
|
||||
# End-to-end test for creator --upstream-socks, on Telemost.
|
||||
#
|
||||
# A telemost creator JOINS an existing conference (your call link, never created
|
||||
# here) and a telemost joiner joins the same conference to form the tunnel. We run
|
||||
# the pair twice - once with direct egress, once with -upstream-socks - and assert
|
||||
# the joiner's public egress IP CHANGES. A changed IP proves the joiner's traffic
|
||||
# left through the upstream SOCKS5 (your VPN client -> VPS) instead of this host.
|
||||
#
|
||||
# Needs: a real upstream SOCKS5 proxy whose exit IP differs from this machine
|
||||
# (an actual VPN client pointing at a VPS), plus Yandex cookies and a live call link.
|
||||
#
|
||||
# Usage:
|
||||
# UPSTREAM_SOCKS=127.0.0.1:1080 ./test-upstream-socks.sh <cookies-yandex.json> <tm-link>
|
||||
# UPSTREAM_SOCKS=127.0.0.1:1080 UPSTREAM_USER=u UPSTREAM_PASS=p \
|
||||
# ./test-upstream-socks.sh <cookies-yandex.json> https://telemost.yandex.ru/j/<id>
|
||||
|
||||
set -u
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
CREATOR="$ROOT/headless/telemost/headless-telemost-creator"
|
||||
JOINER="$ROOT/headless/telemost-joiner/headless-telemost-joiner"
|
||||
SOCKS_PORT=11080
|
||||
IP_URL="https://api.ipify.org"
|
||||
SETTLE_TIMEOUT=45
|
||||
PROBE_TIMEOUT=15
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage: UPSTREAM_SOCKS=host:port $0 <cookies-yandex.json> <tm-link>" >&2
|
||||
exit 2
|
||||
fi
|
||||
COOKIES="$1"
|
||||
TM_LINK="$2"
|
||||
|
||||
if [ -z "${UPSTREAM_SOCKS:-}" ]; then
|
||||
echo "FAIL: set UPSTREAM_SOCKS=host:port (a real SOCKS5 proxy / VPN client whose exit IP differs from this host)" >&2
|
||||
exit 2
|
||||
fi
|
||||
[ -x "$CREATOR" ] || { echo "FAIL: missing $CREATOR (run ./build-headless.sh first)" >&2; exit 2; }
|
||||
[ -x "$JOINER" ] || { echo "FAIL: missing $JOINER (run ./build-headless.sh first)" >&2; exit 2; }
|
||||
[ -f "$COOKIES" ] || { echo "FAIL: cookies not found at: $COOKIES" >&2; exit 2; }
|
||||
echo "cookies=$COOKIES tm-link=$TM_LINK upstream=$UPSTREAM_SOCKS"
|
||||
|
||||
CREATOR_PID=""
|
||||
JOINER_PID=""
|
||||
kill_pair() {
|
||||
[ -n "$JOINER_PID" ] && kill "$JOINER_PID" 2>/dev/null
|
||||
[ -n "$CREATOR_PID" ] && kill "$CREATOR_PID" 2>/dev/null
|
||||
wait 2>/dev/null
|
||||
JOINER_PID=""
|
||||
CREATOR_PID=""
|
||||
}
|
||||
trap kill_pair EXIT INT TERM
|
||||
|
||||
# run_chain <label> [extra creator args...] -> prints the joiner's egress IP on stdout
|
||||
run_chain() {
|
||||
label="$1"
|
||||
shift
|
||||
clog=$(mktemp -t up-c.XXXXXX.log)
|
||||
jlog=$(mktemp -t up-j.XXXXXX.log)
|
||||
|
||||
"$CREATOR" -cookies "$COOKIES" -tm-link "$TM_LINK" "$@" >"$clog" 2>&1 &
|
||||
CREATOR_PID=$!
|
||||
|
||||
w=0
|
||||
while [ "$w" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
grep -q "media_server=" "$clog" && break
|
||||
if ! kill -0 "$CREATOR_PID" 2>/dev/null; then
|
||||
echo "FAIL[$label]: creator died before joining the conference" >&2
|
||||
tail -20 "$clog" >&2
|
||||
kill_pair
|
||||
return 1
|
||||
fi
|
||||
sleep 1
|
||||
w=$((w + 1))
|
||||
done
|
||||
if ! grep -q "media_server=" "$clog"; then
|
||||
echo "FAIL[$label]: creator did not join the conference in ${SETTLE_TIMEOUT}s" >&2
|
||||
tail -20 "$clog" >&2
|
||||
kill_pair
|
||||
return 1
|
||||
fi
|
||||
sleep 3
|
||||
|
||||
"$JOINER" -tm-link "$TM_LINK" -socks-port "$SOCKS_PORT" >"$jlog" 2>&1 &
|
||||
JOINER_PID=$!
|
||||
|
||||
w=0
|
||||
while [ "$w" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
grep -q "TUNNEL CONNECTED" "$jlog" && break
|
||||
if ! kill -0 "$JOINER_PID" 2>/dev/null; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
w=$((w + 1))
|
||||
done
|
||||
if ! grep -q "TUNNEL CONNECTED" "$jlog"; then
|
||||
echo "FAIL[$label]: joiner never reached TUNNEL CONNECTED in ${SETTLE_TIMEOUT}s" >&2
|
||||
tail -20 "$jlog" >&2
|
||||
kill_pair
|
||||
return 1
|
||||
fi
|
||||
|
||||
w=0
|
||||
while [ "$w" -lt 10 ]; do
|
||||
nc -z 127.0.0.1 "$SOCKS_PORT" 2>/dev/null && break
|
||||
sleep 1
|
||||
w=$((w + 1))
|
||||
done
|
||||
|
||||
ip=$(curl --socks5-hostname "127.0.0.1:$SOCKS_PORT" -m "$PROBE_TIMEOUT" -s "$IP_URL")
|
||||
kill_pair
|
||||
echo "$ip"
|
||||
}
|
||||
|
||||
echo "=== baseline: direct egress ==="
|
||||
DIRECT_IP=$(run_chain direct) || exit 1
|
||||
echo "direct_ip=$DIRECT_IP"
|
||||
|
||||
# Let the fixed SOCKS port free up before the second pair.
|
||||
sleep 2
|
||||
|
||||
echo "=== upstream: -upstream-socks $UPSTREAM_SOCKS ==="
|
||||
set -- -upstream-socks "$UPSTREAM_SOCKS"
|
||||
[ -n "${UPSTREAM_USER:-}" ] && set -- "$@" -upstream-user "$UPSTREAM_USER"
|
||||
[ -n "${UPSTREAM_PASS:-}" ] && set -- "$@" -upstream-pass "$UPSTREAM_PASS"
|
||||
UPSTREAM_IP=$(run_chain upstream "$@") || exit 1
|
||||
echo "upstream_ip=$UPSTREAM_IP"
|
||||
|
||||
case "$DIRECT_IP" in
|
||||
*.*) ;;
|
||||
*)
|
||||
echo "FAIL: no direct egress IP (baseline chain broken)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
case "$UPSTREAM_IP" in
|
||||
*.*) ;;
|
||||
*)
|
||||
echo "FAIL: no egress IP via upstream - is $UPSTREAM_SOCKS reachable and does its SOCKS5 inbound work?" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
if [ "$DIRECT_IP" = "$UPSTREAM_IP" ]; then
|
||||
echo "FAIL: egress IP unchanged ($UPSTREAM_IP) - joiner traffic did NOT go through the upstream" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "PASS: egress moved from $DIRECT_IP (this host) to $UPSTREAM_IP (via $UPSTREAM_SOCKS)"
|
||||
@@ -1,93 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Smoke test for -vk-link: create a call, then join it via the new flag.
|
||||
#
|
||||
# Usage: ./test-vk-join-existing.sh <path-to-cookies.json>
|
||||
|
||||
set -u
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
CREATOR="$ROOT/headless/vk/headless-vk-creator"
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <path-to-cookies.json>" >&2
|
||||
exit 2
|
||||
fi
|
||||
COOKIES="$1"
|
||||
SETTLE_TIMEOUT=25
|
||||
|
||||
[ -x "$CREATOR" ] || { echo "FAIL: $CREATOR not built, run ./build-headless.sh" >&2; exit 2; }
|
||||
[ -f "$COOKIES" ] || { echo "FAIL: cookies not found at: $COOKIES" >&2; exit 2; }
|
||||
echo "cookies: $COOKIES"
|
||||
|
||||
PHASE1_LOG=$(mktemp -t vk-create.XXXXXX.log)
|
||||
PHASE2_LOG=$(mktemp -t vk-join.XXXXXX.log)
|
||||
P1_PID=""
|
||||
P2_PID=""
|
||||
|
||||
cleanup() {
|
||||
[ -n "$P2_PID" ] && kill "$P2_PID" 2>/dev/null
|
||||
[ -n "$P1_PID" ] && kill "$P1_PID" 2>/dev/null
|
||||
wait 2>/dev/null
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
echo "=== phase 1: create call ==="
|
||||
"$CREATOR" -cookies "$COOKIES" > "$PHASE1_LOG" 2>&1 &
|
||||
P1_PID=$!
|
||||
|
||||
waited=0
|
||||
JOIN_LINK=""
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
JOIN_LINK=$(grep -m1 -oE "https://vk\.com/call/join/[A-Za-z0-9_-]+" "$PHASE1_LOG")
|
||||
[ -n "$JOIN_LINK" ] && break
|
||||
if ! kill -0 "$P1_PID" 2>/dev/null; then
|
||||
echo "FAIL: phase 1 process died" >&2
|
||||
tail -20 "$PHASE1_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
if [ -z "$JOIN_LINK" ]; then
|
||||
echo "FAIL: phase 1 did not print join_link within ${SETTLE_TIMEOUT}s" >&2
|
||||
tail -20 "$PHASE1_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "phase 1 join_link: $JOIN_LINK"
|
||||
|
||||
# Wait a beat so the call is fully joined on VK's side before phase 2 starts.
|
||||
sleep 3
|
||||
|
||||
echo ""
|
||||
echo "=== phase 2: join existing call via -vk-link ==="
|
||||
"$CREATOR" -cookies "$COOKIES" -vk-link "$JOIN_LINK" > "$PHASE2_LOG" 2>&1 &
|
||||
P2_PID=$!
|
||||
|
||||
waited=0
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
if grep -q "vk-ws] Connected" "$PHASE2_LOG"; then
|
||||
break
|
||||
fi
|
||||
if grep -qE "Failed to join existing call|empty WS endpoint|empty session_key" "$PHASE2_LOG"; then
|
||||
break
|
||||
fi
|
||||
if ! kill -0 "$P2_PID" 2>/dev/null; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "--- phase 2 log tail ---"
|
||||
tail -25 "$PHASE2_LOG"
|
||||
|
||||
if grep -q "vk-ws] Connected" "$PHASE2_LOG"; then
|
||||
echo ""
|
||||
echo "PASS: phase 2 joined the existing call (got vk-ws connection)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "FAIL: phase 2 did not reach vk-ws connection" >&2
|
||||
exit 1
|
||||
@@ -1,87 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Smoke test for headless-wbstream-creator -room: create a room, then a second
|
||||
# creator joins the same room id.
|
||||
|
||||
set -u
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
CREATOR="$ROOT/headless/wbstream/headless-wbstream-creator"
|
||||
SETTLE_TIMEOUT=25
|
||||
|
||||
[ -x "$CREATOR" ] || { echo "FAIL: $CREATOR not built (run ./build-headless.sh)" >&2; exit 2; }
|
||||
|
||||
PHASE1_LOG=$(mktemp -t wb-create.XXXXXX.log)
|
||||
PHASE2_LOG=$(mktemp -t wb-join.XXXXXX.log)
|
||||
P1_PID=""
|
||||
P2_PID=""
|
||||
|
||||
cleanup() {
|
||||
[ -n "$P2_PID" ] && kill "$P2_PID" 2>/dev/null
|
||||
[ -n "$P1_PID" ] && kill "$P1_PID" 2>/dev/null
|
||||
wait 2>/dev/null
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
echo "=== phase 1: create room ==="
|
||||
"$CREATOR" > "$PHASE1_LOG" 2>&1 &
|
||||
P1_PID=$!
|
||||
|
||||
waited=0
|
||||
JOIN_LINK=""
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
JOIN_LINK=$(grep -m1 -oE "wbstream://[A-Za-z0-9-]+" "$PHASE1_LOG" | head -1)
|
||||
[ -n "$JOIN_LINK" ] && break
|
||||
if ! kill -0 "$P1_PID" 2>/dev/null; then
|
||||
echo "FAIL: phase 1 process died" >&2
|
||||
tail -20 "$PHASE1_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
if [ -z "$JOIN_LINK" ]; then
|
||||
echo "FAIL: phase 1 did not print join_link within ${SETTLE_TIMEOUT}s" >&2
|
||||
tail -20 "$PHASE1_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "phase 1 join_link: $JOIN_LINK"
|
||||
|
||||
sleep 3
|
||||
|
||||
echo ""
|
||||
echo "=== phase 2: join existing room via -room ==="
|
||||
"$CREATOR" -room "$JOIN_LINK" > "$PHASE2_LOG" 2>&1 &
|
||||
P2_PID=$!
|
||||
|
||||
waited=0
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
if grep -q "\[lk\] join: room=" "$PHASE2_LOG"; then
|
||||
break
|
||||
fi
|
||||
if grep -qE "Failed to|register guest|create room" "$PHASE2_LOG" | grep -qiE "error|failed"; then
|
||||
break
|
||||
fi
|
||||
if ! kill -0 "$P2_PID" 2>/dev/null; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "--- phase 2 log tail ---"
|
||||
tail -25 "$PHASE2_LOG"
|
||||
|
||||
phase2_room=$(grep -m1 -oE "room=[a-f0-9-]+" "$PHASE2_LOG" | head -1 | cut -d= -f2)
|
||||
expected_room=$(echo "$JOIN_LINK" | sed 's|wbstream://||')
|
||||
|
||||
if [ "$phase2_room" = "$expected_room" ]; then
|
||||
echo ""
|
||||
echo "PASS: phase 2 joined room $phase2_room"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "FAIL: phase 2 did not join the expected room (got '$phase2_room', wanted '$expected_room')" >&2
|
||||
exit 1
|
||||
@@ -1,135 +0,0 @@
|
||||
#!/bin/sh
|
||||
# End-to-end smoke test: spawn a wbstream creator + joiner pair, route curl
|
||||
# through the joiner's SOCKS5 and verify the response arrives.
|
||||
#
|
||||
# Usage:
|
||||
# ./test-wbstream.sh [video|dc] # default: video
|
||||
|
||||
set -u
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
CREATOR="$ROOT/headless/wbstream/headless-wbstream-creator"
|
||||
JOINER="$ROOT/headless/wbstream-joiner/headless-wbstream-joiner"
|
||||
COOKIES="${WBSTREAM_COOKIES:-$ROOT/cookies-wbstream.json}"
|
||||
SOCKS_PORT=11080
|
||||
TARGET_URL="https://api.ipify.org"
|
||||
PROBE_TIMEOUT=15
|
||||
SETTLE_TIMEOUT=20
|
||||
|
||||
mode_arg="${1:-video}"
|
||||
case "$mode_arg" in
|
||||
video|dc) ;;
|
||||
*)
|
||||
echo "Unknown mode: $mode_arg (expected video or dc)" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
CREATOR_LOG=$(mktemp -t wb-c.XXXXXX.log)
|
||||
JOINER_LOG=$(mktemp -t wb-j.XXXXXX.log)
|
||||
CREATOR_PID=""
|
||||
JOINER_PID=""
|
||||
|
||||
cleanup() {
|
||||
[ -n "$JOINER_PID" ] && kill "$JOINER_PID" 2>/dev/null
|
||||
[ -n "$CREATOR_PID" ] && kill "$CREATOR_PID" 2>/dev/null
|
||||
wait 2>/dev/null
|
||||
}
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
require_bin() {
|
||||
if [ ! -x "$1" ]; then
|
||||
echo "FAIL: missing binary $1" >&2
|
||||
echo "Run ./build-headless.sh first." >&2
|
||||
exit 2
|
||||
fi
|
||||
}
|
||||
|
||||
require_bin "$CREATOR"
|
||||
require_bin "$JOINER"
|
||||
|
||||
if [ ! -f "$COOKIES" ]; then
|
||||
echo "FAIL: cookies file not found at $COOKIES" >&2
|
||||
echo "Set WBSTREAM_COOKIES or place cookies-wbstream.json at repo root." >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "=== mode=$mode_arg ==="
|
||||
|
||||
"$CREATOR" --cookies "$COOKIES" > "$CREATOR_LOG" 2>&1 &
|
||||
CREATOR_PID=$!
|
||||
|
||||
waited=0
|
||||
JOIN_LINK=""
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
JOIN_LINK=$(grep -m1 "join_link:" "$CREATOR_LOG" | awk '{print $2}')
|
||||
[ -n "$JOIN_LINK" ] && break
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
if [ -z "$JOIN_LINK" ]; then
|
||||
echo "FAIL: creator did not print a join_link within ${SETTLE_TIMEOUT}s" >&2
|
||||
tail -20 "$CREATOR_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "join_link=$JOIN_LINK"
|
||||
|
||||
"$JOINER" --room "$JOIN_LINK" --socks-port "$SOCKS_PORT" --tunnel-mode "$mode_arg" \
|
||||
> "$JOINER_LOG" 2>&1 &
|
||||
JOINER_PID=$!
|
||||
|
||||
waited=0
|
||||
while [ "$waited" -lt "$SETTLE_TIMEOUT" ]; do
|
||||
if grep -q "TUNNEL CONNECTED" "$JOINER_LOG"; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
|
||||
if ! grep -q "TUNNEL CONNECTED" "$JOINER_LOG"; then
|
||||
echo "FAIL: joiner did not reach TUNNEL CONNECTED within ${SETTLE_TIMEOUT}s" >&2
|
||||
tail -20 "$JOINER_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# SOCKS listener starts in a goroutine after TUNNEL CONNECTED prints; poll.
|
||||
waited=0
|
||||
while [ "$waited" -lt 10 ]; do
|
||||
if nc -z 127.0.0.1 "$SOCKS_PORT" 2>/dev/null; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
waited=$((waited + 1))
|
||||
done
|
||||
if ! nc -z 127.0.0.1 "$SOCKS_PORT" 2>/dev/null; then
|
||||
echo "FAIL: SOCKS5 port $SOCKS_PORT never opened" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
response=$(curl --socks5 "127.0.0.1:$SOCKS_PORT" -m "$PROBE_TIMEOUT" -sv "$TARGET_URL" 2>&1)
|
||||
if ! echo "$response" | grep -q "HTTP/.* 200"; then
|
||||
echo "FAIL: SOCKS5 request did not return HTTP 200" >&2
|
||||
echo "--- curl output ---" >&2
|
||||
echo "$response" >&2
|
||||
echo "--- joiner log tail ---" >&2
|
||||
tail -30 "$JOINER_LOG" >&2
|
||||
echo "--- creator log tail ---" >&2
|
||||
tail -30 "$CREATOR_LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
response=$(echo "$response" | tail -1)
|
||||
echo "remote_ip=$response"
|
||||
|
||||
speed=$(curl --socks5 "127.0.0.1:$SOCKS_PORT" -m 30 -s -o /dev/null \
|
||||
-w "%{speed_download}" \
|
||||
"https://speed.cloudflare.com/__down?bytes=10485760")
|
||||
if [ -z "$speed" ] || [ "$speed" = "0" ]; then
|
||||
echo "FAIL: throughput probe returned 0 B/s" >&2
|
||||
exit 1
|
||||
fi
|
||||
mbps=$(awk -v b="$speed" 'BEGIN { printf "%.2f", b * 8 / 1000000 }')
|
||||
echo "throughput=${mbps} Mbps"
|
||||
|
||||
echo "PASS: mode=$mode_arg"
|
||||
@@ -69,11 +69,24 @@ func main() {
|
||||
log.Fatalf("[auth] cookies file is missing __wb_device_id; re-export via creator-app's 'Export Cookies' button")
|
||||
}
|
||||
cookieHeader := common.FilterCookies(rawCookies, wbstream.WBStreamCookieAllowlist)
|
||||
bearer, err := wbstream.RefreshAccessToken(nil, cookieHeader, deviceID)
|
||||
persistCookies := func(rotated map[string]string) {
|
||||
if len(rotated) == 0 {
|
||||
return
|
||||
}
|
||||
if werr := common.UpdateCookieFile(*cookiesPath, rotated); werr != nil {
|
||||
log.Printf("[auth] warn: persist rotated cookies: %v", werr)
|
||||
return
|
||||
}
|
||||
rawCookies = common.LoadCookies(*cookiesPath)
|
||||
cookieHeader = common.FilterCookies(rawCookies, wbstream.WBStreamCookieAllowlist)
|
||||
log.Printf("[auth] persisted %d rotated cookie(s)", len(rotated))
|
||||
}
|
||||
bearer, rotated, err := wbstream.RefreshAccessToken(nil, cookieHeader, deviceID)
|
||||
if err != nil {
|
||||
common.EmitAuthErrorFor(err)
|
||||
log.Fatalf("[auth] slide-v3 refresh: %v", err)
|
||||
}
|
||||
persistCookies(rotated)
|
||||
log.Printf("[auth] bearer refreshed (len=%d)", len(bearer))
|
||||
requestedRoom := wbstream.ParseRoomID(*roomFlag)
|
||||
roomID, roomToken, accessToken, serverURL, err := wbstream.AuthAsLoggedIn(nil, cookieHeader, bearer, requestedRoom, *displayName)
|
||||
@@ -163,13 +176,14 @@ func main() {
|
||||
}
|
||||
time.Sleep(3 * time.Second)
|
||||
|
||||
newBearer, refreshErr := wbstream.RefreshAccessToken(nil, cookieHeader, deviceID)
|
||||
newBearer, rotated, refreshErr := wbstream.RefreshAccessToken(nil, cookieHeader, deviceID)
|
||||
if refreshErr != nil {
|
||||
log.Printf("[rejoin] slide-v3 refresh failed: %v, retrying in 5s", refreshErr)
|
||||
time.Sleep(5 * time.Second)
|
||||
continue
|
||||
}
|
||||
bearer = newBearer
|
||||
persistCookies(rotated)
|
||||
_, newRoomToken, newAccessToken, newServerURL, err := wbstream.AuthAsLoggedIn(nil, cookieHeader, bearer, roomID, *displayName)
|
||||
if err != nil {
|
||||
log.Printf("[rejoin] auth failed: %v, retrying in 5s", err)
|
||||
|
||||
Reference in new issue
Block a user