Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions tests/integration_tests/functional/test_kvm_ptp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,18 @@
import pytest


def test_kvm_ptp(uvm_plain_any):
def test_kvm_ptp(uvm_any_booted):
"""Test kvm_ptp is usable"""

vm = uvm_plain_any
vm = uvm_any_booted
if vm.guest_kernel_version[:2] < (6, 1):
pytest.skip("Only supported in kernel 6.1 and after")

vm.spawn()
vm.basic_config(vcpu_count=2, mem_size_mib=256)
vm.add_net_iface()
vm.start()
_, dmesg, _ = vm.ssh.check_output("dmesg |grep -i ptp")
assert "PTP clock support registered" in dmesg

vm.ssh.check_output("[ -c /dev/ptp0 ]")
# wait up to 5s to see the PTP device
vm.ssh.check_output("udevadm wait -t 5 /dev/ptp0")

# phc_ctl[14515.127]: clock time is 1697545854.728335694 or Tue Oct 17 12:30:54 2023
vm.ssh.check_output("phc_ctl /dev/ptp0 -- get")
Loading