Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/pkg
Path: blob/main/tests/frontend/lua.sh
2065 views
1
#! /usr/bin/env atf-sh
2
3
. $(atf_get_srcdir)/test_environment.sh
4
5
tests_init \
6
script_basic \
7
script_message \
8
script_rooteddir \
9
script_remove \
10
script_execute \
11
script_rename \
12
script_upgrade \
13
script_filecmp \
14
script_filecmp_symlink \
15
script_copy \
16
script_copy_symlink \
17
script_sample_not_exists \
18
script_sample_not_exists_symlink \
19
script_sample_not_exists_two_files \
20
script_sample_exists \
21
script_stat \
22
script_arguments
23
24
script_arguments_body() {
25
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
26
cat << EOF >> test.ucl
27
lua_scripts: {
28
post-install: [
29
"-- args: plop\nprint(arg[1])"
30
]
31
}
32
EOF
33
atf_check \
34
-o empty \
35
-e empty \
36
-s exit:0 \
37
pkg create -M test.ucl
38
39
mkdir ${TMPDIR}/target
40
atf_check \
41
-o inline:"plop\n" \
42
-e empty \
43
-s exit:0 \
44
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
45
46
}
47
48
script_basic_body() {
49
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
50
cat << EOF >> test.ucl
51
lua_scripts: {
52
post-install: [
53
'print("this is post install1")',
54
'print("this is post install2")',
55
]
56
}
57
EOF
58
59
atf_check \
60
-o empty \
61
-e empty \
62
-s exit:0 \
63
pkg create -M test.ucl
64
65
mkdir ${TMPDIR}/target
66
atf_check \
67
-o inline:"this is post install1\nthis is post install2\n" \
68
-e empty \
69
-s exit:0 \
70
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
71
72
}
73
74
script_message_body() {
75
# The message should be the last thing planned
76
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
77
cat << EOF >> test.ucl
78
lua_scripts: {
79
post-install: [
80
"print(\"this is post install1\")\npkg.print_msg(\"this is a message\")",
81
'print("this is post install2")',
82
]
83
}
84
EOF
85
86
atf_check \
87
-o empty \
88
-e empty \
89
-s exit:0 \
90
pkg create -M test.ucl
91
92
mkdir ${TMPDIR}/target
93
atf_check \
94
-o inline:"this is post install1\nthis is post install2\nthis is a message\n" \
95
-e empty \
96
-s exit:0 \
97
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
98
99
}
100
101
script_rooteddir_body() {
102
# The message should be the last thing planned
103
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
104
cat << EOF >> test.ucl
105
lua_scripts: {
106
post-install: [ <<EOS
107
test = io.open("/file.txt", "w+")
108
test:write("test\n")
109
io.close(test)
110
EOS
111
,
112
]
113
}
114
EOF
115
116
atf_check \
117
-o empty \
118
-e empty \
119
-s exit:0 \
120
pkg create -M test.ucl
121
122
mkdir ${TMPDIR}/target
123
atf_check \
124
-e empty \
125
-s exit:0 \
126
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
127
[ -f ${TMPDIR}/target/file.txt ] || atf_fail "File not created in the rootdir"
128
# test the mode
129
atf_check -o match:"^-rw-r--r--" ls -l ${TMPDIR}/target/file.txt
130
atf_check \
131
-e empty \
132
-o inline:"test\n" \
133
-s exit:0 \
134
cat ${TMPDIR}/target/file.txt
135
136
}
137
138
script_remove_body() {
139
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
140
cat << EOF >> test.ucl
141
lua_scripts: {
142
post-install: [ <<EOS
143
os.remove("/file")
144
EOS
145
,
146
]
147
}
148
EOF
149
150
atf_check \
151
-o empty \
152
-e empty \
153
-s exit:0 \
154
pkg create -M test.ucl
155
156
mkdir -p ${TMPDIR}/target/file
157
atf_check \
158
-e empty \
159
-s exit:0 \
160
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
161
test -d ${TMPDIR}/target/file && atf_fail "directory not removed"
162
163
touch ${TMPDIR}/target/file
164
atf_check \
165
-e empty \
166
-s exit:0 \
167
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
168
test -f ${TMPDIR}/target/file && atf_fail "file not removed"
169
return 0
170
}
171
172
script_rename_body() {
173
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
174
cat << EOF >> test.ucl
175
lua_scripts: {
176
post-install: [ <<EOS
177
os.rename("/file","/plop")
178
EOS
179
,
180
]
181
}
182
EOF
183
184
atf_check \
185
-o empty \
186
-e empty \
187
-s exit:0 \
188
pkg create -M test.ucl
189
mkdir -p ${TMPDIR}/target
190
touch ${TMPDIR}/target/file
191
atf_check \
192
-e inline:"${ERR}" \
193
-s exit:0 \
194
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
195
test -f ${TMPDIR}/target/file && atf_fail "File not renamed"
196
test -f ${TMPDIR}/target/plop || atf_fail "File not renamed"
197
return 0
198
}
199
200
script_execute_body() {
201
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
202
cat << EOF >> test.ucl
203
lua_scripts: {
204
post-install: [ <<EOS
205
os.execute("echo yeah")
206
EOS
207
,
208
]
209
}
210
EOF
211
212
ERR="pkg: Failed to execute lua script: [string \"os.execute(\"echo yeah\")\"]:1: os.execute not available
213
pkg: lua script failed\n"
214
215
216
atf_check \
217
-o empty \
218
-e empty \
219
-s exit:0 \
220
pkg create -M test.ucl
221
mkdir -p ${TMPDIR}/target
222
atf_check \
223
-e inline:"${ERR}" \
224
-s exit:0 \
225
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
226
}
227
228
script_upgrade_body() {
229
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
230
cat << EOF >> test.ucl
231
lua_scripts: {
232
post-install: [ <<EOS
233
if pkg_upgrade then
234
pkg.print_msg("upgrade : ".. tostring(pkg_upgrade))
235
end
236
EOS
237
,
238
]
239
}
240
EOF
241
242
243
atf_check \
244
-o empty \
245
-e empty \
246
-s exit:0 \
247
pkg create -M test.ucl
248
mkdir -p ${TMPDIR}/target
249
atf_check \
250
-e empty \
251
-o empty \
252
-s exit:0 \
253
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
254
255
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "2" "/"
256
cat << EOF >> test.ucl
257
lua_scripts: {
258
post-install: [ <<EOS
259
if pkg_upgrade then
260
pkg.print_msg("upgrade:".. tostring(pkg_upgrade))
261
end
262
EOS
263
,
264
]
265
}
266
EOF
267
268
rm ${TMPDIR}/test-1.pkg
269
atf_check \
270
-o empty \
271
-e empty \
272
-s exit:0 \
273
pkg create -M test.ucl
274
mkdir -p ${TMPDIR}/target
275
atf_check \
276
-o ignore \
277
-e empty \
278
-s exit:0 \
279
pkg repo .
280
mkdir reposconf
281
cat <<EOF >> reposconf/repo.conf
282
local: {
283
url: file:///${TMPDIR},
284
enabled: true
285
}
286
EOF
287
atf_check \
288
-e empty \
289
-o match:"upgrade:true" \
290
-s exit:0 \
291
pkg -o REPOS_DIR="${TMPDIR}/reposconf" -r ${TMPDIR}/target upgrade -y
292
}
293
294
script_filecmp_body() {
295
echo "sametext" > a
296
echo "sametext" > b
297
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
298
cat << EOF >> test.ucl
299
files: {
300
${TMPDIR}/a: ""
301
${TMPDIR}/b: ""
302
}
303
lua_scripts: {
304
post-install: [ <<EOS
305
if pkg.filecmp("${TMPDIR}/a", "${TMPDIR}/b") == 0 then
306
pkg.print_msg("same")
307
else
308
pkg.print_msg("different")
309
end
310
EOS
311
, ]
312
}
313
EOF
314
315
atf_check \
316
-o empty \
317
-e empty \
318
-s exit:0 \
319
pkg create -M test.ucl
320
321
mkdir ${TMPDIR}/target
322
atf_check \
323
-o inline:"same\n" \
324
-e empty \
325
-s exit:0 \
326
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
327
328
# Cleanup
329
atf_check \
330
-o empty \
331
-e empty \
332
-s exit:0 \
333
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target delete -qfy test-1
334
rm -rf ${TMPDIR}/target
335
336
echo "sametext" > a
337
echo "differenttext" > b
338
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
339
cat << EOF >> test.ucl
340
files: {
341
${TMPDIR}/a: ""
342
${TMPDIR}/b: ""
343
}
344
lua_scripts: {
345
post-install: [ <<EOS
346
if pkg.filecmp("${TMPDIR}/a", "${TMPDIR}/b") == 0 then
347
pkg.print_msg("same")
348
else
349
pkg.print_msg("different")
350
end
351
EOS
352
, ]
353
}
354
EOF
355
356
atf_check \
357
-o empty \
358
-e empty \
359
-s exit:0 \
360
pkg create -M test.ucl
361
362
mkdir ${TMPDIR}/target
363
atf_check \
364
-o inline:"different\n" \
365
-e empty \
366
-s exit:0 \
367
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
368
}
369
370
script_filecmp_symlink_body() {
371
echo "sametext" > a
372
echo "sametext" > b
373
ln -s a c
374
ln -s b d
375
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
376
cat << EOF >> test.ucl
377
files: {
378
${TMPDIR}/a: ""
379
${TMPDIR}/b: ""
380
${TMPDIR}/c: ""
381
${TMPDIR}/d: ""
382
}
383
lua_scripts: {
384
post-install: [ <<EOS
385
if pkg.filecmp("${TMPDIR}/c", "${TMPDIR}/d") == 0 then
386
pkg.print_msg("same")
387
else
388
pkg.print_msg("different")
389
end
390
EOS
391
, ]
392
}
393
EOF
394
395
atf_check \
396
-o empty \
397
-e empty \
398
-s exit:0 \
399
pkg create -M test.ucl
400
401
mkdir ${TMPDIR}/target
402
atf_check \
403
-o inline:"same\n" \
404
-e empty \
405
-s exit:0 \
406
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
407
408
# Cleanup
409
atf_check \
410
-o empty \
411
-e empty \
412
-s exit:0 \
413
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target delete -qfy test-1
414
rm -rf ${TMPDIR}/target
415
rm a b c d
416
417
echo "sametext" > a
418
echo "differenttext" > b
419
ln -s a c
420
ln -s b d
421
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
422
cat << EOF >> test.ucl
423
files: {
424
${TMPDIR}/a: ""
425
${TMPDIR}/b: ""
426
${TMPDIR}/c: ""
427
${TMPDIR}/d: ""
428
}
429
lua_scripts: {
430
post-install: [ <<EOS
431
if pkg.filecmp("${TMPDIR}/c", "${TMPDIR}/d") == 0 then
432
pkg.print_msg("same")
433
else
434
pkg.print_msg("different")
435
end
436
EOS
437
, ]
438
}
439
EOF
440
441
atf_check \
442
-o empty \
443
-e empty \
444
-s exit:0 \
445
pkg create -M test.ucl
446
447
mkdir ${TMPDIR}/target
448
atf_check \
449
-o inline:"different\n" \
450
-e empty \
451
-s exit:0 \
452
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
453
}
454
455
script_copy_body() {
456
echo "sample text" > a.sample
457
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
458
cat << EOF >> test.ucl
459
files: {
460
${TMPDIR}/a.sample: ""
461
}
462
lua_scripts: {
463
post-install: [ <<EOS
464
pkg.copy("${TMPDIR}/a.sample", "${TMPDIR}/a")
465
EOS
466
, ]
467
}
468
EOF
469
470
atf_check \
471
-o empty \
472
-e empty \
473
-s exit:0 \
474
pkg create -M test.ucl
475
476
mkdir ${TMPDIR}/target
477
atf_check \
478
-o empty \
479
-e empty \
480
-s exit:0 \
481
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
482
483
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/a.sample
484
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/a
485
atf_check \
486
-o empty \
487
-e empty \
488
-s exit:0 \
489
cmp -s ${TMPDIR}/target${TMPDIR}/a.sample ${TMPDIR}/target${TMPDIR}/a
490
}
491
492
script_copy_symlink_body() {
493
echo "sample text" > a.sample
494
ln -s a.sample b
495
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
496
cat << EOF >> test.ucl
497
files: {
498
${TMPDIR}/a.sample: ""
499
${TMPDIR}/b: ""
500
}
501
lua_scripts: {
502
post-install: [ <<EOS
503
pkg.copy("${TMPDIR}/b", "${TMPDIR}/a")
504
EOS
505
, ]
506
}
507
EOF
508
509
atf_check \
510
-o empty \
511
-e empty \
512
-s exit:0 \
513
pkg create -M test.ucl
514
515
mkdir ${TMPDIR}/target
516
atf_check \
517
-o empty \
518
-e empty \
519
-s exit:0 \
520
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
521
522
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/a.sample
523
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/b
524
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/a
525
atf_check \
526
-o empty \
527
-e empty \
528
-s exit:0 \
529
cmp -s ${TMPDIR}/target${TMPDIR}/a.sample ${TMPDIR}/target${TMPDIR}/a
530
atf_check \
531
-o empty \
532
-e empty \
533
-s exit:0 \
534
cmp -s ${TMPDIR}/target${TMPDIR}/b ${TMPDIR}/target${TMPDIR}/a
535
}
536
537
script_sample_not_exists_body() {
538
echo "sample text" > a.sample
539
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "${TMPDIR}"
540
cat << EOF >> test.ucl
541
files: {
542
${TMPDIR}/a.sample: ""
543
}
544
lua_scripts: {
545
post-install: [ <<EOS
546
-- args: a.sample
547
sample_file = pkg.prefixed_path(arg[1])
548
if arg[2] == nil then
549
target_file = string.gsub(sample_file,'%.sample$', "")
550
else
551
target_file = pkg.prefixed_path(arg[2])
552
end
553
if not pkg.stat(target_file) then
554
pkg.copy(sample_file, target_file)
555
end
556
EOS
557
, ]
558
}
559
EOF
560
561
atf_check \
562
-o empty \
563
-e empty \
564
-s exit:0 \
565
pkg create -M test.ucl
566
567
mkdir ${TMPDIR}/target
568
atf_check \
569
-o empty \
570
-e empty \
571
-s exit:0 \
572
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
573
574
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/a.sample
575
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/a
576
atf_check \
577
-o empty \
578
-e empty \
579
-s exit:0 \
580
cmp -s ${TMPDIR}/target${TMPDIR}/a.sample ${TMPDIR}/target${TMPDIR}/a
581
}
582
583
script_sample_not_exists_symlink_body() {
584
echo "sample text" > a
585
ln -s a b.sample
586
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "${TMPDIR}"
587
cat << EOF >> test.ucl
588
files: {
589
${TMPDIR}/a: ""
590
${TMPDIR}/b.sample: ""
591
}
592
lua_scripts: {
593
post-install: [ <<EOS
594
-- args: b.sample
595
sample_file = pkg.prefixed_path(arg[1])
596
if arg[2] == nil then
597
target_file = string.gsub(sample_file,'%.sample$', "")
598
else
599
target_file = pkg.prefixed_path(arg[2])
600
end
601
if not pkg.stat(target_file) then
602
pkg.copy(sample_file, target_file)
603
end
604
EOS
605
, ]
606
}
607
EOF
608
609
atf_check \
610
-o empty \
611
-e empty \
612
-s exit:0 \
613
pkg create -M test.ucl
614
615
mkdir ${TMPDIR}/target
616
atf_check \
617
-o empty \
618
-e empty \
619
-s exit:0 \
620
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
621
622
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/a
623
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/b.sample
624
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/b
625
atf_check \
626
-o empty \
627
-e empty \
628
-s exit:0 \
629
cmp -s ${TMPDIR}/target${TMPDIR}/b.sample ${TMPDIR}/target${TMPDIR}/b
630
}
631
632
script_sample_not_exists_two_files_body() {
633
echo "sample text" > a
634
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "${TMPDIR}"
635
cat << EOF >> test.ucl
636
files: {
637
${TMPDIR}/a: ""
638
}
639
lua_scripts: {
640
post-install: [ <<EOS
641
-- args: a b
642
sample_file = pkg.prefixed_path(arg[1])
643
if arg[2] == nil then
644
target_file = string.gsub(sample_file,'%.sample$', "")
645
else
646
target_file = pkg.prefixed_path(arg[2])
647
end
648
if not pkg.stat(target_file) then
649
pkg.copy(sample_file, target_file)
650
end
651
EOS
652
, ]
653
}
654
EOF
655
656
atf_check \
657
-o empty \
658
-e empty \
659
-s exit:0 \
660
pkg create -M test.ucl
661
662
mkdir ${TMPDIR}/target
663
atf_check \
664
-o empty \
665
-e empty \
666
-s exit:0 \
667
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
668
669
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/a
670
atf_check -o inline:"sample text\n" cat ${TMPDIR}/target${TMPDIR}/b
671
atf_check \
672
-o empty \
673
-e empty \
674
-s exit:0 \
675
cmp -s ${TMPDIR}/target${TMPDIR}/a ${TMPDIR}/target${TMPDIR}/b
676
}
677
678
script_sample_exists_body() {
679
echo "sample text" > a.sample
680
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
681
cat << EOF >> test.ucl
682
files: {
683
${TMPDIR}/a.sample: ""
684
}
685
lua_scripts: {
686
post-install: [ <<EOS
687
-- args: a.sample
688
sample_file = pkg.prefixed_path(arg[1])
689
if arg[2] == nil then
690
target_file = string.gsub(sample_file,'%.sample$', "")
691
else
692
target_file = pkg.prefixed_path(arg[2])
693
end
694
if not pkg.stat(target_file) then
695
pkg.copy(sample_file, target_file)
696
end
697
EOS
698
, ]
699
}
700
EOF
701
702
mkdir -p ${TMPDIR}/target${TMPDIR}
703
echo "text modified" > ${TMPDIR}/target${TMPDIR}/a
704
atf_check \
705
-o empty \
706
-e empty \
707
-s exit:0 \
708
pkg create -M test.ucl
709
710
atf_check \
711
-o empty \
712
-e empty \
713
-s exit:0 \
714
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
715
716
atf_check \
717
-o empty \
718
-e empty \
719
-s exit:1 \
720
cmp -s ${TMPDIR}/target${TMPDIR}/a.sample ${TMPDIR}/target${TMPDIR}/a
721
}
722
723
script_stat_body() {
724
touch plop
725
atf_check -s exit:0 sh ${RESOURCEDIR}/test_subr.sh new_pkg "test" "test" "1" "/"
726
cat << EOF >> test.ucl
727
files: {
728
${TMPDIR}/plop: ""
729
}
730
lua_scripts: {
731
post-install: [ <<EOS
732
local st = pkg.stat("${TMPDIR}/plop")
733
if st.size == 0 then
734
pkg.print_msg("zero")
735
end
736
pkg.print_msg(st.type)
737
EOS
738
, ]
739
}
740
EOF
741
atf_check \
742
-o empty \
743
-e empty \
744
-s exit:0 \
745
pkg create -M test.ucl
746
mkdir ${TMPDIR}/target
747
atf_check \
748
-o inline:"zero\nreg\n" \
749
-e empty \
750
-s exit:0 \
751
pkg -o REPOS_DIR=/dev/null -r ${TMPDIR}/target install -qfy ${TMPDIR}/test-1.pkg
752
}
753
754