@@ -450,8 +450,10 @@ functionalAPITests ps = do
450450 it " should send multiple messages to the same connection" $ withSmpServer ps testSendMessagesB
451451 it " should send messages to the 2 connections" $ withSmpServer ps testSendMessagesB2
452452 describe " Async agent commands" $ do
453- fdescribe " connect using async agent commands" $
453+ describe " connect using async agent commands" $
454454 testBasicMatrix2 ps testAsyncCommands
455+ fit " should add short link data using async agent command" $
456+ testSetConnShortLinkAsync ps
455457 it " should restore and complete async commands on restart" $
456458 testAsyncCommandsRestore ps
457459 describe " accept connection using async command" $
@@ -2583,9 +2585,6 @@ testAsyncCommands sqSecured alice bob baseId =
25832585 bobId <- createConnectionAsync alice 1 " 1" True SCMInvitation IKPQOn SMSubscribe
25842586 (" 1" , bobId', INV (ACR _ qInfo)) <- get alice
25852587 liftIO $ bobId' `shouldBe` bobId
2586- setConnShortLinkAsync alice " 1a" bobId SCMInvitation (UserInvLinkData $ UserLinkData " test" ) Nothing
2587- (" 1a" , bobId'', LINK (ACSL SCMInvitation _)) <- get alice
2588- liftIO $ bobId'' `shouldBe` bobId
25892588 aliceId <- joinConnectionAsync bob 1 " 2" True qInfo " bob's connInfo" PQSupportOn SMSubscribe
25902589 (" 2" , aliceId', JOINED sqSecured') <- get bob
25912590 liftIO $ do
@@ -2631,6 +2630,23 @@ testAsyncCommands sqSecured alice bob baseId =
26312630 where
26322631 msgId = subtract baseId
26332632
2633+ testSetConnShortLinkAsync :: (ASrvTransport , AStoreType ) -> IO ()
2634+ testSetConnShortLinkAsync ps = withAgentClients2 $ \ alice bob ->
2635+ withSmpServerStoreLogOn ps testPort $ \ _ -> runRight_ $ do
2636+ let userData = UserLinkData " test user data"
2637+ newLinkData = UserInvLinkData userData
2638+ (bobId, (CCLink qInfo _, _)) <- A. createConnection alice NRMInteractive 1 True True SCMInvitation (Just newLinkData) Nothing IKPQOn SMSubscribe
2639+ let updatedData = UserLinkData " updated user data"
2640+ setConnShortLinkAsync alice " 1" bobId SCMInvitation (UserInvLinkData updatedData) Nothing
2641+ (" 1" , bobId', LINK (ACSL SCMInvitation _)) <- get alice
2642+ liftIO $ bobId' `shouldBe` bobId
2643+ (aliceId, _) <- joinConnection bob 1 True qInfo " bob's connInfo" SMSubscribe
2644+ (" " , _, CONF confId _ " bob's connInfo" ) <- get alice
2645+ allowConnection alice bobId confId " alice's connInfo"
2646+ get alice ##> (" " , bobId, CON )
2647+ get bob ##> (" " , aliceId, INFO " alice's connInfo" )
2648+ get bob ##> (" " , aliceId, CON )
2649+
26342650testAsyncCommandsRestore :: (ASrvTransport , AStoreType ) -> IO ()
26352651testAsyncCommandsRestore ps = do
26362652 alice <- getSMPAgentClient' 1 agentCfg initAgentServers testDB
0 commit comments