diff options
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | changes/bug-3617_remove-exec-bits-from-text-in-bundle | 1 | ||||
-rw-r--r-- | changes/bug-3778_fix-path-prefix-helper | 1 | ||||
-rw-r--r-- | docs/release_checklist.wiki | 2 | ||||
-rwxr-xr-x | pkg/linux/build_bundle.sh | 12 | ||||
-rw-r--r-- | src/leap/bitmask/config/leapsettings.py | 12 | ||||
-rw-r--r-- | src/leap/bitmask/config/tests/test_leapsettings.py | 71 |
7 files changed, 87 insertions, 14 deletions
@@ -1,4 +1,4 @@ -0.3.2 Sep 9: +0.3.2 Sep 6 -- the "no crashes or anything" release: o Fix up script in non-bundle linuces. Closes: #3450 o Logout stops imap and smtp services. Closes: #3553 o Properly daemonize polkit-gnome-authentication-agent. Closes: #3554 diff --git a/changes/bug-3617_remove-exec-bits-from-text-in-bundle b/changes/bug-3617_remove-exec-bits-from-text-in-bundle new file mode 100644 index 00000000..caf3a62e --- /dev/null +++ b/changes/bug-3617_remove-exec-bits-from-text-in-bundle @@ -0,0 +1 @@ + o Remove execution bits in text files in bundle. Closes #3617. diff --git a/changes/bug-3778_fix-path-prefix-helper b/changes/bug-3778_fix-path-prefix-helper new file mode 100644 index 00000000..e7cec539 --- /dev/null +++ b/changes/bug-3778_fix-path-prefix-helper @@ -0,0 +1 @@ + o Fix path prefix helper for the bundle and add regresion tests. Closes #3778. diff --git a/docs/release_checklist.wiki b/docs/release_checklist.wiki index e6467048..273804c7 100644 --- a/docs/release_checklist.wiki +++ b/docs/release_checklist.wiki @@ -27,7 +27,7 @@ * [ ] git checkout develop && git pull origin develop && git merge release-X.Y.Z && git push origin develop * [ ] Build and upload bundles * [ ] Use the scripts under pkg/<os>/ to build the the bundles. - * [ ] Sign them with gpg -a <path/to/bundle> + * [ ] Sign them with gpg -a --sign --detach-sign <path/to/bundle> * [ ] Upload bundle and signature to web-uploads@salmon.leap.se:~/public/client/<os>/Bitmask-<os>-<ver>.(tar.bz2,dmg,zip) * [ ] Update symbolic link for latest upload and signature: * [ ] ~/public/client/Bitmask-<os>-latest diff --git a/pkg/linux/build_bundle.sh b/pkg/linux/build_bundle.sh index e6a1043f..879579f0 100755 --- a/pkg/linux/build_bundle.sh +++ b/pkg/linux/build_bundle.sh @@ -77,13 +77,13 @@ cp $JOINT_CHANGELOG $TEMPLATE_BUNDLE/CHANGELOG cp $REPOS_ROOT/leap_client/LICENSE $TEMPLATE_BUNDLE/LICENSE -# clean pyc$ - +# clean *.pyc files cd $TEMPLATE_BUNDLE -for i in $(find . | grep pyc$); - do - rm $i - done +find . -name "*.pyc" -delete + +# remove execution flags (because vbox fs) and set all read permissions +chmod -x CHANGELOG LICENSE README +chmod +r CHANGELOG LICENSE README # create tarball diff --git a/src/leap/bitmask/config/leapsettings.py b/src/leap/bitmask/config/leapsettings.py index ad67b29e..7d8b5977 100644 --- a/src/leap/bitmask/config/leapsettings.py +++ b/src/leap/bitmask/config/leapsettings.py @@ -75,12 +75,12 @@ class LeapSettings(object): """ Constructor - :param standalone: parameter used to define the location of - the config + :param standalone: parameter used to define the location of the config. :type standalone: bool """ - settings_path = os.path.join( - get_path_prefix(standalone=standalone), "leap", self.CONFIG_NAME) + self._path_prefix = get_path_prefix(standalone=standalone) + settings_path = os.path.join(self._path_prefix, + "leap", self.CONFIG_NAME) self._settings = QtCore.QSettings(settings_path, QtCore.QSettings.IniFormat) @@ -132,8 +132,8 @@ class LeapSettings(object): # other things, not just the directories providers = [] try: - providers_path = os.path.join( - get_path_prefix(), "leap", "providers") + providers_path = os.path.join(self._path_prefix, + "leap", "providers") providers = os.listdir(providers_path) except Exception as e: logger.debug("Error listing providers, assume there are none. %r" diff --git a/src/leap/bitmask/config/tests/test_leapsettings.py b/src/leap/bitmask/config/tests/test_leapsettings.py new file mode 100644 index 00000000..18166923 --- /dev/null +++ b/src/leap/bitmask/config/tests/test_leapsettings.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +# test_leapsettings.py +# Copyright (C) 2013 LEAP +# +# 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 3 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, see <http://www.gnu.org/licenses/>. + +""" +Tests for leapsettings module. +""" + +try: + import unittest2 as unittest +except ImportError: + import unittest + +import os +import mock + +from leap.common.testing.basetest import BaseLeapTest +from leap.bitmask.config.leapsettings import LeapSettings + + +class LeapSettingsTest(BaseLeapTest): + """Tests for LeapSettings""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def test_get_configured_providers(self): + """ + Test that the config file IS NOT stored under the CWD. + """ + self._leapsettings = LeapSettings() + with mock.patch('os.listdir') as os_listdir: + # use this method only to spy where LeapSettings is looking for + self._leapsettings.get_configured_providers() + args, kwargs = os_listdir.call_args + config_dir = args[0] + self.assertFalse(config_dir.startswith(os.getcwd())) + self.assertFalse(config_dir.endswith('config')) + + def test_get_configured_providers_in_bundle(self): + """ + Test that the config file IS stored under the CWD. + """ + self._leapsettings = LeapSettings(standalone=True) + with mock.patch('os.listdir') as os_listdir: + # use this method only to spy where LeapSettings is looking for + self._leapsettings.get_configured_providers() + args, kwargs = os_listdir.call_args + config_dir = args[0] + self.assertTrue(config_dir.startswith(os.getcwd())) + self.assertFalse(config_dir.endswith('config')) + + +if __name__ == "__main__": + unittest.main() |