summaryrefslogtreecommitdiffstats
path: root/test/integration/test-apt-progress-fd
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
commit851b6a097165af4d51c0db01b5e05256e5006896 (patch)
tree5f7c388ec894a7806c49a99f3bdb605d0b299a7c /test/integration/test-apt-progress-fd
parentInitial commit. (diff)
downloadapt-851b6a097165af4d51c0db01b5e05256e5006896.tar.xz
apt-851b6a097165af4d51c0db01b5e05256e5006896.zip
Adding upstream version 2.6.1.upstream/2.6.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xtest/integration/test-apt-progress-fd80
-rwxr-xr-xtest/integration/test-apt-progress-fd-conffile42
-rwxr-xr-xtest/integration/test-apt-progress-fd-deb82258
-rwxr-xr-xtest/integration/test-apt-progress-fd-error25
4 files changed, 205 insertions, 0 deletions
diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd
new file mode 100755
index 0000000..4c19a7b
--- /dev/null
+++ b/test/integration/test-apt-progress-fd
@@ -0,0 +1,80 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+buildsimplenativepackage 'testing' 'amd64' '0.1' 'stable'
+buildsimplenativepackage 'testing' 'amd64' '0.8.15' 'stable'
+buildsimplenativepackage 'testing2' 'amd64,i386' '0.8.15' 'stable'
+setupaptarchive
+
+# install native
+exec 3> apt-progress.log
+testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3
+testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
+dlstatus:1:100.0000:Retrieving file 1 of 1
+pmstatus:dpkg-exec:0.0000:Running dpkg
+pmstatus:testing:0.0000:Preparing testing (amd64)
+pmstatus:testing:20.0000:Unpacking testing (amd64)
+pmstatus:testing:40.0000:Installing testing (amd64)
+pmstatus:dpkg-exec:40.0000:Running dpkg
+pmstatus:testing:40.0000:Preparing to configure testing (amd64)
+pmstatus:testing:60.0000:Configuring testing (amd64)
+pmstatus:testing:80.0000:Installed testing (amd64)'
+
+# upgrade
+exec 3> apt-progress.log
+testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3
+testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
+dlstatus:1:100.0000:Retrieving file 1 of 1
+pmstatus:dpkg-exec:0.0000:Running dpkg
+pmstatus:testing:0.0000:Preparing testing (amd64)
+pmstatus:testing:20.0000:Unpacking testing (amd64)
+pmstatus:testing:40.0000:Installing testing (amd64)
+pmstatus:dpkg-exec:40.0000:Running dpkg
+pmstatus:testing:40.0000:Preparing to configure testing (amd64)
+pmstatus:testing:60.0000:Configuring testing (amd64)
+pmstatus:testing:80.0000:Installed testing (amd64)'
+
+# reinstall
+exec 3> apt-progress.log
+testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3
+testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
+dlstatus:1:100.0000:Retrieving file 1 of 1
+pmstatus:dpkg-exec:0.0000:Running dpkg
+pmstatus:testing:0.0000:Preparing testing (amd64)
+pmstatus:testing:20.0000:Unpacking testing (amd64)
+pmstatus:testing:40.0000:Installing testing (amd64)
+pmstatus:dpkg-exec:40.0000:Running dpkg
+pmstatus:testing:40.0000:Preparing to configure testing (amd64)
+pmstatus:testing:60.0000:Configuring testing (amd64)
+pmstatus:testing:80.0000:Installed testing (amd64)'
+
+# and remove
+exec 3> apt-progress.log
+testsuccess aptget remove testing -y -o APT::Status-Fd=3
+testfileequal './apt-progress.log' 'pmstatus:dpkg-exec:0.0000:Running dpkg
+pmstatus:testing:0.0000:Preparing for removal of testing (amd64)
+pmstatus:testing:33.3333:Removing testing (amd64)
+pmstatus:testing:66.6667:Removing testing (amd64)
+pmstatus:dpkg-exec:66.6667:Running dpkg'
+
+# install non-native and ensure we get proper progress info
+exec 3> apt-progress.log
+testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3
+testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
+dlstatus:1:100.0000:Retrieving file 1 of 1
+pmstatus:dpkg-exec:0.0000:Running dpkg
+pmstatus:testing2:0.0000:Preparing testing2 (i386)
+pmstatus:testing2:20.0000:Unpacking testing2 (i386)
+pmstatus:testing2:40.0000:Installing testing2 (i386)
+pmstatus:dpkg-exec:40.0000:Running dpkg
+pmstatus:testing2:40.0000:Preparing to configure testing2 (i386)
+pmstatus:testing2:60.0000:Configuring testing2 (i386)
+pmstatus:testing2:80.0000:Installed testing2 (i386)'
+
+rm -f apt-progress*.log
diff --git a/test/integration/test-apt-progress-fd-conffile b/test/integration/test-apt-progress-fd-conffile
new file mode 100755
index 0000000..9fb6fbe
--- /dev/null
+++ b/test/integration/test-apt-progress-fd-conffile
@@ -0,0 +1,42 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture 'native'
+
+# old conffile
+setupsimplenativepackage 'compiz-core' 'native' '1.0' 'unstable'
+BUILDDIR='incoming/compiz-core-1.0'
+mkdir -p "${BUILDDIR}/debian/compiz-core/etc"
+echo 'foo=bar;' > "${BUILDDIR}/compiz.conf"
+echo 'compiz.conf /etc/compiz.conf' >> "${BUILDDIR}/debian/install"
+buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
+rm -rf "$BUILDDIR"
+
+# new conffile
+setupsimplenativepackage 'compiz-core' 'native' '2.0' 'unstable'
+BUILDDIR='incoming/compiz-core-2.0'
+mkdir -p "${BUILDDIR}/debian/compiz-core/etc"
+echo 'foo2=bar2;' > "${BUILDDIR}/compiz.conf"
+echo 'compiz.conf /etc/compiz.conf' >> "${BUILDDIR}/debian/install"
+buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
+rm -rf "$BUILDDIR"
+
+setupaptarchive
+
+testsuccess aptget install compiz-core=1.0
+
+# fake conffile change
+echo 'meep' >> rootdir/etc/compiz.conf/compiz.conf
+
+# FIXME: Is there really no way to see if dpkg actually prompts?
+msgtest 'Test for successful execution of' 'apt-get install compiz-core=2.0'
+exec 3> apt-progress.log
+testsuccess --nomsg aptget install compiz-core=2.0 -o APT::Status-Fd=3 -o Dpkg::Use-Pty=false -o dpkg::options::='--force-confold'
+
+# and ensure there is a conffile message in the file
+msgtest 'Test status fd for an included' 'pmconffile msg'
+testsuccess --nomsg grep "pmconffile:/etc/compiz.conf/compiz.conf" apt-progress.log
diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822
new file mode 100755
index 0000000..dd66e28
--- /dev/null
+++ b/test/integration/test-apt-progress-fd-deb822
@@ -0,0 +1,58 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture 'amd64' 'i386'
+
+buildsimplenativepackage 'testing' 'amd64' '0.1' 'stable'
+buildsimplenativepackage 'testing' 'all' '0.8.15' 'stable'
+buildsimplenativepackage 'testing2' 'amd64,i386' '0.8.15' 'stable'
+setupaptarchive
+
+# install native
+exec 3> apt-progress.log
+testsuccess aptget install testing=0.1 -y -o APT::Status-deb822-Fd=3
+
+testfileequal './apt-progress.log' 'Status: progress
+Percent: 0.0000
+Message: Running dpkg
+
+Status: progress
+Package: testing:amd64
+Percent: 0.0000
+Message: Preparing testing (amd64)
+
+Status: progress
+Package: testing:amd64
+Percent: 20.0000
+Message: Unpacking testing (amd64)
+
+Status: progress
+Package: testing:amd64
+Percent: 40.0000
+Message: Installing testing (amd64)
+
+Status: progress
+Percent: 40.0000
+Message: Running dpkg
+
+Status: progress
+Package: testing:amd64
+Percent: 40.0000
+Message: Preparing to configure testing (amd64)
+
+Status: progress
+Package: testing:amd64
+Percent: 60.0000
+Message: Configuring testing (amd64)
+
+Status: progress
+Package: testing:amd64
+Percent: 80.0000
+Message: Installed testing (amd64)
+'
+
+rm -f apt-progress*.log
diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error
new file mode 100755
index 0000000..39c1053
--- /dev/null
+++ b/test/integration/test-apt-progress-fd-error
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture 'native'
+
+mkdir -p usr/bin
+touch usr/bin/file-conflict
+
+buildsimplenativepackage 'foo1' 'native' '0.8.15' 'stable' '' 'pkg with file conflicts' '' '' 'usr/'
+buildsimplenativepackage 'foo2' 'native' '0.8.15' 'stable' '' 'pkg with file conflicts' '' '' 'usr/'
+insertinstalledpackage 'apport' 'native' '1'
+
+setupaptarchive
+
+exec 3> apt-progress.log
+testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3
+msgtest 'Ensure correct error message' 'file-conflict'
+testsuccess --nomsg grep "foo2_0.8.15_[^.]\+.deb:[0-9.]\+:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log
+
+testsuccess test -s rootdir/var/crash/foo2.0.crash
+testsuccess grep '^Package: foo2 0.8.15$' rootdir/var/crash/foo2.0.crash