mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-13 05:36:13 +00:00
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>
31 lines
539 B
Go
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)
|
|
}
|