dpkg (1.18.25) stretch; urgency=medium
[dpkg] / t-func / deb-split.at
CommitLineData
1479465f
GJ
1AT_TESTED([dpkg-split])
2
3AT_SETUP([dpkg-split options])
4AT_KEYWORDS([dpkg-split command-line])
5AT_CHECK([dpkg-split --help], [], [ignore])
6AT_CLEANUP
7
8AT_SETUP([dpkg-split .deb format])
9AT_KEYWORDS([dpkg-split deb-split])
10
11DPKG_GEN_CONTROL([pkg-split])
12DPKG_MOD_CONTROL([pkg-split],
13 [s/^Description:.*$/& - normal package to be split/])
14AT_CHECK([
15# Initialize the template package
16chmod -R u+w pkg-split
17# XXX: Some environments set SIGPIPE to ignore which we cannot reset, and yes
18# does check print error conditions, so we ignore its error message here.
19yes 2>/dev/null | dd of=pkg-split/data-file bs=1024 count=1024 status=none
20find pkg-split | xargs touch -t 197001010100.00
21$ASROOT dpkg-deb -b -Znone pkg-split >/dev/null
22])
23
24AT_CHECK([
25# Test splitting a package (in 3 parts: 400 KiB + 400 KiB + 224 KiB)
26dpkg-split -S 400 -s pkg-split.deb pkg-split-part
27test -f pkg-split-part.1of3.deb
28test -f pkg-split-part.2of3.deb
29test -f pkg-split-part.3of3.deb
30], [], [Splitting package pkg-split into 3 parts: 1 2 3 done
31])
32
33DEB_SPLIT_MD5SUM=a4042d88f6da3da8ab2ab191a290ab66
34
35AT_CHECK_UNQUOTED([
36# Test getting information about the split parts (parsing verification)
37dpkg-split -I pkg-split-part.1of3.deb
38dpkg-split -I pkg-split-part.2of3.deb
39dpkg-split -I pkg-split-part.3of3.deb
40], [], [pkg-split-part.1of3.deb:
41 Part format version: 2.1
42 Part of package: pkg-split
43 ... version: 0.0-1
44 ... architecture: all
45 ... MD5 checksum: $DEB_SPLIT_MD5SUM
46 ... length: 1055178 bytes
47 ... split every: 408576 bytes
48 Part number: 1/3
49 Part length: 408576 bytes
50 Part offset: 0 bytes
51 Part file size (used portion): 408780 bytes
52
53pkg-split-part.2of3.deb:
54 Part format version: 2.1
55 Part of package: pkg-split
56 ... version: 0.0-1
57 ... architecture: all
58 ... MD5 checksum: $DEB_SPLIT_MD5SUM
59 ... length: 1055178 bytes
60 ... split every: 408576 bytes
61 Part number: 2/3
62 Part length: 408576 bytes
63 Part offset: 408576 bytes
64 Part file size (used portion): 408780 bytes
65
66pkg-split-part.3of3.deb:
67 Part format version: 2.1
68 Part of package: pkg-split
69 ... version: 0.0-1
70 ... architecture: all
71 ... MD5 checksum: $DEB_SPLIT_MD5SUM
72 ... length: 1055178 bytes
73 ... split every: 408576 bytes
74 Part number: 3/3
75 Part length: 238026 bytes
76 Part offset: 817152 bytes
77 Part file size (used portion): 238230 bytes
78
79])
80
81AT_CHECK([
82# Test joining the split parts back together
83dpkg-split -o pkg-joined.deb -j pkg-split-part.*.deb
84cmp pkg-split.deb pkg-joined.deb
85], [], [Putting package pkg-split together from 3 parts: 1 2 3 done
86])
87
88AT_CLEANUP