Skip to content

Commit

Permalink
test: sync fs before checking for output file
Browse files Browse the repository at this point in the history
It can happen that we check for the file before `socat` has written it
in the filesystem.

Sync before checking.

Signed-off-by: Pablo Barbáchano <[email protected]>
  • Loading branch information
pb8o committed Jan 23, 2025
1 parent d28ef60 commit a7a691a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/integration_tests/functional/test_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,8 @@ def test_tap_offload(uvm_any):
)

# Try to send a UDP message from host with UDP offload enabled
cmd = f"ip netns exec {vm.ssh.netns} python3 ./host_tools/udp_offload.py {vm.ssh.host} {port}"
utils.check_output(cmd)
vm.netns.check_output(f"python3 ./host_tools/udp_offload.py {vm.ssh.host}")

# Check that the server received the message
ret = vm.ssh.run(f"cat {out_filename}")
ret = vm.ssh.run(f"sync ; cat {out_filename}")
assert ret.stdout == message, f"{ret.stdout=} {ret.stderr=}"

0 comments on commit a7a691a

Please sign in to comment.