2019-11-02 21:32:58 +07:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2019-11-16 17:38:21 +07:00
|
|
|
var mariadbSuiteName = "Mariadb"
|
2019-11-02 21:32:58 +07:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
dockerEnvironment := NewDockerEnvironment([]string{
|
|
|
|
"docker-compose.yml",
|
2019-11-25 03:27:59 +07:00
|
|
|
"internal/suites/Mariadb/docker-compose.yml",
|
2019-11-02 21:32:58 +07:00
|
|
|
"example/compose/authelia/docker-compose.backend.yml",
|
|
|
|
"example/compose/authelia/docker-compose.frontend.yml",
|
|
|
|
"example/compose/nginx/backend/docker-compose.yml",
|
|
|
|
"example/compose/nginx/portal/docker-compose.yml",
|
|
|
|
"example/compose/smtp/docker-compose.yml",
|
2019-11-16 17:38:21 +07:00
|
|
|
"example/compose/mariadb/docker-compose.yml",
|
2019-11-02 21:32:58 +07:00
|
|
|
"example/compose/ldap/docker-compose.yml",
|
|
|
|
})
|
|
|
|
|
|
|
|
setup := func(suitePath string) error {
|
2019-11-25 03:27:59 +07:00
|
|
|
if err := dockerEnvironment.Up(); err != nil {
|
2019-11-02 21:32:58 +07:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return waitUntilAutheliaIsReady(dockerEnvironment)
|
|
|
|
}
|
|
|
|
|
|
|
|
teardown := func(suitePath string) error {
|
2019-11-25 03:27:59 +07:00
|
|
|
err := dockerEnvironment.Down()
|
2019-11-02 21:32:58 +07:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2019-11-16 17:38:21 +07:00
|
|
|
GlobalRegistry.Register(mariadbSuiteName, Suite{
|
2019-11-02 21:32:58 +07:00
|
|
|
SetUp: setup,
|
2019-11-16 17:38:21 +07:00
|
|
|
SetUpTimeout: 3 * time.Minute,
|
2019-11-02 21:32:58 +07:00
|
|
|
TearDown: teardown,
|
|
|
|
TearDownTimeout: 2 * time.Minute,
|
|
|
|
})
|
|
|
|
}
|