From: Ronan Pigott Date: Tue, 31 Dec 2024 04:17:38 +0000 (-0700) Subject: test: add session class "none" login test X-Git-Tag: v258-rc1~1652^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c31ba60983c440a19d802692d1f971e675e7aa24;p=thirdparty%2Fsystemd.git test: add session class "none" login test --- diff --git a/test/units/TEST-35-LOGIN.sh b/test/units/TEST-35-LOGIN.sh index 80320e32e17..1fc49e75b43 100755 --- a/test/units/TEST-35-LOGIN.sh +++ b/test/units/TEST-35-LOGIN.sh @@ -701,13 +701,14 @@ background_at_return() { testcase_background() { - local uid TRANSIENTUNIT1 TRANSIENTUNIT2 + local uid TRANSIENTUNIT0 TRANSIENTUNIT1 TRANSIENTUNIT2 uid=$(id -u logind-test-user) systemctl stop user@"$uid".service PAMSERVICE="pamserv$RANDOM" + TRANSIENTUNIT0="none$RANDOM.service" TRANSIENTUNIT1="bg$RANDOM.service" TRANSIENTUNIT2="bgg$RANDOM.service" @@ -722,6 +723,13 @@ session optional pam_systemd.so debug session required pam_unix.so EOF + systemd-run -u "$TRANSIENTUNIT0" -p PAMName="$PAMSERVICE" -p "Environment=XDG_SESSION_CLASS=none" -p Type=exec -p User=logind-test-user sleep infinity + + # This was a 'none' service, so logind should take no action + (! systemctl is-active user@"$uid".service ) + + systemctl stop "$TRANSIENTUNIT0" + systemd-run -u "$TRANSIENTUNIT1" -p PAMName="$PAMSERVICE" -p "Environment=XDG_SESSION_CLASS=background-light" -p Type=exec -p User=logind-test-user sleep infinity # This was a 'light' background service, hence the service manager should not be running