Commit f836ef71 authored by Michael Terry's avatar Michael Terry

convert permission test to new-style one

parent 159d145f
......@@ -30,7 +30,6 @@ AUTO_TESTS = \
backup/encrypt \
backup/exclude \
backup/mkdir \
backup/permissions \
backup/quiescent \
backup/spaces \
backup/symlinks \
......
#!/usr/bin/env python
# -*- Mode: Python; indent-tabs-mode: nil; tab-width: 2; coding: utf-8 -*-
#
# This file is part of Déjà Dup.
# For copyright information, see AUTHORS.
#
# Déjà Dup 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.
#
# Déjà Dup 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 Déjà Dup. If not, see <http://www.gnu.org/licenses/>.
# Test whether we correctly handle backup destinations with odd permissions
import sys
import os
sys.path.insert(0, sys.path[0]+'/..')
import base
import ldtp
if not base.dup_meets_version(0, 6, 12):
base.skip()
def nowrite():
backupdir = base.get_temp_name('backup', True)
os.system('chmod a-w %s' % backupdir)
base.setup()
base.backup_simple(error='lblPermissiondeniedwhentryingtocreate', backend='file', includes=['data/simple'], dest=backupdir)
def noread():
backupdir = base.get_temp_name('backup', True)
os.system('chmod a-r %s' % backupdir)
base.setup()
base.backup_simple(error=u'lblPermissiondeniedwhentryingtoread\u2018%s\u2019' % backupdir, backend='file', includes=['data/simple'], dest=backupdir, encrypt=None)
def noexec():
backupdir = base.get_temp_name('backup', True)
os.system('chmod a-x %s' % backupdir)
base.setup()
base.backup_simple(error='lblPermissiondeniedwhentryingtocreate', backend='file', includes=['data/simple'], dest=backupdir)
def noget():
backupdir = base.get_temp_name('backup', True)
os.system('cp %s/* %s' % (sys.path[0]+'/vols/simple', backupdir))
os.system('chmod a-r %s/*' % backupdir)
base.setup()
base.backup_simple(error=u'lblPermissiondeniedwhentryingtoread\u2018%s\u2019' %
(backupdir+'/duplicity-full-signatures20090802T011441Zsigtargz'),
backend='file', includes=['data/simple'], dest=backupdir, encrypt=None)
base.run(nowrite)
base.run(noread)
base.run(noexec)
base.run(noget)
[Operation]
Type=backup
Success=false
Error=Permission denied when trying to create /local.
[Duplicity]
Runs=status;dry;backup;
[Duplicity backup]
#ERROR 51 put /remote /local
Output=true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment