14 Commits

Author SHA1 Message Date
Miguel Pires
06d4688ffd daemon: add migrate-home action to debug/ API endpoint
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2022-06-21 15:49:01 +01:00
Michael Vogt
277eb06412 many: replace use of "sanity" with more inclusive naming
This commit replaces the use of "sanity" with more inclusive
naming.

When `sanity` is used in a more general sense either `validity`
or `quick` is used.
2022-03-14 18:22:34 +01:00
Miguel Pires
aa623a49ea many: remove unused parameters and returns 2021-09-02 17:44:34 +01:00
Samuele Pedroni
50850d1846 daemon: tighten access to POST /v2/debug to only root
drop support for cases that have been for a long time available via
GET anyway
2021-05-26 16:17:21 +02:00
Samuele Pedroni
7aa0362582 daemon: introduce apiBaseSuite.(json|sync|async|error)Req
these test a daemon request and check the expected response type
before returning the response for further specific checks

this simplifies away some checks in the tests but the bigger win is
avoiding the .(*daemon.Resp) casts everywhere, in particular
this will reduce the number of affected places if we change
somewhat the internal types used to produce responses
2021-03-31 17:26:49 +02:00
Samuele Pedroni
3b7e703f84 daemon: move the last api_foo_test.go to daemon_test
still todo later: clean up what is left in api.go and api_test.go

there are other non api_ tests also still in daemon
2021-03-01 18:33:14 +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
Samuele Pedroni
9c6da7ae3f overlord,timings,daemon: separate timings from overlord/state
there are places that import timings that shouldn't indirectly get
overlord/state as well

timings strictly doesn't need state in an essential way, use an
interface to mediate between the two instead

the cost of this is having to move the timings helpers specific to
Change/Task to overlord/state itself
2020-03-16 22:43:40 +01:00
Pawel Stolowski
038280d158 Fixed and simplified sorting to account for tasks from lane 0 that fall between ready times of other lanes; removed maxReadyTime. Fixed finding the minimum lane on the api side and added a unit test (thanks @pedronis). 2019-10-08 14:30:06 +02:00
Pawel Stolowski
03ea91f3ce Updated timings tests. 2019-09-24 17:35:11 +02:00
Pawel Stolowski
ee3a76892e Added unit tests. 2019-05-07 10:30:17 +02:00
Samuele Pedroni
35414905ce increment (c) year 2019-02-27 18:36:33 +01:00
John R. Lenton
8fbc41ad94 cmd/snap, daemon: make the connectivity check use GET
With this, all non-hidden debug commands can run unauthorized.
2019-02-27 09:51:09 +00:00
John R. Lenton
ef6d12e9c5 daemon: refactor debug a little bit
This refactors debugCmd into its own file, and modifies getDebug and
postDebug to call getBaseDeclaration, instead of having getDebug call
postDebug which was just asking for trouble down the line.

Also it splits the tests into its own file, but still in the daemon
package; refactoring that will take a bit more work.
2019-02-26 17:02:14 +00:00