From 131b40b2b4a5ca2ab56a7f9a0c637bd524c11455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20P=2E=20M=C3=B6ller?= Date: Sun, 13 Sep 2020 22:50:09 -0300 Subject: [PATCH] add autopkgtest --- debian/control | 1 + debian/source/lintian-overrides | 2 +- debian/tests/control | 2 ++ debian/tests/run-tests | 25 +++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 debian/tests/control create mode 100755 debian/tests/run-tests diff --git a/debian/control b/debian/control index 66cc7c3..2ccc38c 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ Build-Depends: debhelper-compat (=13), python3-setuptools Standards-Version: 4.5.0 Rules-Requires-Root: no +Testsuite: autopkgtest-pkg-python, autopkgtest Package: lubuntu-update-notifier Architecture: all diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides index 0a1bb12..2dc08d1 100644 --- a/debian/source/lintian-overrides +++ b/debian/source/lintian-overrides @@ -1,2 +1,2 @@ # Wishlist -lubuntu-update-notifier source: testsuite-autopkgtest-missing +# lubuntu-update-notifier source: testsuite-autopkgtest-missing diff --git a/debian/tests/control b/debian/tests/control new file mode 100644 index 0000000..8016de6 --- /dev/null +++ b/debian/tests/control @@ -0,0 +1,2 @@ +Tests: run-tests +Depends: @ diff --git a/debian/tests/run-tests b/debian/tests/run-tests new file mode 100755 index 0000000..a0c1030 --- /dev/null +++ b/debian/tests/run-tests @@ -0,0 +1,25 @@ +#!/bin/sh + +# test if apt-check is working as expected. + +OUT=`/usr/lib/update-notifier/apt-check 2>&1` +oldIFS=$IFS +IFS=';' +j=0 +for STRING in $OUT; do + case $j in + 0) + UPG=$STRING;; + 1) + SEC=$STRING;; + esac + j=`expr $j + 1` +done +IFS=$oldIFS +if [ $UPG -ge 0 ]; then + echo "Success: /usr/lib/update-notifier/apt-check is working" + exit 0 +else + echo "Failure: /usr/lib/update-notifier/apt-check is NOT working" + exit 1 +fi