mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 04:34:27 +00:00
govmm: TestAppendPCIBridgeDevice et al. on !s390x
s390x uses CCW, also fixes a lint failure about undeclared variables on s390x. Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
This commit is contained in:
parent
dc285ab1d7
commit
79ecebb280
@ -1,4 +1,3 @@
|
|||||||
//go:build !s390x
|
|
||||||
// +build !s390x
|
// +build !s390x
|
||||||
|
|
||||||
// Copyright contributors to the Virtual Machine Manager for Go project
|
// Copyright contributors to the Virtual Machine Manager for Go project
|
||||||
@ -91,6 +90,52 @@ func TestAppendVirtioBalloon(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestAppendPCIBridgeDevice(t *testing.T) {
|
||||||
|
|
||||||
|
bridge := BridgeDevice{
|
||||||
|
Type: PCIBridge,
|
||||||
|
ID: "mybridge",
|
||||||
|
Bus: "/pci-bus/pcie.0",
|
||||||
|
Addr: "255",
|
||||||
|
Chassis: 5,
|
||||||
|
SHPC: true,
|
||||||
|
ROMFile: romfile,
|
||||||
|
}
|
||||||
|
|
||||||
|
testAppend(bridge, devicePCIBridgeString, t)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestAppendPCIBridgeDeviceWithReservations(t *testing.T) {
|
||||||
|
|
||||||
|
bridge := BridgeDevice{
|
||||||
|
Type: PCIBridge,
|
||||||
|
ID: "mybridge",
|
||||||
|
Bus: "/pci-bus/pcie.0",
|
||||||
|
Addr: "255",
|
||||||
|
Chassis: 5,
|
||||||
|
SHPC: false,
|
||||||
|
ROMFile: romfile,
|
||||||
|
IOReserve: "4k",
|
||||||
|
MemReserve: "1m",
|
||||||
|
Pref64Reserve: "1m",
|
||||||
|
}
|
||||||
|
|
||||||
|
testAppend(bridge, devicePCIBridgeStringReserved, t)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestAppendPCIEBridgeDevice(t *testing.T) {
|
||||||
|
|
||||||
|
bridge := BridgeDevice{
|
||||||
|
Type: PCIEBridge,
|
||||||
|
ID: "mybridge",
|
||||||
|
Bus: "/pci-bus/pcie.0",
|
||||||
|
Addr: "255",
|
||||||
|
ROMFile: "efi-virtio.rom",
|
||||||
|
}
|
||||||
|
|
||||||
|
testAppend(bridge, devicePCIEBridgeString, t)
|
||||||
|
}
|
||||||
|
|
||||||
func TestAppendDevicePCIeRootPort(t *testing.T) {
|
func TestAppendDevicePCIeRootPort(t *testing.T) {
|
||||||
var pcieRootPortID string
|
var pcieRootPortID string
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
// +build s390x
|
|
||||||
|
|
||||||
// Copyright contributors to the Virtual Machine Manager for Go project
|
// Copyright contributors to the Virtual Machine Manager for Go project
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
@ -22,8 +20,6 @@ var (
|
|||||||
deviceSCSIControllerStr = "-device virtio-scsi-ccw,id=foo,devno=" + DevNo
|
deviceSCSIControllerStr = "-device virtio-scsi-ccw,id=foo,devno=" + DevNo
|
||||||
deviceSCSIControllerBusAddrStr = "-device virtio-scsi-ccw,id=foo,bus=pci.0,addr=00:04.0,iothread=iothread1,devno=" + DevNo
|
deviceSCSIControllerBusAddrStr = "-device virtio-scsi-ccw,id=foo,bus=pci.0,addr=00:04.0,iothread=iothread1,devno=" + DevNo
|
||||||
deviceBlockString = "-device virtio-blk-ccw,drive=hd0,scsi=off,config-wce=off,devno=" + DevNo + ",share-rw=on,serial=hd0 -drive id=hd0,file=/var/lib/vm.img,aio=threads,format=qcow2,if=none,readonly"
|
deviceBlockString = "-device virtio-blk-ccw,drive=hd0,scsi=off,config-wce=off,devno=" + DevNo + ",share-rw=on,serial=hd0 -drive id=hd0,file=/var/lib/vm.img,aio=threads,format=qcow2,if=none,readonly"
|
||||||
devicePCIBridgeString = "-device pci-bridge,bus=/pci-bus/pcie.0,id=mybridge,chassis_nr=5,shpc=on,addr=ff"
|
|
||||||
devicePCIEBridgeString = "-device pcie-pci-bridge,bus=/pci-bus/pcie.0,id=mybridge,addr=ff"
|
|
||||||
romfile = ""
|
romfile = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -495,52 +495,6 @@ func TestAppendDeviceSCSIController(t *testing.T) {
|
|||||||
testAppend(scsiCon, deviceSCSIControllerBusAddrStr, t)
|
testAppend(scsiCon, deviceSCSIControllerBusAddrStr, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAppendPCIBridgeDevice(t *testing.T) {
|
|
||||||
|
|
||||||
bridge := BridgeDevice{
|
|
||||||
Type: PCIBridge,
|
|
||||||
ID: "mybridge",
|
|
||||||
Bus: "/pci-bus/pcie.0",
|
|
||||||
Addr: "255",
|
|
||||||
Chassis: 5,
|
|
||||||
SHPC: true,
|
|
||||||
ROMFile: romfile,
|
|
||||||
}
|
|
||||||
|
|
||||||
testAppend(bridge, devicePCIBridgeString, t)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAppendPCIBridgeDeviceWithReservations(t *testing.T) {
|
|
||||||
|
|
||||||
bridge := BridgeDevice{
|
|
||||||
Type: PCIBridge,
|
|
||||||
ID: "mybridge",
|
|
||||||
Bus: "/pci-bus/pcie.0",
|
|
||||||
Addr: "255",
|
|
||||||
Chassis: 5,
|
|
||||||
SHPC: false,
|
|
||||||
ROMFile: romfile,
|
|
||||||
IOReserve: "4k",
|
|
||||||
MemReserve: "1m",
|
|
||||||
Pref64Reserve: "1m",
|
|
||||||
}
|
|
||||||
|
|
||||||
testAppend(bridge, devicePCIBridgeStringReserved, t)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAppendPCIEBridgeDevice(t *testing.T) {
|
|
||||||
|
|
||||||
bridge := BridgeDevice{
|
|
||||||
Type: PCIEBridge,
|
|
||||||
ID: "mybridge",
|
|
||||||
Bus: "/pci-bus/pcie.0",
|
|
||||||
Addr: "255",
|
|
||||||
ROMFile: "efi-virtio.rom",
|
|
||||||
}
|
|
||||||
|
|
||||||
testAppend(bridge, devicePCIEBridgeString, t)
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestAppendEmptyDevice(t *testing.T) {
|
func TestAppendEmptyDevice(t *testing.T) {
|
||||||
device := SerialDevice{}
|
device := SerialDevice{}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user