예제 #1
0
 def test_check_unsafe_path(self):
     if not tests_utils.coreutils_readlink_available():
         self.skipTest("coreutils readlink(1) unavailable")
     vfs = vfsimpl.VFSLocalFS(self.rawfile)
     vfs.imgdir = "/foo"
     self.assertRaises(exception.Invalid, vfs._canonical_path,
                       'etc/../../../something.conf')
예제 #2
0
 def test_check_safe_path(self):
     if not tests_utils.coreutils_readlink_available():
         self.skipTest("coreutils readlink(1) unavailable")
     vfs = vfsimpl.VFSLocalFS(self.rawfile)
     vfs.imgdir = "/foo"
     ret = vfs._canonical_path('etc/something.conf')
     self.assertEqual(ret, '/foo/etc/something.conf')
예제 #3
0
파일: test_localfs.py 프로젝트: anantk/nova
 def test_check_safe_path(self):
     if not tests_utils.coreutils_readlink_available():
         self.skipTest("coreutils readlink(1) unavailable")
     vfs = vfsimpl.VFSLocalFS(self.rawfile)
     vfs.imgdir = "/foo"
     ret = vfs._canonical_path('etc/something.conf')
     self.assertEqual(ret, '/foo/etc/something.conf')
예제 #4
0
파일: test_localfs.py 프로젝트: anantk/nova
 def test_check_unsafe_path(self):
     if not tests_utils.coreutils_readlink_available():
         self.skipTest("coreutils readlink(1) unavailable")
     vfs = vfsimpl.VFSLocalFS(self.rawfile)
     vfs.imgdir = "/foo"
     self.assertRaises(exception.Invalid,
                       vfs._canonical_path,
                       'etc/../../../something.conf')