gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r19306 - gnunet-update/test


From: gnunet
Subject: [GNUnet-SVN] r19306 - gnunet-update/test
Date: Sat, 21 Jan 2012 21:52:19 +0100

Author: harsha
Date: 2012-01-21 21:52:19 +0100 (Sat, 21 Jan 2012)
New Revision: 19306

Modified:
   gnunet-update/test/test_regression.py
Log:
- extended regression tests

Modified: gnunet-update/test/test_regression.py
===================================================================
--- gnunet-update/test/test_regression.py       2012-01-21 20:12:03 UTC (rev 
19305)
+++ gnunet-update/test/test_regression.py       2012-01-21 20:52:19 UTC (rev 
19306)
@@ -53,19 +53,51 @@
             os.path.join(self.test_dir, 
                          "confs/gnunet-update-home/etc/gnunet-update.conf")
             ]
-        self.install_dir = tempfile.mkdtemp(prefix="gnunet-update-test")
+        self.install_dir = tempfile.mkdtemp(prefix="gnunet-update-test-")
 
     def tearDown(self):
         """Test tear down routine"""
         shutil.rmtree(self.install_dir)
+
+
+    def build_package(self, package_path, configure_options):
+        """Builds and install the given package with configure_options.
+
+        pacakge_path: The path of the directory containing sources
+        configure_options: the options which are to be passed to configure
+        """
+        cwd = os.getcwd()
+        if cwd != package_path:
+            os.chdir(package_path)
+
+        gnunet_update.package.run_configure(configure_options)
+        gnunet_update.package.run_make()
+        gnunet_update.package.run_make_install()
         
+        if cwd != package_path:
+            os.chdir(cwd)
+        
 
     def test_regression(self):
         """Regression testing for packager, installer and updater"""
+        
+        libfake0_prefix = os.path.join(self.install_dir, "libfake0")
+        libfake1_prefix = os.path.join(self.install_dir, "libfake1")
 
+        self.build_package(os.path.join(self.test_dir,
+                                        "old/libfake"),
+                           [ "--prefix=" + libfake0_prefix ])
+
+        self.build_package(os.path.join(self.test_dir,
+                                        "old/libfake"),
+                           [ "--prefix=" + libfake1_prefix ])
+
         # Run packager on old package
         # Set up arguments for the packager script
         sys.argv = ["package"] + self.common_argv + [
+            # The configure option for linking with libfake
+            "-o", 
+            "--with-libfake=" + libfake0_prefix,
             # The source directory
             os.path.join(self.test_dir, 
                          "old/test-package"),
@@ -77,6 +109,9 @@
 
         # Run packager on new Package
         sys.argv = ["package"] + self.common_argv + [
+            # The configure option for linking with libfake
+            "-o", 
+            "--with-libfake=" + libfake1_prefix,
             # The source directory
             os.path.join(self.test_dir, 
                          "new/test-package"),
@@ -89,6 +124,8 @@
 
         # Run installer on the old package
         sys.argv = ["install"] + self.common_argv + [
+            # The group option
+            "-g", "group1",
             # The install package file
             os.path.join(self.install_dir, "old-pack.tgz"),
             # installation location




reply via email to

[Prev in Thread] Current Thread [Next in Thread]