Skip to content

Commit 9657e13

Browse files
authored
Add conduwuit (#723)
* add conduwuit to list of runtime homeservers Signed-off-by: strawberry <[email protected]> * allow conduwuit to run Content-Disposition tests we perform the checks being tested Signed-off-by: strawberry <[email protected]> --------- Signed-off-by: strawberry <[email protected]>
1 parent 370a014 commit 9657e13

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

dockerfiles/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ duplication, we now point to dockerfiles in respective repositories rather than
88
- Dendrite: https://github.com/matrix-org/dendrite/blob/v0.8.2/build/scripts/Complement.Dockerfile
99
- Synapse: https://github.com/matrix-org/synapse/blob/develop/docker/complement/Dockerfile
1010
- Conduit: https://gitlab.com/famedly/conduit/-/blob/next/tests/Complement.Dockerfile
11+
- conduwuit: https://conduwuit.puppyirl.gay/development/testing.html

runtime/hs.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import (
88
)
99

1010
const (
11-
Dendrite = "dendrite"
12-
Synapse = "synapse"
13-
Conduit = "conduit"
11+
Dendrite = "dendrite"
12+
Synapse = "synapse"
13+
Conduit = "conduit"
14+
Conduwuit = "conduwuit"
1415
)
1516

1617
var Homeserver string

runtime/hs_conduwuit.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build conduwuit_blacklist || conduit_blacklist
2+
// +build conduwuit_blacklist conduit_blacklist
3+
4+
// for now, a couple skipped conduit tests still apply to conduwuit. this will change in the future
5+
6+
package runtime
7+
8+
func init() {
9+
Homeserver = Conduwuit
10+
}

tests/media_filename_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ func TestMediaFilenames(t *testing.T) {
121121
})
122122

123123
t.Run("Will serve safe media types as inline", func(t *testing.T) {
124-
if runtime.Homeserver != runtime.Synapse {
124+
if runtime.Homeserver != runtime.Synapse && runtime.Homeserver != runtime.Conduwuit {
125125
// We need to check that this security behaviour is being correctly run in
126-
// Synapse, but since this is not part of the Matrix spec we do not assume
126+
// Synapse or conduwuit, but since this is not part of the Matrix spec we do not assume
127127
// other homeservers are doing so.
128-
t.Skip("Skipping test of Content-Disposition header requirements on non-Synapse homeserver")
128+
t.Skip("Skipping test of Content-Disposition header requirements on non-Synapse and non-conduwuit homeserver")
129129
}
130130
t.Parallel()
131131

@@ -139,11 +139,11 @@ func TestMediaFilenames(t *testing.T) {
139139
})
140140

141141
t.Run("Will serve safe media types with parameters as inline", func(t *testing.T) {
142-
if runtime.Homeserver != runtime.Synapse {
142+
if runtime.Homeserver != runtime.Synapse && runtime.Homeserver != runtime.Conduwuit {
143143
// We need to check that this security behaviour is being correctly run in
144-
// Synapse, but since this is not part of the Matrix spec we do not assume
144+
// Synapse or conduwuit, but since this is not part of the Matrix spec we do not assume
145145
// other homeservers are doing so.
146-
t.Skip("Skipping test of Content-Disposition header requirements on non-Synapse homeserver")
146+
t.Skip("Skipping test of Content-Disposition header requirements on non-Synapse and non-conduwuit homeserver")
147147
}
148148
t.Parallel()
149149

@@ -158,11 +158,11 @@ func TestMediaFilenames(t *testing.T) {
158158
})
159159

160160
t.Run("Will serve unsafe media types as attachments", func(t *testing.T) {
161-
if runtime.Homeserver != runtime.Synapse {
161+
if runtime.Homeserver != runtime.Synapse && runtime.Homeserver != runtime.Conduwuit {
162162
// We need to check that this security behaviour is being correctly run in
163-
// Synapse, but since this is not part of the Matrix spec we do not assume
163+
// Synapse or conduwuit, but since this is not part of the Matrix spec we do not assume
164164
// other homeservers are doing so.
165-
t.Skip("Skipping test of Content-Disposition header requirements on non-Synapse homeserver")
165+
t.Skip("Skipping test of Content-Disposition header requirements on non-Synapse and non-conduwuit homeserver")
166166
}
167167
t.Parallel()
168168

0 commit comments

Comments
 (0)