gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r25101 - in gnunet-update: . src/tests src/tests/confs


From: gnunet
Subject: [GNUnet-SVN] r25101 - in gnunet-update: . src/tests src/tests/confs
Date: Thu, 22 Nov 2012 15:49:16 +0100

Author: harsha
Date: 2012-11-22 15:49:16 +0100 (Thu, 22 Nov 2012)
New Revision: 25101

Added:
   gnunet-update/src/tests/__init__.py.in
   gnunet-update/src/tests/confs/gnunet-update.conf
   gnunet-update/src/tests/gen_user_home.sh
Removed:
   gnunet-update/src/tests/__init__.py
Modified:
   gnunet-update/configure.ac
   gnunet-update/src/tests/
   gnunet-update/src/tests/Makefile.am
   gnunet-update/src/tests/test_config.py
   gnunet-update/src/tests/test_regression.py
   gnunet-update/src/tests/test_util.py
Log:
- build fixes

Modified: gnunet-update/configure.ac
===================================================================
--- gnunet-update/configure.ac  2012-11-22 14:10:49 UTC (rev 25100)
+++ gnunet-update/configure.ac  2012-11-22 14:49:16 UTC (rev 25101)
@@ -193,4 +193,5 @@
 src/ext/Makefile
 src/gnunet_update/Makefile
 src/tests/Makefile
+src/tests/__init__.py
 ])

Index: gnunet-update/src/tests
===================================================================
--- gnunet-update/src/tests     2012-11-22 14:10:49 UTC (rev 25100)
+++ gnunet-update/src/tests     2012-11-22 14:49:16 UTC (rev 25101)

Property changes on: gnunet-update/src/tests
___________________________________________________________________
Modified: svn:ignore
## -1,3 +1,5 ##
 Makefile.in
 Makefile
+__init__.py
+user-home
 
Modified: gnunet-update/src/tests/Makefile.am
===================================================================
--- gnunet-update/src/tests/Makefile.am 2012-11-22 14:10:49 UTC (rev 25100)
+++ gnunet-update/src/tests/Makefile.am 2012-11-22 14:49:16 UTC (rev 25101)
@@ -1,3 +1,8 @@
+check_DATA = gen_user_home
+
+gen_user_home: gen_user_home.sh
+       $(srcdir)/gen_user_home.sh
+
 TESTS_ENVIRONMENT = $(PYTHON)
 testscripts = \
   test_config.py \
@@ -69,6 +74,7 @@
 
 EXTRA_DIST = \
   __init__.py \
+  gen_user_home.sh \
   keys \
   confs \
   $(testscripts) \

Deleted: gnunet-update/src/tests/__init__.py
===================================================================
--- gnunet-update/src/tests/__init__.py 2012-11-22 14:10:49 UTC (rev 25100)
+++ gnunet-update/src/tests/__init__.py 2012-11-22 14:49:16 UTC (rev 25101)
@@ -1,28 +0,0 @@
-# This file is part of GNUnet.
-# (C) 2001--2011 Christian Grothoff (and other contributing authors)
-#
-# GNUnet 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, or (at your
-# option) any later version.
-#
-# GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
-# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-# 
-# File:    gnunet_update/tests/__init__.py
-# Author:  Sree Harsha Totakura
-#
-# Unit tests package initialization file.
-
-import sys
-import os
-
-# Add the gnunet_update to the os.sys so that it can be loaded
-sys.path.append(os.path.join(os.path.dirname(__file__),'../'))

Copied: gnunet-update/src/tests/__init__.py.in (from rev 25089, 
gnunet-update/src/tests/__init__.py)
===================================================================
--- gnunet-update/src/tests/__init__.py.in                              (rev 0)
+++ gnunet-update/src/tests/__init__.py.in      2012-11-22 14:49:16 UTC (rev 
25101)
@@ -0,0 +1,33 @@
+# This file is part of GNUnet.
+# (C) 2001--2011 Christian Grothoff (and other contributing authors)
+#
+# GNUnet 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, or (at your
+# option) any later version.
+#
+# GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+# 
+# File:    gnunet_update/tests/__init__.py
+# Author:  Sree Harsha Totakura
+#
+# Unit tests package initialization file.
+
+import sys
+import os
+
+pwd = os.path.dirname(__file__)
+
+# Add the gnunet_update to the os.sys so that it can be loaded
+sys.path.append(os.path.join(pwd, '../'))
+os.environ['HOME'] = os.path.join(pwd, 'user-home')
+if os.environ.get('GNUNET_UPDATE_HOME') is None:
+    os.environ['GNUNET_UPDATE_HOME'] = "@prefix@"

