check_tables_clean(tmpdir);
}
+/**
+ * \short Test that a susetags repo reads shared attributes
+ */
+void cache_write_shared_attributes(const Pathname &repodir)
+{
+ ZConfig::instance().overrideSystemArchitecture( Arch( "x86_64" ) );
+ data::RecordId repository_id;
+ filesystem::TmpDir tmpdir;
+ string alias = "novell.com";
+ write_susetags_repo( alias, repodir, tmpdir );
+
+ ResStore dbres = get_resolvables( alias, tmpdir);;
+ //read_resolvables( alias, tmpdir, std::inserter(dbres, dbres.end()));
+ MIL << dbres.size() << " resolvables" << endl;
+
+ // 2 packages and a product
+ BOOST_CHECK_EQUAL( dbres.size(), (unsigned)3);
+
+ for ( ResStore::const_iterator it = dbres.begin();
+ it != dbres.end();
+ ++it )
+ {
+ MIL << *it << endl;
+ if ( isKind<Package>(*it) )
+ {
+ Package::Ptr p = asKind<Package>(*it);
+ if ( (p->name() == "foo") && p->arch() == Arch("x86_64") )
+ {
+ BOOST_CHECK_EQUAL( p->description(), "foo bar");
+ }
+ }
+ }
+ check_tables_clean(tmpdir);
+}
+
void cache_write_susetags_normal_test(const std::string &dir)
{
Pathname repodir = Pathname(dir) + "/repo/susetags/data/stable-x86-subset";
cache_write_susetags(repodir);
}
+void cache_write_shared_attributes_test(const std::string &dir)
+{
+ Pathname repodir = Pathname(dir) + "/repo/susetags/data/shared_attributes";
+ cache_write_shared_attributes(repodir);
+}
+
test_suite*
init_unit_test_suite( int argc, char *argv[] )
{
(std::string const*)params, params+1));
test->add(BOOST_PARAM_TEST_CASE(&cache_write_susetags_gz_test,
(std::string const*)params, params+1));
- //test->add(BOOST_PARAM_TEST_CASE(&cache_write_test2,
- // (std::string const*)params, params+1));
+ test->add(BOOST_PARAM_TEST_CASE(&cache_write_shared_attributes_test,
+ (std::string const*)params, params+1));
return test;
}
--- /dev/null
+PRODUCT openSUSE-factory
+VERSION 10.3
+DISTPRODUCT SuSE-Linux-STABLE-X86
+DISTVERSION 10.2.42-factory
+VENDOR SUSE LINUX Products GmbH, Nuernberg, Germany
+RELNOTESURL http://www.suse.com/relnotes/i386/openSUSE/FACTORY/release-notes.rpm
+ARCH.x86_64 x86_64 i686 i586 i486 i386 noarch
+ARCH.i686 i686 i586 i486 i386 noarch
+ARCH.i586 i586 i486 i386 noarch
+ARCH.i486 i486 i386 noarch
+ARCH.i386 i386 noarch
+DEFAULTBASE i586
+REQUIRES openSUSE-release = 10.3 pattern:basesystem
+PROVIDES product:openSUSE = 10.2.42
+OBSOLETES product:SUSE_LINUX product:openSUSE <= 10.2
+LINGUAS cs da de en en_GB es fi fr hu it ja km nl nb pl pt_BR zh_CN zh_TW
+SHORTLABEL FACTORY
+LABEL openSUSE FACTORY 10.3
+LABEL.de openSUSE FACTORY 10.3
+EXTRAURLS http://download.opensuse.org/distribution/10.2/repo/oss/
+OPTIONALURLS http://download.opensuse.org/distribution/10.2/repo/non-oss/ http://download.opensuse.org/distribution/10.2/repo/debug/
+DESCRDIR suse/setup/descr
+DATADIR suse
+FLAGS update
+LANGUAGE en_US
+META SHA1 cec02abacb62fce2964a787d516879822691be6e packages
+META SHA1 2664997a3bae2679cf1395a81d54a7dd4532c276 packages.DU
+META SHA1 1c539c3fe4a8ec5fbe96ce3b559fc952124f9acd packages.en
+
+
--- /dev/null
+##----------------------------------------
+=Pkg: foo 1.0 1 i586
+=Cks: SHA1 05f0647241433d01636785fd282cc824a6527269
++Req:
+bar > 1.0
+-Req:
+=Grp: Bar
+=Lic: BSD License and BSD-like, GNU General Public License (GPL)
+=Src: foo 1.0 1 src
+=Tim: 1183399094
+=Loc: 1 foo-1.0-1.i586.rpm
+=Siz: 16356019 38850584
++Aut:
+Foo Bar <foo@bar.org>
+-Aut:
+##----------------------------------------
+=Pkg: foo 1.0 1 x86_64
+=Cks: SHA1 05f0647241433d01636785fd282cc824a6527269
++Req:
+bar > 1.0
+-Req:
+=Grp: Bar
+=Lic: BSD License and BSD-like, GNU General Public License (GPL)
+=Src: foo 1.0 1 src
+=Tim: 1183399094
+=Loc: 1 foo-1.0-1.x86_64.rpm
+=Siz: 16356019 38850584
++Aut:
+Foo Bar <foo@bar.org>
+-Aut:
+=Shr: foo 1.0 1 i586
+