diff options
-rw-r--r-- | vmadm/e2-obnam-server.yaml | 3 | ||||
-rw-r--r-- | vmadm/e2-web.yaml | 3 | ||||
-rw-r--r-- | vmdebootstrap/authorized_keys | 1 | ||||
-rwxr-xr-x | vmdebootstrap/base-create.sh | 21 | ||||
-rw-r--r-- | vmdebootstrap/base-debian7-amd64.conf | 4 | ||||
-rw-r--r-- | vmdebootstrap/base-debian7-i386.conf | 5 | ||||
-rw-r--r-- | vmdebootstrap/base-debian8-amd64.conf | 4 | ||||
-rw-r--r-- | vmdebootstrap/base-debian8-i386.conf | 5 | ||||
-rw-r--r-- | vmdebootstrap/base-unstable-amd64.conf | 4 | ||||
-rw-r--r-- | vmdebootstrap/base-unstable-i386.conf | 5 | ||||
-rw-r--r-- | vmdebootstrap/base.conf | 11 | ||||
-rwxr-xr-x | vmdebootstrap/base.customize | 46 | ||||
-rw-r--r-- | yarns/000.yarn | 5 | ||||
-rw-r--r-- | yarns/100-willikins.yarn | 23 | ||||
-rw-r--r-- | yarns/200-ick-workers.yarn | 35 | ||||
-rw-r--r-- | yarns/900-implements.yarn | 121 | ||||
-rwxr-xr-x | yarns/run.sh | 8 | ||||
-rwxr-xr-x | yarns/ssh_runcmd | 12 | ||||
-rw-r--r-- | yarns/yarn.sh | 6 |
19 files changed, 0 insertions, 322 deletions
diff --git a/vmadm/e2-obnam-server.yaml b/vmadm/e2-obnam-server.yaml deleted file mode 100644 index 6c96702..0000000 --- a/vmadm/e2-obnam-server.yaml +++ /dev/null @@ -1,3 +0,0 @@ -obnam-server: - image_size_gib: 300 - memory_mib: 4096 diff --git a/vmadm/e2-web.yaml b/vmadm/e2-web.yaml deleted file mode 100644 index b6a2d86..0000000 --- a/vmadm/e2-web.yaml +++ /dev/null @@ -1,3 +0,0 @@ -web: - image_size_gib: 10 - memory_mib: 1024 diff --git a/vmdebootstrap/authorized_keys b/vmdebootstrap/authorized_keys deleted file mode 100644 index b7e5273..0000000 --- a/vmdebootstrap/authorized_keys +++ /dev/null @@ -1 +0,0 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzc5k+s8dm6zwxlfgIAUVY8x1UPOXDnxLgIpMbS7DuHmtpo7a6doFRGdaPnQStteliLWmmggVwh5q3PPvgegTT6SIc3mPoL3UK/2bnkU+wGwUfhykP/Uulhtzr6Dsr3vgTNp6dFCvSd5ZEb+ih9I9nRviWM9vDYXccc4jKoxb9Zepb6QWp3F8dPpUFEf6GbH+WunE2TFj8aJ5f4R77phpof+vLfiJyV0QTUVpf3BYPfnnmbOVLy/3t4YvdUde+FMdXiWwmfb35ZNmRqpD0U4jzFVGg2TgeGXCu18kva04i20S2yrQEY5oQndnaRZdbWa7Hp83WRIuk1d0X1TXViVPcw== liw diff --git a/vmdebootstrap/base-create.sh b/vmdebootstrap/base-create.sh deleted file mode 100755 index f4318b1..0000000 --- a/vmdebootstrap/base-create.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# -# Create all missing disk images. -# This needs to be run as root, from the directory it exists in. - -set -eu - -# Add my git checkout of the vmdebootstrap git repository to PATH, -# so that I can run, on my jessie machine, the current version. -PATH="$PATH:/home/liw/vmdebootstrap/vmdebootstrap" - -for conf in $(find . -maxdepth 1 -name 'base-*.conf') -do - img=$(vmdebootstrap --config base.conf --config "$conf" --dump-config | - awk '$1 == "image" { print $3 }') - if [ ! -e "$img" ] - then - echo "==== Building $conf" - vmdebootstrap --config base.conf --config "$conf" - fi -done diff --git a/vmdebootstrap/base-debian7-amd64.conf b/vmdebootstrap/base-debian7-amd64.conf deleted file mode 100644 index b007ba4..0000000 --- a/vmdebootstrap/base-debian7-amd64.conf +++ /dev/null @@ -1,4 +0,0 @@ -[config] -arch = amd64 -distribution = wheezy -image = base-debian7-amd64.img diff --git a/vmdebootstrap/base-debian7-i386.conf b/vmdebootstrap/base-debian7-i386.conf deleted file mode 100644 index d1cea68..0000000 --- a/vmdebootstrap/base-debian7-i386.conf +++ /dev/null @@ -1,5 +0,0 @@ -[config] -arch = i386 -distribution = wheezy -image = base-debian7-i386.img -kernel-package = linux-image-486 diff --git a/vmdebootstrap/base-debian8-amd64.conf b/vmdebootstrap/base-debian8-amd64.conf deleted file mode 100644 index 150fb62..0000000 --- a/vmdebootstrap/base-debian8-amd64.conf +++ /dev/null @@ -1,4 +0,0 @@ -[config] -arch = amd64 -distribution = jessie -image = base-debian8-amd64.img diff --git a/vmdebootstrap/base-debian8-i386.conf b/vmdebootstrap/base-debian8-i386.conf deleted file mode 100644 index ef9c395..0000000 --- a/vmdebootstrap/base-debian8-i386.conf +++ /dev/null @@ -1,5 +0,0 @@ -[config] -arch = i386 -distribution = jessie -image = base-debian8-i386.img -kernel-package = linux-image-586 diff --git a/vmdebootstrap/base-unstable-amd64.conf b/vmdebootstrap/base-unstable-amd64.conf deleted file mode 100644 index f5cf3bf..0000000 --- a/vmdebootstrap/base-unstable-amd64.conf +++ /dev/null @@ -1,4 +0,0 @@ -[config] -arch = amd64 -distribution = unstable -image = base-unstable-amd64.img diff --git a/vmdebootstrap/base-unstable-i386.conf b/vmdebootstrap/base-unstable-i386.conf deleted file mode 100644 index 39b6c6f..0000000 --- a/vmdebootstrap/base-unstable-i386.conf +++ /dev/null @@ -1,5 +0,0 @@ -[config] -arch = i386 -distribution = unstable -image = base-unstable-i386.img -kernel-package = linux-image-586 diff --git a/vmdebootstrap/base.conf b/vmdebootstrap/base.conf deleted file mode 100644 index dff561f..0000000 --- a/vmdebootstrap/base.conf +++ /dev/null @@ -1,11 +0,0 @@ -[config] -mirror = http://192.168.122.1/debian -enable-dhcp = yes -size = 4G -verbose = no -grub = yes -sparse = yes -sudo = yes -package = ssh, python -customize = ./base.customize -hostname = base diff --git a/vmdebootstrap/base.customize b/vmdebootstrap/base.customize deleted file mode 100755 index 9c007f7..0000000 --- a/vmdebootstrap/base.customize +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -# -# base.customize - configure base disk image for management by ansible -# -# This sets up a very basic image, just enough to allow ansible to log -# in and become root with sudo. All the rest of the configuration -# happens via ansible. -# -# Copyright 2015 Lars Wirzenius -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see <http://www.gnu.org/licenses/>. - - -set -eu - -# Avoid any problems (mainly weird perl warnings) from inherited -# locale from user. -export LC_ALL=C - -rootdir="$1" - -# Create an account for ansible. -chroot "$rootdir" adduser --gecos 'Ansible' --disabled-password ansible - -# Install an authorize_keys file so that ansible can access the account. -chroot "$rootdir" install -d -o ansible -g ansible -m 0700 /home/ansible/.ssh -install -m 0600 authorized_keys "$rootdir/home/ansible/.ssh/authorized_keys" -chroot "$rootdir" chown ansible:ansible /home/ansible/.ssh/authorized_keys - -# Add ansible to sudoers, without password. -cat <<EOF >> "$rootdir/etc/sudoers.d/ansible" -ansible ALL=(ALL:ALL) NOPASSWD: ALL -EOF -chroot "$rootdir" chown root:root /etc/sudoers.d/ansible -chroot "$rootdir" chmod 0440 /etc/sudoers.d/ansible 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" "$@" -} |