File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1259,6 +1259,12 @@ async fn kerberos_missing_krb_kdc_fails_closed() -> anyhow::Result<()> {
12591259 !logs. contains( FORWARD_LOG ) && !logs. contains( INJECT_LOG ) ,
12601260 "missing krb_kdc must fail closed; logs:\n {logs}"
12611261 ) ;
1262+ tokio:: time:: sleep ( Duration :: from_millis ( 250 ) ) . await ;
1263+ anyhow:: ensure!(
1264+ rdp. accepted( ) == 0 ,
1265+ "missing krb_kdc must not dial the target; accepted={}" ,
1266+ rdp. accepted( )
1267+ ) ;
12621268 let _ = gateway. process . start_kill ( ) ;
12631269 Ok ( ( ) )
12641270}
@@ -1303,20 +1309,28 @@ async fn ntlm_injection_completes_credssp_both_legs() -> anyhow::Result<()> {
13031309
13041310struct FakeClosedTarget {
13051311 port : u16 ,
1312+ accepted : Arc < AtomicUsize > ,
13061313}
13071314
13081315impl FakeClosedTarget {
13091316 async fn start ( ) -> anyhow:: Result < Self > {
13101317 let listener = TcpListener :: bind ( "127.0.0.1:0" ) . await . context ( "bind closed target" ) ?;
13111318 let port = listener. local_addr ( ) ?. port ( ) ;
1319+ let accepted = Arc :: new ( AtomicUsize :: new ( 0 ) ) ;
1320+ let accepted_task = Arc :: clone ( & accepted) ;
13121321 tokio:: spawn ( async move {
13131322 loop {
13141323 let Ok ( ( _stream, _) ) = listener. accept ( ) . await else {
13151324 break ;
13161325 } ;
1326+ accepted_task. fetch_add ( 1 , Ordering :: SeqCst ) ;
13171327 }
13181328 } ) ;
1319- Ok ( Self { port } )
1329+ Ok ( Self { port, accepted } )
1330+ }
1331+
1332+ fn accepted ( & self ) -> usize {
1333+ self . accepted . load ( Ordering :: SeqCst )
13201334 }
13211335}
13221336
You can’t perform that action at this time.
0 commit comments