mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-22 16:54:25 +01:00
proxy/shim: add unit tests
To test built-in proxy and shim types. Signed-off-by: Peng Tao <bergwolf@gmail.com>
This commit is contained in:
@@ -52,6 +52,10 @@ func TestSetNoProxyType(t *testing.T) {
|
||||
testSetProxyType(t, "noProxy", NoProxyType)
|
||||
}
|
||||
|
||||
func TestSetKataBuiltInProxyType(t *testing.T) {
|
||||
testSetProxyType(t, "kataBuiltInProxy", KataBuiltInProxyType)
|
||||
}
|
||||
|
||||
func TestSetUnknownProxyType(t *testing.T) {
|
||||
var proxyType ProxyType
|
||||
|
||||
@@ -97,6 +101,11 @@ func TestStringFromNoopProxyType(t *testing.T) {
|
||||
testStringFromProxyType(t, proxyType, "noopProxy")
|
||||
}
|
||||
|
||||
func TestStringFromKataBuiltInProxyType(t *testing.T) {
|
||||
proxyType := KataBuiltInProxyType
|
||||
testStringFromProxyType(t, proxyType, "kataBuiltInProxy")
|
||||
}
|
||||
|
||||
func TestStringFromUnknownProxyType(t *testing.T) {
|
||||
var proxyType ProxyType
|
||||
testStringFromProxyType(t, proxyType, "")
|
||||
@@ -137,6 +146,12 @@ func TestNewProxyFromNoopProxyType(t *testing.T) {
|
||||
testNewProxyFromProxyType(t, proxyType, expectedProxy)
|
||||
}
|
||||
|
||||
func TestNewProxyFromKataBuiltInProxyType(t *testing.T) {
|
||||
proxyType := KataBuiltInProxyType
|
||||
expectedProxy := &kataBuiltInProxy{}
|
||||
testNewProxyFromProxyType(t, proxyType, expectedProxy)
|
||||
}
|
||||
|
||||
func TestNewProxyFromUnknownProxyType(t *testing.T) {
|
||||
var proxyType ProxyType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user