|
2 | 2 | # Licensed under the Apache V2, see LICENCE file for details. |
3 | 3 |
|
4 | 4 | import asyncio |
5 | | -from tempfile import NamedTemporaryFile |
6 | 5 |
|
7 | 6 | import pytest |
8 | 7 |
|
@@ -37,31 +36,3 @@ async def test_status(): |
37 | 36 | machine.status_message.lower() == 'running' and |
38 | 37 | machine.agent_status == 'started')), |
39 | 38 | timeout=480) |
40 | | - |
41 | | - |
42 | | -@base.bootstrapped |
43 | | -async def test_scp(): |
44 | | - # ensure that asyncio.subprocess will work; |
45 | | - try: |
46 | | - asyncio.get_child_watcher().attach_loop() |
47 | | - except RuntimeError: |
48 | | - pytest.skip('test_scp will always fail outside of MainThread') |
49 | | - async with base.CleanModel() as model: |
50 | | - await model.add_machine() |
51 | | - await asyncio.wait_for( |
52 | | - model.block_until(lambda: model.machines), |
53 | | - timeout=240) |
54 | | - machine = model.machines['0'] |
55 | | - await asyncio.wait_for( |
56 | | - model.block_until(lambda: (machine.status == 'running' and |
57 | | - machine.agent_status == 'started')), |
58 | | - timeout=480) |
59 | | - |
60 | | - with NamedTemporaryFile() as f: |
61 | | - f.write(b'testcontents') |
62 | | - f.flush() |
63 | | - await machine.scp_to(f.name, 'testfile', scp_opts='-p') |
64 | | - |
65 | | - with NamedTemporaryFile() as f: |
66 | | - await machine.scp_from('testfile', f.name, scp_opts='-p') |
67 | | - assert f.read() == b'testcontents' |
0 commit comments