Revert "Remove vendored libjuju"
[osm/N2VC.git] / modules / libjuju / tests / integration / test_machine.py
index 8957ae1..070208a 100644 (file)
@@ -26,18 +26,15 @@ async def test_status(event_loop):
         assert machine.agent_status == 'pending'
         assert not machine.agent_version
 
         assert machine.agent_status == 'pending'
         assert not machine.agent_version
 
+        # there is some inconsistency in the capitalization of status_message
+        # between different providers
         await asyncio.wait_for(
         await asyncio.wait_for(
-            model.block_until(lambda: (machine.status == 'running' and
-                                       machine.agent_status == 'started' and
-                                       machine.agent_version is not None)),
+            model.block_until(
+                lambda: (machine.status == 'running' and
+                         machine.status_message.lower() == 'running' and
+                         machine.agent_status == 'started')),
             timeout=480)
 
             timeout=480)
 
-        assert machine.status == 'running'
-        # there is some inconsistency in the message case between providers
-        assert machine.status_message.lower() == 'running'
-        assert machine.agent_status == 'started'
-        assert machine.agent_version.major >= 2
-
 
 @base.bootstrapped
 @pytest.mark.asyncio
 
 @base.bootstrapped
 @pytest.mark.asyncio
@@ -61,8 +58,8 @@ async def test_scp(event_loop):
         with NamedTemporaryFile() as f:
             f.write(b'testcontents')
             f.flush()
         with NamedTemporaryFile() as f:
             f.write(b'testcontents')
             f.flush()
-            await machine.scp_to(f.name, 'testfile')
+            await machine.scp_to(f.name, 'testfile', scp_opts='-p')
 
         with NamedTemporaryFile() as f:
 
         with NamedTemporaryFile() as f:
-            await machine.scp_from('testfile', f.name)
+            await machine.scp_from('testfile', f.name, scp_opts='-p')
             assert f.read() == b'testcontents'
             assert f.read() == b'testcontents'