Esempio n. 1
0
    def test_actions_on_disabled(self, p):
        """ disabled SoftChroot should not change args on apply and revoke """
        sc = SoftChroot(None)
        a = sc.apply(p)
        self.assertEqual(a, p)

        r = sc.revoke(p)
        self.assertEqual(r, p)
Esempio n. 2
0
    def test_actions_on_disabled(self, p):
        """ softchroot: disabled SC, apply and revoke should not change args """
        sc = SoftChroot(None)
        a = sc.apply(p)
        self.assertEqual(a, p)

        r = sc.revoke(p)
        self.assertEqual(r, p)
Esempio n. 3
0
    def test_apply_out_of_root(self, p, e):
        """ softchroot: apply to paths outside of the chroot """
        chroot = '/tmp/'
        sc = SoftChroot(chroot)
        a = sc.apply(p)

        # !!! Important thing for compatibility with non-soft-chroot:
        # !!! the path outside of chroot should be the same, but with chroot prefix!!
        self.assertEqual(a, e)
Esempio n. 4
0
 def test_apply_out_of_root(self, p):
     """ apply SoftChroot to paths outside of the chroot """
     sc = SoftChroot('/tmp/')
     a = sc.apply(p)
     self.assertEqual(a, '/')
Esempio n. 5
0
 def test_apply(self, p, e):
     """ apply SoftChroot """
     sc = SoftChroot('/tmp/')
     a = sc.apply(p)
     self.assertEqual(a, e)
Esempio n. 6
0
 def test_apply_to_chroot_without_slash(self, chroot_root, path, exp):
     """ softchroot: apply to the chroot path without trailing slash """
     sc = SoftChroot(chroot_root)
     a = sc.apply(path)
     self.assertEqual(a, exp)
Esempio n. 7
0
 def test_apply(self, p, e):
     """ softchroot: apply """
     sc = SoftChroot('/tmp/')
     a = sc.apply(p)
     self.assertEqual(a, e)
Esempio n. 8
0
 def test_apply_out_of_root(self, p):
     """ apply SoftChroot to paths outside of the chroot """
     sc = SoftChroot('/tmp/')
     a = sc.apply(p)
     self.assertEqual(a, '/')