1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-25 01:34:28 +03:00
Commit Graph

43 Commits

Author SHA1 Message Date
Mike Yuan
a37928d34c
TEST-35-LOGIN: test changes to list-sessions 2024-01-17 11:30:05 +08:00
Lennart Poettering
3b52ef6f00 test: add integration test for new 'background-light' session class 2024-01-11 17:47:41 +01:00
Lennart Poettering
4cb4e6cf6d pam_systemd: register systemd user service manager as class='manager'
Now that we have thew new class, start making us of it in pam_systemd.so
when running for user@.service.
2024-01-11 17:23:47 +01:00
Mike Yuan
5446a52b39
TEST-35-LOGIN: enable FileDescriptorStorePreserve= for coldplug test 2024-01-04 17:14:23 +08:00
Mike Yuan
cd4dd90b99
logind: introduce Sleep() call and action that automatically choose a sleep operation 2023-12-05 22:18:32 +08:00
Lennart Poettering
8bfa22f079 loginctl: set appropriate ersatz strings for all tables 2023-11-28 11:33:01 +01:00
Michael Biebl
6f9409eebb test: use kill-whom instead of kill-who (the latter is deprecated) 2023-10-12 13:06:12 +09:00
Zbigniew Jędrzejewski-Szmek
1c5d54b2df test: use 'until' instead of 'while !'
In general, it's better to avoid a negation. And "!" is special, because it is
used for history expansion, i.e. the same command would behave differently if
pasted on the command line.

Inspired by 4a899c5a23.
2023-09-06 19:54:29 +01:00
Frantisek Sumsal
07268394d6 test: unify /testok & /failed handling
And drop it where not necessary.
2023-07-12 16:03:40 +02:00
Zbigniew Jędrzejewski-Szmek
e80444729f tests: drop unnecessary redirection of stderr
command -v doesn't print anything to stderr, let's use the canonical
form with just >/dev/null.
2023-05-30 16:04:35 +02:00
David Tardon
556723e738 loginctl: show session idle status in list-sessions 2023-05-24 10:04:45 +02:00
David Tardon
98a155962d test: extend test for loginctl list-* 2023-05-23 09:29:21 +02:00
Luca Boccassi
b1f17f78e3
Merge pull request #27739 from dtardon/test-session-properties
Add a test for org.freedesktop.logind1.Session SetIdleHint
2023-05-22 23:55:25 +01:00
David Tardon
b4ad59596d login: do not hardcode tty used in TEST-35-LOGIN
The test can be run manually outside of CI.
2023-05-22 21:13:15 +02:00
Frantisek Sumsal
7234a2131b test: use run_testcases() in a few more places 2023-05-22 16:02:49 +02:00
Frantisek Sumsal
587ae50d55 test: add a missing session activation
Otherwise test_list_user_sessions() would fail unless ordered after
test_session(), which activates the session.
2023-05-22 16:02:49 +02:00
Frantisek Sumsal
e71bac7222 test: make shellcheck happy again
No functional changes.
2023-05-16 23:07:45 +02:00
Frantisek Sumsal
cb153b4fe9 test: rename assert.sh to util.sh
So we can extend it with additional utility functions without making it
confusing.

No functional change.
2023-05-16 22:43:52 +02:00
Mike Yuan
306ff2e297
test: add test for state in loginctl list-{users,sessions} 2023-05-16 18:09:15 +08:00
Zbigniew Jędrzejewski-Szmek
4481a30855 test: use idiomatic bash loop iteration
In a few cases, also avoid a sleep in the last (failed) iteration of the loop.
It doesn't matter too much, but it's still ugly.
2023-04-24 21:59:28 +02:00
Dmitry V. Levin
e873a9f18a treewide: fix unnecessary $ on arithmetic variables
This should fix shellcheck warning SC2004.
2023-04-01 01:48:44 +08:00
Franck Bui
26c2b30277 test: install unit tests in a dedicated subdirectory below '$testsdir'
/usr/lib/systemd/tests may contain more than the unit tests. For example on
SUSE we also install the integration tests there.

