summaryrefslogtreecommitdiff
path: root/pieni.net.yarn
blob: b1b2ab6d6054fff457ac06322d155e0d084fbe94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
---
title: System tests for pieni.net
author: Lars Wirzenius
version: 2017-04-21
...

# Introduction

This is a system test suite written in [yarn][]. They test the various
aspects of my personal server.

[yarn]: http://liw.fi/cmdtest/


## Configuration and running the test suite

To run the test suite, specify the server address that is to be
tested. In order to be able to run these tests against a new server,
before DNS gets updated, the domain names are not hardcoded. Instead,
you need to specify the address (IP address or DNS name) of the
server, and the tests pretend it has whatever service names in DNS
that need to be updated.

Do this with:

    EXAMPLE
    yarn --env ADDRESS=new.example.com ...


# files.liw.fi

<http://files.liw.fi/> is where I publish various files I want to
share with others. There are no accounts, no passwords. A tiny amount
of privacy is available by not having directory listings and choosing
semi-random URLs, but mostly I just don't put anything really
sensitive there.

    SCENARIO files.liw.fi
    GIVEN server is also known as files.liw.fi

    WHEN user fetches http://files.liw.fi/
    THEN HTTP status is 200
    AND HTTP body matches "Random files of mine"

    WHEN user fetches http://files.liw.fi/private/
    THEN HTTP status is 200
    AND HTTP body matches "Not for you"


# code.liw.fi

`code.liw.fi` is where I publish my free software projects. There is a
directory per project, for project specific files, and a repository of
packages for Debian.

    SCENARIO code.liw.fi
    GIVEN server is also known as code.liw.fi

    WHEN user fetches http://code.liw.fi/
    THEN HTTP status is 200
    AND HTTP body matches "http://liw\.fi/code"

    WHEN user fetches http://code.liw.fi/debian/
    THEN HTTP status is 200
    AND HTTP body matches "dists"
    AND HTTP body matches "pool"

`apt.asc` has the signing key for the Debian package archive.

    WHEN user fetches http://code.liw.fi/apt.asc
    THEN HTTP status is 200
    AND HTTP body matches "-----BEGIN PGP PUBLIC KEY BLOCK-----"


# benchmark.obnam.org

`benchmark.obnam.org` is where I publish benchmark results from
Obnam, a side project of mine.

    SCENARIO benchmark.obnam.org
    GIVEN server is also known as benchmark.obnam.org

    WHEN user fetches http://benchmark.obnam.org/
    THEN HTTP status is 200
    AND HTTP body matches "Obnam benchmarks"


# bugs.liw.fi

`bugs.liw.fi` is where I publish a static website showing the status
of my distix instance for random personal projects.

    SCENARIO bugs.liw.fi
    GIVEN server is also known as bugs.liw.fi

    WHEN user fetches http://bugs.liw.fi/
    THEN HTTP status is 200
    AND HTTP body matches "distix"
    AND HTTP body matches "Lars Wirzenius"


# distix.obnam.org

`distix.obnam.org` is where I publish a static website showing the
status of my Obnam distix instances.

    SCENARIO distix.obnam.org
    GIVEN server is also known as distix.obnam.org

    WHEN user fetches http://distix.obnam.org/
    THEN HTTP status is 200
    AND HTTP body matches "distix"
    AND HTTP body matches "obnam-support"
    AND HTTP body matches "obnam-dev"

    WHEN user fetches http://distix.obnam.org/obnam-dev/
    THEN HTTP status is 200
    AND HTTP body matches "distix"
    AND HTTP body matches "Obnam development"

    WHEN user fetches http://distix.obnam.org/obnam-support/
    THEN HTTP status is 200
    AND HTTP body matches "distix"
    AND HTTP body matches "Obnam"
    AND HTTP body matches "support"


# liw.iki.fi

`liw.iki.fi` is where I have an old website and blog.

    SCENARIO liw.iki.fi
    GIVEN server is also known as liw.iki.fi

    WHEN user fetches http://liw.iki.fi/
    THEN HTTP status is 200

    WHEN user fetches http://liw.iki.fi/
    THEN HTTP status is 200

    WHEN user fetches http://liw.iki.fi/liw/
    THEN HTTP status is 200

    WHEN user fetches http://liw.iki.fi/liw/log/index.html
    THEN HTTP status is 200

    WHEN user fetches http://liw.iki.fi/liw/log2/index.html
    THEN HTTP status is 200


