Commit Graph

31 Commits (fba52a0edfbb6966213692a582c1ae39df713165)

Author SHA1 Message Date
David Wilson 9d070541d9 ansible: try to create tempdir if missing.
Closes #358.
6 years ago
David Wilson 46ec0ffcaf tests: log original traceback in assertRaises(). 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 6e0883f369 issue #275: tests: fix bug in 2.6 compat check_output(), ignore it for >2.6. 7 years ago
David Wilson 3b1cc3676c issue #275: ssh_debug_level=3 for tests 7 years ago
David Wilson 38d69a6ecd issue #275: tests: drop docker client dep, doesn't run on 2.6. 7 years ago
David Wilson 7d9b7eec0c tests: must wrap log_to_file() in is_master
Without it, end up with a billion loggers attached in some tests
7 years ago
David Wilson 6109de51a0 tests: Ansible SSH timeout test
Also change Docker image to new 'mitogen' organization.
7 years ago
David Wilson d4d4f46006 tests: update check_host_keys parameter style in testlib. 7 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.
7 years ago
David Wilson 35fdd97f9a issue #164: utility to print Docker hostname for use from shell scripts. 7 years ago
David Wilson 40b978c9b7 core: Fix source verification.
Previously:

* src_id could be spoofed
* auth_id was checked but the message was still delivered!
7 years ago
David Wilson 1ff27ada49 Add maximum message size checks. Closes #151. 7 years ago
David Wilson 03fcf057dd tests: just call log_to_file() from testlib
Now we can run test.sh with MITOGEN_LOG_LEVEL=debug and things just
work.
7 years ago
David Wilson ec1de4b4b9 tests: ensure strace is available in the docker image..
..and enable privileged=True since that's needed for ptrace()
7 years ago
Alex Willmer 7e01c5bed5 Import and use unittest2 without aliasing it 7 years ago
Alex Willmer df9556d1d9 Replace custom assertContains() with unitest2 assertIn() 7 years ago
Alex Willmer 17da6e9998 Use unittest2 in all tests
This allows using features such as TestCase,assertIsInstance on Python
2.6 and earlier.
7 years ago
R W H Bricheno df61f6ab4d Prevent MacOS exception on shutdown of closed socket. 7 years ago
David Wilson 65defaa354 tests: initial first_stage_test. 7 years ago
Alex Willmer 8dcfb1b7f7 testlib: Auto negotiate Docker API version
Ubuntu 17.04 provides Docker 1.12.6, which has API version 1.24.
`dev_requirements.txt` specifies the docker-py 2.5.1, which by default
requests API version 1.30.

Hence when the SSH unit tests try to run the container specified in
`DockerizedSshDaemon` an error occurs

```
APIError: 400 Client Error: Bad Request ("client is newer than server
(client API version: 1.30, server API version: 1.24)")
```
7 years ago
Alex Willmer dfc7b85504 testlib: Wait for sshd before running tests
On Ubuntu 17.10 something (probably Docker) appears to be accepting
connections, before sshd is fully ready. This results in a race
condition, and hence connection errors for the first few tests (2-3 on
my laptop).

testlib.wait_for_port() checks not only that the port can be connected
to, but also something resembling the sshd banner is sent.

Fixes #51
7 years ago
David Wilson 17a05dc14f Try to be compatible with older Docker daemons; (hopefully) closes #46 7 years ago
David Wilson dfe68b33d6 Handle docker running on localhost. 7 years ago
David Wilson bc801bc2ed Allow call_function_test to succeed depite testlib import. 7 years ago
David Wilson bcae62c682 issue #20: TestCase subclass with a nicer assertRaises 7 years ago
David Wilson 3a0f03183c Simple working fakessh_test. 7 years ago
David Wilson e2d3ac9b6a Fixup some more tests. 7 years ago
David Wilson b51e41edb5 Working DockerMixin for tests. 7 years ago
David Wilson e7ff6259a3 Initial commit. 7 years ago