You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test-apt-progress-fd 3.2 KiB

7 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.0000:Retrieving file 1 of 1
  15. dlstatus:1:100.0000:Retrieving file 1 of 1
  16. pmstatus:dpkg-exec:0.0000:Running dpkg
  17. pmstatus:testing:0.0000:Preparing testing (amd64)
  18. pmstatus:testing:20.0000:Unpacking testing (amd64)
  19. pmstatus:testing:40.0000:Installing testing (amd64)
  20. pmstatus:dpkg-exec:40.0000:Running dpkg
  21. pmstatus:testing:40.0000:Preparing to configure testing (amd64)
  22. pmstatus:testing:60.0000:Configuring testing (amd64)
  23. pmstatus:testing:80.0000:Installed testing (amd64)'
  24. # upgrade
  25. exec 3> apt-progress.log
  26. testsuccess aptget install testing=0.8.15 -y -o APT::Status-Fd=3
  27. testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
  28. dlstatus:1:100.0000:Retrieving file 1 of 1
  29. pmstatus:dpkg-exec:0.0000:Running dpkg
  30. pmstatus:testing:0.0000:Preparing testing (amd64)
  31. pmstatus:testing:20.0000:Unpacking testing (amd64)
  32. pmstatus:testing:40.0000:Installing testing (amd64)
  33. pmstatus:dpkg-exec:40.0000:Running dpkg
  34. pmstatus:testing:40.0000:Preparing to configure testing (amd64)
  35. pmstatus:testing:60.0000:Configuring testing (amd64)
  36. pmstatus:testing:80.0000:Installed testing (amd64)'
  37. # reinstall
  38. exec 3> apt-progress.log
  39. testsuccess aptget install testing=0.8.15 --reinstall -y -o APT::Status-Fd=3
  40. testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
  41. dlstatus:1:100.0000:Retrieving file 1 of 1
  42. pmstatus:dpkg-exec:0.0000:Running dpkg
  43. pmstatus:testing:0.0000:Preparing testing (amd64)
  44. pmstatus:testing:20.0000:Unpacking testing (amd64)
  45. pmstatus:testing:40.0000:Installing testing (amd64)
  46. pmstatus:dpkg-exec:40.0000:Running dpkg
  47. pmstatus:testing:40.0000:Preparing to configure testing (amd64)
  48. pmstatus:testing:60.0000:Configuring testing (amd64)
  49. pmstatus:testing:80.0000:Installed testing (amd64)'
  50. # and remove
  51. exec 3> apt-progress.log
  52. testsuccess aptget remove testing -y -o APT::Status-Fd=3
  53. testfileequal './apt-progress.log' 'pmstatus:dpkg-exec:0.0000:Running dpkg
  54. pmstatus:testing:0.0000:Preparing for removal of testing (amd64)
  55. pmstatus:testing:33.3333:Removing testing (amd64)
  56. pmstatus:testing:66.6667:Removing testing (amd64)
  57. pmstatus:dpkg-exec:66.6667:Running dpkg'
  58. # install non-native and ensure we get proper progress info
  59. exec 3> apt-progress.log
  60. testsuccess aptget install testing2:i386 -y -o APT::Status-Fd=3
  61. testfileequal './apt-progress.log' 'dlstatus:1:0.0000:Retrieving file 1 of 1
  62. dlstatus:1:100.0000:Retrieving file 1 of 1
  63. pmstatus:dpkg-exec:0.0000:Running dpkg
  64. pmstatus:testing2:0.0000:Preparing testing2 (i386)
  65. pmstatus:testing2:20.0000:Unpacking testing2 (i386)
  66. pmstatus:testing2:40.0000:Installing testing2 (i386)
  67. pmstatus:dpkg-exec:40.0000:Running dpkg
  68. pmstatus:testing2:40.0000:Preparing to configure testing2 (i386)
  69. pmstatus:testing2:60.0000:Configuring testing2 (i386)
  70. pmstatus:testing2:80.0000:Installed testing2 (i386)'
  71. rm -f apt-progress*.log