# git.liw.fi

`git.liw.fi` is where my git server resides. Over HTTP it exposes
cgit for browing public repositories.

    SCENARIO git.liw.fi
    GIVEN server is also known as git.liw.fi

    WHEN user fetches http://git.liw.fi/
    THEN HTTP status is 200
    AND HTTP body matches "cgit"
    AND HTTP body matches "obnam"
    AND HTTP body matches "bumper"

It must also have Gitano accessible over ssh.

    WHEN user runs Gitano help
    THEN exit code is 0
    AND standard error matches "Gitano"

Also, it'd be nice if the anonymous git protocol works.

    WHEN user clones the bumper repository over git://
    THEN exit code is 0


# noir.liw.fi

`noir.liw.fi` is where I publish my novel.

    SCENARIO noir.liw.fi
    GIVEN server is also known as noir.liw.fi

    WHEN user fetches http://noir.liw.fi/
    THEN HTTP status is 200
    AND HTTP body matches "Hacker Noir"


# docstory.fi

`docstory.fi` is something I host for someone else.

    SCENARIO docstory.fi

    GIVEN server is also known as docstory.fi
    WHEN user fetches http://docstory.fi/
    THEN HTTP status is 200
    AND HTTP body matches "meta.*refresh.*URL=http://filmmaker.docstory.fi"

    GIVEN server is also known as www.docstory.fi
    WHEN user fetches http://www.docstory.fi/
    THEN HTTP status is 200
    AND HTTP body matches "meta.*refresh.*URL=http://filmmaker.docstory.fi"


# Mail handling

`pieni.net` is what handles all my incoming mail. There are several
important addresses on a couple of domains. Let's see if they all
work. We do this by sending mail (over SMTP+TLS) and checking it
arrives (over IMAP+TLS). For each mail we use a large random number as
the subject, making each mail unique and easy to check for.

To run these tests we need to be able to log in via IMAP. For this,
we'll need passwords, and we will get the passwords with the `pass`
utility. Each password should be stored using a name
`server-yarns/imap/username@server` where `username` is the user and
`server` the address used for IMAP.

    SCENARIO server handles incoming mail

    GIVEN server is also known as pieni.net

    GIVEN large random number R
    WHEN someone sends mail to postmaster@pieni.net with subject $R
    THEN mailbox of liw has a mail with subject $R
    AND mails for liw with subject $R get deleted

    GIVEN large random number R
    WHEN someone sends mail to root@pieni.net with subject $R
    THEN mailbox of liw has a mail with subject $R
    AND mails for liw with subject $R get deleted

    GIVEN large random number R
    WHEN someone sends mail to abuse@pieni.net with subject $R
    THEN mailbox of liw has a mail with subject $R
    AND mails for liw with subject $R get deleted

    GIVEN server is also known as liw.fi

    GIVEN large random number R
    WHEN someone sends mail to postmaster@liw.fi with subject $R
    THEN mailbox of liw has a mail with subject $R
    AND mails for liw with subject $R get deleted

    GIVEN large random number R
    WHEN someone sends mail to abuse@liw.fi with subject $R
    THEN mailbox of liw has a mail with subject $R
    AND mails for liw with subject $R get deleted

    GIVEN large random number R
    WHEN someone sends mail to liw-passthrough@liw.fi with subject $R
    THEN mailbox of liw has a mail with subject $R
    AND mails for liw with subject $R get deleted

    WHEN someone sends mail to bugs-passthrough@liw.fi with subject $R
    THEN mailbox of distix has a mail with subject $R
    AND mailbox of liw has a mail with subject $R
    AND mails for distix with subject $R get deleted
    AND mails for liw with subject $R get deleted

`pieni.net` needs to accept mail from my various machines, and relay
them anywhere. However, only from my machines, not any random spammer.

    SCENARIO mail relaying is denied
    WHEN client sends MAIL FROM:root@code.liw.fi
    AND client sends RCPT TO:liw@iki.fi
    THEN SMTP status code is 554

    SCENARIO mail relaying is allowed for pienirelay
    WHEN client SMTP authenticates as pienirelay
    AND client sends MAIL FROM:root@code.liw.fi
    AND client sends RCPT TO:liw@iki.fi
    THEN SMTP status code is 250