mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-24 01:24:26 +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:
@@ -89,6 +89,11 @@ func TestStringFromNoopShimType(t *testing.T) {
|
||||
testStringFromShimType(t, shimType, "noopShim")
|
||||
}
|
||||
|
||||
func TestStringFromKataBuiltInShimType(t *testing.T) {
|
||||
shimType := KataBuiltInShimType
|
||||
testStringFromShimType(t, shimType, "kataBuiltInShim")
|
||||
}
|
||||
|
||||
func TestStringFromUnknownShimType(t *testing.T) {
|
||||
var shimType ShimType
|
||||
testStringFromShimType(t, shimType, "")
|
||||
@@ -123,6 +128,12 @@ func TestNewShimFromNoopShimType(t *testing.T) {
|
||||
testNewShimFromShimType(t, shimType, expectedShim)
|
||||
}
|
||||
|
||||
func TestNewShimFromKataBuiltInShimType(t *testing.T) {
|
||||
shimType := KataBuiltInShimType
|
||||
expectedShim := &kataBuiltInShim{}
|
||||
testNewShimFromShimType(t, shimType, expectedShim)
|
||||
}
|
||||
|
||||
func TestNewShimFromUnknownShimType(t *testing.T) {
|
||||
var shimType ShimType
|
||||
|
||||
@@ -170,6 +181,14 @@ func TestNewShimConfigFromNoopShimPodConfig(t *testing.T) {
|
||||
testNewShimConfigFromPodConfig(t, podConfig, nil)
|
||||
}
|
||||
|
||||
func TestNewShimConfigFromKataBuiltInShimPodConfig(t *testing.T) {
|
||||
podConfig := PodConfig{
|
||||
ShimType: KataBuiltInShimType,
|
||||
}
|
||||
|
||||
testNewShimConfigFromPodConfig(t, podConfig, nil)
|
||||
}
|
||||
|
||||
func TestNewShimConfigFromUnknownShimPodConfig(t *testing.T) {
|
||||
var shimType ShimType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user