1#    rpmi.at: test various aspects of rpm install
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
19AT_BANNER([RPM install tests])
20
21AT_SETUP([rpm -U <manifest>])
22AT_KEYWORDS([install])
23AT_CHECK([
24RPMDB_INIT
25
26echo /data/RPMS/hello-2.0-1.x86_64.rpm > ${RPMTEST}/tmp/test.mft
27runroot rpm -U --ignorearch --ignoreos --nodeps \
28	/tmp/test.mft
29],
30[0],
31[],
32[])
33AT_CLEANUP
34
35AT_SETUP([rpm -U <manifest notfound 1>])
36AT_KEYWORDS([install])
37AT_CHECK([
38RPMDB_INIT
39
40echo /data/RPMS/hello-2.0-1.x86_64.rpm > ${RPMTEST}/tmp/test.mft
41runroot rpm -U --ignorearch --ignoreos --nodeps \
42	/tmp/test-not-there.mft
43],
44[1],
45[],
46[error: open of /tmp/test-not-there.mft failed: No such file or directory
47])
48AT_CLEANUP
49
50AT_SETUP([rpm -U <manifest notfound 2>])
51AT_KEYWORDS([install])
52AT_CHECK([
53RPMDB_INIT
54
55echo /data/RPMS/hello-not-there-2.0-1.x86_64.rpm > ${RPMTEST}/tmp/test.mft
56runroot rpm -U --ignorearch --ignoreos --nodeps \
57	/tmp/test.mft
58],
59[1],
60[],
61[error: open of /data/RPMS/hello-not-there-2.0-1.x86_64.rpm failed: No such file or directory
62])
63AT_CLEANUP
64
65AT_SETUP([rpm -U <notfound>])
66AT_KEYWORDS([install])
67AT_CHECK([
68RPMDB_INIT
69
70runroot rpm -U --ignorearch --ignoreos --nodeps \
71	/data/RPMS/hello-not-there-2.0-1.x86_64.rpm
72],
73[1],
74[],
75[error: open of /data/RPMS/hello-not-there-2.0-1.x86_64.rpm failed: No such file or directory
76])
77AT_CLEANUP
78
79AT_SETUP([rpm -U <unsigned 1>])
80AT_KEYWORDS([install])
81AT_CHECK([
82RPMDB_INIT
83
84runroot rpm -U --ignorearch --ignoreos --nodeps \
85	/data/RPMS/hello-2.0-1.x86_64.rpm
86],
87[0],
88[],
89[])
90AT_CLEANUP
91
92AT_SETUP([rpm -U <unsigned 2>])
93AT_KEYWORDS([install])
94AT_CHECK([
95RPMDB_INIT
96
97runroot rpm -U --ignorearch --ignoreos --nodeps \
98	--define "_pkgverify_level signature" \
99	/data/RPMS/hello-2.0-1.x86_64.rpm
100],
101[1],
102[],
103[	package hello-2.0-1.x86_64 does not verify: no signature
104])
105AT_CLEANUP
106
107AT_SETUP([rpm -U <corrupted unsigned 1>])
108AT_KEYWORDS([install])
109AT_CHECK([
110RPMDB_INIT
111
112pkg="hello-2.0-1.x86_64.rpm"
113cp "${RPMTEST}"/data/RPMS/${pkg} "${RPMTEST}"/tmp/${pkg}
114dd if=/dev/zero of="${RPMTEST}"/tmp/${pkg} \
115   conv=notrunc bs=1 seek=5555 count=6 2> /dev/null
116
117echo "INSTALL 1"
118runroot rpm -U --ignorearch --ignoreos --nodeps --nodigest \
119	--define "_pkgverify_level none" \
120	/tmp/${pkg} 2>&1 | sed -e 's/;.*$//g'
121echo "INSTALL 2"
122runroot rpm -U --ignorearch --ignoreos --nodeps \
123	--define "_pkgverify_level digest" \
124	/tmp/${pkg} 2>&1
125echo "INSTALL 3"
126runroot rpm -U --ignorearch --ignoreos --nodeps \
127	--define "_pkgverify_flags 0x30300" \
128	--define "__vsflags 0x30300" \
129	--define "_pkgverify_level digest" \
130	/tmp/${pkg} 2>&1
131echo "INSTALL 4"
132runroot rpm -U --ignorearch --ignoreos --nodeps --nodigest --noverify \
133	--define "_pkgverify_level digest" \
134	/tmp/${pkg} 2>&1 | sed -e 's/;.*$//g'
135],
136[0],
137[INSTALL 1
138error: unpacking of archive failed on file /usr/share/doc/hello-2.0/COPYING
139error: hello-2.0-1.x86_64: install failed
140INSTALL 2
141error: /tmp/hello-2.0-1.x86_64.rpm: Header SHA256 digest: BAD (Expected ef920781af3bf072ae9888eec3de1c589143101dff9cc0b561468d395fb766d9 != 29fdfe92782fb0470a9a164a6c94af87d3b138c63b39d4c30e0223ca1202ba82)
142error: /tmp/hello-2.0-1.x86_64.rpm: Header SHA1 digest: BAD (Expected 5cd9874c510b67b44483f9e382a1649ef7743bac != 4261b2c1eb861a4152c2239bce20bfbcaa8971ba)
143error: /tmp/hello-2.0-1.x86_64.rpm cannot be installed
144INSTALL 3
145	package hello-2.0-1.x86_64 does not verify: no digest
146INSTALL 4
147error: unpacking of archive failed on file /usr/share/doc/hello-2.0/COPYING
148error: hello-2.0-1.x86_64: install failed
149],
150[])
151AT_CLEANUP
152
153AT_SETUP([rpm -U <corrupted unsigned 2>])
154AT_KEYWORDS([install])
155AT_CHECK([
156RPMDB_INIT
157
158pkg="hello-2.0-1.x86_64.rpm"
159cp "${RPMTEST}"/data/RPMS/${pkg} "${RPMTEST}"/tmp/${pkg}
160dd if=/dev/zero of="${RPMTEST}"/tmp/${pkg} \
161   conv=notrunc bs=1 seek=7777 count=6 2> /dev/null
162
163echo "INSTALL 1"
164runroot rpm -U --ignorearch --ignoreos --nodeps \
165	--define "_pkgverify_level none" \
166	/tmp/${pkg} 2>&1
167echo "INSTALL 2"
168runroot rpm -U --ignorearch --ignoreos --nodeps \
169	--define "_pkgverify_level digest" \
170	/tmp/${pkg} 2>&1
171echo "INSTALL 3"
172runroot rpm -U --ignorearch --ignoreos --nodeps \
173	--define "_pkgverify_flags 0x30300" \
174	--define "_pkgverify_level digest" \
175	/tmp/${pkg} 2>&1
176echo "INSTALL 4"
177runroot rpm -U --ignorearch --ignoreos --nodeps --nodigest --noverify \
178	--define "_pkgverify_level digest" \
179	/tmp/${pkg} 2>&1
180],
181[1],
182[INSTALL 1
183error: unpacking of archive failed: cpio: Bad magic
184error: hello-2.0-1.x86_64: install failed
185INSTALL 2
186	package hello-2.0-1.x86_64 does not verify: Payload SHA256 digest: BAD (Expected 84a7338287bf19715c4eed0243f5cdb447eeb0ade37b2af718d4060aefca2f7c != bea903609dceac36e1f26a983c493c98064d320fdfeb423034ed63d649b2c8dc)
187INSTALL 3
188	package hello-2.0-1.x86_64 does not verify: no digest
189INSTALL 4
190error: unpacking of archive failed: cpio: Bad magic
191error: hello-2.0-1.x86_64: install failed
192],
193[])
194AT_CLEANUP
195
196AT_SETUP([rpm -U <signed nokey 1>])
197AT_KEYWORDS([install])
198AT_CHECK([
199RPMDB_INIT
200
201runroot rpm -U --ignorearch --ignoreos --nodeps \
202	/data/RPMS/hello-2.0-1.x86_64-signed.rpm
203],
204[0],
205[],
206[warning: /data/RPMS/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY
207])
208AT_CLEANUP
209
210AT_SETUP([rpm -U <signed nokey 2>])
211AT_KEYWORDS([install])
212AT_CHECK([
213RPMDB_INIT
214
215runroot rpm -U --ignorearch --ignoreos --nodeps \
216	--define "_pkgverify_level signature" \
217	/data/RPMS/hello-2.0-1.x86_64-signed.rpm
218],
219[1],
220[],
221[warning: /data/RPMS/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY
222	package hello-2.0-1.x86_64 does not verify: Header V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY
223])
224AT_CLEANUP
225
226AT_SETUP([rpm -U <signed 1>])
227AT_KEYWORDS([install])
228AT_CHECK([
229RPMDB_INIT
230
231runroot rpmkeys --import /data/keys/rpm.org-rsa-2048-test.pub
232runroot rpm -U --ignorearch --ignoreos --nodeps \
233	/data/RPMS/hello-2.0-1.x86_64-signed.rpm
234],
235[0],
236[],
237[])
238AT_CLEANUP
239
240AT_SETUP([rpm -U <signed 2>])
241AT_KEYWORDS([install])
242AT_CHECK([
243RPMDB_INIT
244
245runroot rpmkeys --import /data/keys/rpm.org-rsa-2048-test.pub
246runroot rpm -U --ignorearch --ignoreos --nodeps \
247	--define "_pkgverify_level signature" \
248	/data/RPMS/hello-2.0-1.x86_64-signed.rpm
249],
250[0],
251[],
252[])
253AT_CLEANUP
254
255AT_SETUP([rpm -U <corrupted signed 1>])
256AT_KEYWORDS([install])
257AT_CHECK([
258RPMDB_INIT
259
260pkg="hello-2.0-1.x86_64-signed.rpm"
261cp "${RPMTEST}"/data/RPMS/${pkg} "${RPMTEST}"/tmp/${pkg}
262dd if=/dev/zero of="${RPMTEST}"/tmp/${pkg} \
263   conv=notrunc bs=1 seek=264 count=2 2> /dev/null
264
265runroot rpm -U --ignorearch --ignoreos --nodeps \
266	/tmp/${pkg}
267],
268[1],
269[],
270[error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header RSA signature: BAD (package tag 268: invalid OpenPGP signature)
271error: /tmp/hello-2.0-1.x86_64-signed.rpm cannot be installed
272])
273AT_CLEANUP
274
275AT_SETUP([rpm -U <corrupted signed 2>])
276AT_KEYWORDS([install])
277AT_CHECK([
278RPMDB_INIT
279
280pkg="hello-2.0-1.x86_64-signed.rpm"
281cp "${RPMTEST}"/data/RPMS/${pkg} "${RPMTEST}"/tmp/${pkg}
282dd if=/dev/zero of="${RPMTEST}"/tmp/${pkg} \
283   conv=notrunc bs=1 seek=5555 count=6 2> /dev/null
284
285runroot rpm -U --ignorearch --ignoreos --nodeps \
286	/tmp/${pkg}
287],
288[1],
289[],
290[error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 Signature, key ID 1964c5fc: BAD
291error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header SHA256 digest: BAD (Expected ef920781af3bf072ae9888eec3de1c589143101dff9cc0b561468d395fb766d9 != 29fdfe92782fb0470a9a164a6c94af87d3b138c63b39d4c30e0223ca1202ba82)
292error: /tmp/hello-2.0-1.x86_64-signed.rpm: Header SHA1 digest: BAD (Expected 5cd9874c510b67b44483f9e382a1649ef7743bac != 4261b2c1eb861a4152c2239bce20bfbcaa8971ba)
293error: /tmp/hello-2.0-1.x86_64-signed.rpm cannot be installed
294])
295AT_CLEANUP
296
297AT_SETUP([rpm -U <corrupted signed 3>])
298AT_KEYWORDS([install])
299AT_CHECK([
300RPMDB_INIT
301
302pkg="hello-2.0-1.x86_64-signed.rpm"
303cp "${RPMTEST}"/data/RPMS/${pkg} "${RPMTEST}"/tmp/${pkg}
304dd if=/dev/zero of="${RPMTEST}"/tmp/${pkg} \
305   conv=notrunc bs=1 seek=7711 count=6 2> /dev/null
306
307echo "INSTALL 1"
308runroot rpm -U --ignorearch --ignoreos --nodeps \
309	--define "_pkgverify_level none" \
310	/tmp/${pkg} 2>&1
311
312echo "INSTALL 2"
313runroot rpm -U --ignorearch --ignoreos --nodeps --nosignature \
314	--define "_pkgverify_level none" \
315	/tmp/${pkg} 2>&1
316
317echo "INSTALL 3"
318runroot rpm -U --ignorearch --ignoreos --nodeps \
319	--define "_pkgverify_level signature" \
320	/tmp/${pkg} 2>&1
321
322echo "INSTALL 4"
323runroot rpm -U --ignorearch --ignoreos --nodeps \
324	--define "_pkgverify_flags 0xc0c00" \
325	--define "__vsflags 0xc0c00" \
326	--define "_pkgverify_level signature" \
327	/tmp/${pkg} 2>&1
328
329echo "INSTALL 5"
330runroot rpm -U --ignorearch --ignoreos --nodeps --noverify \
331	--define "_pkgverify_level signature" \
332	/tmp/${pkg} 2>&1
333],
334[1],
335[INSTALL 1
336warning: /tmp/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY
337error: unpacking of archive failed: cpio: Bad magic
338error: hello-2.0-1.x86_64: install failed
339INSTALL 2
340error: unpacking of archive failed: cpio: Bad magic
341error: hello-2.0-1.x86_64: install failed
342INSTALL 3
343warning: /tmp/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY
344	package hello-2.0-1.x86_64 does not verify: Header V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY
345INSTALL 4
346	package hello-2.0-1.x86_64 does not verify: no signature
347INSTALL 5
348warning: /tmp/hello-2.0-1.x86_64-signed.rpm: Header V4 RSA/SHA256 Signature, key ID 1964c5fc: NOKEY
349error: unpacking of archive failed: cpio: Bad magic
350error: hello-2.0-1.x86_64: install failed
351],
352[])
353AT_CLEANUP
354
355# ------------------------------
356# Check if rpm -U *.src.rpm works
357AT_SETUP([rpm -U *.src.rpm])
358AT_KEYWORDS([install])
359AT_CHECK([
360RPMDB_INIT
361rm -rf ${TOPDIR}
362
363runroot rpm \
364  -U /data/SRPMS/hello-1.0-1.src.rpm
365],
366[0],
367[ignore],
368[ignore])
369AT_CLEANUP
370
371# ------------------------------
372# Check if rpm -i *.src.rpm works
373AT_SETUP([rpm -i *.src.rpm])
374AT_KEYWORDS([install])
375AT_CHECK([
376RPMDB_INIT
377rm -rf ${TOPDIR}
378
379runroot rpm \
380  -i /data/SRPMS/hello-1.0-1.src.rpm
381],
382[0],
383[ignore],
384[ignore])
385AT_CLEANUP
386
387# ------------------------------
388# Various error behavior tests
389#
390AT_SETUP([rpm -i <nonexistent file>])
391AT_KEYWORDS([install])
392AT_CHECK([
393RPMDB_INIT
394runroot rpm \
395  -i no_such_file
396],
397[1],
398[],
399[error: open of no_such_file failed: No such file or directory
400])
401AT_CLEANUP
402
403AT_SETUP([rpm -i --nomanifest <garbage text file>])
404AT_KEYWORDS([install])
405AT_CHECK([
406RPMDB_INIT
407junk="${RPMTEST}/textfile"
408cat << EOF > "${junk}"
409no_such.file
410not_an.rpm
411EOF
412
413runroot rpm \
414  -Uv --nomanifest /textfile
415],
416[1],
417[],
418[error: /textfile cannot be installed
419])
420AT_CLEANUP
421
422AT_SETUP([rpm -i <garbage text file])
423AT_KEYWORDS([install])
424AT_CHECK([
425RPMDB_INIT
426junk="${RPMTEST}/not_an.rpm"
427cat << EOF > "${junk}"
428no_such.file
429not_pkg.rpm
430EOF
431
432runroot rpm \
433  -Uv /not_an.rpm
434],
435[2],
436[],
437[error: open of no_such.file failed: No such file or directory
438error: open of not_pkg.rpm failed: No such file or directory
439])
440AT_CLEANUP
441
442# ------------------------------
443AT_SETUP([rpm upgrade/downgrade])
444RPMDB_INIT
445
446for v in "1.0" "2.0"; do
447    runroot rpmbuild --quiet -bb \
448        --define "ver $v" \
449          /data/SPECS/versiontest.spec
450done
451
452# Test normal upgrade
453AT_CHECK([
454RPMDB_INIT
455runroot rpm -U /build/RPMS/noarch/versiontest-1.0-1.noarch.rpm
456runroot rpm -U /build/RPMS/noarch/versiontest-2.0-1.noarch.rpm
457runroot rpm -q versiontest
458],
459[0],
460[versiontest-2.0-1.noarch
461],
462[])
463
464# Test upgrading to older package (should fail)
465AT_CHECK([
466RPMDB_INIT
467
468runroot rpm -U /build/RPMS/noarch/versiontest-2.0-1.noarch.rpm
469runroot rpm -U /build/RPMS/noarch/versiontest-1.0-1.noarch.rpm
470],
471[2],
472[],
473[	package versiontest-2.0-1.noarch (which is newer than versiontest-1.0-1.noarch) is already installed
474])
475
476# Test downgrading to older package with --oldpackage
477AT_CHECK([
478RPMDB_INIT
479
480runroot rpm -U /build/RPMS/noarch/versiontest-2.0-1.noarch.rpm
481runroot rpm -U --oldpackage /build/RPMS/noarch/versiontest-1.0-1.noarch.rpm
482runroot rpm -q versiontest
483],
484[0],
485[versiontest-1.0-1.noarch
486],
487[ignore])
488
489# Test upgrade of different versions in same transaction
490AT_CHECK([
491RPMDB_INIT
492
493runroot rpm -Uv \
494  /build/RPMS/noarch/versiontest-1.0-1.noarch.rpm \
495  /build/RPMS/noarch/versiontest-2.0-1.noarch.rpm
496runroot rpm -q versiontest
497],
498[0],
499[Verifying packages...
500Preparing packages...
501versiontest-2.0-1.noarch
502versiontest-2.0-1.noarch
503],
504[warning: package versiontest-1.0-1.noarch was already added, replacing with versiontest-2.0-1.noarch
505])
506
507# Test upgrade of different versions in same transaction
508AT_CHECK([
509RPMDB_INIT
510
511runroot rpm -Uv \
512  /build/RPMS/noarch/versiontest-2.0-1.noarch.rpm \
513  /build/RPMS/noarch/versiontest-1.0-1.noarch.rpm
514runroot rpm -q versiontest
515],
516[0],
517[Verifying packages...
518Preparing packages...
519versiontest-2.0-1.noarch
520versiontest-2.0-1.noarch
521],
522[warning: package versiontest-2.0-1.noarch was already added, skipping versiontest-1.0-1.noarch
523])
524
525# Test install of two different versions in same transaction
526AT_CHECK([
527RPMDB_INIT
528
529runroot rpm -i \
530  /build/RPMS/noarch/versiontest-1.0-1.noarch.rpm \
531  /build/RPMS/noarch/versiontest-2.0-1.noarch.rpm
532runroot rpm -q versiontest
533],
534[0],
535[versiontest-2.0-1.noarch
536versiontest-1.0-1.noarch
537],
538[])
539
540# Test install of two different versions in same transaction
541# TODO: test only one was installed
542AT_CHECK([
543RPMDB_INIT
544
545runroot rpm -i \
546  /build/RPMS/noarch/versiontest-1.0-1.noarch.rpm \
547  /build/RPMS/noarch/versiontest-1.0-1.noarch.rpm
548runroot rpm -q versiontest
549],
550[0],
551[versiontest-1.0-1.noarch
552],
553[])
554# TODO: the same with epoch vs no epoch
555AT_CLEANUP
556
557AT_SETUP([rpm -U obsoleted packages])
558AT_KEYWORDS([install obsolete])
559RPMDB_INIT
560runroot rpmbuild --quiet -bb \
561	--define "pkg one" \
562	--define "obs deptest-two <= 1.0" \
563	/data/SPECS/deptest.spec
564runroot rpmbuild --quiet -bb \
565	--define "pkg two" \
566	/data/SPECS/deptest.spec
567
568# Test upgrade of obsoleted package in same transaction
569AT_CHECK([
570RPMDB_INIT
571
572runroot rpm -Uv \
573  /build/RPMS/noarch/deptest-two-1.0-1.noarch.rpm \
574  /build/RPMS/noarch/deptest-one-1.0-1.noarch.rpm
575runroot rpm -q deptest-one
576],
577[0],
578[Verifying packages...
579Preparing packages...
580deptest-one-1.0-1.noarch
581deptest-one-1.0-1.noarch
582],
583[warning: package deptest-two-1.0-1.noarch was already added, replacing with deptest-one-1.0-1.noarch
584])
585
586# Test upgrade of obsoleted package in same transaction
587AT_CHECK([
588RPMDB_INIT
589
590runroot rpm -Uv \
591  /build/RPMS/noarch/deptest-one-1.0-1.noarch.rpm \
592  /build/RPMS/noarch/deptest-two-1.0-1.noarch.rpm
593runroot rpm -q deptest-one
594],
595[0],
596[Verifying packages...
597Preparing packages...
598deptest-one-1.0-1.noarch
599deptest-one-1.0-1.noarch
600],
601[warning: package deptest-one-1.0-1.noarch was already added, skipping deptest-two-1.0-1.noarch
602])
603AT_CLEANUP
604
605AT_SETUP([rpm -U with invalid --relocate])
606AT_KEYWORDS([install relocate])
607AT_CHECK([
608RPMDB_INIT
609
610runroot rpmbuild --quiet -bb /data/SPECS/hello-script.spec
611
612runroot rpm -U --test --ignoreos --relocate /usr=/opt \
613  /build/RPMS/noarch/hello-script-1.0-1.noarch.rpm
614],
615[1],
616[],
617[	path /usr in package hello-script-1.0-1.noarch is not relocatable
618])
619AT_CLEANUP
620
621AT_SETUP([rpm -U --badreloc with invalid --relocate])
622AT_KEYWORDS([install relocate])
623AT_CHECK([
624RPMDB_INIT
625
626runroot rpmbuild --quiet -bb /data/SPECS/hello-script.spec
627
628runroot rpm -U --test --ignoreos --badreloc --relocate /usr=/opt \
629  /build/RPMS/noarch/hello-script-1.0-1.noarch.rpm
630],
631[0],
632[],
633[])
634AT_CLEANUP
635
636AT_SETUP([rpm -i with/without --excludedocs])
637AT_KEYWORDS([install excludedocs])
638AT_CHECK([
639RPMDB_INIT
640
641runroot rpmbuild --quiet -bb /data/SPECS/testdoc.spec
642
643runroot rpm -i --excludedocs \
644  /build/RPMS/noarch/testdoc-1.0-1.noarch.rpm
645
646RPM_DOCDIR=$(runroot rpm --eval '%_defaultdocdir')
647RPM_DATADIR=$(runroot rpm --eval '%_datadir')
648
649test ! -e ${RPMTEST}${RPM_DOCDIR}/testdoc || exit 1
650test -e ${RPMTEST}${RPM_DATADIR}/testdoc/nodoc || exit 1
651
652runroot rpm -e testdoc
653
654runroot rpm -i \
655  /build/RPMS/noarch/testdoc-1.0-1.noarch.rpm
656test -e ${RPMTEST}${RPM_DOCDIR}/testdoc/documentation1 || exit 1
657test -e ${RPMTEST}${RPM_DOCDIR}/testdoc/documentation2 || exit 1
658test -e ${RPMTEST}${RPM_DOCDIR}/testdoc/examples/example1 || exit 1
659test -e ${RPMTEST}${RPM_DOCDIR}/testdoc/examples/example2 || exit 1
660test -e ${RPMTEST}${RPM_DATADIR}/testdoc/nodoc || exit 1
661
662runroot rpm -e testdoc
663],
664[0],
665[],
666[])
667AT_CLEANUP
668
669AT_SETUP([rpm -i --excludeartifacts])
670AT_KEYWORDS([install])
671RPMDB_INIT
672runroot rpmbuild --quiet -bb /data/SPECS/vattrtest.spec
673
674AT_CHECK([
675RPMDB_INIT
676runroot rpm -i --excludeartifacts /build/RPMS/noarch/vattrtest-1.0-1.noarch.rpm
677test -e ${RPMTEST}/opt/vattrtest/a && exit 1
678runroot rpm -e vattrtest
679runroot rpm -i /build/RPMS/noarch/vattrtest-1.0-1.noarch.rpm
680test -e ${RPMTEST}/opt/vattrtest/a || exit 1
681],
682[0],
683[],
684[])
685AT_CLEANUP
686
687AT_SETUP([rpm -U <suicidal>])
688AT_KEYWORDS([install])
689RPMDB_INIT
690
691for r in 1 2; do
692    runroot rpmbuild -bb --quiet \
693		--define "rel ${r}" \
694		/data/SPECS/suicidal.spec
695done
696
697AT_CHECK([
698RPMDB_INIT
699
700for r in 1 2; do
701    runroot rpm -U \
702	--define "_minimize_writes 0" \
703	/build/RPMS/noarch/suicidal-1-${r}.noarch.rpm
704done
705runroot rpm -V --nouser --nogroup suicidal
706],
707[0],
708[],
709[])
710
711AT_CHECK([
712RPMDB_INIT
713
714for r in 1 2; do
715    runroot rpm -U \
716	--define "_minimize_writes 1" \
717	/build/RPMS/noarch/suicidal-1-${r}.noarch.rpm
718done
719runroot rpm -V --nouser --nogroup suicidal
720],
721[0],
722[],
723[])
724AT_CLEANUP
725