summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2024-11-18 20:07:02 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2024-11-18 20:15:08 +0100
commit1c4fa81cc398e21868ad237509f1ea8e772d76de (patch)
tree9376185fca5ef2a2c794a2d976d2e559f7b05b07 /test
parent963efeff8778afacef35f69c181d234e0a27d5d3 (diff)
Add a --comment option to record Comment: in history
Suggested-by: mhoye on IRC
Diffstat (limited to 'test')
-rwxr-xr-xtest/integration/test-history40
1 files changed, 40 insertions, 0 deletions
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