Putting the unit tests in a dedicated directory named 'unit-tests' makes the
layout cleaner.

Note that `run-unit-tests.py` has not been moved so we don't need to adjust
(Fedora) packaging and users also don't need to descend into the subdirectory.
2023-03-24 14:08:57 +01:00
Lennart Poettering
d7fce219ae test: test setting ambient caps via pam_systemd.so 2023-02-28 21:42:29 +01:00
Frantisek Sumsal
70e9066bc2 test: add a couple of sanity tests for loginctl 2022-11-01 17:32:17 +01:00
Michal Sekletar
5aa633db22 tests: add test for StopIdleSessionSec= option 2022-08-24 14:50:52 +02:00
Yu Watanabe
3cf9c51e97 test: restart logind before cleaning up sessions
Hopefully, fixes #24040.
2022-07-31 00:15:47 +09:00
Yu Watanabe
54d5c126d3 test: do not restart getty@tty2 automatically 2022-07-31 00:15:47 +09:00
Yu Watanabe
fe9d58b25a test: terminate session and user on cleanup 2022-07-31 00:15:47 +09:00
Yu Watanabe
8015e25870 test: wait for user service or slice to be finished
Hopefully fixes #24040.
2022-07-22 19:47:09 +00:00
David Tardon
283db37a20 test: merge grep | awk calls 2022-07-17 20:26:09 +02:00
David Tardon
6083f7a604 test: add a simple test for list-users 2022-07-17 20:26:09 +02:00
Michal Sekletar
527e0e8188 Revert "tests: add test for handling of background sessions"
This reverts commit bf40417c7c.
2022-07-14 11:07:13 +02:00
David Tardon
9ac0855b61 test: add test for org.freedesktop.login1.Session SetType 2022-07-13 13:53:13 +02:00
David Tardon
bd681a7eb0 test: ensure cleanup functions return success
Otherwise the return value of the last command is propagated, which may
cause spurious test failures. E.g., pkill returns 1 if no process
matched, which may be a problem in cleanup session:

cleanup_session() {
...

    pkill -u "$(id -u logind-test-user)"
    sleep 1
    pkill -KILL -u "$(id -u logind-test-user)"
}

If there are no remaining processes when the final pkill runs, it will
return 1 and therefore cleanup_session will return 1 as well.
2022-07-13 13:53:13 +02:00
Yu Watanabe
9d9fd4ad0a test: start test user session before idle action setting is changed
Otherwise, idle action may be triggered before starting the test user
session.

This also introduce create_session() and cleanup_session() helper
functions.

Fixes #23952.
2022-07-08 16:14:38 +00:00
Yu Watanabe
63663a0f0f test: several cleanups for TEST-35-LOGIN
- use test_append_files() to install additional commands
- drop use of expect
- include assert.sh and use assertions at several places
- use timeout command at several places
- always use logind-test-user
- etc
2022-07-07 13:15:00 +00:00
Michal Sekletar
bf40417c7c tests: add test for handling of background sessions 2022-07-07 10:11:43 +09:00
Yu Watanabe
948fce5118 test: fix typo 2022-07-07 09:33:11 +09:00
Michal Sekletar
181656fc0f tests: verify that Lock D-Bus signal is sent when IdleAction=lock 2022-07-04 14:22:15 +02:00
Yu Watanabe
172cbcdc8b tree-wide: fix typo 2022-06-15 14:50:34 +09:00
Yu Watanabe
6243063824 test: use trap RETURN 2022-06-14 21:08:04 +09:00
Yu Watanabe
2f34ee3329 test: insert space in for loop 2022-06-14 21:05:10 +09:00
Yu Watanabe
9c94ab0f6f test: import logind test from debian/ubuntu test suite 2022-06-10 15:44:10 +09:00