aboutsummaryrefslogtreecommitdiffstats
path: root/tests/edid.py
blob: 6a21bf7bdaa31dd2707ba78795503559de2a31a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
# edid tests
#

# stdlib
import os
import time
from shutil import copyfile

# avocado
import avocado

# my bits
from drminfo import TestDRM

class EDID(TestDRM):
    """
    edid test

    :avocado: tags=x86_64
    """

    timeout = 60

    def run_edid_test(self, vga):

        self.boot_gfx_vm("%s,edid=on" % vga);
        self.console_prepare();

        self.console_run('edid-decode /sys/class/drm/card0-Virtual-1/edid')
        edid = self.console_wait('---root---')
        self.write_text(vga, "edid", edid)
        if edid.find("QEMU Monitor") < 0:
            self.fail("edid not valid")

    @avocado.skipUnless(os.path.exists('/usr/bin/dracut'), "no dracut")
    @avocado.skipUnless(os.path.exists('/usr/bin/edid-decode'), "no edid-decode")
    def setUp(self):
        TestDRM.setUp(self);
        if not os.path.isfile(self.initrd):
            self.prepare_kernel_initrd()

    def test_stdvga(self):
        vga = "VGA"
        self.run_edid_test(vga)

    def test_bochs_dpy(self):
        vga = 'bochs-display'
        self.run_edid_test(vga)

    def test_virtio_vga(self):
        vga = 'virtio-vga'
        self.run_edid_test(vga)

    def test_virtio_gpu(self):
        vga = 'virtio-gpu-pci'
        self.run_edid_test(vga)