Files
kata-containers/virtcontainers/no_proxy_test.go
Peng Tao d75841ef23 ut: add more UTs
Let's make codecov happier;)

Signed-off-by: Peng Tao <bergwolf@gmail.com>
2018-09-14 08:54:55 +08:00

37 lines
599 B
Go

// Copyright (c) 2017 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package virtcontainers
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNoProxyStart(t *testing.T) {
p := &noProxy{}
assert := assert.New(t)
agentURL := "agentURL"
_, _, err := p.start(proxyParams{
agentURL: agentURL,
})
assert.NotNil(err)
pid, vmURL, err := p.start(proxyParams{
agentURL: agentURL,
logger: testDefaultLogger,
})
assert.Nil(err)
assert.Equal(vmURL, agentURL)
assert.Equal(pid, 0)
err = p.stop(0)
assert.Nil(err)
assert.False(p.consoleWatched())
}