Skip to content

Commit

Permalink
tests/acceptance: test s390x zpci fid propagation
Browse files Browse the repository at this point in the history
Verify that a fid specified on the command line shows up correctly
as the function_id in the guest.

Signed-off-by: Cornelia Huck <[email protected]>
[re-formatted overlong lines]
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Wainer dos Santos Moschetta <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
cohuck committed Dec 11, 2020
1 parent 864852c commit 085cec5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/acceptance/machine_s390_ccw_virtio.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ def test_s390x_devices(self):
'-device',
'virtio-rng-ccw,devno=fe.3.1234,max_revision=2',
'-device', 'zpci,uid=5,target=zzz',
'-device', 'virtio-net-pci,id=zzz')
'-device', 'virtio-net-pci,id=zzz',
'-device', 'zpci,uid=0xa,fid=12,target=serial',
'-device', 'virtio-serial-pci,id=serial')
self.vm.launch()

shell_ready = "sh: can't access tty; job control turned off"
Expand All @@ -65,11 +67,11 @@ def test_s390x_devices(self):
exec_command_and_wait_for_pattern(self, 'exit', shell_ready)

ccw_bus_ids="0.1.1111 0.2.0000 0.3.1234"
pci_bus_id="0005:00:00.0"
pci_bus_ids="0005:00:00.0 000a:00:00.0"
exec_command_and_wait_for_pattern(self, 'ls /sys/bus/ccw/devices/',
ccw_bus_ids)
exec_command_and_wait_for_pattern(self, 'ls /sys/bus/pci/devices/',
pci_bus_id)
pci_bus_ids)
# check that the device at 0.2.0000 is in legacy mode, while the
# device at 0.3.1234 has the virtio-1 feature bit set
virtio_rng_features="00000000000000000000000000001100" + \
Expand All @@ -93,3 +95,7 @@ def test_s390x_devices(self):
exec_command_and_wait_for_pattern(self,
'cat /sys/bus/pci/devices/0005\:00\:00.0/subsystem_device',
'0x0001')
# check fid propagation
exec_command_and_wait_for_pattern(self,
'cat /sys/bus/pci/devices/000a\:00\:00.0/function_id',
'0x0000000c')

0 comments on commit 085cec5

Please sign in to comment.