Fix DuoPush suite and do some clean up.

pull/474/head
Clement Michaud 2019-12-04 08:46:49 +01:00 committed by Clément Michaud
parent 32820518cf
commit 135cf718d5
10 changed files with 16 additions and 21 deletions

View File

@ -27,9 +27,4 @@ func RunCI(cmd *cobra.Command, args []string) {
if err := utils.CommandWithStdout("authelia-scripts", "--log-level", "debug", "unittest").Run(); err != nil {
log.Fatal(err)
}
log.Info("=====> Build Docker stage <=====")
if err := utils.CommandWithStdout("authelia-scripts", "--log-level", "debug", "docker", "build").Run(); err != nil {
log.Fatal(err)
}
}

View File

@ -237,7 +237,7 @@ func runSuiteTests(suiteName string, withEnv bool) error {
if suite.TestTimeout > 0 {
timeout = fmt.Sprintf("%ds", int64(suite.TestTimeout/time.Second))
}
testCmdLine := fmt.Sprintf("go test -v ./internal/suites -timeout %s -run '^(Test%sSuite)$'", timeout, suiteName)
testCmdLine := fmt.Sprintf("go test -count=1 -v ./internal/suites -timeout %s -run '^(Test%sSuite)$'", timeout, suiteName)
log.Infof("Running tests of suite %s...", suiteName)
log.Debugf("Running tests with command: %s", testCmdLine)

View File

@ -157,10 +157,10 @@ access_control:
# Rules applied to 'admins' group
- domain: "mx2.mail.example.com"
subject: "groups:admins"
subject: "group:admins"
policy: deny
- domain: "*.example.com"
subject: "groups:admins"
subject: "group:admins"
policy: two_factor
# Rules applied to 'dev' group

View File

@ -7,4 +7,8 @@ go get github.com/cespare/reflex
mkdir -p /var/lib/authelia
mkdir -p /etc/authelia
# Sleep 10 seconds to wait the end of npm install updating web directory
# and making reflex reload multiple times.
sleep 10
reflex -c /resources/reflex.conf

View File

@ -92,10 +92,10 @@
# Rules applied to 'admins' group
- domain: 'mx2.mail.example.com'
subject: 'groups:admins'
subject: 'group:admins'
policy: deny
- domain: '*.example.com'
subject: 'groups:admins'
subject: 'group:admins'
policy: two_factor
# Rules applied to 'dev' group

View File

@ -50,10 +50,10 @@ access_control:
# Rules applied to 'admins' group
- domain: "mx2.mail.example.com"
subject: "groups:admins"
subject: "group:admins"
policy: deny
- domain: "*.example.com"
subject: "groups:admins"
subject: "group:admins"
policy: two_factor
# Rules applied to 'dev' group

View File

@ -8,5 +8,6 @@ import (
func (wds *WebDriverSession) doChangeMethod(ctx context.Context, t *testing.T, method string) {
wds.WaitElementLocatedByID(ctx, t, "methods-button").Click()
wds.WaitElementLocatedByID(ctx, t, "methods-dialog")
wds.WaitElementLocatedByID(ctx, t, fmt.Sprintf("%s-option", method)).Click()
}

View File

@ -47,17 +47,13 @@ func (s *UserPreferencesScenario) SetupTest() {
}
func (s *UserPreferencesScenario) TestShouldRememberLastUsed2FAMethod() {
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 40*time.Second)
defer cancel()
// Authenticate
s.doLoginOneFactor(ctx, s.T(), "john", "password", false, "")
s.verifyIsSecondFactorPage(ctx, s.T())
// And select OTP method
s.doChangeMethod(ctx, s.T(), "one-time-password")
s.WaitElementLocatedByID(ctx, s.T(), "one-time-password-method")
// Then switch to push notification method
s.doChangeMethod(ctx, s.T(), "push-notification")
s.WaitElementLocatedByID(ctx, s.T(), "push-notification-method")

View File

@ -49,7 +49,7 @@ func init() {
SetUp: setup,
SetUpTimeout: 5 * time.Minute,
OnSetupTimeout: onSetupTimeout,
TestTimeout: 1 * time.Minute,
TestTimeout: 2 * time.Minute,
TearDown: teardown,
TearDownTimeout: 2 * time.Minute,

View File

@ -23,12 +23,11 @@ export default function (props: Props) {
return (
<Dialog
id="methods-dialog"
open={props.open}
className={style.root}
onClose={props.onClose}>
<DialogContent>
<Grid container justify="center" spacing={1}>
<Grid container justify="center" spacing={1} id="methods-dialog">
{props.methods.has(SecondFactorMethod.TOTP)
? <MethodItem
id="one-time-password-option"