Update prosody to version 0.12.0 (#35)

* Update luarocks to 3.9.0
* Update tests for prosody version 0.12.0
This commit is contained in:
Sara Aimée Smiseth 2022-05-05 18:25:19 +02:00 committed by GitHub
parent 13d9c1b9d1
commit 7a4ebd68d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 29 deletions

View file

@ -1,4 +1,4 @@
version: '3.7'
version: '3.9'
services:
prosody:

View file

@ -1,3 +1,3 @@
aioxmpp==0.12.2
aioxmpp==0.13.2
pip-chill==1.0.1
pytest-asyncio==0.15.1
pytest-asyncio==0.18.3

View file

@ -18,7 +18,7 @@ generateCert() {
registerTestUser() {
local userName="$1"
local containerName="$2"
sudo docker exec "$containerName" /bin/bash -c "/entrypoint.bash register $userName localhost 12345678"
sudo docker compose exec "$containerName" /bin/bash -c "/entrypoint.bash register $userName localhost 12345678"
}
registerTestUsers() {
@ -60,12 +60,12 @@ sudo docker-compose down \
&& sleep 10 \
&& sudo docker-compose up -d prosody_postgres
registerTestUsers tests_prosody_postgres_1
registerTestUsers prosody_postgres
runTests prosody_postgres
sudo docker-compose down
# Run tests for second container with SQLite
sudo docker-compose up -d prosody
registerTestUsers tests_prosody_1
registerTestUsers prosody
runTests prosody
sudo docker-compose down

View file

@ -3,41 +3,40 @@
load 'bats/bats-support/load'
load 'bats/bats-assert/load'
# group alternation in regex because the xml properties switch around. sometimes 'type=...' comes after 'to=...' and sometimes before
@test "Should send 5 messages" {
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Received\[c2s\]: <message (type='chat'|to='.*@localhost'|id=':.*') (type='chat'|to='.*@localhost'|id=':.*') (type='chat'|to='.*@localhost'|id=':.*')>\" | wc -l"
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Received\[c2s\]: <message\" | wc -l"
assert_success
assert_output "5"
}
@test "Should select certificate for localhost" {
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Selecting certificate /usr/local/etc/prosody/certs/localhost/fullchain.pem with key /usr/local/etc/prosody/certs/localhost/privkey.pem for localhost\" | wc -l"
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Certificates loaded\" | grep \" localhost:tls\" | wc -l"
assert_success
assert_output "3"
assert_output "1"
}
@test "Should select certificate for conference.localhost" {
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Selecting certificate /usr/local/etc/prosody/certs/conference.localhost/fullchain.pem with key /usr/local/etc/prosody/certs/conference.localhost/privkey.pem for conference.localhost\" | wc -l"
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"conference.localhost:tls\" | wc -l"
assert_success
assert_output "3"
assert_output "1"
}
@test "Should select certificate for proxy.localhost" {
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Selecting certificate /usr/local/etc/prosody/certs/proxy.localhost/fullchain.pem with key /usr/local/etc/prosody/certs/proxy.localhost/privkey.pem for proxy.localhost\" | wc -l"
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"proxy.localhost:tls\" | wc -l"
assert_success
assert_output "3"
assert_output "1"
}
@test "Should select certificate for pubsub.localhost" {
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Selecting certificate /usr/local/etc/prosody/certs/pubsub.localhost/fullchain.pem with key /usr/local/etc/prosody/certs/pubsub.localhost/privkey.pem for pubsub.localhost\" | wc -l"
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"pubsub.localhost:tls\" | wc -l"
assert_success
assert_output "3"
assert_output "1"
}
@test "Should select certificate for upload.localhost" {
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Selecting certificate /usr/local/etc/prosody/certs/upload.localhost/fullchain.pem with key /usr/local/etc/prosody/certs/upload.localhost/privkey.pem for upload.localhost\" | wc -l"
run bash -c "sudo docker-compose logs $batsContainerName | grep \"Certificates loaded\" | grep \"upload.localhost:tls\" | wc -l"
assert_success
assert_output "3"
assert_output "1"
}
@test "Should log error for user with wrong password" {
@ -70,12 +69,6 @@ load 'bats/bats-assert/load'
assert_output
}
@test "Should activate http" {
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 'http' on (\[::\]:5280|\[\*\]:5280), (\[::\]:5280|\[\*\]:5280)\""
assert_success
assert_output
}
@test "Should activate https" {
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 'https' on (\[::\]:5281|\[\*\]:5281), (\[::\]:5281|\[\*\]:5281)\""
assert_success