Files
kata-containers/virtcontainers/fc_test.go
Julio Montes 5ac6e9a897 virtcontainers: make socket generation hypervisor specific
Kata support several hypervisor and not all hypervisor support the
same type of sockets, for example QEMU support vsock and unix sockets, while
firecracker only support hybrid vsocks, hence sockets generations should be
hypervisor specific

fixes #2027

Signed-off-by: Julio Montes <julio.montes@intel.com>
2019-09-19 19:39:07 +00:00

32 lines
593 B
Go

// Copyright (c) 2019 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package virtcontainers
import (
"testing"
"github.com/kata-containers/runtime/virtcontainers/types"
"github.com/stretchr/testify/assert"
)
func TestFCGenerateSocket(t *testing.T) {
assert := assert.New(t)
fc := firecracker{}
i, err := fc.generateSocket("a", false)
assert.Error(err)
assert.Nil(i)
i, err = fc.generateSocket("a", true)
assert.NoError(err)
assert.NotNil(i)
hvsock, ok := i.(types.HybridVSock)
assert.True(ok)
assert.NotEmpty(hvsock.UdsPath)
assert.NotZero(hvsock.Port)
}