From fb7de03555356b20d42ce8d5a1ac9998a09caf89 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Fri, 21 Feb 2020 15:43:18 -0800 Subject: [PATCH] disabling another flaky test --- tests/sudo_test.py | 79 +++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/tests/sudo_test.py b/tests/sudo_test.py index 9ecf103d..7a6523e5 100644 --- a/tests/sudo_test.py +++ b/tests/sudo_test.py @@ -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' - - 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_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)) +# 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_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)) if __name__ == '__main__':