Merge "Fix _FunctionalBase.test_run_as"

This commit is contained in:
Zuul 2024-09-13 15:01:15 +00:00 committed by Gerrit Code Review
commit 8ea880af3f

View File

@ -111,11 +111,11 @@ later_install_cmd: CommandFilter, %s, root
# Should run as 'nobody' # Should run as 'nobody'
code, out, err = self.execute(['id', '-u']) code, out, err = self.execute(['id', '-u'])
self.assertEqual('%s\n' % pwd.getpwnam('nobody').pw_uid, out) self.assertEqual(pwd.getpwnam('nobody').pw_uid, int(out.strip()))
# Should run as 'root' # Should run as 'root'
code, out, err = self.execute(['sh', '-c', 'id -u']) code, out, err = self.execute(['sh', '-c', 'id -u'])
self.assertEqual('0\n', out) self.assertEqual(0, int(out.strip()))
class RootwrapTest(_FunctionalBase, testtools.TestCase): class RootwrapTest(_FunctionalBase, testtools.TestCase):