mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-10 00:23:54 +00:00
Convert virtcontainers tests to testify/assert to make the virtcontainers tests more readable. fixes #156 Signed-off-by: Julio Montes <julio.montes@intel.com>
29 lines
521 B
Go
29 lines
521 B
Go
// 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)
|
|
}
|