chiark / gitweb /
awful debugging hacking
[dpkg] / t-func / deb-split.at
1 AT_TESTED([dpkg-split])
2
3 AT_SETUP([dpkg-split options])
4 AT_KEYWORDS([dpkg-split command-line])
5 AT_CHECK([dpkg-split --help], [], [ignore])
6 AT_CLEANUP
7
8 AT_SETUP([dpkg-split .deb format])
9 AT_KEYWORDS([dpkg-split deb-split])
10
11 DPKG_GEN_CONTROL([pkg-split])
12 DPKG_MOD_CONTROL([pkg-split],
13                  [s/^Description:.*$/& - normal package to be split/])
14 AT_CHECK([
15 # Initialize the template package
16 chmod -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.
19 yes 2>/dev/null | dd of=pkg-split/data-file bs=1024 count=1024 status=none
20 find pkg-split | xargs touch -t 197001010100.00
21 $ASROOT dpkg-deb -b -Znone pkg-split >/dev/null
22 ])
23
24 AT_CHECK([
25 # Test splitting a package (in 3 parts: 400 KiB + 400 KiB + 224 KiB)
26 dpkg-split -S 400 -s pkg-split.deb pkg-split-part
27 test -f pkg-split-part.1of3.deb
28 test -f pkg-split-part.2of3.deb
29 test -f pkg-split-part.3of3.deb
30 ], [], [Splitting package pkg-split into 3 parts: 1 2 3 done
31 ])
32
33 DEB_SPLIT_MD5SUM=a4042d88f6da3da8ab2ab191a290ab66
34
35 AT_CHECK_UNQUOTED([
36 # Test getting information about the split parts (parsing verification)
37 dpkg-split -I pkg-split-part.1of3.deb
38 dpkg-split -I pkg-split-part.2of3.deb
39 dpkg-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
53 pkg-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
66 pkg-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
81 AT_CHECK([
82 # Test joining the split parts back together
83 dpkg-split -o pkg-joined.deb -j pkg-split-part.*.deb
84 cmp pkg-split.deb pkg-joined.deb
85 ], [], [Putting package pkg-split together from 3 parts: 1 2 3 done
86 ])
87
88 AT_CLEANUP