diff options
author | Neil Williams <neil.williams@linaro.org> | 2018-12-20 12:42:14 +0000 |
---|---|---|
committer | Neil Williams <neil.williams@linaro.org> | 2018-12-20 12:43:21 +0000 |
commit | a89b9ff43771f662d1fae970edd27d00b99bfc41 (patch) | |
tree | 2254f1cee151d0d0cbfbd4d2c13dd22be78674bc | |
parent | 94a87146ec8a806965cc683fa44ddb13f21a92db (diff) |
Update the hacking session template
Move the Debian hacking session to not rely on install steps
and call lava-test-raise on failure.
Remove unsupported V1 JSON examples.
Change-Id: Ic2b778a71a25591eeeca1cd93d5338fab4bd7932
Signed-off-by: Neil Williams <neil.williams@linaro.org>
-rwxr-xr-x | apt-install.sh | 14 | ||||
-rw-r--r-- | debian-hacking-example.json | 32 | ||||
-rw-r--r-- | debian-hacking-example.yaml | 71 | ||||
-rw-r--r-- | hacking-session-debian.yaml | 8 | ||||
-rw-r--r-- | lava-common | 92 | ||||
-rw-r--r-- | oe-hacking-example.json | 48 | ||||
-rwxr-xr-x | setup_session_debian | 10 |
7 files changed, 189 insertions, 86 deletions
diff --git a/apt-install.sh b/apt-install.sh new file mode 100755 index 0000000..0e197d0 --- /dev/null +++ b/apt-install.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# on request apt setup + +. ./testdefs/lava-common + +APTOPTS="-q -y install --no-install-recommends -o Dpkg::Options::=--force-confold" +LAVAOPTS="-q -y install --no-install-recommends" + +export DEBIAN_FRONTEND=noninteractive +unset LANG +unset LANGUAGE +command 'update-apt' "apt-get update -q" +command 'install-packages' "apt-get ${APTOPTS} $@" diff --git a/debian-hacking-example.json b/debian-hacking-example.json deleted file mode 100644 index 4c20958..0000000 --- a/debian-hacking-example.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "actions": [ - { - "command": "deploy_linaro_image", - "parameters": { - "image": "http://community.validation.linaro.org/images/kvm/ubuntu-12-04-server-base-lava.img.gz" - } - }, - { - "command": "lava_test_shell", - "parameters": { - "testdef_repos": [ - { - "git-repo": "http://staging.git.linaro.org/git/lava-team/hacking-session.git", - "parameters": { - "PUB_KEY": "<PUB_KEY (REQUIRED) (DEFAULT=None)>", - "GATEWAY": "<GATEWAY (OPTIONAL) (DEFAULT=None)>", - "IRC_USER": "<IRC NICK (OPTIONAL) (DEFAULT=None)>", - "IRC_SERVER": "<IRC SERVER (OPTIONAL) (DEFAULT=irc.freenode.net)>" - }, - "testdef": "hacking-session-debian.yaml" - } - ], - "timeout": 18000 - } - } - ], - "device_type": "kvm", - "health_check": false, - "job_name": "kvm-hacking", - "timeout": 18000 -} diff --git a/debian-hacking-example.yaml b/debian-hacking-example.yaml new file mode 100644 index 0000000..22fc299 --- /dev/null +++ b/debian-hacking-example.yaml @@ -0,0 +1,71 @@ +device_type: beaglebone-black + +# When the test action or the job times out, the hacking session +# will end without warning. + +job_name: nfs-bbb-hacking +timeouts: + # maximum time for the entire job, including hacking. + job: + minutes: 45 + action: + minutes: 5 +priority: medium +visibility: public + +metadata: + source: http://git.linaro.org/lava-team/hacking-session.git + path: debian-hacking-example.yaml + build-readme: http://files.lavasoftware.org/components/lava/standard/debian/stretch/armhf/3/debian-stretch-armmp-armhf-readme.html + build-console: https://ci.linaro.org/view/lava-ci/job/lava-debian-stretch-armmp-armhf/3/console + build-script: http://files.lavasoftware.org/components/lava/standard/debian/stretch/armhf/3/armmp-nfs.sh + +actions: +- deploy: + timeout: + minutes: 4 + to: tftp + kernel: + url: http://files.lavasoftware.org/components/lava/standard/debian/stretch/armhf/3/vmlinuz-4.9.0-4-armmp + sha256sum: b6043cc5a07e2cead3f7f098018e7706ea7840eece2a456ba5fcfaddaf98a21e + type: zimage + ramdisk: + url: http://files.lavasoftware.org/components/lava/standard/debian/stretch/armhf/3/initrd.img-4.9.0-4-armmp + sha256sum: 4cc25f499ae74e72b5d74c9c5e65e143de8c2e3b019f5d1781abbf519479b843 + compression: gz + modules: + url: http://files.lavasoftware.org/components/lava/standard/debian/stretch/armhf/3/modules.tar.gz + sha256sum: 10e6930e9282dd44905cfd3f3a2d5a5058a1d400374afb2619412554e1067d58 + compression: gz + nfsrootfs: + url: https://files.lavasoftware.org/components/lava/standard/debian/stretch/armhf/3/stretch-armhf-nfs.tar.gz + sha256sum: 46d18f339ac973359e8ac507e5258b620709add94cf5e09a858d936ace38f698 + compression: gz + dtb: + url: http://files.lavasoftware.org/components/lava/standard/debian/stretch/armhf/3/dtbs/am335x-boneblack.dtb + sha256sum: c4c461712bf52af7d020e78678e20fc946f1d9b9552ef26fd07ae85c5373ece9 + +- boot: + timeout: + minutes: 3 + method: u-boot + commands: nfs + type: bootz + auto_login: + login_prompt: 'login:' + username: root + prompts: + - 'root@stretch:' + +- test: + # maximum time available for hacking. + timeout: + minutes: 30 + definitions: + - repository: http://git.linaro.org/lava-team/hacking-session.git + from: git + path: hacking-session-debian.yaml + name: hacking + parameters: + IRC_USER: "" + PUB_KEY: "" diff --git a/hacking-session-debian.yaml b/hacking-session-debian.yaml index 8620ec0..4aa97b0 100644 --- a/hacking-session-debian.yaml +++ b/hacking-session-debian.yaml @@ -2,19 +2,15 @@ metadata: name: hacking-session-debian format: "Lava-Test-Shell Test Definition 1.0" description: "SSH Hacking Session" - version: 1.0 + version: 2.0 params: PUB_KEY: None IRC_SERVER: irc.freenode.net -install: - deps: - - openssh-server - - netcat-traditional - - wget run: steps: + # package installation is included in setup_session_debian - ./setup_session_debian "$PUB_KEY" - export IRC_SERVER - export IRC_USER diff --git a/lava-common b/lava-common new file mode 100644 index 0000000..8aa8acf --- /dev/null +++ b/lava-common @@ -0,0 +1,92 @@ +#!/bin/sh + +# Copyright 2018 Linaro + +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of the nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +LAVA='echo # ' + +LAVA_RAISE='echo # ' + +LAVA_SET='echo #' + +if [ -n `which lava-test-case || true` ]; then + LAVA='lava-test-case' +fi + +if [ -n `which lava-test-raise || true` ]; then + LAVA_RAISE='lava-test-raise' +fi + +if [ -n `which lava-test-set || true` ]; then + LAVA_SET='lava-test-set' +fi + +command(){ + # setup command - will abort the test job upon failure. + # expects two quoted arguments + # $1 - valid lava test case name (no spaces) + # $2 - the full command line to execute + # Note: avoid trying to set environment variables. + # use an explicit export. + CMD="" + PREFIX=$1 + shift + while [ "$1" != "" ]; do + CMD="${CMD} $1" && shift; + done; + if [ -n "$(which lava-test-case || true)" ]; then + echo "${CMD}" + $CMD && lava-test-case "${PREFIX}" --result pass || lava-test-raise "${PREFIX}" + else + echo "${CMD}" + $CMD + fi +} + +testcase(){ + # test case command - will report a test case fail result upon failure. + # expects two quoted arguments + # $1 - valid lava test case name (no spaces) + # $2 - the full command line to execute + # Note: avoid trying to set environment variables. + # use an explicit export. + CMD="" + PREFIX=$1 + shift + while [ "$1" != "" ]; do + CMD="${CMD} $1" && shift; + done; + if [ -n "$(which lava-test-case || true)" ]; then + echo "$CMD" + $CMD && lava-test-case "${PREFIX}" --result pass || lava-test-case "${PREFIX}" --result fail + else + echo "$CMD" + $CMD + fi +} diff --git a/oe-hacking-example.json b/oe-hacking-example.json deleted file mode 100644 index 0a51c8d..0000000 --- a/oe-hacking-example.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "actions": [ - { - "command": "deploy_linaro_kernel", - "parameters": { - "dtb": "http://community.validation.linaro.org/images/arndale/linaro/exynos5250-arndale.dtb", - "kernel": "http://community.validation.linaro.org/images/arndale/linaro/uImage", - "nfsrootfs": "http://snapshots.linaro.org/openembedded/images/lng-armv7a-gcc-4.8/173/linaro-image-lng-genericarmv7a-20131205-173.rootfs.tar.gz" - } - }, - { - "command": "boot_linaro_image", - "parameters": { - "boot_cmds": [ - "setenv autoload no", - "setenv kernel_addr_r '0x40007000'", - "setenv fdt_addr_r '0x41f00000'", - "setenv loadkernel 'tftp ${kernel_addr_r} ${lava_kernel}'", - "setenv fdt_high '0xffffffff'", - "setenv loadfdt 'tftp ${fdt_addr_r} ${lava_dtb}'", - "setenv nfsargs 'setenv bootargs console=tty0 console=ttySAC2,115200n8 drm_kms_helper.edid_firmware=edid-1920x1080.fw root=/dev/nfs rw nfsroot=${lava_server_ip}:${lava_nfsrootfs} ip=:::::eth0:dhcp'", - "setenv bootcmd 'usb start; dhcp; setenv serverip ${lava_server_ip}; run loadkernel; run loadfdt; run nfsargs; bootm ${kernel_addr_r} - ${fdt_addr_r}'", - "boot" - ] - } - }, - { - "command": "lava_test_shell", - "parameters": { - "testdef_repos": [ - { - "git-repo": "http://staging.git.linaro.org/git/lava-team/hacking-session.git", - "parameters": { - "PUB_KEY": "<PUB_KEY (REQUIRED) (DEFAULT=None)>", - "GATEWAY": "<GATEWAY (OPTIONAL) (DEFAULT=10.0.0.1)>" - }, - "testdef": "hacking-session-oe.yaml" - } - ], - "timeout": 18000 - } - } - ], - "device_type": "arndale", - "health_check": false, - "job_name": "arndale-oe-hacking-nfs", - "timeout": 18000 -} diff --git a/setup_session_debian b/setup_session_debian index 72a08c8..f04121b 100755 --- a/setup_session_debian +++ b/setup_session_debian @@ -1,6 +1,8 @@ #!/bin/bash # Usage ./setup_session <pub_key> +. ./testdefs/lava-common + chmod a+x stop_hacking_debian cp stop_hacking_debian /bin/stop_hacking chmod a+x continue_hacking @@ -29,6 +31,14 @@ if [ ! -z "${SUDO_USER}" -a -z "${container}" ]; then chown -R ${SUDO_USER}:${SUDO_GID} ${HOME}/.ssh fi +APTOPTS="-q -y install --no-install-recommends -o Dpkg::Options::=--force-confold" + +export DEBIAN_FRONTEND=noninteractive +unset LANG +unset LANGUAGE +command 'update-apt' "apt-get update -q" +command 'install-packages' "apt-get ${APTOPTS} openssh-server netcat-traditional wget" + # Change SSHD log level to DEBUG grep -P "^LogLevel" /etc/ssh/sshd_config if [ $? -eq 0 ]; then |