File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 55from playwright .sync_api import expect
66import socket
77import os
8+ import time
89
910FOOTER_TEXT_EN = "Internet.nl is an initiative of the Internet community and the Dutch"
1011FOOTER_TEXT_NL = "Internet.nl is een initiatief van de internetgemeenschap en de Nederlandse"
@@ -220,3 +221,17 @@ def test_cron_postgres_backups(trigger_cron, docker_compose_exec):
220221
221222 assert docker_compose_exec ("cron" , "ls /var/lib/postgresql/backups/internetnl_db1.daily.sql.gz" )
222223 assert docker_compose_exec ("cron" , "ls /var/lib/postgresql/backups/internetnl_db1.weekly.sql.gz" )
224+
225+ def test_mail_server (app_domain : str ):
226+ """Test if dummy SMTP server is running, see: https://github.com/internetstandards/Internet.nl/issues/1875."""
227+
228+ # connect to SMTP socket and test if HELO message is correct
229+ with socket .socket (socket .AF_INET , socket .SOCK_STREAM ) as s :
230+ s .connect ((app_domain , 25 ))
231+ s .sendall (b"HELO example.com\r \n " )
232+ time .sleep (1 ) # second response line is not sent directly
233+ response = s .recv (1024 )
234+ assert response .decode () == f"220 { app_domain } ESMTP ready\r \n 250 { app_domain } \r \n "
235+ s .sendall (b"AUTH PLAIN dXNlcgB1c2VyAHB3ZA==\r \n " )
236+ response = s .recv (1024 )
237+ assert response == b"500 5.5.1 Invalid command\r \n "
You can’t perform that action at this time.
0 commit comments