/* */
static bool Stats(CommandLine &CmdL)
{
- pkgCacheFile CacheFile;
- pkgCache *Cache = CacheFile.GetPkgCache();
-
if (CmdL.FileSize() > 1) {
_error->Error(_("apt-cache stats does not take any arguments"));
return false;
}
+
+ pkgCacheFile CacheFile;
+ pkgCache *Cache = CacheFile.GetPkgCache();
+
if (unlikely(Cache == NULL))
return false;
return 0;
}
- unlink(filename);
+ if (strcmp(filename, "/dev/null") != 0)
+ unlink(filename);
FileFd input, output;
if (input.OpenDescriptor(STDIN_FILENO, FileFd::ReadOnly) == false ||
output.Open(filename, FileFd::WriteOnly | FileFd::Create | FileFd::Exclusive, 0600) == false ||
static bool DoSrvLookup(CommandLine &CmdL)
{
- if (CmdL.FileSize() < 1)
+ if (CmdL.FileSize() <= 1)
return _error->Error("Must specify at least one SRV record");
for(size_t i = 1; CmdL.FileList[i] != NULL; ++i)
std::string const host = name.substr(0, found);
size_t const port = atoi(name.c_str() + found + 1);
if(GetSrvRecords(host, port, srv_records) == false)
- _error->Warning(_("GetSrvRec failed for %s"), name.c_str());
+ _error->Error(_("GetSrvRec failed for %s"), name.c_str());
}
else if(GetSrvRecords(name, srv_records) == false)
- _error->Warning(_("GetSrvRec failed for %s"), name.c_str());
+ _error->Error(_("GetSrvRec failed for %s"), name.c_str());
for (SrvRec const &I : srv_records)
c1out << I.target << "\t" << I.priority << "\t" << I.weight << "\t" << I.port << std::endl;
#include <stdio.h>
#include <iostream>
#include <string>
+#include <memory>
#include <apti18n.h>
/*}}}*/
// Emit
FileFd stdoutfd;
stdoutfd.OpenDescriptor(STDOUT_FILENO, FileFd::WriteOnly, false);
- unsigned char *Buffer = new unsigned char[Largest+1];
+ auto const Buffer = std::unique_ptr<unsigned char[]>(new unsigned char[Largest+1]);
for (vector<PkgName>::iterator I = List.begin(); I != List.end(); ++I)
{
// Read in the Record.
- if (Fd.Seek(I->Offset) == false || Fd.Read(Buffer,I->Length) == false)
- {
- delete [] Buffer;
+ if (Fd.Seek(I->Offset) == false || Fd.Read(Buffer.get(),I->Length) == false)
return false;
- }
Buffer[I->Length] = '\n';
- if (Section.Scan((char *)Buffer,I->Length+1) == false)
- {
- delete [] Buffer;
+ if (Section.Scan((char *)Buffer.get(),I->Length+1) == false)
return _error->Error("Internal error, failed to scan buffer");
- }
// Sort the section
if (Section.Write(stdoutfd, Order) == false || stdoutfd.Write("\n", 1) == false)
- {
- delete [] Buffer;
return _error->Error("Internal error, failed to sort fields");
- }
}
-
- delete [] Buffer;
return true;
}
/*}}}*/
msggroup
}
-testsuccessequal() {
- msggroup 'testsuccessequal'
- local CMP="$1"
- shift
- testsuccess "$@"
- testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testsuccess.output" "$CMP"
+testreturnstateequal() {
+ local STATE="$1"
+ msggroup "${STATE}equal"
+ if [ "$2" != '--nomsg' ]; then
+ local CMP="$2"
+ shift 2
+ "$STATE" "$@"
+ testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/${STATE}.output" "$CMP"
+ else
+ local CMP="$3"
+ shift 3
+ "$STATE" --nomsg "$@"
+ testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/${STATE}.output" "$CMP"
+ fi
msggroup
}
+testsuccessequal() {
+ testreturnstateequal 'testsuccess' "$@"
+}
testwarningequal() {
- msggroup 'testwarningequal'
- local CMP="$1"
- shift
- testwarning "$@"
- testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testwarning.output" "$CMP"
- msggroup
+ testreturnstateequal 'testwarning' "$@"
}
testfailureequal() {
- msggroup 'testfailureequal'
- local CMP="$1"
- shift
- testfailure "$@"
- testfileequal "${TMPWORKINGDIRECTORY}/rootdir/tmp/testfailure.output" "$CMP"
- msggroup
+ testreturnstateequal 'testfailure' "$@"
}
testfailuremsg() {
testsuccess aptcache stats
cp rootdir/tmp/testsuccess.output stats.output
testsuccess test -s stats.output
+testfailureequal 'E: apt-cache stats does not take any arguments' aptcache stats foo
testsuccess aptcache xvcg foo
cp rootdir/tmp/testsuccess.output xvcg.output
testsuccess test -s xvcg.output
. $TESTDIR/framework
setupenvironment
-configarchitecture "i386"
+configarchitecture 'i386'
-buildsimplenativepackage 'debhelper' 'i386' '7' 'stable'
-buildsimplenativepackage 'build-essential' 'i386' '1' 'stable'
+insertpackage 'stable' 'debhelper' 'i386' '7'
+insertpackage 'stable' 'build-essential' 'i386' '1'
+insertinstalledpackage 'build-conflict' 'i386' '1'
setupaptarchive
+
+msgmsg 'Test with' 'unsigned dsc'
cat > 2vcard_0.5-3.dsc <<EOF
Format: 1.0
Source: 2vcard
Uploaders: Marcela Tiznado <mlt@debian.org>
Standards-Version: 3.8.0
Build-Depends: debhelper (>= 5.0.37)
+Build-Conflicts: build-conflict (<< 2)
Checksums-Sha1:
b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
EOF
-testsuccessequal "Reading package lists...
+test2vcardbuilddep() {
+ testsuccessequal "Reading package lists...
Building dependency tree...
Note, using file '2vcard_0.5-3.dsc' to get the build dependencies
+The following packages will be REMOVED:
+ build-conflict
The following NEW packages will be installed:
build-essential debhelper
-0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
+Remv build-conflict [1]
Inst build-essential (1 stable [i386])
Inst debhelper (7 stable [i386])
Conf build-essential (1 stable [i386])
Conf debhelper (7 stable [i386])" aptget build-dep -s 2vcard_0.5-3.dsc
+}
+test2vcardbuilddep
+msgmsg 'Test with' 'signed dsc'
cat > 2vcard_0.5-3.dsc <<EOF
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Uploaders: Marcela Tiznado <mlt@debian.org>
Standards-Version: 3.8.0
Build-Depends: debhelper (>= 5.0.37)
+Build-Conflicts: build-conflict (<< 2)
Checksums-Sha1:
b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
=4eRd
-----END PGP SIGNATURE-----
EOF
-
-testsuccessequal "Reading package lists...
-Building dependency tree...
-Note, using file '2vcard_0.5-3.dsc' to get the build dependencies
-The following NEW packages will be installed:
- build-essential debhelper
-0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
-Inst build-essential (1 stable [i386])
-Inst debhelper (7 stable [i386])
-Conf build-essential (1 stable [i386])
-Conf debhelper (7 stable [i386])" aptget build-dep --simulate 2vcard_0.5-3.dsc
+test2vcardbuilddep
-# unpacked source dir
+msgmsg 'Test with' 'unpacked source dir'
mkdir -p foo-1.0/debian
cat > foo-1.0/debian/control <<'EOF'
Source: apturl
Inst debhelper (7 stable [i386])
Conf build-essential (1 stable [i386])
Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./foo-1.0
+
+
+testfailureequal 'Reading package lists...
+Building dependency tree...
+E: Must specify at least one package to check builddeps for' aptget build-dep
+testfailureequal 'Reading package lists...
+Building dependency tree...
+E: No architecture information available for armel. See apt.conf(5) APT::Architectures for setup' aptget build-dep --simulate ./foo-1.0 -a armel
+testfailureequal 'Reading package lists...
+Building dependency tree...
+E: Unable to find a source package for foo' aptget build-dep --simulate foo
# nothing to do always works
testsuccess aptget clean
+testsuccess aptget clean -s
# generate some dirt and clean it up
touch rootdir/var/lib/apt/lists/partial/http.debian.net_debian_dists_sid_main_i18n_Translation-en
testfailureequal 'E: Must specify at least one pair url/filename' apthelper download-file
testfailureequal 'E: Must specify at least one pair url/filename' apthelper download-file http://example.org/
testfailureequal 'E: Need one URL as argument' apthelper auto-detect-proxy
+testfailureequal 'E: Must specify at least one SRV record' apthelper srv-lookup
+testfailureequal 'E: GetSrvRec failed for localhost' apthelper srv-lookup localhost
+testfailureequal 'E: GetSrvRec failed for localhost:8080' apthelper srv-lookup localhost:8080
configarchitecture 'i386'
LISTS='rootdir/etc/apt/sources.list.d/test.list'
+ABSLISTS="$(readlink -f $LISTS)"
SOURCES='rootdir/etc/apt/sources.list.d/test.sources'
BASE='# some comment
# that contains a : as well
msgcleantest 'Test sources.list' 'old style'
echo "deb http://ftp.debian.org/debian stable main" > $LISTS
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris
msgcleantest 'Test sources.list' 'old style with tabs'
echo "deb http://ftp.debian.org/debian stable main" > $LISTS
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris
+msgcleantest 'Test sources.list' 'old style with forgotten end for options'
+echo "deb [trusted=yes arch+=armel,powerpc http://ftp.debian.org/debian stable main" > $LISTS
+testfailureequal "E: Malformed entry 1 in list file $ABSLISTS ([option] not assignment)
+E: The list of sources could not be read." aptget update --print-uris
+
+msgcleantest 'Test sources.list' 'old style with stray ] instead of options'
+echo "deb ] http://ftp.debian.org/debian stable main" > $LISTS
+testfailureequal "E: Malformed entry 1 in list file $ABSLISTS (URI parse)
+E: The list of sources could not be read." aptget update --print-uris
+
+msgcleantest 'Test sources.list' 'old style options no key'
+echo "deb [=test] http://ftp.debian.org/debian stable main" > $LISTS
+testfailureequal "E: Malformed entry 1 in list file $ABSLISTS ([option] no key)
+E: The list of sources could not be read." aptget update --print-uris
+
+msgcleantest 'Test sources.list' 'old style options no value'
+echo "deb [test=] http://ftp.debian.org/debian stable main" > $LISTS
+testfailureequal "E: Malformed entry 1 in list file $ABSLISTS ([option] no value)
+E: The list of sources could not be read." aptget update --print-uris
+
msgcleantest 'Test sources.list' 'old style with options'
echo "deb [trusted=yes arch+=armel,powerpc] http://ftp.debian.org/debian stable main" > $LISTS
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-powerpc/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-powerpc_Packages 0
msgcleantest 'Test sources.list' 'old style with comments'
echo "deb http://ftp.debian.org/debian stable main # non-free" > $LISTS
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris
msgcleantest 'Test sources.list' 'old style with option comments'
echo "deb [trusted=yes#yeahreally] http://ftp.debian.org/debian stable main # non-free" > $LISTS
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris
msgcleantest 'Test sources.list' 'simple deb822'
echo "$BASE" > $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris
echo "$BASE" > $SOURCES
echo "" >> $SOURCES
echo "$BASE" | sed s/stable/unstable/ >> $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0
# two suite entries
msgcleantest 'Test deb822 with' 'two Suite entries'
echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0
'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0
msgcleantest 'Test deb822' 'architecture option'
echo "$BASE" > $SOURCES
echo "Architectures: amd64 armel" >> $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris
msgcleantest 'Test old-style' 'suite arch variable'
echo 'deb http://ftp.tlh.debian.org/universe unstable/binary-$(ARCH)/' > $LISTS
-testequal --nomsg "'http://ftp.tlh.debian.org/universe/unstable/binary-i386/InRelease' ftp.tlh.debian.org_universe_unstable_binary-i386_InRelease 0
+testsuccessequal --nomsg "'http://ftp.tlh.debian.org/universe/unstable/binary-i386/InRelease' ftp.tlh.debian.org_universe_unstable_binary-i386_InRelease 0
'http://ftp.tlh.debian.org/universe/unstable/binary-i386/Packages.xz' ftp.tlh.debian.org_universe_unstable_binary-i386_Packages 0
'http://ftp.tlh.debian.org/universe/unstable/binary-i386/en.xz' ftp.tlh.debian.org_universe_unstable_binary-i386_en 0 " aptget update --print-uris
echo 'Types: deb
URIs: http://ftp.tlh.debian.org/universe
Suites: stable/binary-$(ARCH)/' > $SOURCES
-testequal --nomsg "'http://ftp.tlh.debian.org/universe/stable/binary-i386/InRelease' ftp.tlh.debian.org_universe_stable_binary-i386_InRelease 0
+testsuccessequal --nomsg "'http://ftp.tlh.debian.org/universe/stable/binary-i386/InRelease' ftp.tlh.debian.org_universe_stable_binary-i386_InRelease 0
'http://ftp.tlh.debian.org/universe/stable/binary-i386/Packages.xz' ftp.tlh.debian.org_universe_stable_binary-i386_Packages 0
'http://ftp.tlh.debian.org/universe/stable/binary-i386/en.xz' ftp.tlh.debian.org_universe_stable_binary-i386_en 0 " aptget update --print-uris
msgcleantest 'Test old-style sources.list file which has' 'malformed dist'
echo "deb http://ftp.debian.org" > $LISTS
-testequal --nomsg "E: Malformed entry 1 in list file $TMPWORKINGDIRECTORY/$LISTS (Suite)
+testfailureequal --nomsg "E: Malformed entry 1 in list file $TMPWORKINGDIRECTORY/$LISTS (Suite)
E: The list of sources could not be read." aptget update --print-uris
msgcleantest 'Test deb822 sources.list file which has' 'malformed URI'
echo "Types: deb
Suites: stable
" > $SOURCES
-testequal --nomsg "E: Malformed entry 1 in sources file $TMPWORKINGDIRECTORY/$SOURCES (URI)
+testfailureequal --nomsg "E: Malformed entry 1 in sources file $TMPWORKINGDIRECTORY/$SOURCES (URI)
E: The list of sources could not be read." aptget update --print-uris
# with Enabled: false
# multiple URIs
msgcleantest 'Test deb822 sources.list file which has' 'Multiple URIs work'
echo "$BASE" | sed -e 's#http://ftp.debian.org/debian#http://ftp.debian.org/debian http://ftp.de.debian.org/debian#' > $SOURCES
-testequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.de.debian.org/debian/dists/stable/InRelease' ftp.de.debian.org_debian_dists_stable_InRelease 0
'http://ftp.de.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.de.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.de.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.de.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
# multiple Type in one field
msgcleantest 'Test deb822 sources.list file which has' 'Multiple Types work'
echo "$BASE" | sed -e 's#Types: deb#Types: deb deb-src#' > $SOURCES
-testequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
+testsuccessequal --nomsg "'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
'http://ftp.debian.org/debian/dists/stable/main/source/Sources.xz' ftp.debian.org_debian_dists_stable_main_source_Sources 0
'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.xz' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0
'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.xz' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 " aptget update --print-uris
URIs: http://emacs.naquadah.org
Suites: stable/
EOF
-testequal --nomsg "'http://emacs.naquadah.org/stable/InRelease' emacs.naquadah.org_stable_InRelease 0
+testsuccessequal --nomsg "'http://emacs.naquadah.org/stable/InRelease' emacs.naquadah.org_stable_InRelease 0
'http://emacs.naquadah.org/stable/Packages.xz' emacs.naquadah.org_stable_Packages 0
'http://emacs.naquadah.org/stable/en.xz' emacs.naquadah.org_stable_en 0 " aptget update --print-uris
testfailure aptget install --solver dump coolstuff -s
testsuccess grep ERR_NO_FILENAME rootdir/tmp/testfailure.output
+export APT_EDSP_DUMP_FILENAME="/nonexistent/apt/edsp.dump"
+testfailure aptget install --solver dump coolstuff -s
+testsuccess grep ERR_WRITE_ERROR rootdir/tmp/testfailure.output
export APT_EDSP_DUMP_FILENAME="${TMPWORKINGDIRECTORY}/downloaded/dump.edsp"
testfailureequal 'Reading package lists...
testsuccess grep 'ERR_UNSOLVABLE' rootdir/tmp/testfailure.output
configarchitecture 'armel'
+testfailure aptget install --solver apt awesomecoolstuff:i386 -s
+msgtest 'An invalid EDSP file generates a' 'hard error'
+if echo "Request: This is a test\nFoo: bar\n\n" | aptinternalsolver -q=0 > solver.result 2>&1; then
+ cat solver.result
+ msgfail
+else
+ msgpass
+fi
msgtest 'Test direct calling is okay for' 'apt-internal-solver'
cat "$APT_EDSP_DUMP_FILENAME" | aptinternalsolver -q=0 > solver.result 2>&1 || true
if [ "$(tail -n2 solver.result | head -n1 )" = "Message: Done" ]; then
fi
rm -f "$APT_EDSP_DUMP_FILENAME"
-testfailure aptget install --solver apt awesomecoolstuff:i386 -s
-
testsuccess aptinternalsolver scenario
testsuccessequal 'Package: stuff
Source: stuff
testsuccessequal "$(cat ${PKGFILE}-new)
" aptcache show apt newstuff
- msgmsg "Testcase: index is already up-to-date: $*"
- find rootdir/var/lib/apt/lists -name '*diff_Index' -type f -delete
- testsuccess aptget update "$@"
- testequal 'Hit:1 http://localhost:8080 InRelease
-Reading package lists...' aptget update "$@" -o Debug::Acquire::Transaction=0 -o Debug::pkgAcquire::Diffs=0
- testsuccessequal "$(cat ${PKGFILE}-new)
-" aptcache show apt newstuff
-
msgmsg "Testcase: apply with two patches: $*"
cp ${PKGFILE}-new aptarchive/Packages
echo '