* New environment variable STORAGE was added. Defaults to sql like before. See [prosody docs](https://prosody.im/doc/storage). This fixes [#38](https://github.com/SaraSmiseth/prosody/issues/38).

* New tests for a container with STORAGE set to `internal`.
This commit is contained in:
Sara Aimée Smiseth 2022-08-19 10:01:29 +02:00
parent ab2afd4249
commit eb572d8180
7 changed files with 133 additions and 81 deletions

View file

@ -18,6 +18,24 @@ services:
volumes:
- ./certs:/usr/local/etc/prosody/certs
prosody_internal_storage:
image: prosody
restart: unless-stopped
ports:
- "5000:5000"
- "5222:5222"
- "5223:5223"
- "5269:5269"
- "5281:5281"
environment:
DOMAIN: localhost
E2E_POLICY_WHITELIST: "admin@localhost, user1@localhost"
LOG_LEVEL: debug
PROSODY_ADMINS: "admin@localhost, admin2@localhost"
STORAGE: "internal"
volumes:
- ./certs:/usr/local/etc/prosody/certs
prosody_postgres:
image: prosody
restart: unless-stopped
@ -45,7 +63,7 @@ services:
- postgres
postgres:
image: postgres:13-alpine
image: postgres:14-alpine
restart: unless-stopped
environment:
POSTGRES_DB: prosody

View file

@ -69,3 +69,9 @@ sudo docker-compose up -d prosody
registerTestUsers prosody
runTests prosody
sudo docker-compose down
# Run tests for third container with internal storage
sudo docker-compose up -d prosody_internal_storage
registerTestUsers prosody_internal_storage
runTests prosody_internal_storage
sudo docker-compose down

View file

@ -0,0 +1,21 @@
# For tests with pipes see: https://github.com/sstephenson/bats/issues/10
load 'bats/bats-support/load'
load 'bats/bats-assert/load'
# TODO
#@test "Should use internal storage" {
# run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Connecting to \[SQLite3\] \/usr\/local\/var\/lib\/prosody\/prosody\.sqlite\.\.\.\""
# assert_failure
# assert_output
#}
@test "Should not use sqlite" {
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Connecting to \[SQLite3\] \/usr\/local\/var\/lib\/prosody\/prosody\.sqlite\.\.\.\""
assert_failure
}
@test "Should not use postgres" {
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Connecting to \[PostgreSQL\] prosody\.\.\.\""
assert_failure
}