mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-04 15:04:25 +01:00
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>
51 lines
778 B
Go
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()
|
|
}
|
|
}
|