mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
aed9099ce2
* refactor: factorize startup checks * refactor: address linting issues
27 lines
634 B
Go
27 lines
634 B
Go
package ntp
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/authelia/authelia/v4/internal/configuration/schema"
|
|
"github.com/authelia/authelia/v4/internal/configuration/validator"
|
|
"github.com/authelia/authelia/v4/internal/logging"
|
|
)
|
|
|
|
func TestShouldCheckNTP(t *testing.T) {
|
|
config := schema.NTPConfiguration{
|
|
Address: "time.cloudflare.com:123",
|
|
Version: 4,
|
|
MaximumDesync: "3s",
|
|
DisableStartupCheck: false,
|
|
}
|
|
sv := schema.NewStructValidator()
|
|
validator.ValidateNTP(&config, sv)
|
|
|
|
ntp := NewProvider(&config)
|
|
|
|
assert.NoError(t, ntp.StartupCheck(logging.Logger()))
|
|
}
|