-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrun-bats-tests.sh
executable file
·54 lines (45 loc) · 1.42 KB
/
run-bats-tests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bats
@test "Check that we have a /tmp directory" {
run stat /tmp
[ $status = 0 ]
}
# @test "Check that we get redirected from http to https" {
# run curl -A bats-test -I http://$WP_DEFAULT_HOST/
# [ $status = 0 ]
# [[ $output =~ "301" ]]
# }
@test "Check that we can fetch the startpage" {
run curl -A bats-test -I https://$WP_DEFAULT_HOST/
[ $status = 0 ]
[[ $output =~ "200" ]]
}
@test "Check that we get the correct content of the startpage" {
run curl -A bats-test https://$WP_DEFAULT_HOST/
[ $status = 0 ]
[[ $output =~ "WordPress" ]]
}
@test "Check that we can fetch the loginpage" {
run curl -A bats-test -I https://$WP_DEFAULT_HOST/wp-login.php
[ $status = 0 ]
[[ $output =~ "200" ]]
}
@test "Check that we cannot fetch the wp-config.conf" {
run curl -A bats-test -I https://$WP_DEFAULT_HOST/wp-config.php
[ $status = 0 ]
[[ $output =~ "403" ]]
}
@test "Check that we cannot fetch the wp-settings.conf" {
run curl -A bats-test -I https://$WP_DEFAULT_HOST/wp-settings.php
[ $status = 0 ]
[[ $output =~ "403" ]]
}
@test "Check that we cannot fetch the readme.html" {
run curl -A bats-test -I https://$WP_DEFAULT_HOST/readme.html
[ $status = 0 ]
[[ $output =~ "403" ]]
}
@test "Check that we cannot fetch the license.html" {
run curl -A bats-test -I https://$WP_DEFAULT_HOST/license.html
[ $status = 0 ]
[[ $output =~ "403" ]]
}