From 800001862656aabeef3705e0ebab2f9bd8dca79d Mon Sep 17 00:00:00 2001 From: Jay Vyas Date: Tue, 28 Mar 2023 14:32:35 -0400 Subject: [PATCH 1/2] pci passthrough unit tests reproducer of nested arrays issue --- tkg/tkgctl/helpers_test.go | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tkg/tkgctl/helpers_test.go b/tkg/tkgctl/helpers_test.go index bcd5cbd696..8a7ba4cd17 100644 --- a/tkg/tkgctl/helpers_test.go +++ b/tkg/tkgctl/helpers_test.go @@ -15,6 +15,52 @@ import ( "github.com/vmware-tanzu/tanzu-framework/tkg/utils" ) +var _ = Describe("PCI Parameters", func() { + It("Should parse nested stuff", func() { + + values1 := []interface{}{ + map[string]interface{}{ + "class": "tkg-worker", + "name": "md-0-gpu", + "variables": map[string]interface{}{ + "overrides": []interface{}{ + map[string]interface{}{ + "name": "worker", + "value": map[string]interface{}{ + "count": 1, + "machine": map[string]interface{}{ + "customVMXKeys": map[string]interface{}{ + "pciPassthru.64bitMMIOSizeGB": "16", + "pciPassthru.RelaxACSforP2P": "true", + "pciPassthru.allowP2P": "true", + "pciPassthru.use64bitMMIO": "true", + }, + "diskGiB": 300, + "memoryMiB": 16384, + "numCPUs": 4, + "hardwareVersion": "vmx-17", + "pciDeviceId": 7864, + "pciVendorId": 4318, + "devices": []interface{}{ + map[string]interface{}{ + "deviceId": "7864", + "vendorId": "4318", + }, + }, + }, + }, + }, + }, + }, + }, + } + + output1 := map[string]interface{}{} + + processYamlObjectArrayInterfaceType(values1, constants.TopologyWorkersMachineDeployments, output1) + }) +}) + var _ = Describe("Cluster Class - IP Family Validation related test cases: ", func() { var cidrsIpv6Ipv4 string var cidrsIpv4 string From d2d9dda3a9238de7e6c0f9ea0a8a0b071771a2e0 Mon Sep 17 00:00:00 2001 From: Jay Vyas Date: Tue, 28 Mar 2023 14:44:07 -0400 Subject: [PATCH 2/2] pci passthrough unit tests reproducer of nested arrays issue 2 --- tkg/tkgctl/helpers_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tkg/tkgctl/helpers_test.go b/tkg/tkgctl/helpers_test.go index 8a7ba4cd17..a67f6c67af 100644 --- a/tkg/tkgctl/helpers_test.go +++ b/tkg/tkgctl/helpers_test.go @@ -15,7 +15,7 @@ import ( "github.com/vmware-tanzu/tanzu-framework/tkg/utils" ) -var _ = Describe("PCI Parameters", func() { +var _ = Describe("PCI Parameters for node pools with GPUs", func() { It("Should parse nested stuff", func() { values1 := []interface{}{