"Fossies" - the Fresh Open Source Software Archive

Member "apt-2.2.4/test/integration/test-phased-updates" (10 Jun 2021, 10384 Bytes) of package /linux/misc/apt-2.2.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 set -e
    3 
    4 TESTDIR="$(readlink -f "$(dirname "$0")")"
    5 . "$TESTDIR/framework"
    6 
    7 setupenvironment
    8 echo 'Debug::Phasing "1";' > rootdir/etc/apt/apt.conf.d/debug-phasing
    9 configarchitecture 'i386' 'armel'
   10 
   11 
   12 insertinstalledpackage 'phased1' 'all' '1'
   13 insertinstalledpackage 'phased2' 'all' '1'
   14 
   15 insertpackage 'unstable' 'phased1' 'all' '10' 'Phased-Update-Percentage: 10'
   16 insertpackage 'unstable' 'phased2' 'all' '10' 'Phased-Update-Percentage: 10'
   17 insertpackage 'unstable' 'phased3' 'all' '10' 'Phased-Update-Percentage: 10'
   18 
   19 insertpackage 'unstable' 'phased1' 'all' '100' 'Phased-Update-Percentage: 100'
   20 insertpackage 'unstable' 'phased2' 'all' '100' 'Phased-Update-Percentage: 100'
   21 insertpackage 'unstable' 'phased3' 'all' '100' 'Phased-Update-Percentage: 100'
   22 
   23 insertpackage 'unstable' 'phased1' 'all' '50' 'Phased-Update-Percentage: 50'
   24 insertpackage 'unstable' 'phased2' 'all' '50' 'Phased-Update-Percentage: 50'
   25 insertpackage 'unstable' 'phased3' 'all' '50' 'Phased-Update-Percentage: 50'
   26 
   27 setupaptarchive
   28 
   29 msgmsg "Basic test"
   30 testsuccessequal "phased1:
   31   Installed: 1
   32   Candidate: 100
   33   Version table:
   34      100 500
   35         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   36      50 500 (phased 50%)
   37         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   38      10 1 (phased 10%)
   39         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   40  *** 1 100
   41         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
   42 phased2:
   43   Installed: 1
   44   Candidate: 100
   45   Version table:
   46      100 500
   47         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   48      50 1 (phased 50%)
   49         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   50      10 1 (phased 10%)
   51         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   52  *** 1 100
   53         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
   54 phased3:
   55   Installed: (none)
   56   Candidate: 100
   57   Version table:
   58      100 500
   59         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   60      50 500 (phased 50%)
   61         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   62      10 1 (phased 10%)
   63         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages" aptcache policy phased1 phased2 phased3
   64 
   65 msgmsg "Test for always-include-phased-updates"
   66 for always in Update-Manager::Always-Include-Phased-Updates APT::Get::Always-Include-Phased-Updates; do
   67 testsuccessequal "phased1:
   68   Installed: 1
   69   Candidate: 100
   70   Version table:
   71      100 500
   72         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   73      50 500 (phased 50%)
   74         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   75      10 500 (phased 10%)
   76         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   77  *** 1 100
   78         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
   79 phased2:
   80   Installed: 1
   81   Candidate: 100
   82   Version table:
   83      100 500
   84         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   85      50 500 (phased 50%)
   86         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   87      10 500 (phased 10%)
   88         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   89  *** 1 100
   90         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
   91 phased3:
   92   Installed: (none)
   93   Candidate: 100
   94   Version table:
   95      100 500
   96         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   97      50 500 (phased 50%)
   98         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
   99      10 500 (phased 10%)
  100         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages" aptcache policy phased1 phased2 phased3 -o $always=true
  101 done
  102 
  103 msgmsg "Test for never-include-phased-updates"
  104 for never in Update-Manager::Never-Include-Phased-Updates APT::Get::Never-Include-Phased-Updates; do
  105 testsuccessequal "phased1:
  106   Installed: 1
  107   Candidate: 100
  108   Version table:
  109      100 500
  110         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  111      50 1 (phased 50%)
  112         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  113      10 1 (phased 10%)
  114         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  115  *** 1 100
  116         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
  117 phased2:
  118   Installed: 1
  119   Candidate: 100
  120   Version table:
  121      100 500
  122         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  123      50 1 (phased 50%)
  124         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  125      10 1 (phased 10%)
  126         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  127  *** 1 100
  128         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
  129 phased3:
  130   Installed: (none)
  131   Candidate: 100
  132   Version table:
  133      100 500
  134         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  135      50 1 (phased 50%)
  136         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  137      10 1 (phased 10%)
  138         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages" aptcache policy phased1 phased2 phased3 -o $never=true
  139 done
  140 
  141 msgmsg "Test that being in a chroot equals always-include-phased-updates"
  142 testsuccessequal "phased1:
  143   Installed: 1
  144   Candidate: 100
  145   Version table:
  146      100 500
  147         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  148      50 500 (phased 50%)
  149         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  150      10 500 (phased 10%)
  151         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  152  *** 1 100
  153         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
  154 phased2:
  155   Installed: 1
  156   Candidate: 100
  157   Version table:
  158      100 500
  159         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  160      50 500 (phased 50%)
  161         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  162      10 500 (phased 10%)
  163         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  164  *** 1 100
  165         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased1 phased2 -o Dir::Bin::ischroot=/bin/true
  166 
  167 msgmsg "Test that empty machine-id equals always-include-phased-updates"
  168 testsuccessequal "phased1:
  169   Installed: 1
  170   Candidate: 100
  171   Version table:
  172      100 500
  173         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  174      50 500 (phased 50%)
  175         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  176      10 500 (phased 10%)
  177         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  178  *** 1 100
  179         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
  180 phased2:
  181   Installed: 1
  182   Candidate: 100
  183   Version table:
  184      100 500
  185         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  186      50 500 (phased 50%)
  187         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  188      10 500 (phased 10%)
  189         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  190  *** 1 100
  191         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased1 phased2 -o Dir::Etc::machine-id=/dev/null -o APT::Machine-Id=""
  192 
  193 msgmsg "Test that never-include-phased-updates trumps empty machine-id"
  194 testsuccessequal "phased1:
  195   Installed: 1
  196   Candidate: 100
  197   Version table:
  198      100 500
  199         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  200      50 1 (phased 50%)
  201         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  202      10 1 (phased 10%)
  203         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  204  *** 1 100
  205         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
  206 phased2:
  207   Installed: 1
  208   Candidate: 100
  209   Version table:
  210      100 500
  211         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  212      50 1 (phased 50%)
  213         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  214      10 1 (phased 10%)
  215         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  216  *** 1 100
  217         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased1 phased2 -o Dir::Etc::machine-id=/dev/null -o APT::Machine-Id="" -o APT::Get::Never-Include-Phased-Updates=1
  218 
  219 
  220 msgmsg "Test that SOURCE_DATE_EPOCH set equals always-include-phased-updates"
  221 export SOURCE_DATE_EPOCH=0
  222 testsuccessequal "phased1:
  223   Installed: 1
  224   Candidate: 100
  225   Version table:
  226      100 500
  227         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  228      50 500 (phased 50%)
  229         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  230      10 500 (phased 10%)
  231         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  232  *** 1 100
  233         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
  234 phased2:
  235   Installed: 1
  236   Candidate: 100
  237   Version table:
  238      100 500
  239         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  240      50 500 (phased 50%)
  241         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  242      10 500 (phased 10%)
  243         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  244  *** 1 100
  245         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased1 phased2
  246 unset SOURCE_DATE_EPOCH
  247 
  248 msgmsg "Test that different machine-id produces different outcome"
  249 testsuccessequal "phased1:
  250   Installed: 1
  251   Candidate: 100
  252   Version table:
  253      100 500
  254         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  255      50 500 (phased 50%)
  256         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  257      10 1 (phased 10%)
  258         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  259  *** 1 100
  260         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status
  261 phased2:
  262   Installed: 1
  263   Candidate: 100
  264   Version table:
  265      100 500
  266         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  267      50 500 (phased 50%)
  268         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  269      10 1 (phased 10%)
  270         500 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main all Packages
  271  *** 1 100
  272         100 ${TMPWORKINGDIRECTORY}/rootdir/var/lib/dpkg/status" aptcache policy phased1 phased2 -o apt::machine-id="00000000000000000000000000000000"