r137 - in branches/rewrite/tests: . Config

Otavio Salvador partial-mirror-devel@lists.alioth.debian.org
Sat, 03 Jul 2004 14:17:45 -0600


Author: otavio
Date: Sat Jul  3 14:17:44 2004
New Revision: 137

Added:
   branches/rewrite/tests/
   branches/rewrite/tests/Config/
   branches/rewrite/tests/Config/good.conf
   branches/rewrite/tests/Config/test.py
   branches/rewrite/tests/Makefile
Log:
Initial test environment.

Added: branches/rewrite/tests/Config/good.conf
==============================================================================
--- (empty file)
+++ branches/rewrite/tests/Config/good.conf	Sat Jul  3 14:17:44 2004
@@ -0,0 +1,73 @@
+;;
+;; debpartial-mirror configuration file.
+;;
+;; $Id: debpartial-mirror.conf 130 2004-07-02 12:33:24Z natbudin-guest $
+
+[GLOBAL]
+;; Show debug information?
+debug = DEBUG
+
+;; Mirror destination directory
+mirror_dir = /var/cache/debpartial-mirror/
+
+;; Which architectures should I download?
+architectures = i386
+
+;; What should I look for, by default?
+sections = main
+distributions = stable
+
+;; What should I get?
+get_suggests = true
+get_recommends = true
+get_provides = true
+
+;; Here is our first backend.  It mirrors a subset of packages from the
+;; Debian official repositories.
+[sarge]
+
+;; Where do we get the packages from?
+server = http://ftp.debian.org/debian
+
+;; Since we specify sections and distributions in this section, what we
+;; specify here overrides the settings in [DEFAULT].
+sections = main
+distributions = sarge
+
+;; Only get a subset of the packages in this source.
+filter = subsection:base priority:important
+
+;; Here is another backend.  This one will get all the debian-installer
+;; packages from the unstable distribution (sid).
+[sid_debian-installer]
+server = http://ftp.debian.org/debian
+sections = main/debian-installer
+distributions = sid
+filter = all
+
+;; You can use debian-cd tasks to include or exclude a subset of the
+;; packages.
+include_from_task = /usr/share/debian-cd/tasks/base-sarge
+exclude_from_task = /usr/share/debian-cd/tasks/exclude-sarge
+
+;; This backend is a local repository, as you can see from the use of the
+;; file:// URL.  The idea is that we have a set of custom-made packages
+;; stored on the local computer.
+[local_custom_packages]
+server = file:///var/lib/custom-packages
+sections = main
+distributions = local
+filter = all
+
+;; These packages depend on Debian official packages.  We will use the
+;; "sarge" backend (above) to satisfy these dependencies.
+resolve_deps_using = sarge
+
+;; Here is a merging backend.  It uses the backends we specify above to
+;; create a custom distribution that provides all the packages in each
+;; backend.  This will be created using hard links to the package files
+;; in each backend directory.
+[my_custom_debian_distro]
+backends = sarge sid_debian-installer local_custom_packages
+name = sarge-with-sids-installer-and-some-other-stuff
+filter_sarge = all

Added: branches/rewrite/tests/Config/test.py
==============================================================================
--- (empty file)
+++ branches/rewrite/tests/Config/test.py	Sat Jul  3 14:17:44 2004
@@ -0,0 +1,39 @@
+# debpartial-mirror - partial debian mirror package tool
+# (c) 2004 Otavio Salvador <otavio@debian.org>, Nat Budin <natb@brandeis.edu>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# $Id$
+
+from sys import path, stdout
+path.append("../../src/")
+
+from Config import *
+from logging import *
+
+## Set the debuggin level
+#getLogger().setLevel(DEBUG)
+
+stdout.write("Testing a good configuration file... ")
+try:
+    Config('good.conf')
+    print "Works."
+except InvalidOption, msg:
+    print("Failed to identify the [%s] option on [%s] section."
+          % (msg.option, msg.section))
+except InvalidSection, msg:
+    print("Failed to identify the [%s] section." % msg.section)
+except Exception, msg:
+    print "Failed. Returned", msg
+

Added: branches/rewrite/tests/Makefile
==============================================================================
--- (empty file)
+++ branches/rewrite/tests/Makefile	Sat Jul  3 14:17:44 2004
@@ -0,0 +1,27 @@
+# debpartial-mirror - partial debian mirror package tool
+# (c) 2004 Otavio Salvador <otavio@debian.org>, Nat Budin <natb@brandeis.edu>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# $Id$
+
+### This makefile is to be used to test all needed features of
+### debpartial-mirror system
+
+# Point the sources
+MODULES="Config"
+all:
+	@for dir in $(MODULES); do \
+		cd $$dir ; python test.py; cd ..; \
+	done