[zypp-commit] r6770 - in /trunk/libzypp-testsuite: ./ package/ pokus/ pokus/config/ pokus/pokus.test/ pokus/src/ pokus/tests/ pokus/tests/arch-tests/ pokus/tests/parse-tests/ solver/solver.test/
Author: aschnell Date: Mon Aug 20 21:07:33 2007 New Revision: 6770 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6770&view=rev Log: - added another testsuite Added: trunk/libzypp-testsuite/pokus/ trunk/libzypp-testsuite/pokus/Makefile.am trunk/libzypp-testsuite/pokus/config/ trunk/libzypp-testsuite/pokus/config/Makefile.am trunk/libzypp-testsuite/pokus/config/default.exp trunk/libzypp-testsuite/pokus/config/unix.exp trunk/libzypp-testsuite/pokus/config/unknown.exp trunk/libzypp-testsuite/pokus/pokus.test/ trunk/libzypp-testsuite/pokus/pokus.test/Makefile.am trunk/libzypp-testsuite/pokus/pokus.test/pokus_test.exp trunk/libzypp-testsuite/pokus/src/ trunk/libzypp-testsuite/pokus/src/Makefile.am trunk/libzypp-testsuite/pokus/src/testsuite.rb trunk/libzypp-testsuite/pokus/tests/ trunk/libzypp-testsuite/pokus/tests/arch-tests/ trunk/libzypp-testsuite/pokus/tests/arch-tests/all.rb (with props) trunk/libzypp-testsuite/pokus/tests/parse-tests/ trunk/libzypp-testsuite/pokus/tests/parse-tests/yum1.rb (with props) Modified: trunk/libzypp-testsuite/Makefile.am trunk/libzypp-testsuite/configure.ac trunk/libzypp-testsuite/libzypp-testsuite-tools.spec.in trunk/libzypp-testsuite/package/libzypp-testsuite-tools.changes trunk/libzypp-testsuite/solver/solver.test/parser_test.exp Modified: trunk/libzypp-testsuite/Makefile.am URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/Makefile.am?rev=6770&r1=6769&r2=6770&view=diff ============================================================================== --- trunk/libzypp-testsuite/Makefile.am (original) +++ trunk/libzypp-testsuite/Makefile.am Mon Aug 20 21:07:33 2007 @@ -1,8 +1,8 @@ # # Makefile.am for libzypp/testsuite # -#SUBDIRS = src target solver source parser -SUBDIRS = src solver solvertree +#SUBDIRS = src target solver source parser pokus +SUBDIRS = src solver solvertree pokus ## ################################################## Modified: trunk/libzypp-testsuite/configure.ac URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/configure.ac?rev=6770&r1=6769&r2=6770&view=diff ============================================================================== --- trunk/libzypp-testsuite/configure.ac (original) +++ trunk/libzypp-testsuite/configure.ac Mon Aug 20 21:07:33 2007 @@ -80,11 +80,11 @@ dnl checks for system services dnl ================================================== dnl AC_CONFIG_FILES([FILE...]) -AC_OUTPUT( +AC_OUTPUT( Makefile \ libzypp-testsuite-tools.spec \ libzypp-testsuite-tools.pc \ - src/Makefile \ + src/Makefile \ src/utils/Makefile \ solver/Makefile \ solver/config/Makefile \ @@ -95,6 +95,10 @@ solver/single.out/Makefile solvertree/Makefile \ solvertree/src/Makefile \ + pokus/Makefile \ + pokus/config/Makefile \ + pokus/pokus.test/Makefile \ + pokus/src/Makefile \ dnl source/Makefile \ dnl parser/Makefile \ dnl parser/lib/Makefile \ @@ -106,7 +110,6 @@ dnl target/lib/Makefile \ dnl target/target.test/Makefile \ dnl target/tests/Makefile - ) dnl ================================================== Modified: trunk/libzypp-testsuite/libzypp-testsuite-tools.spec.in URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/libzypp-testsuite-tools.spec.in?rev=6770&r1=6769&r2=6770&view=diff ============================================================================== --- trunk/libzypp-testsuite/libzypp-testsuite-tools.spec.in (original) +++ trunk/libzypp-testsuite/libzypp-testsuite-tools.spec.in Mon Aug 20 21:07:33 2007 @@ -8,19 +8,17 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -# norootforbuild - -Name: libzypp-testsuite-tools -BuildRequires: gcc-c++ libzypp-devel libzypp fdupes dejagnu qt3-devel libqdialogsolver1-devel -Requires: libzypp qt3 libqdialogsolver1 -License: GPL -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Name: libzypp-testsuite-tools +BuildRequires: gcc-c++ libzypp-devel libzypp fdupes dejagnu qt3-devel libqdialogsolver1-devel ruby ruby-zypp ruby-zypptools +Requires: libzypp qt3 libqdialogsolver1 ruby ruby-zypp ruby-zypptools +License: GPL +BuildRoot: %{_tmppath}/%{name}-%{version}-build Autoreqprov: on Summary: Package, Patch, Pattern, and Product Management - testsuite-tools -Version: @VERSION@ -Release: 0 -Source: zypp-testsuite-tools-@VERSION@.tar.bz2 -Prefix: /usr +Version: @VERSION@ +Release: 0 +Source: zypp-testsuite-tools-@VERSION@.tar.bz2 +Prefix: /usr Group: System/Packages %description Modified: trunk/libzypp-testsuite/package/libzypp-testsuite-tools.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/package/libzypp-testsuite-tools.changes?rev=6770&r1=6769&r2=6770&view=diff ============================================================================== --- trunk/libzypp-testsuite/package/libzypp-testsuite-tools.changes (original) +++ trunk/libzypp-testsuite/package/libzypp-testsuite-tools.changes Mon Aug 20 21:07:33 2007 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon Aug 20 21:07:59 CEST 2007 - aschnell@suse.de + +- added another testsuite + +------------------------------------------------------------------- Mon Aug 13 14:38:10 CEST 2007 - schubi@suse.de - changes due new regex class @@ -11,7 +16,7 @@ - Added vendor to helixparser - Added new testcases - reduced logging in solver -- rev 6524 +- rev 6524 - ver 3.14.8 ------------------------------------------------------------------- @@ -20,7 +25,7 @@ - solvertree added (grafical interface) - Not using pool for retrieving additional dependencies which has to be regarded by the solver. -- r 6400 +- r 6400 - ver 3.14.7 ------------------------------------------------------------------- @@ -28,27 +33,27 @@ - new repo handling of libzypp included - rev 6197 -- ver 3.14.6 +- ver 3.14.6 ------------------------------------------------------------------- Fri Jul 6 16:47:28 CEST 2007 - schubi@suse.de - enable "make check" for ix68 and ia64 in autobuild -- rev 5923 +- rev 5923 - ver 3.14.5 ------------------------------------------------------------------- Wed Jun 20 14:33:54 CEST 2007 - schubi@suse.de -- added includes for gcc42 +- added includes for gcc42 ------------------------------------------------------------------- Tue Jun 12 12:10:29 CEST 2007 - schubi@suse.de -- cleanup; moved bineries to /opt/zypp/testsuite/bin +- cleanup; moved bineries to /opt/zypp/testsuite/bin ------------------------------------------------------------------- Thu Apr 5 12:36:12 CEST 2007 - schubi@suse.de -- initial; testsuite package has been extracted from libzypp package +- initial; testsuite package has been extracted from libzypp package Added: trunk/libzypp-testsuite/pokus/Makefile.am URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/Makefile.am?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/Makefile.am (added) +++ trunk/libzypp-testsuite/pokus/Makefile.am Mon Aug 20 21:07:33 2007 @@ -0,0 +1,10 @@ +# +# Makefile.am +# + +SUBDIRS = config pokus.test src +AUTOMAKE_OPTIONS = dejagnu +PACKAGE = pokus + +EXTRA_DIST = tests/* + Added: trunk/libzypp-testsuite/pokus/config/Makefile.am URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/config/Makefile.am?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/config/Makefile.am (added) +++ trunk/libzypp-testsuite/pokus/config/Makefile.am Mon Aug 20 21:07:33 2007 @@ -0,0 +1,9 @@ +# +# Makefile.am +# + +testsuitepokusconfigdatadir = ${testsuitedatadir}/pokus/config + +testsuitepokusconfigdata_DATA = *.exp + +EXTRA_DIST = $(testsuitepokusconfigdata_DATA) Added: trunk/libzypp-testsuite/pokus/config/default.exp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/config/default.exp?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/config/default.exp (added) +++ trunk/libzypp-testsuite/pokus/config/default.exp Mon Aug 20 21:07:33 2007 @@ -0,0 +1 @@ +# default.exp -- empty Added: trunk/libzypp-testsuite/pokus/config/unix.exp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/config/unix.exp?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/config/unix.exp (added) +++ trunk/libzypp-testsuite/pokus/config/unix.exp Mon Aug 20 21:07:33 2007 @@ -0,0 +1 @@ +# unix.exp -- empty Added: trunk/libzypp-testsuite/pokus/config/unknown.exp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/config/unknown.exp?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/config/unknown.exp (added) +++ trunk/libzypp-testsuite/pokus/config/unknown.exp Mon Aug 20 21:07:33 2007 @@ -0,0 +1,2 @@ +perror "No setup for current configuration" +exit 1 Added: trunk/libzypp-testsuite/pokus/pokus.test/Makefile.am URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/pokus.test/Makefile.am?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/pokus.test/Makefile.am (added) +++ trunk/libzypp-testsuite/pokus/pokus.test/Makefile.am Mon Aug 20 21:07:33 2007 @@ -0,0 +1,10 @@ +# +# Makefile.am +# + +testsuitepokustest2datadir = ${testsuitedatadir}/pokus/pokus.test + +testsuitepokustest2data_DATA = *.exp + +EXTRA_DIST = $(testsuitepokustest2data_DATA) + Added: trunk/libzypp-testsuite/pokus/pokus.test/pokus_test.exp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/pokus.test/pokus_test.exp?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/pokus.test/pokus_test.exp (added) +++ trunk/libzypp-testsuite/pokus/pokus.test/pokus_test.exp Mon Aug 20 21:07:33 2007 @@ -0,0 +1,63 @@ + +set datadir "tests" +set errorOccured 0 + +set dircases [glob $datadir/*-tests] + +foreach dircase $dircases { + + set testPath [split $dircase "/"] + set testFilename [lindex $testPath [expr [llength $testPath]-1]] + set testFname [split $testFilename "."] + set testBase_name [lindex $testFname 0] + + set xfails [list] + set xfailname "$dircase/xfail" + if { [file exists $xfailname] != 0 } { + set fp [open $xfailname r] + set xfails [read $fp] + close $fp + } + + set testcases [glob $dircase/*.rb] + + foreach testcase $testcases { + + set testPath [split $testcase "/"] + set testPathLen [llength $testPath] + set testFilename [lindex $testPath [expr $testPathLen-1]] + set testDirname [lindex $testPath [expr $testPathLen-2]] + + set expect_to_fail 0 + if { [lsearch $xfails $testFilename] != -1 } { + set expect_to_fail 1 + } + + set testFname [split $testFilename "."] + set testBase_name [lindex $testFname 0] + puts "Running $testDirname/$testFilename" + + set tmpoutfile ./$testBase_name.tmp.out + set tmperrfile ./$testBase_name.tmp.err + + # run the test + set command "cd $dircase ; ./$testFilename >$tmpoutfile 2>$tmperrfile" + set result "" + set oops [catch { set result [exec sh -c $command] } catched] + + if {$oops != 0} { + fail "test case failed for $testBase_name: $catched" + set errorOccured 0 + continue + } + + # ok, all is fine + pass $testBase_name + } +} + +if { $errorOccured == 0 } { + return 0 +} else { + return -1 +} Added: trunk/libzypp-testsuite/pokus/src/Makefile.am URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/src/Makefile.am?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/src/Makefile.am (added) +++ trunk/libzypp-testsuite/pokus/src/Makefile.am Mon Aug 20 21:07:33 2007 @@ -0,0 +1,9 @@ +# +# Makefile.am +# + +testsuitepokussrcdatadir = ${testsuitedatadir}/pokus/src + +testsuitepokussrcdata_DATA = *.rb + +EXTRA_DIST = $(testsuitepokussrcdata_DATA) Added: trunk/libzypp-testsuite/pokus/src/testsuite.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/src/testsuite.rb?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/src/testsuite.rb (added) +++ trunk/libzypp-testsuite/pokus/src/testsuite.rb Mon Aug 20 21:07:33 2007 @@ -0,0 +1,57 @@ + +# aschnell@suse.de + +require 'rzypp' +include Rzypp + + +class Testsuite + + def Testsuite.set_arch(arch) + + arch = Rzypp::Arch.new(arch.to_s) + zypp = ZYppFactory::instance.get_zypp() + zypp.set_architecture(arch) + + end + + # reads a single repository and returns the pool + def Testsuite.read_repo(url) + + tmp_cache_path = TmpDir.new() + tmp_raw_cache_path = TmpDir.new() + tmp_known_repos_path = TmpDir.new() + + opts = RepoManagerOptions.new() + opts.repoCachePath = tmp_cache_path.path() + opts.repoRawCachePath = tmp_raw_cache_path.path() + opts.knownReposPath = tmp_known_repos_path.path() + + repo_manager = RepoManager.new(opts) + res_pool_manager = ResPoolManager.new() + repo_info = RepoInfo.new() + + repo_info.set_alias("testsuite") + repo_info.set_name("Testsuite Repo") + repo_info.set_enabled(true) + repo_info.set_autorefresh(false) + repo_info.add_base_url(url) + + repo_manager.add_repository(repo_info) + + repos = repo_manager.known_repositories() + repos.each do | repo | + repo_manager.refresh_metadata(repo) + repo_manager.build_cache(repo) + rep = repo_manager.create_from_cache(repo) + store = rep.resolvables() + res_pool_manager.insert(store) + end + + pool = res_pool_manager.accessor() + return pool + + end + +end + Added: trunk/libzypp-testsuite/pokus/tests/arch-tests/all.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/tests/arch-tests/all.rb?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/tests/arch-tests/all.rb (added) +++ trunk/libzypp-testsuite/pokus/tests/arch-tests/all.rb Mon Aug 20 21:07:33 2007 @@ -0,0 +1,63 @@ +#!/usr/bin/ruby + + +# Generate YUM repository containing a package for all architectures. Check +# for architectures that the correct architectures are loaded into the pool. + + +require 'zypptools/lib/arch' +require 'zypptools/lib/package' +require 'zypptools/lib/pattern' +require 'zypptools/lib/selection' +require 'zypptools/lib/product' +require 'zypptools/output/output' +include ZYppTools + +require '../../src/testsuite' + + +path = "/ARVIN/zypp/trunk/repotools/tmp" + + +packages = Array.new() + +Arch.all_archs.each do | arch | + pkg = Package.new("test") + pkg.arch = arch + pkg.version = "1.2" + pkg.release = 1 + pkg.summary = "A pure test package" + packages.push(pkg) +end + + +output = OutputFactory(:yum, path) +output.write(packages) + + +Arch.all_archs.each do | arch | + + x = Arch.new(arch) + + puts "#{x.arch} -> #{x.compat.join(' ')}" + + Testsuite.set_arch(x.arch) + + t = Array.new() + + pool = Testsuite.read_repo("file://" + path) + pool.each do | p | + r = p.resolvable + puts "#{r.kind_to_s} #{r.name} #{r.edition.to_s} #{r.arch.to_s}" + t.push(r.arch.to_s) + end + + if not x.compat.map{|x|x.to_s}.sort().eql?(t.sort()) + puts "Error: archs don't match" + exit 1 + end + + puts + +end + Added: trunk/libzypp-testsuite/pokus/tests/parse-tests/yum1.rb URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/pokus/tests/parse-tests/yum1.rb?rev=6770&view=auto ============================================================================== --- trunk/libzypp-testsuite/pokus/tests/parse-tests/yum1.rb (added) +++ trunk/libzypp-testsuite/pokus/tests/parse-tests/yum1.rb Mon Aug 20 21:07:33 2007 @@ -0,0 +1,45 @@ +#!/usr/bin/ruby + + +# Generate a YUM repository and remove the file 'primary.xml'. + + +require 'zypptools/lib/arch' +require 'zypptools/lib/package' +require 'zypptools/output/output' +include ZYppTools + +require '../../src/testsuite' + + +path = "/ARVIN/zypp/trunk/repotools/tmp" + + +packages = Array.new() + +pkg = Package.new("test") +pkg.arch = "ia64" +pkg.rpmsize = 42 +pkg.version = "1.2" +pkg.release = 1 +pkg.summary = "A pure test package" +packages.push(pkg) + +output = OutputFactory(:yum, path) +output.write(packages) + +FileUtils.rm(path + "/repodata/primary.xml") + + +Testsuite.set_arch("ia64") + +begin + pool = Testsuite.read_repo("file://" + path) +rescue ZYppException => e + puts "ZYppException caught" + puts e.to_s +else + puts "Oh, no exception caught" + exit 1 +end + Modified: trunk/libzypp-testsuite/solver/solver.test/parser_test.exp URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-testsuite/solver/solver.test/parser_test.exp?rev=6770&r1=6769&r2=6770&view=diff ============================================================================== --- trunk/libzypp-testsuite/solver/solver.test/parser_test.exp (original) +++ trunk/libzypp-testsuite/solver/solver.test/parser_test.exp Mon Aug 20 21:07:33 2007 @@ -16,12 +16,12 @@ set prog "src/helixparse" set datadir "data.deptestomatic" set errorOccured 0 - + puts "Running $prog ..." set dircases [glob $datadir/*-tests datadir/*-exercises ] - foreach dircase $dircases { + foreach dircase $dircases { set testPath [split $dircase "/"] set testFilename [lindex $testPath [expr [llength $testPath]-1]] set testFname [split $testFilename "."] @@ -43,7 +43,7 @@ # look for *-packages.xml set testcases [glob $dircase/*-packages.xml $dircase/*-system.xml $dircase/*-package.xml] - foreach testcase $testcases { + foreach testcase $testcases { set testPath [split $testcase "/"] set testPathLen [llength $testPath] @@ -57,7 +57,7 @@ set testFname [split $testFilename "."] set testBase_name [lindex $testFname 0] - puts " ... $testDirname/$testFilename" + puts " ... $testDirname/$testFilename" #generate output directory @@ -78,7 +78,7 @@ } # check return code from runprg - + if {$result != ""} { warning "Run of $testBase_name results in '$result'" set errorOccured 0 -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org