Commit Graph

23 Commits

Author SHA1 Message Date
Maksym Pavlenko
552d763447 Use image lists in client tests
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-25 10:47:00 -07:00
宁明晓10296073
b35fb7d447 remove io/ioutil
Signed-off-by: ningmingxiao <ning.mingxiao@zte.com.cn>
2022-01-11 16:07:23 +08:00
Gabriel Adrian Samfira
77a321a073 Replace find with native Go code
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-07 11:04:38 +00:00
Gabriel Adrian Samfira
22dc60e059 Enable TestVolumeOwnership on Windows
This change enables the TestVolumeOwnership on Windows. The test
assumes that the volume-ownership image is built on Windows, thus
ensuring that Windows file security info (ACLs and ownership info)
are attached to the C:\volumes\test_dir path.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2021-12-07 10:47:13 +00:00
Sebastiaan van Stijn
f33d38c7cb
integration: align tags of test images
I noticed we were using some different versions of the same test
images, so changing them to be the same (can help with find/replace
if we need to update them).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-12-03 15:14:09 +01:00
Claudiu Belu
fb4432c24a integration: Enables TestVolumeCopyUp for Windows
The image that the test is used for Windows has busybox included,
which means we can use sleep.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-10-07 19:30:42 -07:00
Sebastiaan van Stijn
2ac9968401
replace uses of os/exec with golang.org/x/sys/execabs
Go 1.15.7 contained a security fix for CVE-2021-3115, which allowed arbitrary
code to be executed at build time when using cgo on Windows. This issue also
affects Unix users who have “.” listed explicitly in their PATH and are running
“go get” outside of a module or with module mode disabled.

This issue is not limited to the go command itself, and can also affect binaries
that use `os.Command`, `os.LookPath`, etc.

From the related blogpost (ttps://blog.golang.org/path-security):

> Are your own programs affected?
>
> If you use exec.LookPath or exec.Command in your own programs, you only need to
> be concerned if you (or your users) run your program in a directory with untrusted
> contents. If so, then a subprocess could be started using an executable from dot
> instead of from a system directory. (Again, using an executable from dot happens
> always on Windows and only with uncommon PATH settings on Unix.)
>
> If you are concerned, then we’ve published the more restricted variant of os/exec
> as golang.org/x/sys/execabs. You can use it in your program by simply replacing

This patch replaces all uses of `os/exec` with `golang.org/x/sys/execabs`. While
some uses of `os/exec` should not be problematic (e.g. part of tests), it is
probably good to be consistent, in case code gets moved around.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-25 18:11:09 +02:00
Claudiu Belu
a78bdf22df tests: Refactors PodSandbox creation
Most of the tests creating and using Pod Sandboxes in the same way. We can create
a common function that will do that for us, so we can have less duplicated code,
and make it easier to add new tests in the future.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-06-03 16:02:38 +00:00
Claudiu Belu
09a0c9471b tests: Adds support for Windows cri-integration tests
Currently, the cri-integration tests do not work on Windows due to various reasons.
One of the reasons is because all the tests are using Linux-specific images.
Previous commits refactored the image pulling / usage in the cri-integration tests,
making it easier to update, and easier to configure a custom registry to pull images
with Windows support.

For Windows runs, custom registries can be created, which will also contain Windows
images, and the cri-integration tests can be configured to use those registries by
specifying the "--repo-list" argument, a YAML file which will contain an alternative
mapping of the default registries. This is similar to how E2E tests are handled for
Windows runs in Kubernetes.

Some of the tests are Skipped, as they do not pass yet on Windows.

Windows does not collect inodes used stats, thus, the tests that were expecting non-zero
inodes stats were failing.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-05-14 11:27:35 +00:00
Claudiu Belu
273c2bb168 tests: Prepull images used in tests
Most of the tests are pulling and deleting the same test images, which
can be quite inefficient, especially on Windows nodes, where the images
are larger than the Linux ones (a nanoserver Container image is ~250MB
in size). We can instead pull them only once, and reuse them. This will
reduce the test run time on Windows considerably.

Additionally, some of the test images are currently hosted on dockerhub
(busybox image), which has introduced image ratelimiting in November 2020,
which means that test runners could potentially hit that limit faster with
the current implementation. This will reduce that risk.

Some tests are specifically deleting images, so we always have to ensure
that they are pulled.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-04-28 09:43:39 +00:00
Claudiu Belu
5847340a7d tests: Refactors container image usage
Currently, the cri-integration tests do not work on Windows due to various reasons.
One of the reasons is because all the tests are using Linux-specific images. This
commit refactors the image pulling / usage in the cri-integration tests, making it
easier to update, and easier to configure the a custom registry to pull those images
from.

For Windows runs, custom registries can be created, which will also contain Windows
images, and the cri-integration tests can be configured to use those registries by
specifying the "--image-list" argument, a TOML file which will contain an alternative
mapping of the default images.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-04-27 08:44:21 +00:00
Davanum Srinivas
2e4c1d4b74
Use the multi-arch version of the test images
volume-copy-up:2.0 and volume-ownership:2.0

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-04-25 17:49:57 -04:00
Derek McGowan
07c98d0bf1 Fix lint in Unix environments
Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-10-05 17:46:01 -07:00
Derek McGowan
77cf032195 Enable golangci on Windows
Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-10-01 09:01:16 -07:00
Mike Brown
1b60224e2e use containerd/project header test
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2020-04-22 19:35:37 -05:00
Lantao Liu
ba8788c6b9 Update kubernetes dependency to 1.15.0.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-07-31 23:52:03 -07:00
Haiyan Meng
035ce6c975
Update test based on new PullImage CRI.
Signed-off-by: Haiyan Meng <haiyanmeng@google.com>
2019-02-26 12:43:54 -08:00
Lantao Liu
0580ce45fd Update test based on new CRI.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-10-05 11:01:20 -07:00
Lantao Liu
c55776377f Fix empty volume ownership.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-06-11 08:40:35 +00:00
Lantao Liu
387da59ee5 Rename all variables to remove "cricontainerd".
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-19 21:59:32 +00:00
Lantao Liu
605b4a7b6a Update imports
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-02-08 02:45:44 +00:00
Lantao Liu
4e9ca399e1 Use containerd plugin config.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-19 02:25:03 +00:00
Lantao Liu
8782f18d50 Add integration test for volume copy up.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-01-11 19:10:52 +00:00