test-apt-progress-fd 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. testequal "dlstatus:1:0:Retrieving file 1 of 1
  15. dlstatus:1:0:Retrieving file 1 of 1
  16. pmstatus:dpkg-exec:0:Running dpkg
  17. pmstatus:testing:0:Installing testing (amd64)
  18. pmstatus:testing:20:Preparing testing (amd64)
  19. pmstatus:testing:40:Unpacking testing (amd64)
  20. pmstatus:testing:60:Preparing to configure testing
  21. pmstatus:dpkg-exec:60:Running dpkg
  22. pmstatus:testing:60:Configuring testing (amd64)
  23. pmstatus:testing:80:Configuring testing (amd64)
  24. pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
  25. # upgrade
  26. exec 3> apt-progress.log
  27. testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3
  28. testequal "dlstatus:1:0:Retrieving file 1 of 1
  29. dlstatus:1:0:Retrieving file 1 of 1
  30. pmstatus:dpkg-exec:0:Running dpkg
  31. pmstatus:testing:20:Preparing testing (amd64)
  32. pmstatus:testing:40:Unpacking testing (amd64)
  33. pmstatus:testing:60:Preparing to configure testing
  34. pmstatus:dpkg-exec:60:Running dpkg
  35. pmstatus:testing:60:Configuring testing (amd64)
  36. pmstatus:testing:80:Configuring testing (amd64)
  37. pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
  38. # and remove
  39. exec 3> apt-progress.log
  40. testsuccess aptget remove testing -y -o APT::Status-Fd=3
  41. testequal "pmstatus:dpkg-exec:0:Running dpkg
  42. pmstatus:testing:0:Removing testing (amd64)
  43. pmstatus:testing:33.3333:Preparing for removal of testing (amd64)
  44. pmstatus:testing:66.6667:Removing testing (amd64)
  45. pmstatus:testing:100:Removed testing (amd64)" cat apt-progress.log
  46. # install non-native and ensure we get proper progress info
  47. exec 3> apt-progress.log
  48. testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3
  49. # and compare
  50. testequal "dlstatus:1:0:Retrieving file 1 of 1
  51. dlstatus:1:0:Retrieving file 1 of 1
  52. pmstatus:dpkg-exec:0:Running dpkg
  53. pmstatus:testing2:0:Installing testing2 (i386)
  54. pmstatus:testing2:20:Preparing testing2 (i386)
  55. pmstatus:testing2:40:Unpacking testing2 (i386)
  56. pmstatus:testing2:60:Preparing to configure testing2 (i386)
  57. pmstatus:dpkg-exec:60:Running dpkg
  58. pmstatus:testing2:60:Configuring testing2 (i386)
  59. pmstatus:testing2:80:Configuring testing2 (i386)
  60. pmstatus:testing2:100:Installed testing2 (i386)" cat apt-progress.log
  61. rm -f apt-progress*.log