gitee.com/leisunstar/runtime@v0.0.0-20200521203717-5cef3e7b53f9/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  }