Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/pkg
Path: blob/main/tests/frontend/create.sh
2065 views
1
#! /usr/bin/env atf-sh
2
3
. $(atf_get_srcdir)/test_environment.sh
4
5
tests_init \
6
create_from_plist \
7
create_from_plist_with_variables \
8
create_from_plist_set_owner \
9
create_from_plist_set_group_space \
10
create_from_plist_gather_mode \
11
create_from_plist_set_mode \
12
create_from_plist_mini \
13
create_from_plist_fflags create_from_plist_bad_fflags \
14
create_from_plist_with_keyword_arguments \
15
create_from_plist_missing_file \
16
create_from_manifest_and_plist \
17
create_from_manifest \
18
create_from_manifest_dir \
19
create_from_plist_pkg_descr \
20
create_from_plist_hash \
21
create_from_plist_with_keyword_and_message \
22
create_from_plist_include \
23
create_with_hardlink \
24
create_no_clobber \
25
time \
26
create_from_plist_keyword_validation \
27
create_from_plist_keyword_real_args \
28
create_from_plist_keyword_lua_actions \
29
create_from_plist_keyword_deprecated \
30
create_from_plist_keyword_override_prefix
31
32
genmanifest() {
33
cat << EOF >> +MANIFEST
34
name: test
35
origin: test
36
version: 1
37
maintainer: test
38
categories: [test]
39
comment: a test
40
www: http://test
41
prefix: /
42
abi = "*";
43
desc: <<EOD
44
Yet another test
45
EOD
46
EOF
47
}
48
49
genprefixmanifest() {
50
cat << EOF >> +MANIFEST
51
name: test
52
origin: test
53
version: 1
54
maintainer: test
55
categories: [test]
56
comment: a test
57
www: http://test
58
prefix: /prefix
59
abi = "*";
60
desc: <<EOD
61
Yet another test
62
EOD
63
EOF
64
}
65
66
genplist() {
67
cat << EOF >> test.plist
68
$@
69
EOF
70
}
71
72
preparetestcredentials() {
73
touch file1
74
75
genmanifest
76
genplist "@$1 file1"
77
}
78
79
basic_validation() {
80
test -f test-1.pkg || atf_fail "Package not created"
81
}
82
83
create_with_hardlink_body() {
84
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1.0"
85
echo "blah" >> foo
86
ln foo bar
87
echo "@(root,wheel,0555,) /foo" >> test.plist
88
echo "@config(root,wheel,0644,) /bar" >> test.plist
89
90
atf_check \
91
-o ignore \
92
-e ignore \
93
pkg create -M test.ucl -p test.plist -r .
94
}
95
96
create_from_plist_body() {
97
touch file1
98
genmanifest
99
genplist "file1"
100
101
atf_check \
102
-o empty \
103
-e empty \
104
-s exit:0 \
105
pkg create -o ${TMPDIR} -m . -p test.plist -r .
106
107
basic_validation
108
atf_check \
109
-o match:"-rw-r--r-- .*root[ /]+wheel.* /file1$" \
110
-e ignore \
111
-s exit:0 \
112
bsdtar tvf test-1.pkg
113
}
114
115
create_from_plist_missing_file_body() {
116
# touch file1
117
genmanifest
118
genplist "file1"
119
120
atf_check \
121
-o empty \
122
-e match:"Unable to access file .*file1:" \
123
-s exit:1 \
124
pkg create -o ${TMPDIR} -m . -p test.plist -r .
125
}
126
127
create_from_plist_set_owner_body() {
128
129
preparetestcredentials "(plop,,)"
130
131
atf_check \
132
-o empty \
133
-e empty \
134
-s exit:0 \
135
pkg create -o ${TMPDIR} -m . -p test.plist -r .
136
137
basic_validation
138
atf_check \
139
-o match:"-rw-r--r-- .*plop[ /]+wheel.* /file1$" \
140
-e ignore \
141
-s exit:0 \
142
bsdtar tvf test-1.pkg
143
}
144
145
create_from_plist_set_group_body() {
146
147
preparetestcredentials "(,bla,)"
148
149
atf_check \
150
-o empty \
151
-e empty \
152
-s exit:0 \
153
pkg create -o ${TMPDIR} -m . -p test.plist -r .
154
155
basic_validation
156
atf_check \
157
-o match:"-rw-r--r-- .*root[ /]+bla.* /file1$" \
158
-e ignore \
159
-s exit:0 \
160
bsdtar tvf test-1.pkg
161
}
162
163
164
create_from_plist_set_group_space_body() {
165
166
preparetestcredentials "(, bla,)"
167
168
atf_check \
169
-o empty \
170
-e empty \
171
-s exit:0 \
172
pkg create -o ${TMPDIR} -m . -p test.plist -r .
173
174
basic_validation
175
atf_check \
176
-o match:"-rw-r--r-- .*root[ /]+bla.* /file1$" \
177
-e ignore \
178
-s exit:0 \
179
bsdtar tvf test-1.pkg
180
}
181
182
create_from_plist_gather_mode_body() {
183
184
preparetestcredentials "(plop,bla,)"
185
186
chmod 777 file1 || atf_fail "Impossible to change mode"
187
188
atf_check \
189
-o empty \
190
-e empty \
191
-s exit:0 \
192
pkg create -o ${TMPDIR} -m . -p test.plist -r .
193
194
basic_validation
195
atf_check \
196
-o match:"-rwxrwxrwx .*plop[ /]+bla.* /file1$" \
197
-e ignore \
198
-s exit:0 \
199
bsdtar tvf test-1.pkg
200
}
201
202
create_from_plist_set_mode_body() {
203
204
preparetestcredentials "(,,2755)"
205
206
atf_check \
207
-o empty \
208
-e empty \
209
-s exit:0 \
210
pkg create -o ${TMPDIR} -m . -p test.plist -r .
211
212
basic_validation
213
atf_check \
214
-o match:"-rwxr-sr-x .*root[ /]+wheel.* /file1$" \
215
-e ignore \
216
-s exit:0 \
217
bsdtar tvf test-1.pkg
218
}
219
220
create_from_plist_mini_body() {
221
222
preparetestcredentials "(plop,)"
223
224
atf_check \
225
-o empty \
226
-e empty \
227
-s exit:0 \
228
pkg create -o ${TMPDIR} -m . -p test.plist -r .
229
230
basic_validation
231
atf_check \
232
-o match:"-rw-r--r-- .*plop[ /]+wheel.* /file1$" \
233
-e ignore \
234
-s exit:0 \
235
bsdtar tvf test-1.pkg
236
}
237
238
create_from_plist_fflags_body() {
239
atf_skip_on Linux does not support fflags
240
preparetestcredentials "(,,,schg)"
241
242
atf_check \
243
-o empty \
244
-e empty \
245
-s exit:0 \
246
pkg create -o ${TMPDIR} -m . -p test.plist -r .
247
}
248
249
create_from_plist_bad_fflags_body() {
250
atf_skip_on Linux does not support fflags
251
preparetestcredentials "(,,,schg,bad)"
252
253
atf_check \
254
-o empty \
255
-e inline:"${PROGNAME}: Malformed keyword '', wrong fflags\n${PROGNAME}: Malformed keyword @(,,,schg,bad) file1, expecting @keyword or @keyword(owner,group,mode)\n" \
256
-s exit:1 \
257
pkg create -o ${TMPDIR} -m . -p test.plist -r .
258
}
259
260
create_from_plist_keyword_real_args_body() {
261
preparetestcredentials "test"
262
263
cat << EOF > test.ucl
264
actions: []
265
arguments: true
266
post-install-lua: <<EOS
267
if arg ~= nil then
268
print("yes")
269
end
270
for i = 1, #arg do
271
print(arg[i])
272
end
273
EOS
274
EOF
275
276
genplist "@test A B C D"
277
278
mkdir target
279
280
atf_check \
281
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
282
283
atf_check \
284
-o inline:"yes\nfile1\nyes\nA\nB\nC\nD\n" \
285
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
286
}
287
288
create_from_plist_keyword_validation_body() {
289
preparetestcredentials "test"
290
291
cat << EOF > test.ucl
292
actions: []
293
prepackaging: <<EOS
294
io.stderr:write("meh\n")
295
return 1
296
EOS
297
EOF
298
atf_check \
299
-o empty \
300
-e inline:"meh\n${PROGNAME}: Fail to apply keyword 'test'\n" \
301
-s exit:1 \
302
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
303
304
cat << EOF > test.ucl
305
actions: []
306
prepackaging: <<EOS
307
print(line)
308
io.stderr:write("meh\n")
309
return 1
310
EOS
311
EOF
312
atf_check \
313
-o inline:"file1\n" \
314
-e inline:"meh\n${PROGNAME}: Fail to apply keyword 'test'\n" \
315
-s exit:1 \
316
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
317
318
cat << EOF > test.ucl
319
actions: []
320
prepackaging: <<EOS
321
print(#arg)
322
io.stderr:write("meh\n")
323
return 1
324
EOS
325
EOF
326
atf_check \
327
-o inline:"0\n" \
328
-e inline:"meh\n${PROGNAME}: Fail to apply keyword 'test'\n" \
329
-s exit:1 \
330
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
331
332
cat << EOF > test.ucl
333
actions: []
334
arguments: true
335
prepackaging: <<EOS
336
print(#arg)
337
io.stderr:write("meh\n")
338
return 1
339
EOS
340
EOF
341
atf_check \
342
-o inline:"1\n" \
343
-e inline:"meh\n${PROGNAME}: Fail to apply keyword 'test'\n" \
344
-s exit:1 \
345
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
346
347
genplist "@test A B"
348
genplist "@test A A"
349
genplist "@test A B C"
350
cat << EOF > test.ucl
351
actions: []
352
arguments: true
353
prepackaging: <<EOS
354
if #arg == 1 then
355
return 0
356
end
357
if #arg == 2 then
358
if arg[1] == arg[2] then
359
io.stderr:write("The first and the second argument are identical\n")
360
return 1
361
end
362
return 1
363
end
364
io.stderr:write("Invalid number of arguments '".. #arg .. "' expecting 1 or 2\n")
365
return 1
366
EOS
367
EOF
368
output="${PROGNAME}: Fail to apply keyword 'test'
369
The first and the second argument are identical
370
${PROGNAME}: Fail to apply keyword 'test'
371
Invalid number of arguments '3' expecting 1 or 2
372
${PROGNAME}: Fail to apply keyword 'test'
373
"
374
atf_check \
375
-e inline:"${output}" \
376
-s exit:1 \
377
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
378
}
379
380
create_from_plist_with_keyword_arguments_body() {
381
preparetestcredentials "testkeyword"
382
383
atf_check \
384
-o empty \
385
-e inline:"${PROGNAME}: cannot load keyword from ./testkeyword.ucl: No such file or directory\n${PROGNAME}: unknown keyword testkeyword: @testkeyword\n" \
386
-s exit:1 \
387
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
388
389
cat << EOF >> testkeyword.ucl
390
actions: []
391
arguments: true
392
post-install:
393
echo %1 %2
394
EOF
395
396
atf_check \
397
-o empty \
398
-e inline:"${PROGNAME}: Requesting argument %2 while only 1 arguments are available\n${PROGNAME}: Fail to apply keyword 'testkeyword'\n" \
399
-s exit:1 \
400
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
401
402
cat << EOF > testkeyword.ucl
403
actions: [file(%1)]
404
arguments: true
405
post-install:
406
echo %1 %2
407
EOF
408
409
echo "@testkeyword A B" > test.plist
410
411
atf_check \
412
-o empty \
413
-e inline:"${PROGNAME}: Invalid argument: expecting a number got (%1)\n${PROGNAME}: Fail to apply keyword 'testkeyword'\n" \
414
-s exit:1 \
415
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
416
417
cat << EOF > testkeyword.ucl
418
actions: [file(1), dir(2)]
419
arguments: true
420
post-install:
421
echo %1 %2
422
EOF
423
touch A
424
mkdir B
425
426
atf_check \
427
-o empty \
428
-e empty \
429
-s exit:0 \
430
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
431
432
atf_check \
433
-o empty \
434
-e empty \
435
-s exit:0 \
436
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
437
438
cat << EOF >> output.ucl
439
name = "test";
440
origin = "test";
441
version = "1";
442
comment = "a test";
443
maintainer = "test";
444
www = "http://test";
445
abi = "*";
446
arch = "*";
447
prefix = "/";
448
flatsize = 0;
449
desc = "Yet another test";
450
categories [
451
"test",
452
]
453
files {
454
/A = "1\$e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
455
}
456
directories {
457
/B = "y";
458
}
459
scripts {
460
post-install = "# args: A B\necho A B";
461
}
462
EOF
463
464
atf_check \
465
-o file:output.ucl \
466
-e empty \
467
-s exit:0 \
468
pkg info -R --raw-format=ucl -F test-1.pkg
469
}
470
471
create_from_manifest_and_plist_body() {
472
genmanifest
473
touch testfile
474
genplist "testfile"
475
atf_check \
476
-o empty \
477
-e empty \
478
-s exit:0 \
479
pkg create -M ./+MANIFEST -p test.plist -r ${TMPDIR}
480
481
cat << EOF > output.ucl
482
name = "test";
483
origin = "test";
484
version = "1";
485
comment = "a test";
486
maintainer = "test";
487
www = "http://test";
488
abi = "*";
489
arch = "*";
490
prefix = "/";
491
flatsize = 0;
492
desc = "Yet another test";
493
categories [
494
"test",
495
]
496
files {
497
/testfile = "1\$e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
498
}
499
EOF
500
501
atf_check \
502
-o file:output.ucl \
503
-e empty \
504
-s exit:0 \
505
pkg info -R --raw-format=ucl -F test-1.pkg
506
}
507
508
create_from_manifest_body() {
509
genmanifest
510
cat <<EOF >> +MANIFEST
511
files: {
512
/testfile: {perm: 0644}
513
}
514
EOF
515
touch testfile
516
atf_check \
517
-o empty \
518
-e empty \
519
-s exit:0 \
520
pkg create -M ./+MANIFEST -r ${TMPDIR}
521
522
cat << EOF > output.ucl
523
name = "test";
524
origin = "test";
525
version = "1";
526
comment = "a test";
527
maintainer = "test";
528
www = "http://test";
529
abi = "*";
530
arch = "*";
531
prefix = "/";
532
flatsize = 0;
533
desc = "Yet another test";
534
categories [
535
"test",
536
]
537
files {
538
/testfile = "1\$e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
539
}
540
EOF
541
542
atf_check \
543
-o file:output.ucl \
544
-e empty \
545
-s exit:0 \
546
pkg info -R --raw-format=ucl -F test-1.pkg
547
}
548
549
create_from_manifest_dir_body() {
550
genmanifest
551
cat <<EOF >> +MANIFEST
552
files: {
553
/testfile: {perm: 0644}
554
/testdir: {perm: 0644}
555
}
556
EOF
557
touch testfile
558
mkdir testdir
559
atf_check \
560
-o empty \
561
-e not-empty \
562
-s not-exit:0 \
563
pkg create -M ./+MANIFEST -r ${TMPDIR}
564
565
}
566
567
create_from_plist_pkg_descr_body() {
568
genmanifest
569
cat << EOF > ./+DISPLAY
570
Message
571
EOF
572
573
OUTPUT="test-1:
574
Always:
575
Message
576
577
"
578
atf_check pkg create -m . -r ${TMPDIR}
579
atf_check -o inline:"${OUTPUT}" pkg info -D -F ./test-1.pkg
580
581
cat << EOF > ./+DISPLAY
582
[
583
{ message: "message" },
584
{ message: "message upgrade", type = "upgrade" },
585
]
586
EOF
587
588
OUTPUT='test-1:
589
Always:
590
message
591
592
On upgrade:
593
message upgrade
594
595
'
596
597
atf_check pkg create -m . -r ${TMPDIR}
598
atf_check -o inline:"${OUTPUT}" pkg info -D -F ./test-1.pkg
599
600
}
601
602
create_from_plist_hash_body() {
603
touch file1
604
genmanifest
605
genplist "file1"
606
607
atf_check \
608
-o empty \
609
-e empty \
610
-s exit:0 \
611
pkg create -h -o ${TMPDIR} -m . -p test.plist -r .
612
613
atf_check \
614
-o ignore \
615
-e empty \
616
-s exit:0 \
617
ls test-1-*.pkg
618
}
619
620
create_from_plist_with_keyword_and_message_body() {
621
genmanifest
622
genplist "@showmsg plop"
623
cat << EOF > showmsg.ucl
624
actions: []
625
messages: [
626
{ message: "always" },
627
{ message: "on upgrade";type = "upgrade" },
628
{ message: "on install"; type = "install" },
629
]
630
EOF
631
cat << EOF > +DISPLAY
632
old message
633
EOF
634
635
OUTPUT='test-1:
636
Always:
637
old message
638
639
Always:
640
always
641
642
On upgrade:
643
on upgrade
644
645
On install:
646
on install
647
648
'
649
atf_check pkg -o PLIST_KEYWORDS_DIR=. create -m . -r ${TMPDIR} -p test.plist
650
atf_check -o inline:"${OUTPUT}" pkg info -D -F ./test-1.pkg
651
652
}
653
654
time_body() {
655
atf_check sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1"
656
cat << EOF >> test.ucl
657
files: {
658
"${TMPDIR}/a" = "";
659
}
660
EOF
661
touch a
662
pattern=$(ls -l ${TMPDIR}/a | awk '{print $6" +"$7" +"$8".*/a"}')
663
atf_check pkg create -M test.ucl
664
atf_check env SOURCE_DATE_EPOCH=86400 pkg create -M test.ucl
665
atf_check \
666
-o match:"0 Jan +2 +1970.*/a" \
667
bsdtar tvf test-1.pkg
668
atf_check -e match:"Invalid" -s exit:1 pkg create -t meh -M test.ucl
669
atf_check pkg create -t 172800 -M test.ucl
670
atf_check \
671
-o match:"0 Jan +3 +1970.*/a" \
672
bsdtar tvf test-1.pkg
673
atf_check env SOURCE_DATE_EPOCH=86400 pkg create -t 172800 -M test.ucl
674
atf_check \
675
-o match:"0 Jan +3 +1970.*/a" \
676
bsdtar tvf test-1.pkg
677
atf_check pkg create -M test.ucl
678
atf_check \
679
-o match:"${pattern}" \
680
bsdtar tvf test-1.pkg
681
682
mkdir target
683
atf_check -o empty \
684
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
685
atf_check \
686
-o match:"${pattern}" \
687
ls -l ${TMPDIR}/target/${TMPDIR}/a
688
}
689
690
create_no_clobber_body()
691
{
692
atf_check sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1"
693
694
touch test-1.pkg
695
before=$(ls -l test-1.pkg)
696
atf_check pkg create -nM test.ucl
697
after=$(ls -l test-1.pkg)
698
[ "$before" = "$after" ] || atf_fail "Package was recreated \"$before\" vs \"$after\""
699
}
700
701
create_from_plist_include_body()
702
{
703
genmanifest
704
cat << EOF >> test.plist
705
file1
706
@include other-plist
707
file2
708
EOF
709
cat <<EOF >> other-plist
710
file3
711
EOF
712
713
touch file1
714
touch file2
715
touch file3
716
717
atf_check \
718
-s exit:0 \
719
pkg create -o ${TMPDIR} -m . -p test.plist -r .
720
721
atf_check -o inline:"/file1\n/file3\n/file2\n" pkg info -ql -F test*.pkg
722
cat << EOF >> other-plist
723
@include test.plist
724
EOF
725
atf_check \
726
-e inline:"pkg: Inside in @include it is not allowed to reuse @include\n" \
727
-s exit:1 \
728
pkg create -o ${TMPDIR} -m . -p test.plist -r .
729
}
730
731
create_from_plist_keyword_lua_actions_body()
732
{
733
genmanifest
734
genplist "@test(plop,,) A B C D"
735
736
cat << EOF > test.ucl
737
arguments: true
738
prepackaging: <<EOS
739
ok = true
740
for i = 1, #arg do
741
if not pkg.file(arg[i]) then
742
ok = false
743
end
744
end
745
if not ok then
746
return 1
747
end
748
EOS
749
arguments: true
750
EOF
751
752
touch C
753
touch D
754
755
output="${PROGNAME}: Unable to access file ./A:No such file or directory
756
${PROGNAME}: Unable to access file ./B:No such file or directory
757
${PROGNAME}: Fail to apply keyword 'test'
758
"
759
760
atf_check \
761
-e inline:"${output}" \
762
-s exit:1 \
763
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
764
765
touch A B
766
atf_check \
767
-s exit:0 \
768
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
769
atf_check \
770
-o match:"-rw-r--r-- .*plop[ /]+wheel.* /A$" \
771
bsdtar tvf test-1.pkg
772
}
773
774
create_from_plist_keyword_deprecated_body()
775
{
776
genmanifest
777
genplist "@test A B C D"
778
779
cat << EOF > test.ucl
780
arguments: true
781
deprecated: true
782
EOF
783
784
atf_check \
785
-e inline:"${PROGNAME}: Use of '@test' is deprecated\n" \
786
-s exit:0 \
787
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
788
789
cat << EOF > test.ucl
790
arguments: true
791
deprecated: true
792
deprecation_message: <<EOM
793
we don't like it anymore
794
EOM
795
EOF
796
797
atf_check \
798
-e inline:"${PROGNAME}: Use of '@test' is deprecated: we don't like it anymore\n" \
799
-s exit:0 \
800
pkg -o PLIST_KEYWORDS_DIR=. create -o ${TMPDIR} -m . -p test.plist -r .
801
802
}
803
804
create_from_plist_keyword_override_prefix_body()
805
{
806
genmanifest
807
genplist "@override_prefix /plop
808
file"
809
touch file
810
atf_check pkg create -o ${TMPDIR} -m . -p test.plist -r .
811
atf_check -o match:".*/plop/file$" -e ignore tar tf test-1.pkg
812
atf_check -o inline:"/plop/file\n" pkg info -F test-1.pkg -ql
813
814
genprefixmanifest
815
816
mkdir "prefix"
817
touch prefix/file
818
atf_check pkg create -o ${TMPDIR} -m . -p test.plist -r .
819
atf_check -o match:".*/plop/file$" -e ignore tar tf test-1.pkg
820
atf_check -o inline:"/plop/file\n" pkg info -F test-1.pkg -ql
821
}
822
823
824
create_from_plist_with_variables_body() {
825
touch file1 file2 plop file3
826
genmanifest
827
genplist "
828
@var key1
829
@var key2
830
@var key3 plop
831
%%key1%%file1
832
%%key2%%file2
833
%%key3%%
834
@var key3 @comment
835
%%key3%% file3"
836
837
atf_check \
838
-o empty \
839
-e empty \
840
-s exit:0 \
841
pkg create -o ${TMPDIR} -m . -p test.plist -r .
842
843
basic_validation
844
atf_check \
845
-o inline:"/file1\n/file2\n/plop\n" \
846
pkg info -F test-1.pkg -ql
847
rm test-1.pkg
848
echo "
849
%%plop%%
850
" >> test.plist
851
atf_check \
852
-e match:"%%plop%%" \
853
-s exit:1 \
854
pkg create -o ${TMPDIR} -m . -p test.plist -r .
855
}
856
857