mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Add nvproxy test to ensure ABI and struct name maps cover the same ioctls.
PiperOrigin-RevId: 658078138
This commit is contained in:
@@ -37,3 +37,36 @@ func TestAllSupportedHashesPresent(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TestABIStructNamesInSync tests that all the supported ioctls in an ABI version are also mapped
|
||||
// by GetStructNames.
|
||||
func TestABIStructNamesInSync(t *testing.T) {
|
||||
Init()
|
||||
for version, abiCons := range abis {
|
||||
t.Run(version.String(), func(t *testing.T) {
|
||||
abi := abiCons.cons()
|
||||
structNames := abi.getStructNames()
|
||||
|
||||
for ioctl := range abi.frontendIoctl {
|
||||
if _, ok := structNames.frontendNames[ioctl]; !ok {
|
||||
t.Errorf("Frontend ioctl %#x not found in struct names for version %v", ioctl, version.String())
|
||||
}
|
||||
}
|
||||
for ioctl := range abi.uvmIoctl {
|
||||
if _, ok := structNames.uvmNames[ioctl]; !ok {
|
||||
t.Errorf("UVM ioctl %#x not found in struct names for version %v", ioctl, version.String())
|
||||
}
|
||||
}
|
||||
for ioctl := range abi.controlCmd {
|
||||
if _, ok := structNames.controlNames[ioctl]; !ok {
|
||||
t.Errorf("Control command %#x not found in struct names for version %v", ioctl, version.String())
|
||||
}
|
||||
}
|
||||
for ioctl := range abi.allocationClass {
|
||||
if _, ok := structNames.allocationNames[ioctl]; !ok {
|
||||
t.Errorf("Alloc class %#x not found in struct names for version %v", ioctl, version.String())
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user