diff --git a/src/modules/displaymanager/tests/test-dm-gdm.py b/src/modules/displaymanager/tests/test-dm-gdm.py index 778bb8fbb..4856e8af3 100644 --- a/src/modules/displaymanager/tests/test-dm-gdm.py +++ b/src/modules/displaymanager/tests/test-dm-gdm.py @@ -10,10 +10,17 @@ libcalamares.globalstorage.insert("testing", True) from src.modules.displaymanager import main default_desktop_environment = main.DesktopEnvironment("startplasma-x11", "kde-plasma.desktop") -# Specific DM test -d = main.DMgdm("/tmp") -d.have_dm() -d.set_autologin("d", True, default_desktop_environment) -# .. and again (this time checks load/save) -d.set_autologin("d", True, default_desktop_environment) -d.set_autologin("d", True, default_desktop_environment) +import os +import tempfile +with tempfile.TemporaryDirectory(prefix="calamares-gdm") as tempdir: + os.makedirs(tempdir + "/usr/bin") + os.makedirs(tempdir + "/etc/gdm3") + with open(tempdir + "/usr/bin/gdm3", "w") as f: + f.write("#! /bin/sh\n:\n") + # Specific DM test + d = main.DMgdm(tempdir) + assert(d.have_dm()) + d.set_autologin("d", True, default_desktop_environment) + # .. and again (this time checks load/save) + d.set_autologin("d", True, default_desktop_environment) + d.set_autologin("d", True, default_desktop_environment)