]> git.saurik.com Git - apt.git/blame - test/integration/test-kernel-helper-autoremove
add testcase for the autoremove feature
[apt.git] / test / integration / test-kernel-helper-autoremove
CommitLineData
e5bdcc87
MV
1#!/bin/sh
2
3set -e
4
5# setup testdir
6TESTDIR=$(readlink -f $(dirname $0))
7. $TESTDIR/framework
8
9TMPDIR=$(mktemp -d)
10cd $TMPDIR
11addtrap "cd /; rm -rf $TMPDIR"
12
13# create mock environment
14mkdir apt.conf.d
15cat > aptconfig.conf <<EOF
16Dir::Etc::parts "$TMPDIR/apt.conf.d";
17Dir::bin::dpkg "$TMPDIR/fake-dpkg";
18EOF
19APT_CONFIG=aptconfig.conf
20export APT_CONFIG
21
22# install fake-dpkg into it
23install -m755 $TESTDIR/test-kernel-helper-autoremove.fake-dpkg $TMPDIR/fake-dpkg
24
25# run the helper
26sh ${TESTDIR}/../../debian/apt.auto-removal.sh
27
28# and ensure its there, valid and version 10.0.0-1 is there too
29test -e $TMPDIR/apt.conf.d/01autoremove-kernels
30apt-config -c ${APT_CONFIG} dump|grep -q "APT::NeverAutoRemove::.*\^linux-image-10.0.0-1-generic\.\*"
31
32# done
33msgpass