diff --git a/common/boot-no-crashes.sh b/common/boot-no-crashes.sh new file mode 100755 index 0000000000000000000000000000000000000000..9e6e0914d000736ffae8584f0231e9d77f6440db --- /dev/null +++ b/common/boot-no-crashes.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# boot-no-crashes.sh +# +# Verify that no processes crashed so far during this boot. The journal is +# automatically attached to LAVA test failures, so we don’t need to manually +# include that. + +# Copyright © 2016 Collabora Ltd. +# +# SPDX-License-Identifier: MPL-2.0 +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +set -e + +echo "# Anomalous process terminations:" +sudo journalctl -b | grep ANOM_ABEND | sed 's/^/# /g' + +if sudo journalctl -b | grep -q ANOM_ABEND; then + echo "TEST_RESULT:fail:boot-no-crashes:ANOM_ABEND found in journalctl logs" >&2 + exit 1 +else + echo "TEST_RESULT:pass:boot-no-crashes:" + exit 0 +fi diff --git a/common/boot-no-crashes.yaml b/common/boot-no-crashes.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3321e239e0c39ab5032473784bb5b064f7caeeff --- /dev/null +++ b/common/boot-no-crashes.yaml @@ -0,0 +1,18 @@ +metadata: + name: boot-no-crashes + format: "Lava-Test-Shell Test Definition 1.0" + description: "Check that nothing crashed when booting" + maintainer: "philip.withnall@collabora.co.uk" + scope: + - functional + environment: + - lava-test-shell + +run: + steps: + - "common/run-test-in-systemd --name=run-test common/boot-no-crashes.sh" + +parse: + pattern: 'TEST_RESULT:(?P<result>\w+):(?P<test_case_id>[^:]+):' + +# vim:set sw=2 sts=2 et: diff --git a/templates/group-common-tpl.json b/templates/group-common-tpl.json index 60d1da03cd3483809fd47e4bc470d0b09512c5ab..68b7161eb8a10daaa14881972bcb14c47b48b99e 100644 --- a/templates/group-common-tpl.json +++ b/templates/group-common-tpl.json @@ -51,6 +51,11 @@ "revision": "master", "testdef": "common/sanity-check.yaml" }, + { + "git-repo": "https://git.apertis.org/git/apertis-tests.git", + "revision": "master", + "testdef": "common/boot-no-crashes.yaml" + }, { "git-repo": "https://git.apertis.org/git/apertis-tests.git", "revision": "master",