]> git.saurik.com Git - apt.git/commitdiff
Merge remote-tracking branch 'mvo/feature/source-deb822' into debian/experimental...
authorMichael Vogt <mvo@debian.org>
Sat, 18 Jan 2014 20:05:24 +0000 (21:05 +0100)
committerMichael Vogt <mvo@debian.org>
Sat, 18 Jan 2014 20:05:24 +0000 (21:05 +0100)
1  2 
test/integration/test-apt-sources-deb822
test/libapt/sourcelist_test.cc

index a3855496c5b1b30608ac75e354bdda6024b0a8b2,c73b942d433a781859c7e2d78776b56129b7ae3d..6e9a02417c5c64b8134948f9b4918ea0b8474c42
@@@ -5,83 -5,73 +5,83 @@@ TESTDIR=$(readlink -f $(dirname $0)
  . $TESTDIR/framework
  
  setupenvironment
 -configarchitecture "i386"
 +configarchitecture 'i386'
  
 -SOURCES="rootdir/etc/apt/sources.list"
 -
 -echo "deb http://ftp.debian.org/debian stable main" > $SOURCES
 -testequalwithmsg "Old style sources.list works" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
 -'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
 -'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 "  aptget update --print-uris 
 -
 -
 -BASE="# some comment
 +SOURCES='rootdir/etc/apt/sources.list'
 +BASE='# some comment
  # that contains a : as well
  #Type: meep
  
  Type: deb
  URI: http://ftp.debian.org/debian
- Suite: stable
- Section: main
+ Suites: stable
+ Sections: main
  Comment: Some random string
 - that can be very long"
 + that can be very long'
 +
  
 -# simple case
 +msgtest 'Test old-style sources.list'
 +echo "deb http://ftp.debian.org/debian stable main" > $SOURCES
 +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
 +'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
 +'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 "  aptget update --print-uris
 +
 +msgtest 'Test simple deb822 sources.list'
  echo "$BASE"  > $SOURCES
 +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
 +'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
 +'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 "  aptget update --print-uris
 +
  
 -testequalwithmsg "Simple deb822 sources.list works" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
 +msgtest 'Test deb822 with two sections' 'seperated by comma'
 +echo "$BASE" | sed 's/main/main contrib/' > $SOURCES
 +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
 +'http://ftp.debian.org/debian/dists/stable/contrib/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_contrib_binary-i386_Packages 0 :
 +'http://ftp.debian.org/debian/dists/stable/contrib/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_contrib_i18n_Translation-en 0 :
  'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
 -'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 "  aptget update --print-uris 
 +'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 "  aptget update --print-uris
  
 +
 +msgtest 'Test deb822 with' 'two entries'
  # Two entries
  echo "$BASE" > $SOURCES
  echo "" >> $SOURCES
  echo "$BASE" | sed  s/stable/unstable/  >> $SOURCES
 -
 -testequalwithmsg "Multiple entries in deb822 sources.list work" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
 +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
  'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
  'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 
  'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 :
  'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 :
 -'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 "  aptget update --print-uris 
 +'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 "  aptget update --print-uris
  
  # two suite entries
 +msgtest 'Test deb822 with' 'two Suite entries'
  echo "$BASE"  | sed -e "s/stable/stable unstable/" > $SOURCES
 -testequalwithmsg "Two Suite entries deb822 sources.list work" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
 +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
  'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
  'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 
  'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 :
  'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 :
  'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 "  aptget update --print-uris 
  
 -# ARCH option
 +msgtest 'Test deb822' 'architecture option'
  echo "$BASE" > $SOURCES
  echo "Architectures: amd64,armel" >> $SOURCES
 -
 -testequalwithmsg "Arch: option in deb822 sources.list works" "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 :
 +testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 :
  'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 :
  'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
  'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 "  aptget update --print-uris
  
 -# invalid sources.list file
 -echo "deb http://ftp.debian.org" > $SOURCES
  
 -testequalwithmsg "Invalid sources.list file gives proper error" "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist)
 +msgtest 'Test old-style sources.list file which has' 'malformed dist'
 +echo "deb http://ftp.debian.org" > $SOURCES
 +testequal --nomsg "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist)
  E: The list of sources could not be read."  aptget update --print-uris
  
 +
 +msgtest 'Test deb822 sources.list file which has' 'malformed URI'
  echo "Type: deb
- Suite: stable
+ Suites: stable
  " > $SOURCES
 -
 -testequalwithmsg "Invalid deb822 sources.list file gives proper error" "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse)
 +testequal --nomsg  "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse)
  E: The list of sources could not be read."  aptget update --print-uris
index b8658ccf1b55aec321b465c0958e404944c3e467,ae5d11f6602c87039d4657e01eec088663693843..701eeeaa791644d2c355bbd4bb926f25a480b6ef
@@@ -24,8 -24,8 +24,8 @@@ int main(int argc, char *argv[]
     const char contents[] = ""
        "Type: deb\n"
        "URI: http://ftp.debian.org/debian\n"
-       "Suite: stable\n"
-       "Section: main\n"
+       "Suites: stable\n"
+       "Sections: main\n"
        "Comment: Some random string\n"
        " that can be very long\n"
        "\n"
@@@ -36,7 -36,6 +36,7 @@@
        ;
  
     FileFd fd;
 +   atexit(remove_tmpfile);
     tempfile = strdup("apt-test.XXXXXXXX");
     tempfile_fd = mkstemp(tempfile);