Cosmetics.
[platform/upstream/rpm.git] / tests / rpmdb.at
1 #    rpmdb.at: test rpmdb access
2 #
3 #    Copyright (C) 2007  Ralf Corsépius <corsepiu@fedoraproject.org>
4 #
5 #    This program is free software; you can redistribute it and/or modify
6 #    it under the terms of the GNU General Public License as published by
7 #    the Free Software Foundation; either version 2 of the License, or
8 #    (at your option) any later version.
9 #
10 #    This program is distributed in the hope that it will be useful,
11 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 #    GNU General Public License for more details.
14 #
15 #    You should have received a copy of the GNU General Public License
16 #    along with this program; if not, write to the Free Software
17 #    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18
19
20 # ------------------------------
21 # Attempt to initialize a rpmdb
22 AT_SETUP([rpm --initdb])
23 AT_CHECK([
24 RPM_INIT_DB
25 ],
26 [0],
27 [ignore],
28 [ignore])
29 AT_CLEANUP
30
31 # ------------------------------
32 # Run rpm -qa on an empty rpmdb
33 AT_SETUP([rpm -qa])
34 AT_CHECK([
35 RPM_INIT_DB
36 rpm \
37   --rcfile=${RPMRC} \
38   --root="${abs_builddir}"/testing \
39   -qa
40 ],
41 [0],
42 [ignore],
43 [ignore])
44 AT_CLEANUP
45
46
47 # ------------------------------
48 # install a package into a local rpmdb without --relocate and --nodeps
49 # * Must fail due to missing deps
50 # * Use --ignorearch because we don't know the arch
51 AT_SETUP([rpm -i *.i386.rpm])
52 AT_CHECK([
53 RPM_INIT_DB
54 ],
55 [0],[ignore],[ignore])
56
57 AT_CHECK([
58 rpm -i \
59   --rcfile=${RPMRC} \
60   --root="${abs_builddir}"/testing \
61   --ignorearch \
62   "${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm
63 ],
64 [1],
65 [ignore],
66 [error: Failed dependencies:
67         /bin/sh is needed by hello-1.0-1.i386
68         libc.so.6 is needed by hello-1.0-1.i386
69         libc.so.6(GLIBC_2.0) is needed by hello-1.0-1.i386
70         rtld(GNU_HASH) is needed by hello-1.0-1.i386
71 ])
72
73 AT_CLEANUP
74
75
76 # ------------------------------
77 # install a package into a local rpmdb
78 # * Shall only work with relocation
79 # * Use --ignorearch because we don't know the arch
80 AT_SETUP([rpm -i --relocate=.. *.i386.rpm])
81 AT_CHECK([
82 RPM_INIT_DB
83 ],
84 [0],[ignore],[ignore])
85
86 AT_CHECK([
87 rpm -i \
88   --rcfile=${RPMRC} \
89   --root="${abs_builddir}"/testing \
90   --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
91   "${abs_srcdir}"/data/RPMS/hello-1.0-1.i386.rpm
92 ],
93 [0],
94 [ignore],
95 [ignore])
96
97 AT_CLEANUP
98
99
100 # ------------------------------
101 # install a package into a local rpmdb
102 # * Shall only work with relocation
103 # * Use --ignorearch because we don't know the arch
104 AT_SETUP([rpm -i --relocate=.. *.ppc64.rpm])
105 AT_CHECK([
106 RPM_INIT_DB
107 ],
108 [0],[ignore],[ignore])
109
110 AT_CHECK([
111 rpm -i \
112   --rcfile=${RPMRC} \
113   --root="${abs_builddir}"/testing \
114   --nodeps --ignorearch --relocate=/usr="${abs_builddir}"/testing/check \
115   "${abs_srcdir}"/data/RPMS/hello-1.0-1.ppc64.rpm
116 ],
117 [0],
118 [ignore],
119 [ignore])
120
121 AT_CLEANUP