diff -Nru at-3.1.23/debian/changelog at-3.1.23/debian/changelog --- at-3.1.23/debian/changelog 2020-09-25 16:49:04.000000000 +0530 +++ at-3.1.23/debian/changelog 2021-03-18 01:02:35.000000000 +0530 @@ -1,3 +1,11 @@ +at (3.1.23-1.2) unstable; urgency=medium + + * Non-maintainer upload. + * d/t/{control, basic-usage}: Add DEP8 test + for testing basic usage of at and atq commands. + + -- Utkarsh Gupta Thu, 18 Mar 2021 01:02:35 +0530 + at (3.1.23-1.1) unstable; urgency=medium * Non-maintainer upload. diff -Nru at-3.1.23/debian/tests/basic-usage at-3.1.23/debian/tests/basic-usage --- at-3.1.23/debian/tests/basic-usage 1970-01-01 05:30:00.000000000 +0530 +++ at-3.1.23/debian/tests/basic-usage 2021-03-18 01:02:35.000000000 +0530 @@ -0,0 +1,61 @@ +#!/bin/bash + +################################################# +## ## +## Basic usage of `at` to create a file and ## +## also take in account the queue, using atq. ## +## ## +## Written by: ## +## Utkarsh Gupta ## +## License: GPL-2+ ## +## ## +################################################# + +set -ex + +TMPFILE=at.$RANDOM +WORKDIR=$(mktemp -d) +trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM + +JOBS_BEFORE=$(atq | wc -l) + +# use at command to schedule a job. +echo "echo `date` > ${WORKDIR}/${TMPFILE}" | at now + 1 minute + +sleep 2 + +# check if the file is created at the wrong +# time, that is, 58 seconds earlier. +if test -f "$TMPFILE" +then + echo "$TMPFILE already exits but it really shouldn't." + exit 1 +else + echo "OK, $TMPFILE doesn't exist yet; expected.." +fi + +# check atq to see the queued jobs. +# there should be a one new job. +JOBS_AFTER=$(atq | wc -l) + +if [[ $((JOBS_AFTER - JOBS_BEFORE)) -eq 1 ]] +then + echo "OK, 1 new queued job exists.." +else + echo "No new queued job found." + exit 1 +fi + +sleep 58 + +# grep the content of the file to verify that +# everything is in order. +if grep -Fq "UTC" $WORKDIR/$TMPFILE +then + echo "OK, $TMPFILE exists and everything looks in order.." +else + echo "Either $TMPFILE doesn't exist or the content differs." + exit 1 +fi + +echo "OK; PASS." diff -Nru at-3.1.23/debian/tests/control at-3.1.23/debian/tests/control --- at-3.1.23/debian/tests/control 1970-01-01 05:30:00.000000000 +0530 +++ at-3.1.23/debian/tests/control 2021-03-18 01:02:35.000000000 +0530 @@ -0,0 +1,3 @@ +Tests: basic-usage +Depends: @ +Restrictions: allow-stderr, isolation-container