40 Commits

Author SHA1 Message Date
Philip Meulengracht
521e904982 many: support user-daemons in QueryDisabledServices 2024-04-22 15:05:39 +02:00
Miguel Pires
79c5ac14b2 many: remove usages of deprecated io/ioutil package (#13768)
* many: remove usages of deprecated io/ioutil package

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>

* .golangci.yml: remove errcheck ignore rule for io/ioutil

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>

* run-checks: prevent new usages of io/ioutil

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>

---------

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2024-04-03 23:23:24 +02:00
Philip Meulengracht
e68b47746f usersession/client: support additional arguments for start/stop/restart operations, 2024-04-03 09:25:55 +02:00
Philip Meulengracht
1bad85906c o/servicestate: support for user services (#13380)
* o/servicestate: support for user services

* o/servicestate: update docstring for easier readability
2024-04-02 14:22:31 +02:00
Philip Meulengracht
c0e89916f4 usersession: implement restart controls and status querying for user services 2024-01-03 09:18:18 +01:00
Paweł Stołowski
6aee3a20e5 Merge branch 'master' into notifications/close-notification 2021-12-03 13:23:24 +01:00
Paweł Stołowski
fe92dbc522 Use atomic to avoid test race. 2021-11-29 14:51:53 +01:00
Paweł Stołowski
a3ac982b20 Use atomics for client test to avoid race when the handler is called in
parallel (thanks jhenstridge).
2021-11-29 14:47:25 +01:00
Paweł Stołowski
014b0acb66 Provide a way for usersession client to send messages only to a subset
of clients.
2021-11-29 14:47:25 +01:00
Paweł Stołowski
a4e6bd2a6f Also update client side. 2021-11-18 11:54:00 +01:00
Paweł Stołowski
b8762d2183 Also check number of calls in TestPendingRefreshNotification. 2021-11-18 10:38:58 +01:00
Paweł Stołowski
4b75efc58a Expect 2 calls to close notification handler because the test simulates
2 user sessions.
2021-11-18 10:38:57 +01:00
Paweł Stołowski
e81a8861ee Check number of close handler calls (thanks mvo). 2021-11-18 10:38:57 +01:00
Paweł Stołowski
4f7c3badc5 Implement method to close notifications via usersession agent's REST
API.
2021-11-18 10:38:57 +01:00
Alberto Mardegan
c845475185 usersession/client: add a warning about using doMany() carelessly 2021-09-20 09:19:23 +03:00
Alberto Mardegan
2ed8632eb8 usersession/client: refactor doMany() method
Add a method to issue a request to a single usersession agent; besides
making the code more readable, this will come handy in those cases when
we already know the user ID we want to talk to.
2021-09-20 09:19:23 +03:00
Zygmunt Krynicki
59d347502f usersession: add smoke test for PendingRefreshNotification client call
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2020-10-22 14:43:56 +02:00
Zygmunt Krynicki
998131244e usersession: use refreshInfo to refer to PendingSnapRefreshInfo
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2020-10-22 14:43:56 +02:00
Zygmunt Krynicki
2de348f1e9 usersession: add pending refresh notice API
The new API allows snapd to notify userd, in each session, about a
pending snap refresh. The notification carries the snap name and the
amount of time remaining, before a forced refresh occurs.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2020-10-01 08:54:51 +02:00
Michael Vogt
1bd395934b testutils: add HostScaledTimeout 2020-06-09 17:58:22 +01:00
Dimitri John Ledkov
65deccd52f tests: bump timeouts for riscv64 2020-06-09 17:58:22 +01:00
James Henstridge
6f868abccf Merge remote-tracking branch 'upstream/master' into user-daemons 2020-03-27 14:18:10 +08:00
James Henstridge
a653315a2e usersession/client: don't suppress error return for well formed service-control errors 2020-03-27 14:02:18 +08:00
Michael Vogt
70304c3433 travis.yml: run unit tests with go/master as well
* travis.yml: run unit tests with go/master as well

The unit tests of snapd are broken currently for golang-1.14. This
was observed on debian-sid. We did not catch this. To ensure we
get an early warning about failures with the latest go this PR
adds "master" to the go versions to run the unit tests against.

This commit also fixes the broken tests with 1.14
2020-03-19 09:28:01 +01:00
Michael Vogt
9016680bc8 travis.yml: run unit tests on arm64 as well
Use the new travis feature to run unit tests on arm64. This would
have caught the segfault in the rawstocketstopper code.

This also fixes two issues in usersession tests that fail often
in arm. One is the timeout of TestAgentTimeout that is not high
enough for slow arm systems for the "regular" case that should
not hit this timeout.

And then there is a "sleep 99999" in the mock for kdialog which
will cause travis to wait forever for this process to exit.
2020-03-10 17:31:34 +01:00