Skip to content
Snippets Groups Projects
Commit 634be43b authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Use official, latest synapse and fix tests

parent 67d481e2
No related branches found
No related tags found
No related merge requests found
......@@ -7,8 +7,47 @@ if [[ ! -z $TRAVIS_OS_NAME ]]; then
fi
$CMD perl -pi -w -e \
's/rc_messages_per_second.*/rc_messages_per_second: 100/g;' data/homeserver.yaml
's/rc_messages_per_second.*/rc_messages_per_second: 1000/g;' data/homeserver.yaml
$CMD perl -pi -w -e \
's/rc_message_burst_count.*/rc_message_burst_count: 1000/g;' data/homeserver.yaml
's/rc_message_burst_count.*/rc_message_burst_count: 10000/g;' data/homeserver.yaml
(
cat <<HEREDOC
rc_message:
per_second: 1000
burst_count: 10000
rc_registration:
per_second: 1000
burst_count: 3000
rc_login:
address:
per_second: 1000
burst_count: 3000
account:
per_second: 1000
burst_count: 3000
failed_attempts:
per_second: 1000
burst_count: 3000
rc_admin_redaction:
per_second: 1000
burst_count: 5000
HEREDOC
) | $CMD tee -a data/homeserver.yaml
$CMD perl -pi -w -e \
's/enable_registration.*/enable_registration: True/g;' data/homeserver.yaml
's/#enable_registration: false/enable_registration: true/g;' data/homeserver.yaml
$CMD perl -pi -w -e \
's/tls: false/tls: true/g;' data/homeserver.yaml
$CMD perl -pi -w -e \
's/#tls_certificate_path:/tls_certificate_path:/g;' data/homeserver.yaml
$CMD perl -pi -w -e \
's/#tls_private_key_path:/tls_private_key_path:/g;' data/homeserver.yaml
$CMD openssl req -x509 -newkey rsa:4096 -keyout data/localhost.tls.key -out data/localhost.tls.crt -days 365 -subj '/CN=localhost' -nodes
$CMD chmod 0777 data/localhost.tls.crt
$CMD chmod 0777 data/localhost.tls.key
FILES=`find lib include tests examples -type f -type f \( -iname "*.cpp" -o -iname "*.hpp" \)`
SYNAPSE_IMAGE="avhost/docker-matrix:v0.33.4"
SYNAPSE_IMAGE="matrixdotorg/synapse:v1.7.2"
DEPS_BUILD_DIR=.deps
DEPS_SOURCE_DIR=deps
......@@ -43,23 +43,25 @@ image:
docker build -t mtxclient-dev .
synapse: ## Start a synapse instance on docker
@mkdir -p data
@chmod 0777 data
@docker run -v `pwd`/data:/data --rm \
-e SERVER_NAME=localhost -e REPORT_STATS=no ${SYNAPSE_IMAGE} generate
-e SYNAPSE_SERVER_NAME=localhost -e SYNAPSE_REPORT_STATS=no ${SYNAPSE_IMAGE} generate
@./.ci/adjust-config.sh
@docker run -d \
--name synapse \
-p 443:8448 \
-p 8448:8448 \
-p 443:8008 \
-p 8448:8008 \
-p 8008:8008 \
-v `pwd`/data:/data ${SYNAPSE_IMAGE} start
-v `pwd`/data:/data ${SYNAPSE_IMAGE}
@echo Waiting for synapse to start...
@until curl -s -f -k https://localhost:443/_matrix/client/versions; do echo "Checking ..."; sleep 2; done
@echo Register alice
@docker exec synapse /bin/bash -c 'register_new_matrix_user --admin -u alice -p secret -c /data/homeserver.yaml http://localhost:8008'
@docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u alice -p secret -c /data/homeserver.yaml https://localhost:8008'
@echo Register bob
@docker exec synapse /bin/bash -c 'register_new_matrix_user --admin -u bob -p secret -c /data/homeserver.yaml http://localhost:8008'
@docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u bob -p secret -c /data/homeserver.yaml https://localhost:8008'
@echo Register carl
@docker exec synapse /bin/bash -c 'register_new_matrix_user --admin -u carl -p secret -c /data/homeserver.yaml http://localhost:8008'
@docker exec synapse /bin/sh -c 'register_new_matrix_user --admin -u carl -p secret -c /data/homeserver.yaml https://localhost:8008'
stop-synapse: ## Stop any running instance of synapse
@rm -rf ./data/*
......
......@@ -40,9 +40,8 @@ TEST(ClientAPI, Register)
if (res.flows.size() == 0)
return;
EXPECT_EQ(res.flows.size(), 2);
EXPECT_EQ(res.flows.size(), 1);
EXPECT_EQ(res.flows[0].stages[0], "m.login.dummy");
EXPECT_EQ(res.flows[1].stages[0], "m.login.email.identity");
user->flow_response(
username,
......@@ -596,11 +595,13 @@ TEST(ClientAPI, Versions)
mtx_client->versions([](const mtx::responses::Versions &res, RequestErr err) {
check_error(err);
EXPECT_EQ(res.versions.size(), 4);
EXPECT_EQ(res.versions.size(), 6);
EXPECT_EQ(res.versions.at(0), "r0.0.1");
EXPECT_EQ(res.versions.at(1), "r0.1.0");
EXPECT_EQ(res.versions.at(2), "r0.2.0");
EXPECT_EQ(res.versions.at(3), "r0.3.0");
EXPECT_EQ(res.versions.at(4), "r0.4.0");
EXPECT_EQ(res.versions.at(5), "r0.5.0");
});
mtx_client->close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment