Mailinglist Archive: zypp-commit (266 mails)

< Previous Next >
[zypp-commit] r11600 - in /trunk/libzypp/tests/parser: CMakeLists.txt ProductFileReader_test.cc ProductFileReader_test.dat
  • From: mlandres@xxxxxxxxxxxxxxxx
  • Date: Thu, 06 Nov 2008 16:40:08 -0000
  • Message-id: <20081106164008.E150D33904@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Thu Nov 6 17:40:08 2008
New Revision: 11600

URL: http://svn.opensuse.org/viewcvs/zypp?rev=11600&view=rev
Log:
Add Product file tests

Added:
trunk/libzypp/tests/parser/ProductFileReader_test.cc
trunk/libzypp/tests/parser/ProductFileReader_test.dat
Modified:
trunk/libzypp/tests/parser/CMakeLists.txt

Modified: trunk/libzypp/tests/parser/CMakeLists.txt
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/CMakeLists.txt?rev=11600&r1=11599&r2=11600&view=diff
==============================================================================
--- trunk/libzypp/tests/parser/CMakeLists.txt (original)
+++ trunk/libzypp/tests/parser/CMakeLists.txt Thu Nov 6 17:40:08 2008
@@ -1,3 +1,6 @@
ADD_SUBDIRECTORY( yum )
ADD_SUBDIRECTORY( inifile )
ADD_SUBDIRECTORY(ws)
+
+ADD_TESTS( ProductFileReader )
+

Added: trunk/libzypp/tests/parser/ProductFileReader_test.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/ProductFileReader_test.cc?rev=11600&view=auto
==============================================================================
--- trunk/libzypp/tests/parser/ProductFileReader_test.cc (added)
+++ trunk/libzypp/tests/parser/ProductFileReader_test.cc Thu Nov 6 17:40:08
2008
@@ -0,0 +1,39 @@
+#include "TestSetup.h"
+#include <zypp/parser/ProductFileReader.h>
+
+#define LABELED(V) #V << ":\t" << V
+
+//static TestSetup test( Arch_x86_64 );
+
+// Must be the first test!
+BOOST_AUTO_TEST_CASE(basic)
+{
+ parser::ProductFileData data;
+ BOOST_CHECK( data.empty() );
+
+ data = parser::ProductFileReader::scanFile( TESTS_SRC_DIR
"/parser/ProductFileReader_test.dat" );
+ BOOST_REQUIRE( ! data.empty() );
+
+ BOOST_CHECK_EQUAL( data.vendor(), "Novell" );
+ BOOST_CHECK_EQUAL( data.name(), "SUSE_SLES" );
+ BOOST_CHECK_EQUAL( data.edition(), "11-0" );
+ BOOST_CHECK_EQUAL( data.arch(), Arch_i586 );
+ BOOST_CHECK_EQUAL( data.productline(), "" );
+ BOOST_CHECK_EQUAL( data.registerTarget(), "sle-11-i586" );
+ BOOST_CHECK_EQUAL( data.registerRelease(), "whatever" );
+ BOOST_CHECK_EQUAL( data.updaterepokey(), "A43242DKD" );
+
+ BOOST_CHECK_EQUAL( data.upgrades().size(), 2 );
+
+ BOOST_CHECK_EQUAL( data.upgrades()[0].name(), "openSUSE_11.1" );
+ BOOST_CHECK_EQUAL( data.upgrades()[0].summary(), "openSUSE 11.1" );
+ BOOST_CHECK_EQUAL( data.upgrades()[0].repository(),
"http://download.opensuse.org/distribution/openSUSE/11.1"; );
+ BOOST_CHECK_EQUAL( data.upgrades()[0].notify(), true );
+ BOOST_CHECK_EQUAL( data.upgrades()[0].status(), "stable" );
+
+ BOOST_CHECK_EQUAL( data.upgrades()[1].name(), "openSUSE_Factory" );
+ BOOST_CHECK_EQUAL( data.upgrades()[1].summary(), "openSUSE Factory" );
+ BOOST_CHECK_EQUAL( data.upgrades()[1].repository(),
"http://download.opensuse.org/distribution/openSUSE/Factory"; );
+ BOOST_CHECK_EQUAL( data.upgrades()[1].notify(), false );
+ BOOST_CHECK_EQUAL( data.upgrades()[1].status(), "unstable" );
+}

Added: trunk/libzypp/tests/parser/ProductFileReader_test.dat
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/parser/ProductFileReader_test.dat?rev=11600&view=auto
==============================================================================
--- trunk/libzypp/tests/parser/ProductFileReader_test.dat (added)
+++ trunk/libzypp/tests/parser/ProductFileReader_test.dat Thu Nov 6 17:40:08
2008
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<product schemeversion="0">
+ <vendor>Novell</vendor>
+ <name>SUSE_SLES</name>
+ <version>11</version>
+ <release>0</release>
+ <arch>i586</arch>
+ <updaterepokey>A43242DKD</updaterepokey>
+ <summary>SUSE Linux Enterprise Server</summary>
+ <description>
+This is the Server product of the SUSE Linux Enterprise edition. It is an
alternative product for the Windows Server and other UNIX Operating Systems,
providing Server functionality and interoperability with UNIX servers. This is
the replacement product intended to sunset SUSE Linux Enterprise Server10 which
was introduced in May of 2006
+ The SUSE Linux Enterprise Server 11 addresses very large enterprises as
well as large enterprises and in some ways also medium, small,
government and educational needs for a secure, stable, reliable and
high-performance operating system platform.
+ It is the core and base offering to provide a general-purpose
infrastructure solution. This offering is engineered, tested and proven to
handle mission-critical workloads in the data center.
+ Developed and backed by Novell, only SUSE Linux Enterprise Server
offers an open, scalable, high-performance data center solution that comes
with application security, virtualization and Integrated systems management
across a range of hardware architectures.
+ SUSE Linux Enterprise Server is deployable as a general-purpose server
or can be tailored to run a variety of specialized workloads, and it offers
seamless interoperability with your existing data center infrastructure.
+ </description>
+ <urls>
+ <url
name="releasenotes">http://www.novell.com/linux/releasenotes/i586/SUSE-SLES/11/release-notes-sles.rpm</url>
+ </urls>
+
+ <upgrades>
+ <upgrade>
+ <name>openSUSE_11.1</name>
+ <summary>openSUSE 11.1</summary>
+
<repository>http://download.opensuse.org/distribution/openSUSE/11.1</repository>
+ <notify>true</notify>
+ <status>stable</status>
+ </upgrade>
+ <upgrade>
+ <name>openSUSE_Factory</name>
+ <summary>openSUSE Factory</summary>
+
<repository>http://download.opensuse.org/distribution/openSUSE/Factory</repository>
+ <notify>no</notify>
+ <status>unstable</status>
+ </upgrade>
+ </upgrades>
+
+ <register>
+ <target>sle-11-i586</target>
+ <release>whatever</release>
+ </register>
+ <buildconfig>
+ <!-- This section is needed to generate the installation media -->
+ <producttheme>SLES</producttheme>
+ <allowresolving>false</allowresolving>
+ </buildconfig>
+ <installconfig>
+ <!-- All flags needed during installation -->
+ <defaultlang>en_US</defaultlang>
+ <!-- needed for current content file -->
+ <datadir>suse</datadir>
+ <descrdir>suse/setup/descr</descrdir>
+ <references name="sles-release" version="11"/>
+ <distribution>SUSE_SLE</distribution>
+ </installconfig>
+ <runtimeconfig>
+ <!-- All Flags needed in the running system -->
+ </runtimeconfig>
+</product>

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

< Previous Next >
This Thread
  • No further messages