Commit graph

6 commits

Author SHA1 Message Date
Paweł Gronowski
435ecfe6e0
test/volume: Replace Check with NilError where suitable
In these cases, continuing after a non nil error will result in a nil
dereference in panic.
Change the `assert.Check` to `assert.NilError` to avoid that.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2023-08-10 11:18:56 +02:00
Sebastiaan van Stijn
d69b1fdb72
volume/mounts: cleanup tests
- don't use un-keyed structs
- user assert.Check where possible
- use consts for fixed values

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-07-27 15:00:13 +02:00
Sebastiaan van Stijn
8e3f9fd032
volume/mounts: use sub-tests, and use gotest.tools
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-02 14:11:57 +02:00
Sebastiaan van Stijn
73378d2042
volume/mounts: don't use global variable for fileinfoprovider
This allows stubbing the provider for a test without side effects for
other tests, making it no longer needed to reset it to its original
value in a defer()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-02 14:11:55 +02:00
Sebastiaan van Stijn
28b0f47599
volume/mounts: add constructors for each parser
This adds constructors for the Linux, Windows, and LCOW,
to allow using these parsers externally.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-02 14:11:50 +02:00
Sebastiaan van Stijn
df179a1d6a
volume/mounts: split tests per parser
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-02 14:08:34 +02:00