|
7 | 7 | import platform
|
8 | 8 | import re
|
9 | 9 | import shutil
|
10 |
| -import time |
11 | 10 | from pathlib import Path
|
12 | 11 |
|
13 | 12 | import pytest
|
@@ -164,7 +163,7 @@ def test_config_start_no_api_exit(uvm_plain, vm_config_file):
|
164 | 163 | test_microvm.jailer.extra_args.update({"no-api": None})
|
165 | 164 |
|
166 | 165 | test_microvm.spawn() # Start Firecracker and MicroVM
|
167 |
| - time.sleep(3) # Wait for startup |
| 166 | + test_microvm.wait_for_up() |
168 | 167 | test_microvm.ssh.run("reboot") # Exit
|
169 | 168 |
|
170 | 169 | test_microvm.mark_killed() # waits for process to terminate
|
@@ -266,7 +265,7 @@ def test_config_start_with_limit(uvm_plain, vm_config_file):
|
266 | 265 | response += '{ "error": "Request payload with size 260 is larger than '
|
267 | 266 | response += "the limit of 250 allowed by server.\n"
|
268 | 267 | response += 'All previous unanswered requests will be dropped." }'
|
269 |
| - _, stdout, _stderr = utils.check_output(cmd) |
| 268 | + _, stdout, _ = utils.check_output(cmd) |
270 | 269 | assert stdout.encode("utf-8") == response.encode("utf-8")
|
271 | 270 |
|
272 | 271 |
|
@@ -420,8 +419,7 @@ def test_config_start_and_mmds_with_api(uvm_plain, vm_config_file):
|
420 | 419 |
|
421 | 420 | # Network namespace has already been created.
|
422 | 421 | test_microvm.spawn()
|
423 |
| - |
424 |
| - assert test_microvm.state == "Running" |
| 422 | + test_microvm.wait_for_up() |
425 | 423 |
|
426 | 424 | data_store = {
|
427 | 425 | "latest": {
|
@@ -480,6 +478,7 @@ def test_with_config_and_metadata_no_api(uvm_plain, vm_config_file, metadata_fil
|
480 | 478 | _configure_network_interface(test_microvm)
|
481 | 479 | test_microvm.jailer.extra_args.update({"no-api": None})
|
482 | 480 | test_microvm.spawn()
|
| 481 | + test_microvm.wait_for_up() |
483 | 482 |
|
484 | 483 | # Get MMDS version and IPv4 address configured from the file.
|
485 | 484 | version, ipv4_address = _get_optional_fields_from_file(vm_config_file)
|
|
0 commit comments