Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mtxclient
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
mtxclient
Commits
634be43b
Commit
634be43b
authored
5 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Use official, latest synapse and fix tests
parent
67d481e2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.ci/adjust-config.sh
+42
-3
42 additions, 3 deletions
.ci/adjust-config.sh
Makefile
+10
-8
10 additions, 8 deletions
Makefile
tests/client_api.cpp
+4
-3
4 additions, 3 deletions
tests/client_api.cpp
with
56 additions
and
14 deletions
.ci/adjust-config.sh
+
42
−
3
View file @
634be43b
...
...
@@ -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: 100
0
/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
This diff is collapsed.
Click to expand it.
Makefile
+
10
−
8
View file @
634be43b
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:8
44
8
\
-p
8448:8
44
8
\
-p
443:8
00
8
\
-p
8448:8
00
8
\
-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/
ba
sh
-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 http
s
://localhost:8008'
@
echo
Register bob
@
docker
exec
synapse /bin/
ba
sh
-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 http
s
://localhost:8008'
@
echo
Register carl
@
docker
exec
synapse /bin/
ba
sh
-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 http
s
://localhost:8008'
stop-synapse
:
##
Stop any running instance of synapse
@
rm
-rf
./data/
*
...
...
This diff is collapsed.
Click to expand it.
tests/client_api.cpp
+
4
−
3
View file @
634be43b
...
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment