generated from jumpstarter-dev/jumpstarter-devspace
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_target.py
36 lines (31 loc) · 1.16 KB
/
test_target.py
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
import os
import sys
import time
import pytest
from jumpstarter_testing.pytest import JumpstarterTest
from jumpstarter_imagehash import ImageHash
class TestExample(JumpstarterTest):
@pytest.fixture()
def console(self, client):
with client.interface.console.pexpect() as console:
if os.environ.get("DEBUG_CONSOLE"):
console.logfile_read = sys.stdout.buffer
yield console
def test_boot_login(self, client, console):
client.interface.power.off()
time.sleep(1)
client.interface.storage.dut()
client.interface.power.on()
console.expect("login:", timeout=240)
console.sendline("redhat")
console.expect("Password:", timeout=30)
console.sendline("redhat")
def test_boot_image(self, client):
# at this point the target is booted, we just take the image
#image = client.video.snapshot()
#image.save("expected.jpg")
hasher = ImageHash(client.video)
hasher.assert_snapshot("expected.jpg")
def test_devices_in_place(self, client, console):
console.sendline("ls /dev/nv*")
console.expect("/dev/nvhost-gpu")