mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
3c81e75d79
This adds an access-control command that checks the policy enforcement for a given criteria using a configuration file and refactors the configuration validation command to include all configuration sources.
29 lines
609 B
Go
29 lines
609 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"
|
|
)
|
|
|
|
func TestShouldCheckNTP(t *testing.T) {
|
|
config := &schema.Configuration{
|
|
NTP: &schema.NTPConfiguration{
|
|
Address: "time.cloudflare.com:123",
|
|
Version: 4,
|
|
MaximumDesync: "3s",
|
|
DisableStartupCheck: false,
|
|
},
|
|
}
|
|
|
|
sv := schema.NewStructValidator()
|
|
validator.ValidateNTP(config, sv)
|
|
|
|
ntp := NewProvider(config.NTP)
|
|
|
|
assert.NoError(t, ntp.StartupCheck())
|
|
}
|