Files
kata-containers/virtcontainers/capabilities_test.go
Eric Ernst dcd48a9ca1 vc: capabilities: add capability flags for filesystem sharing
Not all hypervisors support filesystem sharing. Add capability flags to track
this. Since most hypervisor implementations in Kata *do* support this, the set
semantices are reversed (ie, set the flag if you do not support the feature).

Fixes: #1022

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Signed-off-by: Julio Montes <julio.montes@intel.com>
2018-12-19 09:54:00 -06:00

51 lines
778 B
Go

// Copyright (c) 2017 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
package virtcontainers
import "testing"
func TestBlockDeviceCapability(t *testing.T) {
var caps capabilities
if caps.isBlockDeviceSupported() {
t.Fatal()
}
caps.setBlockDeviceSupport()
if !caps.isBlockDeviceSupported() {
t.Fatal()
}
}
func TestBlockDeviceHotplugCapability(t *testing.T) {
var caps capabilities
if caps.isBlockDeviceHotplugSupported() {
t.Fatal()
}
caps.setBlockDeviceHotplugSupport()
if !caps.isBlockDeviceHotplugSupported() {
t.Fatal()
}
}
func TestFsSharingCapability(t *testing.T) {
var caps capabilities
if !caps.isFsSharingSupported() {
t.Fatal()
}
caps.setFsSharingUnsupported()
if caps.isFsSharingSupported() {
t.Fatal()
}
}