kata-containers/src/runtime/virtcontainers/macvtap_endpoint_test.go
Bin Liu 1dfd845f51 runtime: go fix code for 1.19
We have starting to use golang 1.19, some features are
not supported later, so run `go fix` to fix them.

Fixes: #5750

Signed-off-by: Bin Liu <bin@hyper.sh>
2022-11-25 11:29:18 +08:00

31 lines
539 B
Go

//go:build linux
// Copyright (c) 2018 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package virtcontainers
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestCreateMacvtapEndpoint(t *testing.T) {
netInfo := NetworkInfo{
Iface: NetlinkIface{
Type: "macvtap",
},
}
expected := &MacvtapEndpoint{
EndpointType: MacvtapEndpointType,
EndpointProperties: netInfo,
}
result, err := createMacvtapNetworkEndpoint(netInfo)
assert.NoError(t, err)
assert.Exactly(t, result, expected)
}