Commit Graph

26 Commits

Author SHA1 Message Date
David Wilson 9fe14e841c parent: reap the child process if connection fails
For example if no response is received in :attr:`connect_timeout`
seconds, the child would be left running.
2018-04-21 15:01:23 +00:00
David Wilson 41d2661ecb tests: fix sudo rule order. 2018-04-17 13:16:40 +01:00
David Wilson 6614d17021 tests: explicit sudo rules to require password from sudo_nopw
This account is used on Travis. It needs to be forced to type passwords
in some cases
2018-04-17 12:41:49 +01:00
David Wilson ba8022424b tests: more work to standardize user accounts. 2018-04-16 18:35:13 +01:00
David Wilson ce6fb05d87 tests: 'fix' responder test.
Needs a complete rewrite, but this will do for now.
2018-04-16 16:59:45 +01:00
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.
2018-04-16 14:24:39 +01:00
Alex Willmer 48623763d6 minimize_source: Implement reindentation 2018-03-31 16:53:08 +01:00
Alex Willmer 556ee2aec6 minimize_source: Handling indentation
In the case that string(s) are replaced, any indent or dedent tags must
be re-inserted after the replacemnts.
2018-03-31 14:25:37 +01:00
Alex Willmer 36c5ff1d05 minimize_source: Make comments test invariant on hashbang/coding handling
strip_comments() currently ignores comments on lines 1 and 2, in order
to preserve lines such as

The comments test had normal comments on those lines, hence it was
failing.
2018-03-31 14:23:29 +01:00
Alex Willmer 35ae4e4227 Issue #160: Add minimize_source testcases 2018-03-31 11:12:55 +01:00
Alex Willmer e3b700b553 tests: Fix no such option -o running FakeSsh.test_okay()
Full output of failed test

```
ERROR: test_okay (__main__.FakeSshTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/ssh_test.py", line 16, in test_okay
    ssh_path=testlib.data_path('fakessh.py'),
  File "/home/alex/src/mitogen/mitogen/master.py", line 650, in ssh
    return self.connect('ssh', **kwargs)
  File "/home/alex/src/mitogen/mitogen/parent.py", line 463, in connect
    return self._connect(context_id, klass, name=name, **kwargs)
  File "/home/alex/src/mitogen/mitogen/parent.py", line 449, in _connect
    stream.connect()
  File "/home/alex/src/mitogen/mitogen/ssh.py", line 104, in connect
    super(Stream, self).connect()
  File "/home/alex/src/mitogen/mitogen/parent.py", line 395, in connect
    self._connect_bootstrap()
  File "/home/alex/src/mitogen/mitogen/ssh.py", line 116, in
_connect_bootstrap
    time.time() + 10.0):
  File "/home/alex/src/mitogen/mitogen/parent.py", line 207, in
iter_read
    (''.join(bits)[-300:],)
mitogen.core.StreamError: EOF on stream; last 300 bytes received:
'Usage: fakessh.py [options]\n\nfakessh.py: error: no such option: -o\n'
```
2018-03-19 21:58:34 +05:45
Alex Willmer 4fb1b928b7 Adjust unittest for master -> parent split
Tests should now match changes in
4d31300dd0
2018-03-19 21:58:29 +05:45
David Wilson b2909ee5f4 Replace nasty print statements in six_brokenpkg. 2018-03-19 21:58:28 +05:45
Alex Willmer 3831ac360f Replace all calls to file() with open()
Although these are synonyms in Python 2.x, when using MyPy to typecheck
code use of file() causes spurious errors.

This commit also serves as one small step to Python 3.x compatibility,
since 3.x removes the file() builtin.
2018-03-19 21:58:27 +05:45
David Wilson 15bf0f54e2 Beginnings of module_finder_test 2018-03-19 21:35:37 +05:45
David Wilson 750e9fab24 Make log_to_file accept string level rather than logging package constant
Saves an import, pain in the ass to type all the time.
2018-03-19 21:35:35 +05:45
David Wilson 1411790f56 master: make write_all() handle O_NONBLOCK and deadlines. 2018-03-19 21:35:35 +05:45
David Wilson db225638f0 core: Make iter_read() handle deadline (and non-blocking IO) properly 2018-03-19 21:35:35 +05:45
David Wilson c67119501b Keep allocate_id() in the enhanced router class. 2018-03-19 21:35:35 +05:45
David Wilson 4720eb1c55 core: add ALLOCATE_ID message for fakessh. 2018-03-19 21:35:35 +05:45
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.
2018-03-19 21:35:35 +05:45
David Wilson e2d3ac9b6a Fixup some more tests. 2018-03-19 21:35:35 +05:45
David Wilson 91ff12f8d8 Import Docker build script for integration tests 2018-03-19 21:35:17 +05:45
David Wilson 1f99dcb435 fix unbelievably dumb variable shadowing 2018-03-19 21:35:17 +05:45
David Wilson 25e4724bac A few more mitogen.slave/master changes 2018-03-19 21:35:17 +05:45
David Wilson e7ff6259a3 Initial commit. 2018-03-19 21:35:13 +05:45