1 |
import os, unittest, time |
import os, unittest, time, traceback, sys |
2 |
from commontest import * |
from commontest import * |
3 |
import rdiff_backup.Security as Security |
import rdiff_backup.Security as Security |
4 |
|
|
12 |
problem. |
problem. |
13 |
|
|
14 |
""" |
""" |
15 |
assert isinstance(exc, Security.Violation), exc |
if not isinstance(exc, Security.Violation): |
16 |
|
type, value, tb = sys.exc_info() |
17 |
|
print "".join(traceback.format_tb(tb)) |
18 |
|
raise exc |
19 |
#assert str(exc).find("Security") >= 0, "%s\n%s" % (exc, repr(exc)) |
#assert str(exc).find("Security") >= 0, "%s\n%s" % (exc, repr(exc)) |
20 |
|
|
21 |
def test_vet_request_ro(self): |
def test_vet_request_ro(self): |
191 |
extra_args = '-r now', |
extra_args = '-r now', |
192 |
success = 0) |
success = 0) |
193 |
|
|
194 |
|
def test_restrict_bug(self): |
195 |
|
"""Test for bug 14209 --- mkdir outside --restrict arg""" |
196 |
|
Myrm('testfiles/output') |
197 |
|
self.secure_rdiff_backup('testfiles/various_file_types', |
198 |
|
'testfiles/output', 1, |
199 |
|
'--restrict foobar', success = 0) |
200 |
|
output = rpath.RPath(Globals.local_connection, 'testfiles/output') |
201 |
|
assert not output.lstat() |
202 |
|
|
203 |
|
|
204 |
if __name__ == "__main__": unittest.main() |
if __name__ == "__main__": unittest.main() |
205 |
|
|