1
0
mirror of https://github.com/kata-containers/kata-containers.git synced 2025-04-29 12:14:48 +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:
Jakob Naucke 2022-01-20 13:45:03 +01:00
parent dc285ab1d7
commit 79ecebb280
No known key found for this signature in database
GPG Key ID: 45FA1C7D310C0EBE
3 changed files with 46 additions and 51 deletions

View File

@ -1,4 +1,3 @@
//go:build !s390x
// +build !s390x
// 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) {
var pcieRootPortID string

View File

@ -1,5 +1,3 @@
// +build s390x
// Copyright contributors to the Virtual Machine Manager for Go project
//
// SPDX-License-Identifier: Apache-2.0
@ -22,8 +20,6 @@ var (
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
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 = ""
)

View File

@ -495,52 +495,6 @@ func TestAppendDeviceSCSIController(t *testing.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) {
device := SerialDevice{}