integration-0.1.0
Safe HaskellNone
LanguageGHC2021

Test.Brig

Synopsis

Documentation

withModifiedTurnFile :: FilePath -> ((String -> App ()) -> App ()) -> App () Source #

Backs up cfgDest, runs the action with an updater that replaces the file content (via copy so brig's filewatch notices), and restores the backup. The 1s sleep gives brig's file watcher time to reload the file before the next assertion.

setTurn :: FilePath -> FilePath -> String -> App () Source #

This essentially writes newConf to cfgDest, but in a portable way that makes sure brig's filewatch notices that the file has changed.

assertCoturnCredentials :: HasCallStack => FilePath -> Value -> App () Source #

Asserts coturn native long-term credentials on a callsconfig/v3 response: username = "unix-expiry:uid" with future expiry and non-empty [a-z0-9] uid, and credential = base64(HMAC-SHA1(secret, username)).

testCallsConfigV3 :: HasCallStack => App () Source #

multiple servers using files callsconfig/v3 - 200

Rewrites the turn v2 servers file watched by backendA's brig (config keys 'turn.serversV2' and 'turn.coturnSecret') and verifies that the v3 endpoint advertises exactly the file's servers with valid coturn native long-term credentials.

assertV3Phase :: (HasCallStack, MakesValue user) => user -> FilePath -> [String] -> App () Source #