mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-18 07:58:36 +00:00
virtcontainers: Reduce kata_agent test noise
We only need to set the agent context before calling into its API. Fixes: #1211 Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
2093fe6bfd
commit
560902c8f1
@ -73,6 +73,7 @@ func TestKataAgentConnect(t *testing.T) {
|
||||
defer proxy.Stop()
|
||||
|
||||
k := &kataAgent{
|
||||
ctx: context.Background(),
|
||||
state: KataAgentState{
|
||||
URL: testKataProxyURL,
|
||||
},
|
||||
@ -105,6 +106,7 @@ func TestKataAgentDisconnect(t *testing.T) {
|
||||
defer proxy.Stop()
|
||||
|
||||
k := &kataAgent{
|
||||
ctx: context.Background(),
|
||||
state: KataAgentState{
|
||||
URL: testKataProxyURL,
|
||||
},
|
||||
@ -294,6 +296,7 @@ func TestKataAgentSendReq(t *testing.T) {
|
||||
defer proxy.Stop()
|
||||
|
||||
k := &kataAgent{
|
||||
ctx: context.Background(),
|
||||
state: KataAgentState{
|
||||
URL: testKataProxyURL,
|
||||
},
|
||||
@ -722,6 +725,7 @@ func TestAgentCreateContainer(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
sandbox := &Sandbox{
|
||||
ctx: context.Background(),
|
||||
id: "foobar",
|
||||
config: &SandboxConfig{
|
||||
ID: "foobar",
|
||||
@ -736,6 +740,7 @@ func TestAgentCreateContainer(t *testing.T) {
|
||||
}
|
||||
|
||||
container := &Container{
|
||||
ctx: sandbox.ctx,
|
||||
id: "barfoo",
|
||||
sandboxID: "foobar",
|
||||
sandbox: sandbox,
|
||||
@ -768,6 +773,7 @@ func TestAgentCreateContainer(t *testing.T) {
|
||||
defer proxy.Stop()
|
||||
|
||||
k := &kataAgent{
|
||||
ctx: context.Background(),
|
||||
state: KataAgentState{
|
||||
URL: testKataProxyURL,
|
||||
},
|
||||
@ -807,6 +813,7 @@ func TestAgentNetworkOperation(t *testing.T) {
|
||||
defer proxy.Stop()
|
||||
|
||||
k := &kataAgent{
|
||||
ctx: context.Background(),
|
||||
state: KataAgentState{
|
||||
URL: testKataProxyURL,
|
||||
},
|
||||
@ -828,9 +835,14 @@ func TestAgentNetworkOperation(t *testing.T) {
|
||||
func TestKataAgentSetProxy(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
k := &kataAgent{}
|
||||
k := &kataAgent{ctx: context.Background()}
|
||||
p := &kataBuiltInProxy{}
|
||||
s := &Sandbox{storage: &filesystem{}}
|
||||
s := &Sandbox{
|
||||
ctx: context.Background(),
|
||||
storage: &filesystem{
|
||||
ctx: context.Background(),
|
||||
},
|
||||
}
|
||||
|
||||
err := k.setProxy(s, p, 0, "")
|
||||
assert.Error(err)
|
||||
@ -877,6 +889,7 @@ func TestKataCopyFile(t *testing.T) {
|
||||
defer proxy.Stop()
|
||||
|
||||
k := &kataAgent{
|
||||
ctx: context.Background(),
|
||||
state: KataAgentState{
|
||||
URL: testKataProxyURL,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user