Commit Graph

22 Commits (5ffaa693a64f23508047dee01425fd0485d95a24)

Author SHA1 Message Date
David Wilson 8a0b343760 issue #406: test for FD leak after every TestCase 6 years ago
David Wilson 51658fdd66 issue #409: name-prefix stubs so they can be added to PATH
Allows us to reference them from playbooks easily.
6 years ago
David Wilson 1eae594e32 ssh: fix check_host_keys="accept" and test; closes #411
Add real accept/enforce tests.
6 years ago
David Wilson 16ca111ebd ssh: better OpenSSH 7.5+ permission denied handling
The user@host prefix in new-style OpenSSH messages unfortunately takes
the host part from ~/.ssh/config and friends. There is no way to know
which hostname will appear in this string without parsing the OpenSSH
config, nor which username will appear.

Instead just regex it.

Add SSH stub modes to print the new/old errors and add some simple
tests.

This extends the work done in b9112a9cbb
6 years ago
David Wilson 0cf6019bac tests: rename one more stubs/ssh.py reference. 6 years ago
David Wilson 73055150f3 tests: move stub tools, into subdir, import docker_test. 6 years ago
David Wilson 7d62a53264 issue #337: ssh: disabling PTYs round 2: make it automatic. 6 years ago
David Wilson 5004207705 issue #337: ssh: support disabling PTY allocation
`.ssh(batch_mode=True)`
6 years ago
David Wilson 830a133ad6 issue #307: require partial line when matching interactive prompt.
This is a best-effort attempt to avoid SSHd banner spam from breaking
our password entry loop.

Closes #307.
6 years ago
David Wilson 6cbf34d5fe tests: another smattering of 3.x type/API fixes. 6 years ago
David Wilson 410016ff47 Initial Python 3.x port work.
* ansible: use unicode_literals everywhere since it only needs to be
  compatible back to 2.6.
* compat/collections.py: delete this entirely and rip out the parts of
  functools that require it.
* Introduce serializable Kwargs dict subclass that translates keys to
  Unicode on instantiation.
* enable_debug_logging() must set _v/_vv globals.
* cStringIO does not exist in 3.x.
* Treat IOLogger and LogForwarder input as latin-1.
* Avoid ResourceWarnings in first stage by explicitly closing fps.
* Fix preamble_size.py syntax errors.
6 years ago
David Wilson f203a91e1a tests: support CentOS Docker images.
- namespace & document test accounts in README.md
- standardize the password format everywhere, and ensure the passwords
  differ everywhere.
- Add MITOGEN_TEST_DISTRO environment variable.
6 years ago
David Wilson 2d7821b824 tests: test_stream_name: fix non-localhost Docker 6 years ago
Alex Willmer 7e01c5bed5 Import and use unittest2 without aliasing it 6 years ago
Alex Willmer e8e023ce59 Use specific TestCase assertions throughout tests
e.g. assert x == y -> self.assertEqual(x, y);
self.assertTrue(isinstance(x, y)) -> self.assertIsInstance(x, y)

These specific methods give more useful errors in the case of a test
failure.
6 years ago
Alex Willmer 17da6e9998 Use unittest2 in all tests
This allows using features such as TestCase,assertIsInstance on Python
2.6 and earlier.
6 years ago
Alex Willmer 94992940dd ssh_test: Correct hostname in SShTest.test_stream_name()
I presume that `u1704` is a relic of a bygone container/host.
6 years ago
David Wilson af6812b458 Fix context naming for sudo and via=. 6 years ago
David Wilson 3a0f03183c Simple working fakessh_test. 6 years ago
David Wilson 498f961488 Fix up a few more ssh_tests, stop sending 400 modules over network.
Defining functions in the current module was causing the entirety of
py.test and all dependencies to be sucked in.
6 years ago
David Wilson 2736592c79 First handful of functional tests for SSH against Docker. 6 years ago
David Wilson e7ff6259a3 Initial commit. 6 years ago