Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ message ConfigExpectations {
repeated SystemConfig config_expectations = 1;
}

message GuestOsSelector {
// The minimum kernel version (inclusive) required for this expectation to
// apply, e.g. "6.8.0" or "6.8".
string min_kernel_version = 1;

// The maximum kernel version (inclusive) required for this expectation to
// apply, e.g. "6.8.0" or "6.8".
string max_kernel_version = 2;
}

// Configuration for a particular variant of a machine.
// Keyed on machine type and NIC types.
message SystemConfig {
Expand All @@ -35,6 +45,9 @@ message SystemConfig {
// The GCE machine type e.g. "n2d-standard-2".
string machine_type = 2;

// Criteria for matching properties of the VM's guest OS.
GuestOsSelector guest_os_selector = 3;

// NICs in the VM. This includes any device expected to be created by the
// GCE stack, but not any created by the user (e.g. not `lo` or `docker0`).
repeated NicExpectation nics = 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,53 @@ config_expectations: {
}
}
config_expectations: {
description: "n2-32 with single GVNIC"
description: "n2-32 with single GVNIC (with GVE NUMA locality awareness)"
machine_type: "n2-highcpu-32"
guest_os_selector: {
min_kernel_version: "6.17"
}
nics: {
type: "GVNIC"
tx_queues: { index: 0 irq_cpulist: "0" xps_cpulist: "0" }
tx_queues: { index: 1 irq_cpulist: "1" xps_cpulist: "1" }
tx_queues: { index: 2 irq_cpulist: "2" xps_cpulist: "2" }
tx_queues: { index: 3 irq_cpulist: "3" xps_cpulist: "3" }
tx_queues: { index: 4 irq_cpulist: "4" xps_cpulist: "4" }
tx_queues: { index: 5 irq_cpulist: "5" xps_cpulist: "5" }
tx_queues: { index: 6 irq_cpulist: "6" xps_cpulist: "6" }
tx_queues: { index: 7 irq_cpulist: "7" xps_cpulist: "7" }
tx_queues: { index: 8 irq_cpulist: "16" xps_cpulist: "8" }
tx_queues: { index: 9 irq_cpulist: "17" xps_cpulist: "9" }
tx_queues: { index: 10 irq_cpulist: "18" xps_cpulist: "10" }
tx_queues: { index: 11 irq_cpulist: "19" xps_cpulist: "11" }
tx_queues: { index: 12 irq_cpulist: "20" xps_cpulist: "12" }
tx_queues: { index: 13 irq_cpulist: "21" xps_cpulist: "13" }
tx_queues: { index: 14 irq_cpulist: "22" xps_cpulist: "14" }
tx_queues: { index: 15 irq_cpulist: "23" xps_cpulist: "15" }
rx_queues: { index: 0 irq_cpulist: "0" }
rx_queues: { index: 1 irq_cpulist: "1" }
rx_queues: { index: 2 irq_cpulist: "2" }
rx_queues: { index: 3 irq_cpulist: "3" }
rx_queues: { index: 4 irq_cpulist: "4" }
rx_queues: { index: 5 irq_cpulist: "5" }
rx_queues: { index: 6 irq_cpulist: "6" }
rx_queues: { index: 7 irq_cpulist: "7" }
rx_queues: { index: 8 irq_cpulist: "16" }
rx_queues: { index: 9 irq_cpulist: "17" }
rx_queues: { index: 10 irq_cpulist: "18" }
rx_queues: { index: 11 irq_cpulist: "19" }
rx_queues: { index: 12 irq_cpulist: "20" }
rx_queues: { index: 13 irq_cpulist: "21" }
rx_queues: { index: 14 irq_cpulist: "22" }
rx_queues: { index: 15 irq_cpulist: "23" }
}
}
config_expectations: {
description: "n2-32 with single GVNIC (without GVE NUMA locality awareness)"
machine_type: "n2-highcpu-32"
guest_os_selector: {
max_kernel_version: "6.16.999"
}
nics: {
type: "GVNIC"
tx_queues: { index: 0 irq_cpulist: "0" xps_cpulist: "0" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,28 @@ func TestRingSizes(t *testing.T) {
})
}
}

func TestKernelVersionFormat(t *testing.T) {
c := proto()
for _, config := range c.GetConfigExpectations() {
t.Run(config.GetDescription(), func(t *testing.T) {
minVer := config.GetGuestOsSelector().GetMinKernelVersion()
if minVer != "" {
if len(networkutils.ParseKernelVersion(minVer)) == 0 {
t.Errorf("Empty or invalid min_kernel_version string: %q", minVer)
}
}
maxVer := config.GetGuestOsSelector().GetMaxKernelVersion()
if maxVer != "" {
if len(networkutils.ParseKernelVersion(maxVer)) == 0 {
t.Errorf("Empty or invalid max_kernel_version string: %q", maxVer)
}
}
if minVer != "" && maxVer != "" {
if networkutils.CompareKernelVersion(minVer, maxVer) > 0 {
t.Errorf("min_kernel_version (%q) is greater than max_kernel_version (%q)", minVer, maxVer)
}
}
})
}
}
Loading