~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_upgrade.py

  • Committer: Alexander Belchenko
  • Date: 2010-06-17 08:53:15 UTC
  • mfrom: (5300 +trunk)
  • mto: (5303.2.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5305.
  • Revision ID: bialix@ukr.net-20100617085315-hr8186zck57zn35s
merge bzr.dev; fix NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007, 2009 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Black box tests for the upgrade ui."""
 
18
import os
 
19
import stat
18
20
 
19
21
from bzrlib import (
20
22
    bzrdir,
21
23
    repository,
22
24
    )
23
25
from bzrlib.tests import (
 
26
    features,
24
27
    TestCaseInTempDir,
25
28
    TestCaseWithTransport,
26
29
    )
146
149
        self.run_bzr('init-repository --format=metaweave repo')
147
150
        self.run_bzr('upgrade --format=knit repo')
148
151
 
 
152
    def test_upgrade_permission_check(self):
 
153
        """'backup.bzr' should retain permissions of .bzr. Bug #262450"""
 
154
        self.requireFeature(features.posix_permissions_feature)
 
155
        old_perms = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
 
156
        backup_dir = 'backup.bzr.~1~'
 
157
        self.run_bzr('init --format=1.6')
 
158
        os.chmod('.bzr', old_perms)
 
159
        self.run_bzr('upgrade')
 
160
        new_perms = os.stat(backup_dir).st_mode & 0777
 
161
        self.assertTrue(new_perms == old_perms)
 
162
 
149
163
 
150
164
    def test_upgrade_with_existing_backup_dir(self):
151
165
        self.make_format_5_branch()