deb-split.at 3.1 KB

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