1//go:build integration2// +build integration34/*5Maddy Mail Server - Composable all-in-one email server.6Copyright © 2019-2020 Max Mazurov <fox.cpp@disroot.org>, Maddy Mail Server contributors78This program is free software: you can redistribute it and/or modify9it under the terms of the GNU General Public License as published by10the Free Software Foundation, either version 3 of the License, or11(at your option) any later version.1213This program is distributed in the hope that it will be useful,14but WITHOUT ANY WARRANTY; without even the implied warranty of15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16GNU General Public License for more details.1718You should have received a copy of the GNU General Public License19along with this program. If not, see <https://www.gnu.org/licenses/>.20*/2122package tests_test2324import (25 "testing"2627 "github.com/foxcpp/maddy/tests"28)2930func TestBasic(tt *testing.T) {31 tt.Parallel()3233 // This test is mostly intended to test whether the integration testing34 // library is working as expected.3536 t := tests.NewT(tt)37 t.DNS(nil)38 t.Port("smtp")39 t.Config(`40 smtp tcp://127.0.0.1:{env:TEST_PORT_smtp} {41 hostname mx.maddy.test42 tls off4344 deliver_to dummy45 }`)46 t.Run(1)47 defer t.Close()4849 conn := t.Conn("smtp")50 defer conn.Close()51 conn.ExpectPattern("220 mx.maddy.test *")52 conn.Writeln("EHLO localhost")53 conn.ExpectPattern("250-*")54 conn.ExpectPattern("250-PIPELINING")55 conn.ExpectPattern("250-8BITMIME")56 conn.ExpectPattern("250-ENHANCEDSTATUSCODES")57 conn.ExpectPattern("250-CHUNKING")58 conn.ExpectPattern("250-SMTPUTF8")59 conn.ExpectPattern("250-SIZE *")60 conn.ExpectPattern("250 LIMITS RCPTMAX=20000")61 conn.Writeln("QUIT")62 conn.ExpectPattern("221 *")63}