From 1c4fa81cc398e21868ad237509f1ea8e772d76de Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 18 Nov 2024 20:07:02 +0100 Subject: Add a --comment option to record Comment: in history Suggested-by: mhoye on IRC --- test/integration/test-history | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 test/integration/test-history (limited to 'test') diff --git a/test/integration/test-history b/test/integration/test-history new file mode 100755 index 000000000..47829e162 --- /dev/null +++ b/test/integration/test-history @@ -0,0 +1,40 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +buildsimplenativepackage 'pkg1' 'amd64' '1' 'stable' +buildsimplenativepackage 'pkg2' 'amd64' '1' 'stable' + + +setupaptarchive + +cathistory() { + sed rootdir/var/log/apt/history.log -re 's/^(Commandline|Start-Date|End-Date):.*/\1: dummy/' +} + + +testsuccess aptget install pkg1 + +testequal " +Start-Date: dummy +Commandline: dummy +Install: pkg1:amd64 (1) +End-Date: dummy" cathistory + +testsuccess aptget install pkg2 --comment="A test comment" + +testequal " +Start-Date: dummy +Commandline: dummy +Install: pkg1:amd64 (1) +End-Date: dummy + +Start-Date: dummy +Commandline: dummy +Comment: A test comment +Install: pkg2:amd64 (1) +End-Date: dummy" cathistory -- cgit v1.2.3-70-g09d2