1c1
< import unittest
---
> import pytest
10,13c10,12
< def test_python_isolation_chroot(self):
< if not self.is_su:
< print('requires root')
< raise unittest.SkipTest()
---
> def test_python_isolation_chroot(self, is_su):
> if not is_su:
> pytest.skip('requires root')
16c15
< 'rootfs': self.testdir,
---
> 'rootfs': self.temp_dir,
21c20
< self.assertEqual(self.get()['status'], 200, 'python chroot')
---
> assert self.get()['status'] == 200, 'python chroot'
25,29c24,27
< self.assertEqual(
< self.getjson(url='/?path=' + self.testdir)['body']['FileExists'],
< False,
< 'testdir does not exists in rootfs',
< )
---
> assert (
> self.getjson(url='/?path=' + self.temp_dir)['body']['FileExists']
> == False
> ), 'temp_dir does not exists in rootfs'
31,35c29,32
< self.assertEqual(
< self.getjson(url='/?path=/proc/self')['body']['FileExists'],
< False,
< 'no /proc/self',
< )
---
> assert (
> self.getjson(url='/?path=/proc/self')['body']['FileExists']
> == False
> ), 'no /proc/self'
37,41c34,36
< self.assertEqual(
< self.getjson(url='/?path=/dev/pts')['body']['FileExists'],
< False,
< 'no /dev/pts',
< )
---
> assert (
> self.getjson(url='/?path=/dev/pts')['body']['FileExists'] == False
> ), 'no /dev/pts'
43,47c38,41
< self.assertEqual(
< self.getjson(url='/?path=/sys/kernel')['body']['FileExists'],
< False,
< 'no /sys/kernel',
< )
---
> assert (
> self.getjson(url='/?path=/sys/kernel')['body']['FileExists']
> == False
> ), 'no /sys/kernel'
51,57c45,47
< self.assertEqual(
< ret['body']['FileExists'], True, 'application exists in rootfs',
< )
<
<
< if __name__ == '__main__':
< TestPythonIsolation.main()
---
> assert (
> ret['body']['FileExists'] == True
> ), 'application exists in rootfs'