diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-09-25 18:38:50 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-09-25 18:38:50 +0300 |
commit | ce3456fc26e02cc369b287a6ef7245c03be0a7f1 (patch) | |
tree | a5a029a0877aac93e898f9248d86a1e46670dd31 | |
download | server-yarns-ce3456fc26e02cc369b287a6ef7245c03be0a7f1.tar.gz |
Initial commit
-rw-r--r-- | 000.yarn | 47 | ||||
-rw-r--r-- | 900-implements.yarn | 17 | ||||
-rwxr-xr-x | run-tests | 8 |
3 files changed, 72 insertions, 0 deletions
diff --git a/000.yarn b/000.yarn new file mode 100644 index 0000000..fd226e8 --- /dev/null +++ b/000.yarn @@ -0,0 +1,47 @@ +--- +title: System tests for liw.fi +author: Lars Wirzenius +version: UNRELEASED +... + +# 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 SERVER=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" diff --git a/900-implements.yarn b/900-implements.yarn new file mode 100644 index 0000000..dbb63dd --- /dev/null +++ b/900-implements.yarn @@ -0,0 +1,17 @@ +# Implementation of scenario steps + +## Server aliases + + IMPLEMENTS GIVEN server is also known as (\S+) + pass + +## HTTP requests + + IMPLEMENTS WHEN user fetches (\S+) + pass + + IMPLEMENTS THEN HTTP status is (\d+) + pass + + IMPLEMENTS THEN HTTP body matches "(.*)" + pass diff --git a/run-tests b/run-tests new file mode 100755 index 0000000..bac0c31 --- /dev/null +++ b/run-tests @@ -0,0 +1,8 @@ +#!/bin/sh + +set -eux + +address="$1" +shift + +yarn --env "SERVER=$address" --shell python2 --shell-arg '' *.yarn "$@" |