[displaymanager] Add tests that run parts of the DM code
- load and set autologin for greetd (this was used to shake out code bugs in load/save) - load and set autologin for sddm
This commit is contained in:
parent
2c186132cd
commit
f3e85efd41
10
src/modules/displaymanager/tests/CMakeTests.txt
Normal file
10
src/modules/displaymanager/tests/CMakeTests.txt
Normal file
@ -0,0 +1,10 @@
|
||||
# We have tests to load (some) of the DMs specifically, to test their
|
||||
# configuration code. Those tests conventionally live in Python
|
||||
# files here in the tests/ directory. Add them.
|
||||
foreach(_dmname greetd sddm)
|
||||
add_test(
|
||||
NAME configure-displaymanager-${_dmname}
|
||||
COMMAND env PYTHONPATH=.: python3 ${CMAKE_CURRENT_LIST_DIR}/test-dm-${_dmname}.py
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
endforeach()
|
18
src/modules/displaymanager/tests/test-dm-greetd.py
Normal file
18
src/modules/displaymanager/tests/test-dm-greetd.py
Normal file
@ -0,0 +1,18 @@
|
||||
# Calamares Boilerplate
|
||||
import libcalamares
|
||||
libcalamares.globalstorage = libcalamares.GlobalStorage(None)
|
||||
libcalamares.globalstorage.insert("testing", True)
|
||||
# Module prep-work
|
||||
import os
|
||||
os.makedirs("/tmp/etc/greetd/", exist_ok=True)
|
||||
try:
|
||||
os.remove("/tmp/etc/greetd/config.toml")
|
||||
except FileNotFoundError as e:
|
||||
pass
|
||||
# Module test
|
||||
from src.modules.displaymanager import main
|
||||
d = main.DMgreetd("/tmp")
|
||||
d.set_autologin("d", True, "kde")
|
||||
# .. and again (this time checks load/save)
|
||||
d.set_autologin("d", True, "kde")
|
||||
d.set_autologin("d", True, "kde")
|
12
src/modules/displaymanager/tests/test-dm-sddm.py
Normal file
12
src/modules/displaymanager/tests/test-dm-sddm.py
Normal file
@ -0,0 +1,12 @@
|
||||
# Calamares Boilerplate
|
||||
import libcalamares
|
||||
libcalamares.globalstorage = libcalamares.GlobalStorage(None)
|
||||
libcalamares.globalstorage.insert("testing", True)
|
||||
# Module prep-work
|
||||
# Module test
|
||||
from src.modules.displaymanager import main
|
||||
d = main.DMsddm("/tmp")
|
||||
d.set_autologin("d", True, "kde")
|
||||
# .. and again (this time checks load/save)
|
||||
d.set_autologin("d", True, "kde")
|
||||
d.set_autologin("d", True, "kde")
|
Loading…
Reference in New Issue
Block a user