Added: gnunet-update/src/tests/confs/gnunet-update.conf
===================================================================
--- gnunet-update/src/tests/confs/gnunet-update.conf                            
(rev 0)
+++ gnunet-update/src/tests/confs/gnunet-update.conf    2012-11-22 14:49:16 UTC 
(rev 25101)
@@ -0,0 +1,40 @@
+# This file is part of GNUnet.
+# (C) 2011 Christian Grothoff (and other contributing authors)
+#
+# GNUnet 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, or (at your
+# option) any later version.
+#
+# GNUnet 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 GNUnet; see the file COPYING.  If not, write to the
+# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+# 
+# File:    etc/gnunet-update.conf
+# Author:  Sree Harsha Totakura
+
+# Default configuration file
+
+# This section is for meta information; it influences what is written to the
+# metadata 
+[META]
+# Specify where the current release is stored. Successive package builds will
+# use the incremented number. This option is only relevant while generating a
+# package; it is not required while installing or updating
+# RELEASE_COUNTER_FILE = /home/user/.gnunet-update/release-counter
+
+# This section is for signing and verifying the integrity of downloaded updates
+[SECURITY]
+# Specify which GPG key to use for signing by its Fingerprint
+PGP_SIGN_KEY = 38D6 5A4C 06DB 8BF5 28D6 FFA9 4BE3 A0A0 D9CA 26A1
+
+# If you don't want to be prompted for your private key password during 
signing,
+# you may specify your private key password here. This option is only relevant
+# while generating a package; it is not required while installing or updating
+PGP_SIGN_KEY_PASSWORD = test

Added: gnunet-update/src/tests/gen_user_home.sh
===================================================================
--- gnunet-update/src/tests/gen_user_home.sh                            (rev 0)
+++ gnunet-update/src/tests/gen_user_home.sh    2012-11-22 14:49:16 UTC (rev 
25101)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# File: tests/gen_user_home.sh
+# Author: Sree Harsha Totakura
+# File to generate a directory for test cases. This directory is similar to a
+# user's home directory
+
+homedir="user-home"
+
+# Clean up existing directory
+rm -rf $homedir
+
+mkdir -p "$homedir/.gnunet-update"
+HOME=$homedir
+gpg --import keys/test.sec \
+    && cp confs/gnunet-update.conf "$homedir/.gnunet-update" \
+    && echo 0 > "$homedir/.gnunet-update/release-counter"


Property changes on: gnunet-update/src/tests/gen_user_home.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: gnunet-update/src/tests/test_config.py
===================================================================
--- gnunet-update/src/tests/test_config.py      2012-11-22 14:10:49 UTC (rev 
25100)
+++ gnunet-update/src/tests/test_config.py      2012-11-22 14:49:16 UTC (rev 
25101)
@@ -35,8 +35,6 @@
 class TestConfig(unittest.TestCase):
     
     def setUp(self):
-        # Modify HOME to point to testing home
-        os.environ['HOME'] = os.path.join(pwd, 'confs/user-home')
         # Modify GNUNET_UPDATE_HOME path
         os.environ['GNUNET_UPDATE_HOME'] = os.path.join(pwd,
                                                         
'confs/gnunet-update-home')
@@ -50,7 +48,7 @@
     def test_config_init_filename(self):
         """Test if the Config constructor is working."""
         config = GnunetUpdateConfig(os.path.join(os.environ['HOME'],
-                                                 "gnunet-update.conf"))
+                                                 
".gnunet-update/gnunet-update.conf"))
 
     def test_config_overwrite(self):
         """Test if a recent configuration overwrites existing options."""

Modified: gnunet-update/src/tests/test_regression.py
===================================================================
--- gnunet-update/src/tests/test_regression.py  2012-11-22 14:10:49 UTC (rev 
25100)
+++ gnunet-update/src/tests/test_regression.py  2012-11-22 14:49:16 UTC (rev 
25101)
@@ -42,16 +42,12 @@
 
     install_dir = None
     common_argv = None
-    test_dir = None
 
     def setUp(self):
         """Test ramp up code"""
-        self.test_dir = os.path.join(os.environ['GNUNET_UPDATE_HOME'],
-                                     "test");
         self.common_argv = [
             '-c',
-            os.path.join(self.test_dir, 
-                         "confs/gnunet-update-home/etc/gnunet-update.conf")
+            "confs/gnunet-update-home/etc/gnunet-update.conf"
             ]
         self.install_dir = tempfile.mkdtemp(prefix="gnunet-update-test-")
 
@@ -84,12 +80,10 @@
         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"),
+        self.build_package("old/libfake",
                            [ "--prefix=" + libfake0_prefix ])
 
-        self.build_package(os.path.join(self.test_dir,
-                                        "new/libfake"),
+        self.build_package("new/libfake",
                            [ "--prefix=" + libfake1_prefix ])
 
         # Run packager on old package
@@ -97,10 +91,8 @@
         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"),
+            "--with-libfake=" + libfake0_prefix,            
+            "old/test-package", # The source directory
             # The path where the package has to be kept
             os.path.join(self.install_dir,
                          "old-pack")
@@ -111,10 +103,8 @@
         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"),
+            "--with-libfake=" + libfake1_prefix,            
+            "new/test-package", # The source directory
             # The path where the package has to be kept
             os.path.join(self.install_dir,
                          "new-pack")

Modified: gnunet-update/src/tests/test_util.py
===================================================================
--- gnunet-update/src/tests/test_util.py        2012-11-22 14:10:49 UTC (rev 
25100)
+++ gnunet-update/src/tests/test_util.py        2012-11-22 14:49:16 UTC (rev 
25101)
@@ -119,8 +119,6 @@
     def test_gpg_sign_verify_file(self):
         """Test gpg file signing."""
                         
-        # Modify HOME to point to testing home
-        os.environ['HOME'] = os.path.join(pwd, 'confs/user-home')
         # Modify GNUNET_UPDATE_HOME path
         os.environ['GNUNET_UPDATE_HOME'] = os.path.join(pwd,
                                                         
'confs/gnunet-update-home')




reply via email to

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