github.com/kata-containers/runtime@v0.0.0-20210505125100-04f29832a923/virtcontainers/types/capabilities_test.go (about)

     1  // Copyright (c) 2017 Intel Corporation
     2  //
     3  // SPDX-License-Identifier: Apache-2.0
     4  //
     5  
     6  package types
     7  
     8  import (
     9  	"testing"
    10  
    11  	"github.com/stretchr/testify/assert"
    12  )
    13  
    14  func TestBlockDeviceCapability(t *testing.T) {
    15  	var caps Capabilities
    16  
    17  	assert.False(t, caps.IsBlockDeviceSupported())
    18  	caps.SetBlockDeviceSupport()
    19  	assert.True(t, caps.IsBlockDeviceSupported())
    20  }
    21  
    22  func TestBlockDeviceHotplugCapability(t *testing.T) {
    23  	var caps Capabilities
    24  
    25  	assert.False(t, caps.IsBlockDeviceHotplugSupported())
    26  	caps.SetBlockDeviceHotplugSupport()
    27  	assert.True(t, caps.IsBlockDeviceHotplugSupported())
    28  }
    29  
    30  func TestFsSharingCapability(t *testing.T) {
    31  	var caps Capabilities
    32  
    33  	assert.False(t, caps.IsFsSharingSupported())
    34  	caps.SetFsSharingSupport()
    35  	assert.True(t, caps.IsFsSharingSupported())
    36  }
    37  
    38  func TestMultiQueueCapability(t *testing.T) {
    39  	assert := assert.New(t)
    40  	var caps Capabilities
    41  
    42  	assert.False(caps.IsMultiQueueSupported())
    43  	caps.SetMultiQueueSupport()
    44  	assert.True(caps.IsMultiQueueSupported())
    45  }