1
0
Fork 0
forked from mirror/prosody

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

@ -4,6 +4,11 @@
* Nothing * Nothing
## v1.2.7
* Updated to Prosody version [0.12.0](https://blog.prosody.im/prosody-0.12.0-released/).
* Updated luarocks to version 3.9.0.
## v1.2.6 ## v1.2.6
* Updated to Prosody version [0.11.13](https://blog.prosody.im/prosody-0.11.13-released/). * Updated to Prosody version [0.11.13](https://blog.prosody.im/prosody-0.11.13-released/).

View file

@ -4,11 +4,11 @@ ARG BUILD_DATE
ARG VCS_REF ARG VCS_REF
ARG VERSION ARG VERSION
ARG LUAROCKS_VERSION=3.8.0 ARG LUAROCKS_VERSION=3.9.0
ARG PROSODY_VERSION=0.11.13 ARG PROSODY_VERSION=0.12.0
ARG LUAROCKS_SHA256=56ab9b90f5acbc42eb7a94cf482e6c058a63e8a1effdf572b8b2a6323a06d923 ARG LUAROCKS_SHA256=5e840f0224891de96be4139e9475d3b1de7af3a32b95c1bdf05394563c60175f
ARG PROSODY_DOWNLOAD_SHA256=39c61b346a09b5125b604cb969e14206cbbcb86c81156ffc6ba2d62527cf0432 ARG PROSODY_DOWNLOAD_SHA256=752ff32015dac565fc3417c2196af268971c358ee066e51f5d912413580d889a
LABEL luarocks.version="${LUAROCKS_VERSION}" LABEL luarocks.version="${LUAROCKS_VERSION}"
LABEL org.opencontainers.image.authors="Sara Smiseth" LABEL org.opencontainers.image.authors="Sara Smiseth"
@ -26,6 +26,7 @@ LABEL prosody.version="${PROSODY_VERSION}"
RUN apt-get update \ RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \
libevent-dev `# this is no build dependency, but needed for luaevent` \ libevent-dev `# this is no build dependency, but needed for luaevent` \
libicu67 \
libidn11 \ libidn11 \
libpq-dev \ libpq-dev \
libsqlite3-0 \ libsqlite3-0 \
@ -36,11 +37,12 @@ RUN apt-get update \
lua-filesystem \ lua-filesystem \
lua-socket \ lua-socket \
lua-sec \ lua-sec \
lua-unbound \
wget \ wget \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN buildDeps='gcc git libc6-dev libidn11-dev liblua5.2-dev libsqlite3-dev libssl-dev make unzip' \ RUN buildDeps='gcc git libc6-dev libidn11-dev liblua5.2-dev libsqlite3-dev libssl-dev libicu-dev make unzip' \
&& set -x \ && set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \

View file

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

View file

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

View file

@ -18,7 +18,7 @@ generateCert() {
registerTestUser() { registerTestUser() {
local userName="$1" local userName="$1"
local containerName="$2" 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() { registerTestUsers() {
@ -60,12 +60,12 @@ sudo docker-compose down \
&& sleep 10 \ && sleep 10 \
&& sudo docker-compose up -d prosody_postgres && sudo docker-compose up -d prosody_postgres
registerTestUsers tests_prosody_postgres_1 registerTestUsers prosody_postgres
runTests prosody_postgres runTests prosody_postgres
sudo docker-compose down sudo docker-compose down
# Run tests for second container with SQLite # Run tests for second container with SQLite
sudo docker-compose up -d prosody sudo docker-compose up -d prosody
registerTestUsers tests_prosody_1 registerTestUsers prosody
runTests prosody runTests prosody
sudo docker-compose down sudo docker-compose down

View file

@ -3,41 +3,40 @@
load 'bats/bats-support/load' load 'bats/bats-support/load'
load 'bats/bats-assert/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" { @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_success
assert_output "5" assert_output "5"
} }
@test "Should select certificate for localhost" { @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_success
assert_output "3" assert_output "1"
} }
@test "Should select certificate for conference.localhost" { @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_success
assert_output "3" assert_output "1"
} }
@test "Should select certificate for proxy.localhost" { @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_success
assert_output "3" assert_output "1"
} }
@test "Should select certificate for pubsub.localhost" { @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_success
assert_output "3" assert_output "1"
} }
@test "Should select certificate for upload.localhost" { @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_success
assert_output "3" assert_output "1"
} }
@test "Should log error for user with wrong password" { @test "Should log error for user with wrong password" {
@ -70,12 +69,6 @@ load 'bats/bats-assert/load'
assert_output 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" { @test "Should activate https" {
run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 'https' on (\[::\]:5281|\[\*\]:5281), (\[::\]:5281|\[\*\]:5281)\"" run bash -c "sudo docker-compose logs $batsContainerName | grep -E \"Activated service 'https' on (\[::\]:5281|\[\*\]:5281), (\[::\]:5281|\[\*\]:5281)\""
assert_success assert_success