summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-08-30 07:57:15 +0200
committerJoas Schilling <coding@schilljs.com>2023-08-30 07:57:15 +0200
commit7af01e70f530afbce2ef8712490a0964a3e7ae9b (patch)
tree7db0caac1f88340bc6c8809dc73a101116fa0ee6 /tests
parent5e7abb60392ce5171b896e4026f7e373d1facf3a (diff)
fix(CI): Only reset BFP when we changed it
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/features/bootstrap/FeatureContext.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php
index 21fb9edda..2ef66eefa 100644
--- a/tests/integration/features/bootstrap/FeatureContext.php
+++ b/tests/integration/features/bootstrap/FeatureContext.php
@@ -106,6 +106,8 @@ class FeatureContext implements Context, SnippetAcceptingContext {
/** @var array */
protected array $changedConfigs = [];
+ protected bool $changedBruteforceSetting = false;
+
private ?SharingContext $sharingContext;
private ?bool $guestsAppWasEnabled = null;
@@ -2972,7 +2974,9 @@ class FeatureContext implements Context, SnippetAcceptingContext {
}
$this->setCurrentUser($currentUser);
- $this->enableDisableBruteForceProtection('disable');
+ if ($this->changedBruteforceSetting) {
+ $this->enableDisableBruteForceProtection('disable');
+ }
}
/**
@@ -3038,7 +3042,9 @@ class FeatureContext implements Context, SnippetAcceptingContext {
* @Given /^(enable|disable) brute force protection$/
*/
public function enableDisableBruteForceProtection(string $enable): void {
- if ($enable === 'disable') {
+ if ($enable === 'enable') {
+ $this->changedBruteforceSetting = true;
+ } else {
// Reset the attempts before disabling
$this->runOcc(['security:bruteforce:reset', '127.0.0.1']);
$this->theCommandWasSuccessful();
@@ -3064,6 +3070,8 @@ class FeatureContext implements Context, SnippetAcceptingContext {
$this->theCommandWasSuccessful();
$this->runOcc(['security:bruteforce:reset', '::1']);
$this->theCommandWasSuccessful();
+ } else {
+ $this->changedBruteforceSetting = false;
}
}