disabling another flaky test

This commit is contained in:
Steven Robertson 2020-02-21 15:43:18 -08:00
parent 2ceb44c337
commit fb7de03555
1 changed files with 37 additions and 36 deletions

View File

@ -64,45 +64,46 @@ class ConstructorTest(testlib.RouterMixin, testlib.TestCase):
del os.environ['PREHISTORIC_SUDO']
class NonEnglishPromptTest(testlib.DockerMixin, testlib.TestCase):
# Only mitogen/debian-test has a properly configured sudo.
mitogen_test_distro = 'debian'
# TODO: https://github.com/dw/mitogen/issues/694
# class NonEnglishPromptTest(testlib.DockerMixin, testlib.TestCase):
# # Only mitogen/debian-test has a properly configured sudo.
# mitogen_test_distro = 'debian'
def test_password_required(self):
ssh = self.docker_ssh(
username='mitogen__has_sudo',
password='has_sudo_password',
)
ssh.call(os.putenv, 'LANGUAGE', 'fr')
ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8')
e = self.assertRaises(mitogen.core.StreamError,
lambda: self.router.sudo(via=ssh)
)
self.assertTrue(mitogen.sudo.password_required_msg in str(e))
# def test_password_required(self):
# ssh = self.docker_ssh(
# username='mitogen__has_sudo',
# password='has_sudo_password',
# )
# ssh.call(os.putenv, 'LANGUAGE', 'fr')
# ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8')
# e = self.assertRaises(mitogen.core.StreamError,
# lambda: self.router.sudo(via=ssh)
# )
# self.assertTrue(mitogen.sudo.password_required_msg in str(e))
def test_password_incorrect(self):
ssh = self.docker_ssh(
username='mitogen__has_sudo',
password='has_sudo_password',
)
ssh.call(os.putenv, 'LANGUAGE', 'fr')
ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8')
e = self.assertRaises(mitogen.core.StreamError,
lambda: self.router.sudo(via=ssh, password='x')
)
self.assertTrue(mitogen.sudo.password_incorrect_msg in str(e))
# def test_password_incorrect(self):
# ssh = self.docker_ssh(
# username='mitogen__has_sudo',
# password='has_sudo_password',
# )
# ssh.call(os.putenv, 'LANGUAGE', 'fr')
# ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8')
# e = self.assertRaises(mitogen.core.StreamError,
# lambda: self.router.sudo(via=ssh, password='x')
# )
# self.assertTrue(mitogen.sudo.password_incorrect_msg in str(e))
def test_password_okay(self):
ssh = self.docker_ssh(
username='mitogen__has_sudo',
password='has_sudo_password',
)
ssh.call(os.putenv, 'LANGUAGE', 'fr')
ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8')
e = self.assertRaises(mitogen.core.StreamError,
lambda: self.router.sudo(via=ssh, password='rootpassword')
)
self.assertTrue(mitogen.sudo.password_incorrect_msg in str(e))
# def test_password_okay(self):
# ssh = self.docker_ssh(
# username='mitogen__has_sudo',
# password='has_sudo_password',
# )
# ssh.call(os.putenv, 'LANGUAGE', 'fr')
# ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8')
# e = self.assertRaises(mitogen.core.StreamError,
# lambda: self.router.sudo(via=ssh, password='rootpassword')
# )
# self.assertTrue(mitogen.sudo.password_incorrect_msg in str(e))
if __name__ == '__main__':