add oci compatibility test case for src/agent/oci/src/lib.rs
follow by Open Container Initiative Runtime Specification
Fixes: #118
Signed-off-by: quanweiZhou <quanweiZhou@linux.alibaba.com>
When using default cc linker, we will have segfault.
Debugging with `rust-gdb`, the specific error is as follows:
src/string/memcpy.c: No such file or directory.
Only changing linker with `aarch64-linux-musl-gcc`, the
`rust-agent` could be totally statically linked and run successfully.
Fixes: #107
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
The __addtf3, __subtf3 and __multf3 symbols are used by aarch64-musl,
but are not provided by rust compiler-builtins.
For now, the only temporary but functional workaround accepted by rust
communities is to get them from libgcc.
Fixes: #107
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Add two interfaces for fs storage driver for supporting global writing
and reading, which is used by ACRN.
Signed-off-by: Wei Zhang <weizhang555@gmail.com>
Needed by some CI scripts, like release or to verify stable
branches state.
Fixes: #114
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
This adds a basic Makefile where we can use a central go test script
in order to run the tests for the CI.
Fixes#109
Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
Fix VM template storage leak by adding delete operations, we need to
delete sandbox storage dirs when stop VM.
Signed-off-by: Wei Zhang <weizhang555.zw@gmail.com>
Fixes#803
Move "newstore" features out of experimental feature list, from this
commit "newstore" will be default enabled.
Signed-off-by: Wei Zhang <weizhang555@gmail.com>
Do not flush it atexit(), where the test report file might be already
closed and it causes go test failure like:
PASS
testing: can't write /tmp/go-build146132196/b001/testlog.txt: close /tmp/go-build146132196/b001/testlog.txt: file already closed
FAIL github.com/kata-containers/runtime/cli 4.256s
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
Otherwise we fail to run it with non-root user with errors like:
`mkdir /var/lib/vc/uuid: permission denied`
Fixes: #2370
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
ret is uintptr and always >= 0. errno is enough for error checking.
This is causing lint error:
/home/vagrant/workplace/golang/src/github.com/kata-containers/runtime/virtcontainers/utils
cli/kata-check.go:446:20: SA4003: no value of type uintptr is less than 0 (staticcheck)
if errno != 0 || ret <= 0 {
^
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
To control whether an image rootfs is used as nvdimm device or just
plain virtio-block device.
Fixes: #2372
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
Do not implement in each arch code. We should have a generic
implementation instead.
-. amd64 and arm64 uses nvdimm
-. ppc64le and s390x uses virtio-blk
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
In oderder to make unit testing simpler,
lets add an interface that could be mocked.
Let hypervisor have a instance of virtiofsd interface,
and this makes a loose dependency to allow mock testing.
With the inteface is possible to add startSandbox unit test:
- use utils.StartCmd to mock call to start hypervisor process.
- Add unit test for startSandbox.
Fixes: #2367
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Check if path is not empty this makes, this help
unit test know why the function failed.
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
9p values are ignored by virtiofs, but this should be
not changed on validation to allow have unit test with
virtiofs config.
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Add unit test for clh.
- Check endpoint has valid values for CH.
- Add unit tests
- Add force flag to ignore cleanup errors.
- Add unit tests.
- Fail if hypervisor ID is empty.
- Add createSandbox uni test
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Add interface with the same methods of client,
this will help to decouple the implementation
and help use to do mock testing.
Add Mock client and add bootVM unit test
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
When we used jailer to launch firecracker, kata container failed due
to the following causes:
1. new flag `--config-file` belongs to the jailed firecracker,
so, adhering to the `end of command options` convention, we need to
give `--config-file` a prefix `--`.
2. The path of the config file(`fcConfig.json`) should be also
relative to the jailed firecracker.
3. Since we do the configuration before func `fcInit` now, we also need
to bring `jailer check` ahead.
4. The config file should be umounted and cleaned up.
Fixes: #2362
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
When kata-runtime was invoked as rootless by podman with
net=none, an empty net namespace path is provided.
kata-runtime was then trying to create a new network namespace
and bind-mounting it under /var/run/netns, resulting in a permission error.
Instead, with this commit, the runtime checks if it is
running rootless and instead creates network namespace bind mount
under rootless directory instead.
Fixes#2319
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Update github.com/kata-containers/agent to handle hvsock issue.
Shortlog:
33f3208 client.go: HybridVSockDialer: Close dup fd after receive packet
74a3b95 release: Kata Containers 1.10.0-rc0
afd0871 ci: install docker before configure
c502552 client.go: HybridVSockDialer: Check return size n of unix.Recvfrom
f8e4ce8 client.go: HybridVSockDialer: Change Read EOT to recv peek
5b64d42 agent: get current cpuset from /sys/devices/system/cpu/online
183a24a release: Kata Containers 1.10.0-alpha1
1ee8516 config: add option to control hotplug timeout of block devices
40567f6 release: Kata Containers 1.10.0-alpha0
19bee57 agent: connect debugging console in a specific vsock port
8361150 docs: Add enable services and installation steps for TRACING.md
a4f7373 agent: fix pause bin on musl
f9f129a docs: Add missing steps at TRACING.md
d3e66bf tracing: Wrapper for tracing functions
7a7dba7 network: ensure parent directories exist
455f728 tracing: Generate an alias for opentracing.Span
5f302e5 agent: Revert "client: remove the parameter of 'enableYamux'"
717ee24 client: remove the parameter of 'enableYamux'
d387c77 vendor: Update github.com/syndtr/gocapability/capability
b3d737b vendor: update libcontainer to 1.0.0-rc9
6eac713 release: Kata Containers 1.9.0-rc0
Fixes: #2284
Signed-off-by: Hui Zhu <teawater@antfin.com>