diff options
-rwxr-xr-x | bin/check_package.sh | 27 | ||||
-rw-r--r-- | jobs/misc/misc-generic.txt | 7 |
2 files changed, 34 insertions, 0 deletions
diff --git a/bin/check_package.sh b/bin/check_package.sh new file mode 100755 index 0000000..3a5cac8 --- /dev/null +++ b/bin/check_package.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright 2020 Canonical Ltd. +# All rights reserved. +# +# Written by: +# Nara Huang <nara.huang@canonical.com> +# Script to check packages that may have license or patent issues, +# if any of package in argument is installed, this script will +# return 1 as the test fails. +installed=0 +if [ $# -ne 0 ]; then + while [ $# != 0 ] + do + dpkg -s $1 &> /dev/null + if [ $? -eq 0 ]; then + echo $1 "is installed." + installed=1 + else + echo $1 "is not installed." + fi + shift + done + exit $installed +else + echo "Usage: \"$0 packagename1 packagename2\""; + exit +fi diff --git a/jobs/misc/misc-generic.txt b/jobs/misc/misc-generic.txt index 7f62d31..0f3f53b 100644 --- a/jobs/misc/misc-generic.txt +++ b/jobs/misc/misc-generic.txt @@ -32,3 +32,10 @@ command: sed -i 's/\#Storage=auto/Storage=persistent/' /etc/systemd/journald.con _summary: Set journald to preserve logs during stress test _description: To make sure system will write journald log to disk during every boot. + +plugin: shell +id: misc/generic/check-unwanted-packages +command: check_package.sh gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libavcodec-extra ubuntu-restricted-extras ttf-mscorefonts-installer unrar +_summary: Check if unwanted packages are installed +_description: + For some packages which may have license or patent issues, this case checks if they are installed. |