test-apt-progress-fd 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'amd64' 'i386'
  7. buildsimplenativepackage 'testing' 'amd64' '0.1' 'stable'
  8. buildsimplenativepackage 'testing' 'amd64' '0.8.15' 'stable'
  9. buildsimplenativepackage 'testing2' 'amd64,i386' '0.8.15' 'stable'
  10. setupaptarchive
  11. # install native
  12. exec 3> apt-progress.log
  13. testsuccess aptget install testing=0.1 -y -o APT::Status-Fd=3
  14. testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
  15. dlstatus:1:0:Retrieving file 1 of 1
  16. dlstatus:1:20:Retrieving file 1 of 1
  17. pmstatus:dpkg-exec:0:Running dpkg
  18. pmstatus:testing:0:Installing testing (amd64)
  19. pmstatus:testing:16.6667:Preparing testing (amd64)
  20. pmstatus:testing:33.3333:Unpacking testing (amd64)
  21. pmstatus:testing:50:Preparing to configure testing (amd64)
  22. pmstatus:dpkg-exec:50:Running dpkg
  23. pmstatus:testing:50:Configuring testing (amd64)
  24. pmstatus:testing:66.6667:Configuring testing (amd64)
  25. pmstatus:testing:83.3333:Installed testing (amd64)
  26. pmstatus:dpkg-exec:83.3333:Running dpkg'
  27. # upgrade
  28. exec 3> apt-progress.log
  29. testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3
  30. testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
  31. dlstatus:1:0:Retrieving file 1 of 1
  32. dlstatus:1:20:Retrieving file 1 of 1
  33. pmstatus:dpkg-exec:0:Running dpkg
  34. pmstatus:testing:0:Installing testing (amd64)
  35. pmstatus:testing:16.6667:Preparing testing (amd64)
  36. pmstatus:testing:33.3333:Unpacking testing (amd64)
  37. pmstatus:testing:50:Preparing to configure testing (amd64)
  38. pmstatus:dpkg-exec:50:Running dpkg
  39. pmstatus:testing:50:Configuring testing (amd64)
  40. pmstatus:testing:66.6667:Configuring testing (amd64)
  41. pmstatus:testing:83.3333:Installed testing (amd64)
  42. pmstatus:dpkg-exec:83.3333:Running dpkg'
  43. # reinstall
  44. exec 3> apt-progress.log
  45. testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3
  46. testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
  47. dlstatus:1:0:Retrieving file 1 of 1
  48. dlstatus:1:20:Retrieving file 1 of 1
  49. pmstatus:dpkg-exec:0:Running dpkg
  50. pmstatus:testing:0:Installing testing (amd64)
  51. pmstatus:testing:16.6667:Preparing testing (amd64)
  52. pmstatus:testing:33.3333:Unpacking testing (amd64)
  53. pmstatus:testing:50:Preparing to configure testing (amd64)
  54. pmstatus:dpkg-exec:50:Running dpkg
  55. pmstatus:testing:50:Configuring testing (amd64)
  56. pmstatus:testing:66.6667:Configuring testing (amd64)
  57. pmstatus:testing:83.3333:Installed testing (amd64)
  58. pmstatus:dpkg-exec:83.3333:Running dpkg'
  59. # and remove
  60. exec 3> apt-progress.log
  61. testsuccess aptget remove testing -y -o APT::Status-Fd=3
  62. testfileequal './apt-progress.log' 'pmstatus:dpkg-exec:0:Running dpkg
  63. pmstatus:testing:0:Removing testing (amd64)
  64. pmstatus:testing:25:Preparing for removal of testing (amd64)
  65. pmstatus:testing:50:Removing testing (amd64)
  66. pmstatus:testing:75:Removed testing (amd64)
  67. pmstatus:dpkg-exec:75:Running dpkg'
  68. # install non-native and ensure we get proper progress info
  69. exec 3> apt-progress.log
  70. testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3
  71. testfileequal './apt-progress.log' 'dlstatus:1:0:Retrieving file 1 of 1
  72. dlstatus:1:0:Retrieving file 1 of 1
  73. dlstatus:1:20:Retrieving file 1 of 1
  74. pmstatus:dpkg-exec:0:Running dpkg
  75. pmstatus:testing2:0:Installing testing2 (i386)
  76. pmstatus:testing2:16.6667:Preparing testing2 (i386)
  77. pmstatus:testing2:33.3333:Unpacking testing2 (i386)
  78. pmstatus:testing2:50:Preparing to configure testing2 (i386)
  79. pmstatus:dpkg-exec:50:Running dpkg
  80. pmstatus:testing2:50:Configuring testing2 (i386)
  81. pmstatus:testing2:66.6667:Configuring testing2 (i386)
  82. pmstatus:testing2:83.3333:Installed testing2 (i386)
  83. pmstatus:dpkg-exec:83.3333:Running dpkg'
  84. rm -f apt-progress*.log