Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Unit tests failing on CentOS #228

Closed
GabyCT opened this issue Apr 17, 2018 · 3 comments · Fixed by #1499
Closed

Unit tests failing on CentOS #228

GabyCT opened this issue Apr 17, 2018 · 3 comments · Fixed by #1499
Assignees

Comments

@GabyCT
Copy link
Contributor

GabyCT commented Apr 17, 2018

Using the following configuration:
CentOS Linux 7 (Core)
kata-runtime : 0.1.0
commit : 8088a62
OCI specs: 1.0.1
Docker version 18.03.0-ce, build 0520e24
go version go1.9.5 linux/amd64
kata-shim version 0.0.1-2bdea2e41109b6b71c600899e1bf5794b125200d
kata-proxy version 0.0.1-de18929631091cb1f079b2e6e1caa3e4625f4930
QEMU emulator version 2.11.1 (v2.11.1)

I did the following steps
$ go get -d github.com/kata-containers/runtime
$ export RUNTIME="kata-runtime"
$ make test

However, some unit tests are failing, this behavior is also seen in the Jenkins jobs that were enabled for the runtime and shim repositories (kata-containers/ci#13). Here is a small summary of unit tests that are failing:
--- FAIL: TestStartStopSandboxHyperstartAgentSuccessfulWithCNMNetwork (0.01s)
cc_proxy_mock.go:89: [CCProxyMock] listening on /tmp/cc-proxy-test882053419/cc-proxy-test.sock
api_test.go:1471: fork/exec /usr/bin/virtcontainers/bin/test/hook: no such file or directory
cc_proxy_mock.go:89: [CCProxyMock] Client connection already closed
cc_proxy_mock.go:89: [CCProxyMock] Stopped
--- FAIL: TestCCShimStartSuccessful (0.00s)
cc_shim_test.go:60: This test should pass (sandbox {id: hypervisor: agent: storage: network: config:0xc4201fed80 volumes:[] containers:[] runPath: configPath: state:{State: BlockIndex:0 Fstype: HotpluggedDrive:false} networkNS:{NetNsPath: NetNsCreated:false Endpoints:[]} annotationsLock: wg:}, params {Container:testContainer Token:testToken URL:foo:///foo/clear-containers/proxy.sock Console: Terminal:false Detach:false PID:0 CreateNS:[] EnterNS:[]}, expectFail false): fork/exec /usr/bin/virtcontainers/bin/test/cc-shim: no such file or directory
--- FAIL: TestCCShimStartDetachSuccessful (0.00s)
cc_shim_test.go:60: This test should pass (sandbox {id: hypervisor: agent: storage: network: config:0xc4201fefc0 volumes:[] containers:[] runPath: configPath: state:{State: BlockIndex:0 Fstype: HotpluggedDrive:false} networkNS:{NetNsPath: NetNsCreated:false Endpoints:[]} annotationsLock: wg:}, params {Container:testContainer Token:testToken URL:foo:///foo/clear-containers/proxy.sock Console: Terminal:false Detach:true PID:0 CreateNS:[] EnterNS:[]}, expectFail false): fork/exec /usr/bin/virtcontainers/bin/test/cc-shim: no such file or directory
--- FAIL: TestCCShimStartWithConsoleSuccessful (0.00s)
cc_shim_test.go:344: Console created for tests:/dev/pts/1
cc_shim_test.go:60: This test should pass (sandbox {id: hypervisor: agent: storage: network: config:0xc420308000 volumes:[] containers:[] runPath: configPath: state:{State: BlockIndex:0 Fstype: HotpluggedDrive:false} networkNS:{NetNsPath: NetNsCreated:false Endpoints:[]} annotationsLock: wg:}, params {Container:testContainer Token:testToken URL:foo:///foo/clear-containers/proxy.sock Console:/dev/pts/1 Terminal:false Detach:false PID:0 CreateNS:[] EnterNS:[]}, expectFail false): fork/exec /usr/bin/virtcontainers/bin/test/cc-shim: no such file or directory
=== RUN TestRunHook
--- FAIL: TestRunHook (0.00s)
hook_test.go:84: unexpected failure: fork/exec /usr/bin/virtcontainers/bin/test/hook: no such file or directory
=== RUN TestRunHookTimeout
--- FAIL: TestRunHookTimeout (0.00s)
hook_test.go:84: unexpected failure: fork/exec /usr/bin/virtcontainers/bin/test/hook: no such file or directory
--- FAIL: TestKataShimStartSuccessful (0.00s)
kata_shim_test.go:54: This test should pass (sandbox {id: hypervisor: agent: storage: network: config:0xc4200bf8c0 volumes:[] containers:[] runPath: configPath: state:{State: BlockIndex:0 Fstype: HotpluggedDrive:false} networkNS:{NetNsPath: NetNsCreated:false Endpoints:[]} annotationsLock: wg:}, params {Container:testContainer Token:testToken URL:foo:///foo/kata-containers/proxy.sock Console: Terminal:false Detach:false PID:0 CreateNS:[] EnterNS:[]}, expectFail false): fork/exec /usr/bin/virtcontainers/bin/test/kata-shim: no such file or directory
--- FAIL: TestKataShimStartDetachSuccessful (0.00s)
kata_shim_test.go:54: This test should pass (sandbox {id: hypervisor: agent: storage: network: config:0xc4200bfb00 volumes:[] containers:[] runPath: configPath: state:{State: BlockIndex:0 Fstype: HotpluggedDrive:false} networkNS:{NetNsPath: NetNsCreated:false Endpoints:[]} annotationsLock: wg:}, params {Container:testContainer Token:testToken URL:foo:///foo/kata-containers/proxy.sock Console: Terminal:false Detach:true PID:0 CreateNS:[] EnterNS:[]}, expectFail false): fork/exec /usr/bin/virtcontainers/bin/test/kata-shim: no such file or directory
=== RUN TestKataShimStartWithConsoleNonExistingFailure
--- PASS: TestKataShimStartWithConsoleNonExistingFailure (0.00s)
=== RUN TestKataShimStartWithConsoleSuccessful
--- FAIL: TestKataShimStartWithConsoleSuccessful (0.00s)
kata_shim_test.go:290: Console created for tests:/dev/pts/1
kata_shim_test.go:54: This test should pass (sandbox {id: hypervisor: agent: storage: network: config:0xc42043a000 volumes:[] containers:[] runPath: configPath: state:{State: BlockIndex:0 Fstype: HotpluggedDrive:false} networkNS:{NetNsPath: NetNsCreated:false Endpoints:[]} annotationsLock: wg:}, params {Container:testContainer Token:testToken URL:foo:///foo/kata-containers/proxy.sock Console:/dev/pts/1 Terminal:false Detach:false PID:0 CreateNS:[] EnterNS:[]}, expectFail false): fork/exec /usr/bin/virtcontainers/bin/test/kata-shim: no such file or directory
--- FAIL: TestGetFileFromNSSuccessful (0.00s)
nsenter_test.go:99
Expected nil, but got: &errors.errorString{s:"failed to Statfs "/proc/self/ns/cgroup": no such file or directory"}
Messages: Should have succeeded: failed to Statfs "/proc/self/ns/cgroup": no such file or directory
nsenter_test.go:100
Error: Expected value not to be nil.
--- FAIL: TestNsEnterSuccessful (0.01s)
Error Trace: nsenter_test.go:221
Error: Expected nil, but got: &errors.errorString{s:"failed to open target ns: failed to Statfs "/proc/90176/ns/cgroup": no such file or directory"}
Messages: failed to open target ns: failed to Statfs "/proc/90176/ns/cgroup": no such file or directory
Error Trace: nsenter_test.go:251
Error: Not equal:
expected: "cgroup"
actual: "0"
Error Trace: nsenter_test.go:251
Error: Not equal:
expected: "ipc:[4026532104]"
actual: "0"
Error Trace: nsenter_test.go:251
Error: Not equal:
expected: "net:[4026532107]"
actual: "0"
FAIL github.com/kata-containers/runtime/virtcontainers 1.343s
FAIL github.com/kata-containers/runtime/virtcontainers/pkg/nsenter 0.024s

@jodh-intel
Copy link
Contributor

nsenter_test.go:99
Expected nil, but got: &errors.errorString{s:"failed to Statfs "/proc/self/ns/cgroup": no such file or directory"}
Messages: Should have succeeded: failed to Statfs "/proc/self/ns/cgroup": no such file or directory
nsenter_test.go:100
Error: Expected value not to be nil.
--- FAIL: TestNsEnterSuccessful (0.01s)

@sboeuf - this is a bug in the nsenter test fwics since:

  • The CentOS kernel is 3.10.0-693.17.1.el7.x86_64.
  • cgroup namespaces first appeared in the 4.4 kernel according to git describe.

@sboeuf
Copy link

sboeuf commented Apr 18, 2018

Oh yeah interesting. Then we need to rework this test to be smarter and to ask the system about what is supported.

chavafg added a commit to chavafg/tests-1 that referenced this issue Jul 25, 2018
Unit tests in centOS are failing.
Issue: kata-containers/runtime#228

But we need to enable CentOS as part of the runtime CI, in order
to prevent regressions.

Fixes: kata-containers#537.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
chavafg added a commit to chavafg/tests-1 that referenced this issue Jul 25, 2018
Unit tests in centOS are failing.
Issue: kata-containers/runtime#228

But we need to enable centOS as part of the runtime CI, in order
to prevent regressions. So this change will skip unit tests
of the runtime repo when running on centOS

Fixes: kata-containers#537.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
chavafg added a commit to chavafg/tests-1 that referenced this issue Jul 25, 2018
Unit tests in centOS are failing.
Issue: kata-containers/runtime#228

But we need to enable centOS as part of the runtime CI, in order
to prevent regressions. So this change will skip unit tests
of the runtime repo when running on centOS

Fixes: kata-containers#537.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
chavafg added a commit to chavafg/ci that referenced this issue Aug 4, 2018
centos jobs on the runtime repo were disabled because unit
tests are failing on this distro:
kata-containers/runtime#228.

We are now skipping unit tests when running on centos, so we
can enable these jobs.

Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
@GabyCT
Copy link
Contributor Author

GabyCT commented Apr 3, 2019

The same tests are failing on SLES 12

12:22:09 Skip testing github.com/kata-containers/runtime/virtcontainers/pkg/nsenter with user current
12:22:09 INFO: Running 'go test' as root user on package 'github.com/kata-containers/runtime/virtcontainers/pkg/nsenter' with flags '-v -race -timeout 30s -outputdir "/tmp/tmp.s4EJ4RW6c2"'
12:22:10 === RUN   TestGetNSPathFromPID
12:22:10 --- PASS: TestGetNSPathFromPID (0.00s)
12:22:10 === RUN   TestGetCurrentThreadNSPath
12:22:10 --- PASS: TestGetCurrentThreadNSPath (0.00s)
12:22:10 === RUN   TestGetFileFromNSEmptyNSPathFailure
12:22:10 --- PASS: TestGetFileFromNSEmptyNSPathFailure (0.00s)
12:22:10 === RUN   TestGetFileFromNSNotExistingNSPathFailure
12:22:10 --- PASS: TestGetFileFromNSNotExistingNSPathFailure (0.00s)
12:22:10 === RUN   TestGetFileFromNSWrongNSPathFailure
12:22:10 --- PASS: TestGetFileFromNSWrongNSPathFailure (0.00s)
12:22:10 === RUN   TestGetFileFromNSSuccessful
12:22:10 --- FAIL: TestGetFileFromNSSuccessful (0.00s)
12:22:10     <autogenerated>:1: 
                          
	Error Trace:	nsenter_test.go:88
12:22:10         
	Error:      	Expected nil, but got: &errors.errorString{s:"failed to Statfs \"/proc/self/ns/cgroup\": no such file or directory"}
12:22:10         
	Messages:   	Should have succeeded: failed to Statfs "/proc/self/ns/cgroup": no such file or directory
12:22:10     <autogenerated>:1: 
                          
	Error Trace:	nsenter_test.go:89
12:22:10         
	Error:      	Expected value not to be nil.
12:22:10         
	Messages:   	The file handler should not be nil
12:22:10 === RUN   TestSetNSNilFileHandlerFailure
12:22:10 --- PASS: TestSetNSNilFileHandlerFailure (0.00s)
12:22:10 === RUN   TestSetNSUnknownNSTypeFailure
12:22:10 --- PASS: TestSetNSUnknownNSTypeFailure (0.00s)
12:22:10 === RUN   TestSetNSWrongFileFailure
12:22:10 --- PASS: TestSetNSWrongFileFailure (0.00s)
12:22:10 === RUN   TestNsEnterEmptyPathAndPIDFromNSListFailure
12:22:10 --- PASS: TestNsEnterEmptyPathAndPIDFromNSListFailure (0.00s)
12:22:10 === RUN   TestNsEnterEmptyNamespaceListSuccess
12:22:10 --- PASS: TestNsEnterEmptyNamespaceListSuccess (0.00s)
12:22:10 === RUN   TestNsEnterSuccessful
12:22:10 --- FAIL: TestNsEnterSuccessful (0.00s)
12:22:10     <autogenerated>:1: 
                          
	Error Trace:	nsenter_test.go:210
12:22:10         
	Error:      	Expected nil, but got: &errors.errorString{s:"failed to open target ns: failed to Statfs \"/proc/107010/ns/cgroup\": no such file or directory"}
12:22:10         
	Messages:   	failed to open target ns: failed to Statfs "/proc/107010/ns/cgroup": no such file or directory
12:22:10     <autogenerated>:1: 
                          
	Error Trace:	nsenter_test.go:240
12:22:10         
	Error:      	Not equal: 
12:22:10         
	            	expected: "cgroup"
12:22:10         
	            	actual: "0"
12:22:10     <autogenerated>:1: 
                          
	Error Trace:	nsenter_test.go:240
12:22:10         
	Error:      	Not equal: 
12:22:10         
	            	expected: "ipc:[4026533094]"
12:22:10         
	            	actual: "0"
12:22:10     <autogenerated>:1: 
                          
	Error Trace:	nsenter_test.go:240
12:22:10         
	Error:      	Not equal: 
12:22:10         
	            	expected: "net:[4026533097]"
12:22:10         
	            	actual: "0"
12:22:10     <autogenerated>:1: 
                          
	Error Trace:	nsenter_test.go:240
12:22:10         
	Error:      	Not equal: 
12:22:10         
	            	expected: "pid:[4026533095]"
12:22:10         
	            	actual: "0"
12:22:10     <autogenerated>:1: 
                          
	Error Trace:	nsenter_test.go:240
12:22:10         
	Error:      	Not equal: 
12:22:10         
	            	expected: "uts:[4026533093]"
12:22:10         
	            	actual: "0"
12:22:10 FAIL
12:22:10 coverage: 76.9% of statements
12:22:10 FAIL	github.com/kata-containers/runtime/virtcontainers/pkg/nsenter	0.022s

GabyCT added a commit to GabyCT/tests-1 that referenced this issue Apr 3, 2019
Unit tests are not working on SLES (nsenter) kata-containers/runtime#228.

Fixes kata-containers#1411

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
@devimc devimc self-assigned this Apr 3, 2019
devimc pushed a commit to devimc/kata-runtime that referenced this issue Apr 3, 2019
Old kernels, like 3.x, does not support cgroup namespace. Skip the test that
checks this namespace if its path in /proc doesn't exist.

fixes kata-containers#228

Signed-off-by: Julio Montes <julio.montes@intel.com>
devimc pushed a commit to devimc/kata-runtime that referenced this issue Apr 3, 2019
Old kernels, like 3.x, does not support cgroup namespace. Skip the test that
checks this namespace if its path in /proc doesn't exist.

Depends-on: github.com/kata-containers/tests#1414

fixes kata-containers#228

Signed-off-by: Julio Montes <julio.montes@intel.com>
devimc pushed a commit to devimc/kata-runtime that referenced this issue Apr 4, 2019
Depending of the linux versions some namespaces are supported or not.
To avoid failures running containers and unit tests in old linux kernels,
only the supported namespaces should be used.

Depends-on: github.com/kata-containers/tests#1414

fixes kata-containers#228

Signed-off-by: Julio Montes <julio.montes@intel.com>
devimc pushed a commit to devimc/kata-runtime that referenced this issue Apr 4, 2019
Depending of the linux versions some namespaces are supported or not.
To avoid failures running containers and unit tests in old linux kernels,
only the supported namespaces should be used.

Depends-on: github.com/kata-containers/tests#1414

fixes kata-containers#228

Signed-off-by: Julio Montes <julio.montes@intel.com>
devimc pushed a commit to devimc/kata-runtime that referenced this issue Apr 8, 2019
Depending of the linux versions some namespaces are supported or not.
To avoid failures running containers and unit tests in old linux kernels,
only the supported namespaces should be used.

Depends-on: github.com/kata-containers/tests#1414

fixes kata-containers#228

Signed-off-by: Julio Montes <julio.montes@intel.com>
devimc pushed a commit to devimc/kata-runtime that referenced this issue Apr 9, 2019
Depending of the linux versions some namespaces are supported or not.
To avoid failures running containers and unit tests in old linux kernels,
only the supported namespaces should be used.

Depends-on: github.com/kata-containers/tests#1414

fixes kata-containers#228

Signed-off-by: Julio Montes <julio.montes@intel.com>
zklei pushed a commit to zklei/runtime that referenced this issue Jun 13, 2019
Update command is used to update the resources of running containers.
Implement update request in agent gRPC.

fixes kata-containers#228

Signed-off-by: Julio Montes <julio.montes@intel.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants