import os


def test_cpufreq_dt():
    "Ensure cpufreq dt platform driver is present"
    assert(os.path.exists('/sys/devices/platform/imx-cpufreq-dt'))


def test_cpufreq():
    assert("1000000" in open("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq").read())
    assert("1000000" in open("/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_min_freq").read())
    assert("1000000" in open("/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_min_freq").read())
    assert("1000000" in open("/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_min_freq").read())
    assert("1500000" in open("/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq").read())
    assert("1500000" in open("/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq").read())
    assert("1500000" in open("/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_max_freq").read())
    assert("1500000" in open("/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_max_freq").read())
