summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-08-20 19:33:08 +0300
committerLars Wirzenius <liw@liw.fi>2021-08-20 19:33:08 +0300
commit085bb29bbecca4f8c0114c1bd09734905f6cec62 (patch)
tree35ad4d98339bc113b815460fbe3885a54dbb10e2 /yarns
parentcb437c9e3a1f7b25e1306e504656286c24186e4c (diff)
downloadansibleness-085bb29bbecca4f8c0114c1bd09734905f6cec62.tar.gz
drop more old crap
Diffstat (limited to 'yarns')
-rw-r--r--yarns/000.yarn5
-rw-r--r--yarns/100-willikins.yarn23
-rw-r--r--yarns/200-ick-workers.yarn35
-rw-r--r--yarns/900-implements.yarn121
-rwxr-xr-xyarns/run.sh8
-rwxr-xr-xyarns/ssh_runcmd12
-rw-r--r--yarns/yarn.sh6
7 files changed, 0 insertions, 210 deletions
diff --git a/yarns/000.yarn b/yarns/000.yarn
deleted file mode 100644
index 5a1bbf0..0000000
--- a/yarns/000.yarn
+++ /dev/null
@@ -1,5 +0,0 @@
----
-title: System test suite
-author: Lars Wirzenius (liw@liw.fi)
-date: GIT VERSION
-...
diff --git a/yarns/100-willikins.yarn b/yarns/100-willikins.yarn
deleted file mode 100644
index 6c2b29c..0000000
--- a/yarns/100-willikins.yarn
+++ /dev/null
@@ -1,23 +0,0 @@
-# The willikins system: home backup server
-
-Our home backup server is a dedicates file server just for storing
-backups. It is only ever accessed over ssh (including sftp).
-
-First, setup configuration.
-
- SCENARIO willikins backup server
- GIVEN server name is willikins
- AND server has account ansible
-
-Check that basic networking and host configuration are OK. We need
-Python 2 for Ansible.
-
- THEN server responds to ping
- AND server hostname is as expected
- AND server account has sudo
- AND server has python version 2 installed
-
-It's a backup server, and we use Obnam over SFTP to access it. Make
-sure that works.
-
- AND server allows SFTP
diff --git a/yarns/200-ick-workers.yarn b/yarns/200-ick-workers.yarn
deleted file mode 100644
index fe78278..0000000
--- a/yarns/200-ick-workers.yarn
+++ /dev/null
@@ -1,35 +0,0 @@
-# Ick workers for my CI system
-
-Ick is my CI program. It needs workers on which it runs builds. These
-need to be accessible over ssh, and the remote user must have
-passwordless sudo access to run pbuilder.
-
-I have a number of the ick workers. Yarn does not provide a looping
-construct or parameterised scenarios. However, since they are all
-maintained using Ansible, and should thus be identical, I avoid having
-to repeat the scenario for each worker by just blindly assuming that
-if one works, they all work.
-
- SCENARIO ick workers can build packages
-
-Basic checks.
-
- GIVEN server name is ick-debian8-amd64
- AND server has account ick
- THEN server responds to ping
- AND server hostname is as expected
- AND server account has sudo
-
-Do a test build of the Debian hello package.
-
- GIVEN a remote temporary directory to use
- AND a directory RESULT on the server
- WHEN server runs apt-get source --download-only hello
- WHEN server runs test -e *.dsc
- WHEN server runs sudo pbuilder --build --buildresult RESULT
- ... --basetgz /var/cache/pbuilder/release.tgz hello_2.9-2+deb8u1.dsc
- THEN remote files RESULT/*.deb exist
-
-Cleanup.
-
- FINALLY remove remote temporary directory
diff --git a/yarns/900-implements.yarn b/yarns/900-implements.yarn
deleted file mode 100644
index 26a05a7..0000000
--- a/yarns/900-implements.yarn
+++ /dev/null
@@ -1,121 +0,0 @@
-# Appendix: Scenario step implementations
-
-## Configuration
-
-Save the name of the server to be tested, so it doesn't need to be
-repeated for every step.
-
- IMPLEMENTS GIVEN server name is (.+)
- echo "SERVER=$MATCH_1" >> "$DATADIR/config.sh"
-
-Set account name to use on server.
-
- IMPLEMENTS GIVEN server has account (.+)
- echo "ACCOUNT=$MATCH_1" >> "$DATADIR/config.sh"
-
-## Ping
-
-Does the server respond to a ping?
-
- IMPLEMENTS THEN server responds to ping
- . "$DATADIR/config.sh"
- ping -c1 "$SERVER"
-
-## Check server hostname
-
-Does the server's hostname match its domain name?
-
- IMPLEMENTS THEN server hostname is as expected
- . "$DATADIR/config.sh"
- ssh "$ACCOUNT@$SERVER" hostname | grep -Fx "$SERVER"
-
-## Ansible account
-
-Does the server have an account `ansible` that has passwordless sudo
-access to root?
-
- IMPLEMENTS THEN server account has sudo
- . "$DATADIR/config.sh"
- ssh "$ACCOUNT@$SERVER" sudo -n id -u > "$DATADIR/id.out"
- grep -F 0 "$DATADIR/id.out"
-
-## Python 2 installed?
-
-Does the server have Python 2 installed, by invoking `python`?
-
- IMPLEMENTS THEN server has python version 2 installed
- . "$DATADIR/config.sh"
- ssh "$ACCOUNT@$SERVER" python --version 2> "$DATADIR/python.out"
- grep "^Python 2\." "$DATADIR/python.out"
-
-## Running command over ssh
-
-Run a command on the server over ssh, capturing stdout and stderr and
-exit code for later inspection.
-
- IMPLEMENTS WHEN running ssh (.*)
- if ssh $MATCH_1 > "$DATADIR/stdout" 2> "$DATADIR/stderr"
- then
- echo 0 > "$DATADIR/exit"
- else
- echo $? > "$DATADIR/exit"
- fi
-
-## Access server over SFTP
-
-Put and get a file over SFTP.
-
- IMPLEMENTS THEN server allows SFTP
- . "$DATADIR/config.sh"
- echo test.file > "$DATADIR/sftp.file"
- cat > "$DATADIR/sftp.commands" << EOF
- put $DATADIR/sftp.file sftp.file
- get sftp.file $DATADIR/sftp.file.copy
- rm sftp.file
- EOF
- sftp -b "$DATADIR/sftp.commands" "$ACCOUNT@$SERVER"
- cmp "$DATADIR/sftp.file" "$DATADIR/sftp.file.copy"
-
-## Inspect results of running a command
-
-The stdout, stderr, and exit code have been saved. Inspect them.
-
- IMPLEMENTS THEN output matches (.+)
- cat "$DATADIR/stdout"
- grep "$MATCH_1" "$DATADIR/stdout"
-
-## Manage a remote temporary directory
-
-Whenever we need to do anything that takes more than one step, we'll
-need a temporary directory in which to work. This is similar to the
-`DATADIR` that yarn provides us on the local machine.
-
- IMPLEMENTS GIVEN a remote temporary directory to use
- . "$DATADIR/config.sh"
- name="$(ssh "$ACCOUNT@$SERVER" mktemp -d)"
- echo "REMOTETMP=$name" >> "$DATADIR/config.sh"
-
- IMPLEMENTS FINALLY remove remote temporary directory
- # FIXME: The following will fail if REMOTETMP contains shell's
- # magic characters or whitespace. Ugh.
- . "$DATADIR/config.sh"
- ssh "$ACCOUNT@$SERVER" rm -rf "$REMOTETMP"
-
-## Create remote directory
-
- IMPLEMENTS GIVEN a directory (\S+) on the server
- . "$DATADIR/config.sh"
- run_remotely "$ACCOUNT@$SERVER" "$REMOTETMP" "mkdir $MATCH_1"
-
-## Check for files on the remote end
-
- IMPLEMENTS THEN remote files (\S+) exist
- . "$DATADIR/config.sh"
- run_remotely "$ACCOUNT@$SERVER" "$REMOTETMP" "ls -d $MATCH_1" |
- grep .
-
-## Run a command on the server
-
- IMPLEMENTS WHEN server runs (.+)
- . "$DATADIR/config.sh"
- run_remotely "$ACCOUNT@$SERVER" "$REMOTETMP" "$MATCH_1"
diff --git a/yarns/run.sh b/yarns/run.sh
deleted file mode 100755
index a9123c5..0000000
--- a/yarns/run.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-cd "$(dirname "$0")"
-yarn \
- --env "SSH_AGENT_PID=$SSH_AGENT_PID" \
- --env "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" \
- -s yarn.sh \
- *.yarn "$@"
diff --git a/yarns/ssh_runcmd b/yarns/ssh_runcmd
deleted file mode 100755
index 261b7e9..0000000
--- a/yarns/ssh_runcmd
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/python2
-
-import sys
-
-import cliapp
-
-cliapp.ssh_runcmd(
- sys.argv[1],
- ['sh', '-c'] + sys.argv[3:],
- remote_cwd=sys.argv[2],
- stdout=None,
- stderr=None)
diff --git a/yarns/yarn.sh b/yarns/yarn.sh
deleted file mode 100644
index abbd225..0000000
--- a/yarns/yarn.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Shell text to execute at the beginning of every yarn step.
-
-run_remotely()
-{
- "$SRCDIR/ssh_runcmd" "$@"
-}