2019-11-02 14:32:58 +00:00
|
|
|
package suites
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
2019-11-16 10:38:21 +00:00
|
|
|
var mariadbSuiteName = "Mariadb"
|
2019-11-02 14:32:58 +00:00
|
|
|
|
|
|
|
func init() {
|
|
|
|
dockerEnvironment := NewDockerEnvironment([]string{
|
|
|
|
"docker-compose.yml",
|
2019-11-24 20:27:59 +00:00
|
|
|
"internal/suites/Mariadb/docker-compose.yml",
|
2019-11-02 14:32:58 +00: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 10:38:21 +00:00
|
|
|
"example/compose/mariadb/docker-compose.yml",
|
2019-11-02 14:32:58 +00:00
|
|
|
"example/compose/ldap/docker-compose.yml",
|
|
|
|
})
|
|
|
|
|
|
|
|
setup := func(suitePath string) error {
|
2019-11-24 20:27:59 +00:00
|
|
|
if err := dockerEnvironment.Up(); err != nil {
|
2019-11-02 14:32:58 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return waitUntilAutheliaIsReady(dockerEnvironment)
|
|
|
|
}
|
|
|
|
|
|
|
|
teardown := func(suitePath string) error {
|
2019-11-24 20:27:59 +00:00
|
|
|
err := dockerEnvironment.Down()
|
2019-11-02 14:32:58 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2019-11-16 10:38:21 +00:00
|
|
|
GlobalRegistry.Register(mariadbSuiteName, Suite{
|
2019-11-02 14:32:58 +00:00
|
|
|
SetUp: setup,
|
2019-11-16 10:38:21 +00:00
|
|
|
SetUpTimeout: 3 * time.Minute,
|
2019-11-02 14:32:58 +00:00
|
|
|
TearDown: teardown,
|
|
|
|
TearDownTimeout: 2 * time.Minute,
|
|
|
|
})
|
|
|
|
}
|