Mailinglist Archive: zypp-commit (325 mails)

< Previous Next >
[zypp-commit] r7115 - in /trunk/libzypp/tests: cache/ repo/susetags/data/shared_attributes/ repo/susetags/data/shared_attributes/suse/ repo/susetags/data/shared_attributes/suse/setup/ repo/susetags/data/shared_a...
  • From: dmacvicar@xxxxxxxxxxxxxxxx
  • Date: Thu, 06 Sep 2007 00:23:51 -0000
  • Message-id: <20070906002352.1FE6E25134@xxxxxxxxxxxxxxxx>
Author: dmacvicar
Date: Thu Sep  6 02:23:51 2007
New Revision: 7115

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7115&view=rev
Log:
test case and reproduced bug # 307163 : empty package descriptions

Added:
    trunk/libzypp/tests/repo/susetags/data/shared_attributes/
    trunk/libzypp/tests/repo/susetags/data/shared_attributes/content
    trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/
    trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/
    trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/
    trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages
    trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.DU
    trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.en
Modified:
    trunk/libzypp/tests/cache/CacheStore_test.cc

Modified: trunk/libzypp/tests/cache/CacheStore_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/cache/CacheStore_test.cc?rev=7115&r1=7114&r2=7115&view=diff
==============================================================================
--- trunk/libzypp/tests/cache/CacheStore_test.cc (original)
+++ trunk/libzypp/tests/cache/CacheStore_test.cc Thu Sep  6 02:23:51 2007
@@ -387,6 +387,41 @@
   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";
@@ -399,6 +434,12 @@
   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[] )
 {
@@ -437,8 +478,8 @@
                                  (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;
 }
 

Added: trunk/libzypp/tests/repo/susetags/data/shared_attributes/content
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/susetags/data/shared_attributes/content?rev=7115&view=auto
==============================================================================
--- trunk/libzypp/tests/repo/susetags/data/shared_attributes/content (added)
+++ trunk/libzypp/tests/repo/susetags/data/shared_attributes/content Thu Sep  6 02:23:51 2007
@@ -0,0 +1,30 @@
+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
+
+

Added: trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages?rev=7115&view=auto
==============================================================================
--- trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages (added)
+++ trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages Thu Sep  6 02:23:51 2007
@@ -0,0 +1,32 @@
+##----------------------------------------
+=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@xxxxxxx>
+-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@xxxxxxx>
+-Aut:
+=Shr: foo 1.0 1 i586
+

Added: trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.DU
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.DU?rev=7115&view=auto
==============================================================================
--- trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.DU (added)
+++ trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.DU Thu Sep  6 02:23:51 2007
@@ -0,0 +1,7 @@
+##----------------------------------------
+=Pkg: foo 1.0 1 i586
++Dir:
+/ 0 39444 0 3068
+usr/share/ 11 0 1 0
+-Dir:
+##----------------------------------------

Added: trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.en
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.en?rev=7115&view=auto
==============================================================================
--- trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.en (added)
+++ trunk/libzypp/tests/repo/susetags/data/shared_attributes/suse/setup/descr/packages.en Thu Sep  6 02:23:51 2007
@@ -0,0 +1,8 @@
+##----------------------------------------
+=Pkg: foo 1.0 1 i586
+=Sum: Foo program
++Des:
+<!-- DT:Rich -->
+<p>This package contains foo</p>
+-Des:
+##----------------------------------------

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages