1142 Commits

Author SHA1 Message Date
Philip Meulengracht
0dde00cdbd o/auth: rename NewUserData to NewUserParams 2022-10-04 13:35:45 +02:00
Philip Meulengracht
aa5b512e0a multiple: refactor arguments given to NewUser into a struct instead 2022-08-26 11:14:16 +02:00
Miguel Pires
a5068a4dd3 daemon: rename form fields 2021-11-18 10:42:59 +00:00
Miguel Pires
e77052e696 daemon: write formdata file parts to snaps dir
The multipart stdlib writes formdata file parts (above a limit) to
/tmp and that could exceed the available space on devices using tmpfs.
The files would then be copied from /tmp to /var/lib/snapd/snaps.
This change adds a custom form reader that reads non-file parts into
memory and writes file parts directly to /var/lib/snapd/snaps.

https://bugs.launchpad.net/snapd/+bug/1950190
2021-11-12 15:04:57 +00:00
Samuele Pedroni
9bfe8da8ad daemon: move api_test.go to daemon_test, unexport userFromRequest
command_counter_test.go also gets moved at the same time
2021-03-16 11:42:38 +01:00
Samuele Pedroni
e1f7348ed3 daemon: move TestUsersOnlyRoot, TestLogsNoServices to the right suites
make also the necessary adjustment/simplifications
2021-03-16 11:42:38 +01:00
Samuele Pedroni
2de27f7974 daemon: move /v2/login|logout tests to api_users_test.go
some bits of apiBaseTest can also be moved as they are strictly used
only for these
2021-03-10 18:49:23 +01:00
Samuele Pedroni
19d9f556c5 daemon: move errToResponse tests out of api_test.go
to either api_snaps_test.go or response_test.go
2021-03-10 18:24:10 +01:00
Samuele Pedroni
865451542e daemon: drop unused/obsolete bits: LeaveOld, licenseData 2021-02-17 18:12:15 +01:00
Samuele Pedroni
14981762c4 daemon: move postSnap and inst.dispatch tests to api_snaps_test.go 2021-02-08 20:25:30 +01:00
Samuele Pedroni
78463cfc72 daemon: move query /snaps/name tests to api_snaps_test.go 2021-01-27 13:57:47 +01:00
Samuele Pedroni
dc4a7dc3ce daemon: start splitting snaps op tests out of api_test.go
this splits /v2/snaps GET and POST tests out of api_test.go
to api_snaps_test.go and api_sideload_n_try_test.go

api.go itself isn't split yet similarly but to clean test writing
two changes were made

* introduction of snapInstruction.dispatchForMany used in postSnaps
  as well
* changed trySnap signature

some imports in api_snaps_test.go are commented out atm,
they were copied from api_test.go and most of them will likely
come back soon
2020-12-08 18:53:58 +01:00
Samuele Pedroni
50761553da daemon: split icon retrieval support to its own api_*.go files 2020-12-08 09:53:13 +01:00
Samuele Pedroni
40d679f925 daemon: split find support to its own api_*.go files 2020-12-07 23:05:06 +01:00
Samuele Pedroni
5b77342654 daemon: split aliases support to its own api_*.go files 2020-12-04 21:01:17 +01:00
Samuele Pedroni
d976b4b2fe daemon: split unsupported buy implementation to its own api_*.go files
have a TODO about the fact that all of this could be just made
to return errors
2020-12-02 22:50:26 +01:00
Samuele Pedroni
92904c8057 daemon: split out snap configuration support to its own api_*.go files 2020-12-01 20:20:48 +01:00
Samuele Pedroni
4be502f3ac daemon: split out snapctl support to its own api_*.go files 2020-12-01 18:28:24 +01:00
Samuele Pedroni
001facd215 daemon: split apps and logs endpoints to api_apps.go and tests 2020-11-30 21:45:48 +01:00
Samuele Pedroni
00593950ab daemon: split out /v2/interfaces to api_interfaces_test.go
make it live in daemon_test, also do the same for api_connections.go

they both share the interfacesSuite
2020-11-26 17:20:00 +01:00
Samuele Pedroni
d8223e56c2 daemon: move general api to api_general*.go
This moves general APIs (that are not specific to some entity
or concept in snapd) to api_general.go and api_general_test.go
from api.go/api_test.go.
2020-11-24 21:05:38 +01:00
Samuele Pedroni
59cad6bc49 daemon: move api_users_test.go to daemon_test
export some bits of APIBaseSuite for this (at least for now)

move a couple of tests back to api_test.go temporarely
2020-11-20 20:51:29 +01:00
Samuele Pedroni
df8ca3c330 daemon: move apiBaseSuite to its own api_base_test.go
APIBaseSuite will be used for a while both from daemon
an daemon_test, so opt to make some field exported
for now at least

also use AddCleanup more and correctly

some cleanups in api_users_test.go in preparation to make
live in daemon_test
2020-11-20 20:16:42 +01:00
Pawel Stolowski
de22e00a2e o/snapstate,servicestate: use service-control task for service actions (9/9) (#8960)
This PR finalizes changes to the semantics of services as follows:
- when units for services are created on snap install/refresh (in link handler), systemd units are only created on disk but not immediately enabled.
- units are enabled later on start-snap-services. These two changes are reflected in wrappers/services.go and changes to AddSnapServies and StartServices.
- service commands executed from snap and snapctl are handled by new service-control-task. This unifies service handling for these commands as there are no ad-hoc calls to systemctl, but everything goes through wrappers. There is one task per snap in case of service commands affecting multiple snaps. The task carries snap name and affected services (if the list is empty, then all services of the snap are considered).
- for compatibility with old snapd though, old-style exec-command tasks are created alongside new type of tasks, but they have ignore flag set on them so new snapd skips them (logic for that landed already in cmdstate).
- disabled/enabled services are tracked with ServicesDisabledByHooks/ServicesEnabledByHooks in SnapState. This is needed for hooks that run between link-snap and start-snap-services, and may effect state of the services.
2020-11-13 12:51:13 +01:00
Zygmunt Krynicki
fa671b7e70 daemon: test setting IgnoreValidation flag (more)
The test checks that flag set in installInstruction is transferred to
snapstate.Flags. This time for the snapUpdate code-path.

Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
2020-10-14 22:44:44 +02:00