Commit graph

520 commits

Author SHA1 Message Date
Lukas Fleischer
016b40f99d Render comments when storing them in the database
Instead of converting package comments from plain text to HTML code when
they are displayed, do the conversion when the comment is posted and
store the rendered result in the database. The conversion itself is done
by a Python script which uses Bleach for sanitizing the text.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-04-23 18:43:26 +02:00
Lukas Fleischer
9de633b1f2 test/setup.sh: Error out on missing SQLite schema
Instead of making all tests fail, error out during initialization if the
SQLite schema has not been generated.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-03-03 20:30:57 +01:00
Lukas Fleischer
da4bd3b59e Add a Makefile to build an SQLite-compatible schema
Allow for automatically converting the schema into a schema that works
with SQLite by running `make` from the schema/ subdirectory. Use the new
Makefile in the test suite.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-03-01 20:12:57 +01:00
Lukas Fleischer
33095b3292 t1200: Test IP address log and bans
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-25 18:42:34 +01:00
Lukas Fleischer
0b09f200c5 t1200: Add tests for vote/unvote
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2017-01-23 09:10:29 +01:00
Lukas Fleischer
6d8edafe77 t1200: Add tests for flag/unflag
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-12-20 18:04:46 +01:00
Lukas Fleischer
ba89ad9b9f t1200: Test maintenance mode
Add a test case to ensure that enabling the maintenance mode disables
the SSH interface.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-12-20 18:04:46 +01:00
Lukas Fleischer
9dd0d92d61 Add tests for out-of-date notifications
Make sure that out-of-date notifications are sent to package base
maintainers as well as co-maintainers.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-13 15:40:34 +01:00
Lukas Fleischer
d987d756b0 test/setup.sh: Fix script paths
The scripts were moved to aurweb/scripts/ in commit 3718860 (Make
maintenance scripts installable, 2016-10-17). Update the paths in the
test suite accordingly.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-11-13 15:33:02 +01:00
Lukas Fleischer
fc6dc44295 git-serve: Close orphan requests upon disown
When disowning a package base via the SSH interface, auto-accept all
pending orphan requests for the affected package.

Also, add a test case that checks whether (only) orphan requests
belonging to disowned packages are closed correctly.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-11 22:14:41 +02:00
Lukas Fleischer
29a5f94dab git-update: Catch long source URLs
Bail out early if the source array contains an entry with more than 8000
characters.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-11 08:36:40 +02:00
Lukas Fleischer
1492444ecb Make URL columns 8000 characters wide
According to RFC 7230, URLs can be up too 8000 characters long. Resize
all URL fields accordingly.

Also, add a test to verify that URLs with more than 8000 characters are
rejected by the update hook.

Reported-by: Andreas Linz <klingt.net@gmail.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-11 08:36:40 +02:00
Lukas Fleischer
d4fe77ac57 Reorganize Git interface scripts
Move the Git interface scripts from git-interface/ to aurweb/git/. Use
setuptools to automatically create wrappers which can be installed using
`python3 setup.py install`. Update the configuration files, the test
suite as well as the INSTALL and README files to reflect these changes.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-10-08 14:25:43 +02:00
Lukas Fleischer
bc3a4f348d t2200: Check that only non-voters get reminders
Add a test to make sure that Trusted Users, who already voted on a
proposal, do not receive any reminders.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:53 +02:00
Lukas Fleischer
eb367d97e2 Use the notify script in tests
Instead of only checking whether the notification script is called with
the correct parameters, actually invoke the real notify script and check
whether proper notifications are generated.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
c8c3747786 Add tests for aurblup
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
d00f4c5197 Add tests for pkgmaint
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
cd2d90612b Add tests for tuvotereminder
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
a48f8ccb13 Add tests for mkpkglists
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00
Lukas Fleischer
49c7e53572 Reorganize tests
Move and rename the existing git-interface tests such that tests for
other scripts can be added easily.

In particular, the following changes are made:

* Move the existing tests from git-interface/test/ to test/.
* Rename t0001-auth.sh to t1100-git-auth.sh.
* Rename t0002-serve.sh to t1200-git-serve.sh.
* Rename t0003-update.sh to t1300-git-update.sh.

Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
2016-09-29 22:07:24 +02:00