aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Williams <neil.williams@linaro.org>2018-06-06 10:48:21 +0100
committerNeil Williams <neil.williams@linaro.org>2018-06-06 10:48:21 +0100
commit9386d8bf8682ab94e7628a3adaadd6cc2caf93bd (patch)
tree80c90e96af3054dcf93c51b1467b17b9469dd3bb
parent0e6f43ba2190097ea7fe588f89fede7aeebe3a15 (diff)
migrate server unittests to new structure
Change-Id: Icbdd31ce999110c3915c983c207d10bdef73b88b
-rwxr-xr-xtestdefs/dispatcher-unittest-setup.sh6
-rw-r--r--testdefs/server-unittest-run.sh16
-rw-r--r--testdefs/server-unittest-setup.sh25
3 files changed, 44 insertions, 3 deletions
diff --git a/testdefs/dispatcher-unittest-setup.sh b/testdefs/dispatcher-unittest-setup.sh
index cd64728..0ed576e 100755
--- a/testdefs/dispatcher-unittest-setup.sh
+++ b/testdefs/dispatcher-unittest-setup.sh
@@ -4,18 +4,18 @@
. ./testdefs/lava-common
-command 'Update-apt' "apt-get update -q"
+command 'update-apt' "apt-get update -q"
export DEBIAN_FRONTEND=noninteractive
command 'install-base' "apt-get -q -y install -o Dpkg::Options::=--force-confold git bc pep8 telnet python3-testscenarios u-boot-tools nfs-kernel-server tftpd-hpa qemu-system-x86 libguestfs-tools rpcbind lxc python3-pyudev python3-jinja2 python3-voluptuous"
# fix up the hosts file before installing apache
echo 127.0.0.1 localhost `hostname` >> /etc/hosts
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
-command 'uwsgi' "apt-get -q -y install apache2"
+command 'apache' "apt-get -q -y install apache2"
command "get-staging-key" 'wget http://images.validation.linaro.org/staging-repo/staging-repo.key.asc'
apt-key add staging-repo.key.asc
echo "deb http://mirror.bytemark.co.uk/debian stretch-backports main" > /etc/apt/sources.list.d/lava-backports.list
echo "deb http://images.validation.linaro.org/staging-repo stretch-backports main" > /etc/apt/sources.list.d/lava-staging.list
-command 'Update-apt-with-new-key' "apt-get update -q"
+command 'update-apt-with-new-key' "apt-get update -q"
command 'install-dispatcher' "apt-get -q -y install -o Dpkg::Options::=--force-confnew lava-dispatcher"
command 'clone-lava' "git clone -q git://git.linaro.org/lava/lava.git"
cd lava
diff --git a/testdefs/server-unittest-run.sh b/testdefs/server-unittest-run.sh
new file mode 100644
index 0000000..48162b8
--- /dev/null
+++ b/testdefs/server-unittest-run.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# dispatcher unit tests run
+
+. ./testdefs/lava-common
+
+sh -ex ./testdefs/dispatcher-unittest-setup.sh
+
+command 'source_directory' "ls ./lava"
+cd lava
+testcase 'test_directory' "ls ../functional"
+testcase "commitlog" 'git --no-pager log -n1'
+../functional/version-wrapper.py
+${LAVA_SET} start unittests
+testcase 'unittests' "../functional/server-unittests.sh"
+${LAVA_SET} stop unittests
diff --git a/testdefs/server-unittest-setup.sh b/testdefs/server-unittest-setup.sh
new file mode 100644
index 0000000..03ec1fb
--- /dev/null
+++ b/testdefs/server-unittest-setup.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# dispatcher unit test setup
+
+. ./testdefs/lava-common
+
+command 'update-apt' "apt-get update -q"
+export DEBIAN_FRONTEND=noninteractive
+command 'install-base' "apt-get -q -y install -o Dpkg::Options::=--force-confold git wget gnupg pep8 postgresql-9.6 python3-django python3-django-tables2 python3-django-restricted-resource python3-django-testscenarios qemu-system-x86 lava-coordinator locales lxc"
+
+unset LANG
+command 'apt_upgrade' "apt-get -q -y upgrade"
+command 'apache' "apt -q -y install apache2"
+
+
+command "get-staging-key" 'wget http://images.validation.linaro.org/staging-repo/staging-repo.key.asc'
+apt-key add staging-repo.key.asc
+echo "deb http://mirror.bytemark.co.uk/debian stretch-backports main" > /etc/apt/sources.list.d/lava-backports.list
+echo "deb http://images.validation.linaro.org/staging-repo stretch-backports main" > /etc/apt/sources.list.d/lava-staging.list
+command 'update-apt-with-new-key' "apt-get update -q"
+command 'install-backports' "apt-get -q -y -t stretch-backports install python3-django-auth-ldap python3-django-testscenarios"
+command 'install-devscripts' "apt-get -q -y --no-install-recommends install devscripts"
+command 'install-server' "apt-get -q -y install -o Dpkg::Options::=--force-confnew lava-server"
+apt-get clean
+command 'clone-lava' "git clone -q git://git.linaro.org/lava/lava.git"