43 Commits

Author SHA1 Message Date
Sergio Cazzolato
0dbb838fe5 tests: test details part 15 (#13941)
* tets: test details part 15

This is the last set of test details

* Update tests/main/snapshot-basic/task.yaml

Co-authored-by: Andrew Phelps <136256549+andrewphelpsj@users.noreply.github.com>

---------

Co-authored-by: Andrew Phelps <136256549+andrewphelpsj@users.noreply.github.com>
2024-05-03 16:07:42 -03:00
Alex Murray
fd16a02b94 o/snapshotstate: check snapshots are self-contained on import (#12414)
* o/snapshotstate: check snapshots are self-contained on import

Snapshots require administrator privileges to be imported and hence are assumed
to be trusted. However, let's try and be as helpful as possible and validate
that they are self-contained on import (ie. there are no files within the
snapshot that point outside of the parent directory) and report an error in that
case.

Thanks: Sam Sanoop <sams@snyk.io>
Signed-off-by: Alex Murray <alex.murray@canonical.com>

* tests: fix snapshot-basic test on trusty

Signed-off-by: Alex Murray <alex.murray@canonical.com>
Co-authored-by: Michael Vogt <mvo@ubuntu.com>
2022-12-12 15:53:51 +01:00
Paweł Stołowski
bb52a67991 Renaming related to inclusive language. 2022-04-14 14:30:47 +02:00
Maciej Borzecki
7721024f40 tests: disable snapd memory limit in selected tests
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-08-24 16:13:36 +02:00
Pawel Stolowski
5625e1a0c7 o/configstate, o/snapshotstate: fix handling of nil snap config on snapshot restore
* Fix for LP #1917870: properly handle nil configuration (no config) when
restoring snaphots.

* Add TestCommitOverNilSnapConfig test (thanks pedronis).

* Add unmarshalSnapConfig() helper.

* Add extra test check for "null" case (thanks mvo!)
2021-03-11 14:17:48 +01:00
Pawel Stolowski
33dbb8e414 o/snapshotstate: create snapshots directory on import
* Create snapshots directory (in case it doesn't exist) on import.
Fixes LP: #1917617

* Sanity check for existing snapshots dir in the spread test.
2021-03-04 20:46:03 +01:00
Paweł Stołowski
e2859532fb Add extra test check for ContentHash() where different sha3_384 checksums inside Snapshot lead to different hash (thanks ijohnson) 2021-01-13 09:58:50 +00:00
Paweł Stołowski
4d4db665e8 Return existing set id when trying to import same snapshot again (based on checksum). 2020-12-15 09:52:33 +00:00
Michael Vogt
d6acc5f4bd tests: fix shellcheck error 2020-10-19 11:31:06 +02:00
Michael Vogt
264b0129cd snapshotstate: fix typo 2020-10-16 20:15:37 +02:00
Michael Vogt
f684c24e28 snapshotstate: detect duplicated snapshot imports 2020-10-16 20:08:55 +02:00
Michael Vogt
6440d285be tests: fix RESTORE_ID parsing 2020-10-02 11:20:05 +02:00
Michael Vogt
f306a1f350 Merge remote-tracking branch 'upstream/master' into snapshot-import 2020-09-30 17:31:53 +02:00
Paweł Stołowski
67a8719670 Fix shellcheck error. 2020-09-30 12:42:01 +02:00
Paweł Stołowski
6d7677a292 Make sure there is just one set in the spread test. 2020-09-29 11:34:30 +02:00
Paweł Stołowski
9b3fa9fe9b Set snapshot set id from its filename (override the one from meta file). Remove part of the iteration logic that ignores snapshots if there is a mismatch on set id, because it won't be the case anymore with this change. 2020-09-25 17:53:27 +02:00
James Jesudason
430a80cbbe spread: clean-up after snapshot import test 2020-09-09 16:03:28 +01:00
James Jesudason
c4334a0b1a Add spread test for import 2020-09-04 14:25:07 +01:00
Zygmunt Krynicki
f492a52ca3 tests: indent line continuation
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
2020-08-26 10:03:25 +02:00
Michael Vogt
341c739aff tests: ensure filelist of two exports is identical 2020-08-24 16:58:28 +02:00
Michael Vogt
a7e5d0c779 daemon, tests: improve doc strings 2020-08-04 11:44:44 +02:00
James Jesudason
32b252331b snapshotstate: lock in prepare export phase
fixes from review
2020-07-28 15:17:03 +01:00
Maciej Borzecki
bdc1d20b42 tests/main/snapshot-basic: fix shellcheck issues
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2020-07-21 14:46:13 +02:00
Michael Vogt
ec92b6e810 tests: tweak snapshort export test naming and test that two exports have the same size 2020-07-15 17:03:57 +02:00
James Jesudason
a0de92181e Changes to comments and redundant type conversions 2020-07-15 14:05:53 +01:00