]>
Commit | Line | Data |
---|---|---|
eb76e936 DK |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
3abb6a6a DK |
4 | TESTDIR="$(readlink -f "$(dirname "$0")")" |
5 | . "$TESTDIR/framework" | |
eb76e936 DK |
6 | setupenvironment |
7 | configarchitecture "i386" | |
8 | ||
9 | buildsimplenativepackage "peace-dpkg" "all" "1.0" "stable" | |
10 | ||
11 | buildsimplenativepackage "a" "all" "1.0" "stable" "Depends: b" | |
12 | buildsimplenativepackage "b" "all" "1.0" "stable" | |
13 | buildsimplenativepackage "c" "all" "1.0" "stable" "Depends: b" | |
14 | ||
15 | setupaptarchive | |
16 | ||
17 | # dpkg freaks out if the last package is removed so keep one around | |
0440d936 | 18 | testsuccess aptget install peace-dpkg -y |
eb76e936 | 19 | testdpkginstalled peace-dpkg |
ec7f904e | 20 | testmarkedauto |
eb76e936 | 21 | |
0440d936 | 22 | testsuccess aptget install a -y |
eb76e936 DK |
23 | testdpkginstalled a b |
24 | testdpkgnotinstalled c | |
ec7f904e | 25 | testmarkedauto 'b' |
eb76e936 | 26 | |
0440d936 | 27 | testsuccess aptget remove a -y |
eb76e936 DK |
28 | testdpkgnotinstalled a c |
29 | testdpkginstalled b | |
ec7f904e | 30 | testmarkedauto 'b' |
eb76e936 | 31 | |
0440d936 | 32 | testsuccess aptget install c -y |
eb76e936 DK |
33 | testdpkgnotinstalled a |
34 | testdpkginstalled b c | |
ec7f904e | 35 | testmarkedauto 'b' |
eb76e936 | 36 | |
25b86db1 | 37 | testsuccessequal 'Reading package lists... |
eb76e936 DK |
38 | Building dependency tree... |
39 | Reading state information... | |
858f91bb | 40 | b is already the newest version (1.0). |
eb76e936 | 41 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b --only-upgrade |
ec7f904e | 42 | testmarkedauto 'b' |
eb76e936 | 43 | |
25b86db1 | 44 | testsuccessequal 'Reading package lists... |
eb76e936 DK |
45 | Building dependency tree... |
46 | Reading state information... | |
858f91bb | 47 | b is already the newest version (1.0). |
eb76e936 | 48 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b -d |
ec7f904e | 49 | testmarkedauto 'b' |
eb76e936 | 50 | |
97be52d4 DK |
51 | rm rootdir/var/log/apt/history.log |
52 | ||
0440d936 | 53 | testsuccess aptget install b --reinstall -y |
eb76e936 DK |
54 | testdpkgnotinstalled a |
55 | testdpkginstalled b c | |
ec7f904e | 56 | testmarkedauto 'b' |
eb76e936 | 57 | |
97be52d4 | 58 | sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' |
0479205d DK |
59 | if [ -n "$SUDO_USER" ]; then |
60 | testfileequal 'rootdir/var/log/apt/history.log' " | |
61 | Requested-By: $SUDO_USER ($(id -u "$SUDO_USER")) | |
62 | Reinstall: b:i386 (1.0)" | |
63 | else | |
64 | testfileequal 'rootdir/var/log/apt/history.log' ' | |
97be52d4 | 65 | Reinstall: b:i386 (1.0)' |
0479205d | 66 | fi |
97be52d4 | 67 | |
25b86db1 | 68 | testsuccessequal 'Reading package lists... |
eb76e936 DK |
69 | Building dependency tree... |
70 | Reading state information... | |
858f91bb | 71 | b is already the newest version (1.0). |
eb76e936 DK |
72 | b set to manually installed. |
73 | 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install b | |
ec7f904e | 74 | testmarkedauto |
eb76e936 | 75 | |
0440d936 | 76 | testsuccess aptget remove b -y |
eb76e936 | 77 | testdpkgnotinstalled a b c |
ec7f904e | 78 | testmarkedauto |
eb76e936 | 79 | |
0440d936 | 80 | testsuccess aptget install a b -y |
eb76e936 DK |
81 | testdpkginstalled a b |
82 | testdpkgnotinstalled c | |
ec7f904e | 83 | testmarkedauto |
eb76e936 | 84 | |
0440d936 | 85 | testsuccess aptget purge a b -y |
eb76e936 | 86 | testdpkgnotinstalled a b c |
ec7f904e | 87 | testmarkedauto |
eb76e936 | 88 | |
0440d936 | 89 | testsuccess aptget install b c -y |
eb76e936 DK |
90 | testdpkgnotinstalled a |
91 | testdpkginstalled b c | |
ec7f904e | 92 | testmarkedauto |
eb76e936 | 93 | |
0440d936 | 94 | testsuccess aptget install a -y |
eb76e936 | 95 | testdpkginstalled a b c |
ec7f904e | 96 | testmarkedauto |