Skip to content

Commit 785d4ab

Browse files
authored
Delete all exsting config tests before tests (hestiacp#3349)
* Delete all exsting config tests before tests * Fix typo in command * Use correct path * Update test
1 parent d27e7cd commit 785d4ab

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

bin/v-check-user-2fa

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if [ -z "$TWOFA" ]; then
4444
fi
4545

4646
# Check if token is valid
47-
result=$($HESIA_PHP $HESTIA/web/inc/2fa/check.php "$TWOFA" "$token")
47+
result=$($HESTIA_PHP $HESTIA/web/inc/2fa/check.php "$TWOFA" "$token")
4848
if [ "$result" != "ok" ]; then
4949
echo "Error: Authentication token mismatch."
5050
exit 9

test/config-tests.bats

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,21 @@ function setup() {
3535
source $HESTIA/func/ip.sh
3636
}
3737

38-
@test "Setup" {
38+
@test "Prepare for tests" {
39+
run rm -f /usr/local/hestia/data/templates/web/nginx/php-fpm/*.*
40+
run rm -f /usr/local/hestia/data/templates/web/nginx/*.*
41+
run rm -f /usr/local/hestia/data/templates/web/apache2/php-fpm/*.*
42+
run rm -f /usr/local/hestia/data/templates/web/apache2/*.*
43+
44+
run v-update-web-templates
45+
}
46+
47+
@test "Setup Test domain" {
3948
run v-add-user $user $user $user@hestiacp.com default "Super Test"
4049
assert_success
4150
refute_output
4251

43-
run run v-add-web-domain $user 'testhestiacp.com'
52+
run v-add-web-domain $user 'testhestiacp.com'
4453
assert_success
4554
refute_output
4655

@@ -78,4 +87,4 @@ function setup() {
7887
run v-delete-user $user
7988
assert_success
8089
refute_output
81-
}
90+
}

0 commit comments

Comments
 (0)