SPDX-License-Identifier: AGPL-3.0-only

Bound the XFTP server wrong-certificate test with the common timeout assertion
so a TLS cleanup regression cannot hang the port build.

Exercise the advertised new-sender/old-recipient combinations instead of
accidentally repeating the new/new cases in the version matrix.

Index: tests/XFTPAgent.hs
--- tests/XFTPAgent.hs.orig
+++ tests/XFTPAgent.hs
@@ -10,7 +10,7 @@

 module XFTPAgent where

-import AgentTests.FunctionalAPITests (get, rfGet, runRight, runRight_, sfGet, withAgent)
+import AgentTests.FunctionalAPITests (get, rfGet, runRight, runRight_, sfGet, shouldRespond, withAgent)

 import Control.Logger.Simple
 import Control.Monad
@@ -85,7 +85,7 @@
         it "should pass without basic auth" $ \_ -> testXFTPServerTest Nothing (noAuthSrv testXFTPServer2) `shouldReturn` Nothing
         let srv1 = testXFTPServer2 {keyHash = "1234"}
         it "should fail with incorrect fingerprint" $ \_ -> do
-          testXFTPServerTest Nothing (noAuthSrv srv1) `shouldReturn` Just (ProtocolTestFailure TSConnect $ BROKER (B.unpack $ strEncode srv1) $ NETWORK NEUnknownCAError)
+          testXFTPServerTest Nothing (noAuthSrv srv1) `shouldRespond` Just (ProtocolTestFailure TSConnect $ BROKER (B.unpack $ strEncode srv1) $ NETWORK NEUnknownCAError)
         describe "server with password" $ do
           let auth = Just "abcd"
               srv = ProtoServerWithAuth testXFTPServer2
@@ -267,12 +267,12 @@
 testXFTPAgentSendReceiveMatrix = do
   describe "old server" $ do
     it "new clients" $ run oldServer newClient newClient
-    it "new sender, old recipient" $ run oldServer newClient newClient
+    it "new sender, old recipient" $ run oldServer newClient oldClient
     it "old sender, new recipient" $ run oldServer oldClient newClient
     it "old clients" $ run oldServer oldClient oldClient
   describe "new server" $ do
     it "new clients" $ run newServer newClient newClient
-    it "new sender, old recipient" $ run newServer newClient newClient
+    it "new sender, old recipient" $ run newServer newClient oldClient
     it "old sender, new recipient" $ run newServer oldClient newClient
     it "old clients" $ run newServer oldClient oldClient
   where
