mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-03-31 20:36:22 +00:00
* send "quota exceeded" message from SMP server when sender gets ERR QUOTA (ignored in the agent for now) * send msg quota to the recipient to indicate that sender got ERR QUOTA, test * switch between slow/fast retry intervals (tests do not pass yet) * send QCONT message, refactor RetryInterval, test * refactor * remove comment * remove space * unit test for withRetryLock2 * refactor
42 lines
1.5 KiB
Haskell
42 lines
1.5 KiB
Haskell
{-# LANGUAGE TypeApplications #-}
|
|
|
|
import AgentTests (agentTests)
|
|
-- import Control.Logger.Simple
|
|
import CLITests
|
|
import CoreTests.CryptoTests
|
|
import CoreTests.EncodingTests
|
|
import CoreTests.ProtocolErrorTests
|
|
import CoreTests.RetryIntervalTests
|
|
import CoreTests.VersionRangeTests
|
|
import NtfServerTests (ntfServerTests)
|
|
import ServerTests
|
|
import Simplex.Messaging.Transport (TLS, Transport (..))
|
|
import Simplex.Messaging.Transport.WebSockets (WS)
|
|
import System.Directory (createDirectoryIfMissing, removeDirectoryRecursive)
|
|
import System.Environment (setEnv)
|
|
import Test.Hspec
|
|
|
|
-- logCfg :: LogConfig
|
|
-- logCfg = LogConfig {lc_file = Nothing, lc_stderr = True}
|
|
|
|
main :: IO ()
|
|
main = do
|
|
-- setLogLevel LogInfo -- LogError
|
|
-- withGlobalLogging logCfg $ do
|
|
createDirectoryIfMissing False "tests/tmp"
|
|
setEnv "APNS_KEY_ID" "H82WD9K9AQ"
|
|
setEnv "APNS_KEY_FILE" "./tests/fixtures/AuthKey_H82WD9K9AQ.p8"
|
|
hspec $ do
|
|
describe "Core tests" $ do
|
|
describe "Encoding tests" encodingTests
|
|
describe "Protocol error tests" protocolErrorTests
|
|
describe "Version range" versionRangeTests
|
|
describe "Encryption tests" cryptoTests
|
|
describe "Retry interval tests" retryIntervalTests
|
|
describe "SMP server via TLS" $ serverTests (transport @TLS)
|
|
describe "SMP server via WebSockets" $ serverTests (transport @WS)
|
|
describe "Notifications server" $ ntfServerTests (transport @TLS)
|
|
describe "SMP client agent" $ agentTests (transport @TLS)
|
|
describe "Server CLIs" cliTests
|
|
removeDirectoryRecursive "tests/tmp"
|