Skip to content

OCPQE-26834 - GCP capi cases disks/ShieldedVms,Confidential VMs #341

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

miyadav
Copy link
Member

@miyadav miyadav commented Nov 20, 2024

@sunzhaohua2 @huali9 @RadekManak @damdo @racheljpg PTAL when time permits,
All tests works well .. Added some info in comments for few scenarios.

@openshift-ci openshift-ci bot requested review from elmiko and RadekManak November 20, 2024 06:02
@miyadav
Copy link
Member Author

miyadav commented Nov 20, 2024

@sunzhaohua2 , here is the run with latest commits PTAL , when time permits , added all reviews

`miyadav@miyadav-thinkpadx1carbongen8:~/cluster-api-actuator-pkg$ ./hack/ci-integration.sh -focus "Cluster API GCP MachineSet" -v  
Running Suite: Machine Suite - /home/miyadav/cluster-api-actuator-pkg/pkg
=========================================================================
Random Seed: 1732095369

Will run 6 of 48 specs
------------------------------
[BeforeSuite] 
/home/miyadav/cluster-api-actuator-pkg/pkg/e2e_test.go:63
[BeforeSuite] PASSED [3.894 seconds]
------------------------------
SSSSSSSS
------------------------------
Cluster API GCP MachineSet should be able to run a machine with disk types Disk type pd-standard
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:96
  STEP: Creating core cluster @ 11/20/24 15:06:27.439
  STEP: Creating GCP machine template @ 11/20/24 15:06:33.694
  STEP: Creating MachineSet "gcp-machineset-77825" @ 11/20/24 15:06:35.291
  STEP: Waiting for MachineSet machines "gcp-machineset-77825" to enter Running phase @ 11/20/24 15:06:35.886
  STEP: Deleting MachineSet "gcp-machineset-77825" @ 11/20/24 15:12:30.879
  STEP: Waiting for MachineSet "gcp-machineset-77825" to be deleted @ 11/20/24 15:12:31.176
  STEP: Deleting /gcp-machine-template @ 11/20/24 15:13:09.122
• [407.525 seconds]
------------------------------
Cluster API GCP MachineSet should be able to run a machine with disk types Disk type pd-ssd
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:97
  STEP: Creating GCP machine template @ 11/20/24 15:13:12.156
  STEP: Creating MachineSet "gcp-machineset-77825" @ 11/20/24 15:13:13.123
  STEP: Waiting for MachineSet machines "gcp-machineset-77825" to enter Running phase @ 11/20/24 15:13:14.443
  STEP: Deleting MachineSet "gcp-machineset-77825" @ 11/20/24 15:16:37.871
  STEP: Waiting for MachineSet "gcp-machineset-77825" to be deleted @ 11/20/24 15:16:38.163
  STEP: Deleting /gcp-machine-template @ 11/20/24 15:17:25.879
• [255.013 seconds]
------------------------------
Cluster API GCP MachineSet should configure Shielded VM options correctly all Shielded VM options enabled
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:141
  STEP: Creating GCP machine template @ 11/20/24 15:17:26.766
  STEP: Creating MachineSet "gcp-machineset-shieldedvm-74795" @ 11/20/24 15:17:27.095
  STEP: Waiting for MachineSet machines "gcp-machineset-shieldedvm-74795" to enter Running phase @ 11/20/24 15:17:27.393
  STEP: Verifying the Shielded VM configuration on the created GCP MachineTemplate @ 11/20/24 15:21:06.568
  STEP: Deleting MachineSet "gcp-machineset-shieldedvm-74795" @ 11/20/24 15:21:06.856
  STEP: Waiting for MachineSet "gcp-machineset-shieldedvm-74795" to be deleted @ 11/20/24 15:21:07.146
  STEP: Deleting /gcp-machine-template @ 11/20/24 15:21:40.24
• [254.695 seconds]
------------------------------
Cluster API GCP MachineSet should configure Shielded VM options correctly only SecureBoot enabled
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:142
  STEP: Creating GCP machine template @ 11/20/24 15:21:41.946
  STEP: Creating MachineSet "gcp-machineset-shieldedvm-74795" @ 11/20/24 15:21:42.251
  STEP: Waiting for MachineSet machines "gcp-machineset-shieldedvm-74795" to enter Running phase @ 11/20/24 15:21:43.662
  STEP: Verifying the Shielded VM configuration on the created GCP MachineTemplate @ 11/20/24 15:25:23.827
  STEP: Deleting MachineSet "gcp-machineset-shieldedvm-74795" @ 11/20/24 15:25:24.115
  STEP: Waiting for MachineSet "gcp-machineset-shieldedvm-74795" to be deleted @ 11/20/24 15:25:24.407
  STEP: Deleting /gcp-machine-template @ 11/20/24 15:26:11.722
• [271.630 seconds]
------------------------------
Cluster API GCP MachineSet should configure Confidential VM correctly Confidential Compute enabled
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:195
  STEP: Creating a GCP MachineTemplate for Confidential VM @ 11/20/24 15:26:13.092
  STEP: Creating GCP machine template @ 11/20/24 15:26:13.093
  STEP: Creating a MachineSet for Confidential VM @ 11/20/24 15:26:13.395
  STEP: Creating MachineSet "gcp-machineset-confidential-74703" @ 11/20/24 15:26:13.395
  STEP: Waiting for MachineSet machines "gcp-machineset-confidential-74703" to enter Running phase @ 11/20/24 15:26:14.232
  STEP: Verifying the Confidential VM configuration on the created GCP MachineTemplate @ 11/20/24 15:29:58.381
  STEP: Deleting MachineSet "gcp-machineset-confidential-74703" @ 11/20/24 15:29:58.669
  STEP: Waiting for MachineSet "gcp-machineset-confidential-74703" to be deleted @ 11/20/24 15:29:58.961
  STEP: Deleting /gcp-machine-template @ 11/20/24 15:30:48.943
• [276.552 seconds]
------------------------------
Cluster API GCP MachineSet should configure Confidential VM correctly Confidential Compute disabled
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:196
  STEP: Creating a GCP MachineTemplate for Confidential VM @ 11/20/24 15:30:49.642
  STEP: Creating GCP machine template @ 11/20/24 15:30:49.642
  STEP: Creating a MachineSet for Confidential VM @ 11/20/24 15:30:49.945
  STEP: Creating MachineSet "gcp-machineset-confidential-74703" @ 11/20/24 15:30:49.945
  STEP: Waiting for MachineSet machines "gcp-machineset-confidential-74703" to enter Running phase @ 11/20/24 15:30:50.485
  STEP: Verifying the Confidential VM configuration on the created GCP MachineTemplate @ 11/20/24 15:34:29.004
  STEP: Deleting MachineSet "gcp-machineset-confidential-74703" @ 11/20/24 15:34:29.332
  STEP: Waiting for MachineSet "gcp-machineset-confidential-74703" to be deleted @ 11/20/24 15:34:29.624
  STEP: Deleting /gcp-machine-template @ 11/20/24 15:35:20.586
• [273.030 seconds]
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
[ReportAfterSuite] Autogenerated ReportAfterSuite for --junit-report
autogenerated by Ginkgo
[ReportAfterSuite] PASSED [0.010 seconds]
------------------------------

Ran 6 of 48 Specs in 1742.342 seconds
SUCCESS! -- 6 Passed | 0 Failed | 0 Pending | 42 Skipped
PASS

Ginkgo ran 1 suite in 29m13.10920284s
Test Suite Passed`

@miyadav
Copy link
Member Author

miyadav commented Nov 21, 2024

miyadav@miyadav-thinkpadx1carbongen8:~/cluster-api-actuator-pkg$ ./hack/ci-integration.sh -focus "Cluster API GCP MachineSet" -v
Running Suite: Machine Suite - /home/miyadav/cluster-api-actuator-pkg/pkg
=========================================================================
Random Seed: 1732193534

Will run 6 of 48 specs
------------------------------
[BeforeSuite] 
/home/miyadav/cluster-api-actuator-pkg/pkg/e2e_test.go:63
[BeforeSuite] PASSED [0.953 seconds]
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
Cluster API GCP MachineSet should be able to run a machine with disk types Disk type pd-standard [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:99
  STEP: Creating core cluster @ 11/21/24 18:22:26.952
  STEP: Creating GCP machine template @ 11/21/24 18:22:29.031
  STEP: Creating MachineSet "gcp-machineset-77825" @ 11/21/24 18:22:29.614
  STEP: Waiting for MachineSet machines "gcp-machineset-77825" to enter Running phase @ 11/21/24 18:22:30.322
  STEP: Deleting MachineSet "gcp-machineset-77825" @ 11/21/24 18:27:50.278
  STEP: Waiting for MachineSet "gcp-machineset-77825" to be deleted @ 11/21/24 18:27:52.88
  STEP: Deleting /gcp-machine-template @ 11/21/24 18:28:26.498
• [361.538 seconds]
------------------------------
Cluster API GCP MachineSet should be able to run a machine with disk types Disk type pd-ssd [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:100
  STEP: Creating GCP machine template @ 11/21/24 18:28:27.107
  STEP: Creating MachineSet "gcp-machineset-77825" @ 11/21/24 18:28:27.5
  STEP: Waiting for MachineSet machines "gcp-machineset-77825" to enter Running phase @ 11/21/24 18:28:27.801
  STEP: Deleting MachineSet "gcp-machineset-77825" @ 11/21/24 18:32:19.731
  STEP: Waiting for MachineSet "gcp-machineset-77825" to be deleted @ 11/21/24 18:32:20.485
  STEP: Deleting /gcp-machine-template @ 11/21/24 18:33:04.138
• [277.947 seconds]
------------------------------
Cluster API GCP MachineSet should configure Shielded VM options correctly all Shielded VM options enabled [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:146
  STEP: Creating GCP machine template @ 11/21/24 18:33:05.2
  STEP: Creating MachineSet "gcp-machineset-shieldedvm-74795" @ 11/21/24 18:33:05.798
  STEP: Waiting for MachineSet machines "gcp-machineset-shieldedvm-74795" to enter Running phase @ 11/21/24 18:33:06.762
  STEP: Verifying the Shielded VM configuration on the created GCP MachineTemplate @ 11/21/24 19:02:44.311
  STEP: Deleting MachineSet "gcp-machineset-shieldedvm-74795" @ 11/21/24 19:02:44.631
  STEP: Waiting for MachineSet "gcp-machineset-shieldedvm-74795" to be deleted @ 11/21/24 19:02:45.004
  STEP: Deleting /gcp-machine-template @ 11/21/24 19:03:34.243
• [311.354 seconds]
------------------------------
Cluster API GCP MachineSet should configure Shielded VM options correctly only SecureBoot enabled [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:147
  STEP: Creating GCP machine template @ 11/21/24 19:03:34.855
  STEP: Creating MachineSet "gcp-machineset-shieldedvm-74795" @ 11/21/24 19:03:35.152
  STEP: Waiting for MachineSet machines "gcp-machineset-shieldedvm-74795" to enter Running phase @ 11/21/24 19:03:35.514
  STEP: Verifying the Shielded VM configuration on the created GCP MachineTemplate @ 11/21/24 19:09:03.874
  STEP: Deleting MachineSet "gcp-machineset-shieldedvm-74795" @ 11/21/24 19:09:04.152
  STEP: Waiting for MachineSet "gcp-machineset-shieldedvm-74795" to be deleted @ 11/21/24 19:09:04.438
  STEP: Deleting /gcp-machine-template @ 11/21/24 19:09:47.998
• [373.991 seconds]
------------------------------
Cluster API GCP MachineSet should configure Confidential VM correctly Confidential Compute enabled [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:206
  STEP: Creating GCP machine template @ 11/21/24 19:09:48.847
  STEP: Creating a MachineSet for Confidential VM @ 11/21/24 19:09:49.236
  STEP: Creating MachineSet "gcp-machineset-confidential-74703" @ 11/21/24 19:09:49.236
  STEP: Waiting for MachineSet machines "gcp-machineset-confidential-74703" to enter Running phase @ 11/21/24 19:09:49.53
  STEP: Verifying the Confidential VM configuration on the created GCP MachineTemplate @ 11/21/24 19:15:17.918
  STEP: Deleting MachineSet "gcp-machineset-confidential-74703" @ 11/21/24 19:15:18.196
  STEP: Waiting for MachineSet "gcp-machineset-confidential-74703" to be deleted @ 11/21/24 19:15:18.811
  STEP: Deleting /gcp-machine-template @ 11/21/24 19:15:57.636
• [369.367 seconds]
------------------------------
Cluster API GCP MachineSet should configure Confidential VM correctly Confidential Compute disabled [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:207
  STEP: Creating GCP machine template @ 11/21/24 19:15:58.215
  STEP: Creating a MachineSet for Confidential VM @ 11/21/24 19:15:58.547
  STEP: Creating MachineSet "gcp-machineset-confidential-74703" @ 11/21/24 19:15:58.547
  STEP: Waiting for MachineSet machines "gcp-machineset-confidential-74703" to enter Running phase @ 11/21/24 19:15:58.839
  STEP: Verifying the Confidential VM configuration on the created GCP MachineTemplate @ 11/21/24 19:20:56.553
  STEP: Deleting MachineSet "gcp-machineset-confidential-74703" @ 11/21/24 19:20:57.613
  STEP: Waiting for MachineSet "gcp-machineset-confidential-74703" to be deleted @ 11/21/24 19:20:59.982
  STEP: Deleting /gcp-machine-template @ 11/21/24 19:21:39.859
• [343.254 seconds]
------------------------------
SS
------------------------------
[ReportAfterSuite] Autogenerated ReportAfterSuite for --junit-report
autogenerated by Ginkgo
[ReportAfterSuite] PASSED [0.003 seconds]
------------------------------

Ran 6 of 48 Specs in 2038.406 seconds
SUCCESS! -- 6 Passed | 0 Failed | 0 Pending | 42 Skipped
PASS

Ginkgo ran 1 suite in 34m8.162623478s
Test Suite Passed

@miyadav
Copy link
Member Author

miyadav commented Nov 22, 2024

`miyadav@miyadav-thinkpadx1carbongen8:~/cluster-api-actuator-pkg$ ./hack/ci-integration.sh -focus "Cluster API GCP MachineSet" -v
Running Suite: Machine Suite - /home/miyadav/cluster-api-actuator-pkg/pkg
=========================================================================
Random Seed: 1732253510

Will run 8 of 50 specs
------------------------------
[BeforeSuite] 
/home/miyadav/cluster-api-actuator-pkg/pkg/e2e_test.go:63
[BeforeSuite] PASSED [0.939 seconds]
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
Cluster API GCP MachineSet should be able to run a machine with disk types Disk type pd-standard [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:103
  STEP: Creating core cluster @ 11/22/24 11:01:59.991
  STEP: Creating GCP machine template @ 11/22/24 11:02:02.054
  STEP: Creating MachineSet "gcp-machineset-77825" @ 11/22/24 11:02:02.756
  STEP: Waiting for MachineSet machines "gcp-machineset-77825" to enter Running phase @ 11/22/24 11:02:03.101
  STEP: Deleting MachineSet "gcp-machineset-77825" @ 11/22/24 11:07:18.251
  STEP: Waiting for MachineSet "gcp-machineset-77825" to be deleted @ 11/22/24 11:07:18.542
  STEP: Deleting /gcp-machine-template @ 11/22/24 11:07:56.383
• [358.007 seconds]
------------------------------
Cluster API GCP MachineSet should be able to run a machine with disk types Disk type pd-ssd [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:104
  STEP: Creating GCP machine template @ 11/22/24 11:07:57.066
  STEP: Creating MachineSet "gcp-machineset-77825" @ 11/22/24 11:07:57.366
  STEP: Waiting for MachineSet machines "gcp-machineset-77825" to enter Running phase @ 11/22/24 11:07:57.661
  STEP: Deleting MachineSet "gcp-machineset-77825" @ 11/22/24 11:12:01.833
  STEP: Waiting for MachineSet "gcp-machineset-77825" to be deleted @ 11/22/24 11:12:02.204
  STEP: Deleting /gcp-machine-template @ 11/22/24 11:12:50.742
• [294.379 seconds]
------------------------------
Cluster API GCP MachineSet should configure Shielded VM options correctly all Shielded VM options enabled [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:151
  STEP: Creating GCP machine template @ 11/22/24 11:12:51.431
  STEP: Creating MachineSet "gcp-machineset-shieldedvm-74795" @ 11/22/24 11:12:51.766
  STEP: Waiting for MachineSet machines "gcp-machineset-shieldedvm-74795" to enter Running phase @ 11/22/24 11:12:52.077
  STEP: Verifying the Shielded VM configuration on the created GCP MachineTemplate @ 11/22/24 11:18:23.067
  STEP: Deleting MachineSet "gcp-machineset-shieldedvm-74795" @ 11/22/24 11:18:23.44
  STEP: Waiting for MachineSet "gcp-machineset-shieldedvm-74795" to be deleted @ 11/22/24 11:18:23.748
  STEP: Deleting /gcp-machine-template @ 11/22/24 11:19:07.267
• [376.502 seconds]
------------------------------
Cluster API GCP MachineSet should configure Shielded VM options correctly only SecureBoot enabled [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:152
  STEP: Creating GCP machine template @ 11/22/24 11:19:07.936
  STEP: Creating MachineSet "gcp-machineset-shieldedvm-74795" @ 11/22/24 11:19:08.245
  STEP: Waiting for MachineSet machines "gcp-machineset-shieldedvm-74795" to enter Running phase @ 11/22/24 11:19:08.544
  STEP: Verifying the Shielded VM configuration on the created GCP MachineTemplate @ 11/22/24 11:26:20.545
  STEP: Deleting MachineSet "gcp-machineset-shieldedvm-74795" @ 11/22/24 11:26:20.828
  STEP: Waiting for MachineSet "gcp-machineset-shieldedvm-74795" to be deleted @ 11/22/24 11:26:21.115
  STEP: Deleting /gcp-machine-template @ 11/22/24 11:27:04.284
• [477.021 seconds]
------------------------------
Cluster API GCP MachineSet should configure Confidential VM correctly Confidential Compute enabled [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:211
  STEP: Creating GCP machine template @ 11/22/24 11:27:04.956
  STEP: Creating a MachineSet for Confidential VM @ 11/22/24 11:27:05.259
  STEP: Creating MachineSet "gcp-machineset-confidential-74703" @ 11/22/24 11:27:05.26
  STEP: Waiting for MachineSet machines "gcp-machineset-confidential-74703" to enter Running phase @ 11/22/24 11:27:05.579
  STEP: Verifying the Confidential VM configuration on the created GCP MachineTemplate @ 11/22/24 11:32:40.223
  STEP: Deleting MachineSet "gcp-machineset-confidential-74703" @ 11/22/24 11:32:40.529
  STEP: Waiting for MachineSet "gcp-machineset-confidential-74703" to be deleted @ 11/22/24 11:32:40.817
  STEP: Deleting /gcp-machine-template @ 11/22/24 11:33:18.621
• [374.356 seconds]
------------------------------
Cluster API GCP MachineSet should configure Confidential VM correctly Confidential Compute disabled [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:212
  STEP: Creating GCP machine template @ 11/22/24 11:33:19.24
  STEP: Creating a MachineSet for Confidential VM @ 11/22/24 11:33:19.646
  STEP: Creating MachineSet "gcp-machineset-confidential-74703" @ 11/22/24 11:33:19.646
  STEP: Waiting for MachineSet machines "gcp-machineset-confidential-74703" to enter Running phase @ 11/22/24 11:33:19.953
  STEP: Verifying the Confidential VM configuration on the created GCP MachineTemplate @ 11/22/24 11:38:49.453
  STEP: Deleting MachineSet "gcp-machineset-confidential-74703" @ 11/22/24 11:38:49.784
  STEP: Waiting for MachineSet "gcp-machineset-confidential-74703" to be deleted @ 11/22/24 11:38:50.092
  STEP: Deleting /gcp-machine-template @ 11/22/24 11:39:38.526
• [379.915 seconds]
------------------------------
Cluster API GCP MachineSet should provision GPU machine successfully [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:216
  STEP: Creating GCP machine template @ 11/22/24 11:39:39.143
  STEP: Creating a MachineSet for GPU machine @ 11/22/24 11:39:39.447
  STEP: Creating MachineSet "gcp-machineset-gpu-74732" @ 11/22/24 11:39:39.447
  STEP: Waiting for MachineSet machines "gcp-machineset-gpu-74732" to enter Running phase @ 11/22/24 11:39:39.754
  STEP: Verifying the GPU machinetype configuration on the created GCP MachineTemplate @ 11/22/24 11:45:13.861
  STEP: Deleting MachineSet "gcp-machineset-gpu-74732" @ 11/22/24 11:45:14.143
  STEP: Waiting for MachineSet "gcp-machineset-gpu-74732" to be deleted @ 11/22/24 11:45:14.475
  STEP: Deleting /gcp-machine-template @ 11/22/24 11:45:52.262
• [373.749 seconds]
------------------------------
Cluster API GCP MachineSet should provision Preemptible machine successfully [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:256
  STEP: Creating GCP machine template @ 11/22/24 11:45:52.903
  STEP: Creating a MachineSet for preeemptible machine @ 11/22/24 11:45:53.309
  STEP: Creating MachineSet "gcp-machineset-preemptible-75792" @ 11/22/24 11:45:53.309
  STEP: Waiting for MachineSet machines "gcp-machineset-preemptible-75792" to enter Running phase @ 11/22/24 11:45:53.619
  STEP: Verifying the preemptible machinetype configuration on the created GCP MachineTemplate @ 11/22/24 11:50:39.57
  STEP: Deleting MachineSet "gcp-machineset-preemptible-75792" @ 11/22/24 11:50:39.852
  STEP: Waiting for MachineSet "gcp-machineset-preemptible-75792" to be deleted @ 11/22/24 11:50:40.142
  STEP: Deleting /gcp-machine-template @ 11/22/24 11:51:39.123
• [346.830 seconds]
------------------------------
SSSSSSS
------------------------------
[ReportAfterSuite] Autogenerated ReportAfterSuite for --junit-report
autogenerated by Ginkgo
[ReportAfterSuite] PASSED [0.006 seconds]
------------------------------

Ran 8 of 50 Specs in 2981.700 seconds
SUCCESS! -- 8 Passed | 0 Failed | 0 Pending | 42 Skipped
PASS

Ginkgo ran 1 suite in 49m48.737077758s
Test Suite Passed`

@miyadav
Copy link
Member Author

miyadav commented Dec 3, 2024

/test e2e-aws-capi-techpreview e2e-gcp-capi-techpreview e2e-aws-operator

@miyadav
Copy link
Member Author

miyadav commented Dec 3, 2024

/test e2e-gcp-capi-techpreview

@miyadav miyadav force-pushed the gcp-capi-cases-all branch 5 times, most recently from 72de761 to b665e74 Compare December 20, 2024 08:38
@miyadav
Copy link
Member Author

miyadav commented Jan 2, 2025

@JoelSpeed could you take a look at this as well , if time permits....

pkg/capi/gcp.go Outdated
var confidentialComputevalue = *createdTemplate.Spec.Template.Spec.ConfidentialCompute
Expect(fmt.Sprintf("%v", confidentialComputevalue)).To(Equal(fmt.Sprintf("%v", *confidentialCompute)))
},
Entry("Confidential Compute enabled", &confidentialComputeEnabled),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use ptr.To rather than taking the pointer like this

From k8s.io/utils/ptr

We use it a lot in other tests

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was having some trouble , with validation if I was using ptr.To so , I removed pointer value from compare to a simple string , will include that in next commit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, any idea what the issue was?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value of *confidentialCompute is Enabled or Disabled I thought return value of ptr.To was boolean true/false whereas it can be pointer to any literal , will modify the code as below -

			expectedConfidentialComputeValue := ptr.To(
				map[bool]string{
					true:  "Enabled",
					false: "Disabled",
				}[*confidentialCompute == gcpv1.ConfidentialComputePolicyEnabled],
			)

			Expect(fmt.Sprintf("%v", *expectedConfidentialComputeValue)).To(Equal(fmt.Sprintf("%v", *confidentialCompute)))

@miyadav miyadav force-pushed the gcp-capi-cases-all branch from 8defd12 to eb84fb4 Compare January 9, 2025 09:35
@miyadav
Copy link
Member Author

miyadav commented Jan 9, 2025

/test e2e-gcp-capi-techpreview

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, left a couple of things

@miyadav miyadav force-pushed the gcp-capi-cases-all branch from eb84fb4 to 1da2322 Compare January 9, 2025 13:47
@miyadav
Copy link
Member Author

miyadav commented Jan 9, 2025

@damdo @JoelSpeed made the changes( templatename generation) , validated changes . Should be good . PTAL , when time permits , will trigger e2e as well.

`miyadav@miyadav-thinkpadx1carbongen8:~/cluster-api-actuator-pkg$ ./hack/ci-integration.sh -focus "should configure Confidential VM correctly" -v
Running Suite: Machine Suite - /home/miyadav/cluster-api-actuator-pkg/pkg
=========================================================================
Random Seed: 1736429522

Will run 2 of 59 specs
------------------------------
[BeforeSuite] 
/home/miyadav/cluster-api-actuator-pkg/pkg/e2e_test.go:68
[BeforeSuite] PASSED [0.888 seconds]
------------------------------
SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
------------------------------
Cluster API GCP MachineSet should configure Confidential VM correctly Confidential Compute enabled [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:207
  STEP: Creating core cluster @ 01/09/25 19:02:13.397
  STEP: Creating GCP machine template @ 01/09/25 19:02:15.432
  STEP: Creating a MachineSet for Confidential VM @ 01/09/25 19:02:16.039
  STEP: Creating MachineSet "gcp-machineset-confidential-74703" @ 01/09/25 19:02:16.039
  STEP: Waiting for MachineSet machines "gcp-machineset-confidential-74703" to enter Running phase @ 01/09/25 19:02:16.382
  STEP: Verifying the Confidential VM configuration on the created GCP MachineTemplate @ 01/09/25 19:08:03.064
  STEP: Deleting MachineSet "gcp-machineset-confidential-74703" @ 01/09/25 19:08:03.35
  STEP: Waiting for MachineSet "gcp-machineset-confidential-74703" to be deleted @ 01/09/25 19:08:03.648
  STEP: Deleting /gcpmachinetemplate-mxlkh @ 01/09/25 19:08:53.2
• [401.422 seconds]
------------------------------
Cluster API GCP MachineSet should configure Confidential VM correctly Confidential Compute disabled [capi, disruptive]
/home/miyadav/cluster-api-actuator-pkg/pkg/capi/gcp.go:208
  STEP: Creating GCP machine template @ 01/09/25 19:08:54.121
  STEP: Creating a MachineSet for Confidential VM @ 01/09/25 19:08:54.436
  STEP: Creating MachineSet "gcp-machineset-confidential-74703" @ 01/09/25 19:08:54.436
  STEP: Waiting for MachineSet machines "gcp-machineset-confidential-74703" to enter Running phase @ 01/09/25 19:08:54.747
  STEP: Verifying the Confidential VM configuration on the created GCP MachineTemplate @ 01/09/25 19:13:35.475
  STEP: Deleting MachineSet "gcp-machineset-confidential-74703" @ 01/09/25 19:13:35.756
  STEP: Waiting for MachineSet "gcp-machineset-confidential-74703" to be deleted @ 01/09/25 19:13:36.043
  STEP: Deleting /gcpmachinetemplate-44gcd @ 01/09/25 19:15:40.696
• [407.491 seconds]
------------------------------
S
------------------------------
[ReportAfterSuite] Autogenerated ReportAfterSuite for --junit-report
autogenerated by Ginkgo
[ReportAfterSuite] PASSED [0.012 seconds]
------------------------------

Ran 2 of 59 Specs in 809.803 seconds
SUCCESS! -- 2 Passed | 0 Failed | 0 Pending | 57 Skipped
PASS`

Copy link
Member

@damdo damdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the feedback @miyadav

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 9, 2025
pkg/capi/gcp.go Outdated
var confidentialComputevalue = *createdTemplate.Spec.Template.Spec.ConfidentialCompute
Expect(fmt.Sprintf("%v", confidentialComputevalue)).To(Equal(fmt.Sprintf("%v", *confidentialCompute)))
},
Entry("Confidential Compute enabled", &confidentialComputeEnabled),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, any idea what the issue was?

@miyadav miyadav force-pushed the gcp-capi-cases-all branch from 1da2322 to 0cef15b Compare January 10, 2025 04:32
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 10, 2025
pkg/capi/gcp.go Outdated
Comment on lines 146 to 191
// Define constants as variable for this case to pass values properly
confidentialComputeEnabled := gcpv1.ConfidentialComputePolicyEnabled
confidentialComputeDisabled := gcpv1.ConfidentialComputePolicyDisabled
DescribeTable("should configure Confidential VM correctly", framework.LabelCAPI, framework.LabelDisruptive,
func(confidentialCompute *gcpv1.ConfidentialComputePolicy) {
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
Expect(mapiProviderSpec).ToNot(BeNil())
gcpMachineTemplate = createGCPMachineTemplate(mapiProviderSpec)
gcpMachineTemplate.Spec.Template.Spec.ConfidentialCompute = confidentialCompute
gcpMachineTemplate.Spec.Template.Spec.InstanceType = "n2d-standard-4"

if *confidentialCompute == gcpv1.ConfidentialComputePolicyEnabled {
mapiProviderSpec.OnHostMaintenance = OnHostMaintenanceTerminate
gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = (*gcpv1.HostMaintenancePolicy)(&mapiProviderSpec.OnHostMaintenance)
} else {
mapiProviderSpec.OnHostMaintenance = "Migrate"
gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = (*gcpv1.HostMaintenancePolicy)(&mapiProviderSpec.OnHostMaintenance)
}

Expect(cl.Create(ctx, gcpMachineTemplate)).To(Succeed())

By("Creating a MachineSet for Confidential VM")
machineSet, err = framework.CreateCAPIMachineSet(ctx, cl, framework.NewCAPIMachineSetParams(
"gcp-machineset-confidential-74703",
clusterName,
mapiProviderSpec.Zone,
1,
corev1.ObjectReference{
Kind: "GCPMachineTemplate",
APIVersion: infraAPIVersion,
Name: gcpMachineTemplate.Name,
},
))
Expect(err).ToNot(HaveOccurred(), "Failed to create CAPI MachineSet with Confidential VM configuration")

framework.WaitForCAPIMachinesRunning(ctx, cl, machineSet.Name)

By("Verifying the Confidential VM configuration on the created GCP MachineTemplate")
createdTemplate := &gcpv1.GCPMachineTemplate{}
Expect(cl.Get(framework.GetContext(), client.ObjectKey{
Namespace: framework.ClusterAPINamespace,
Name: gcpMachineTemplate.Name,
}, createdTemplate)).To(Succeed())

expectedConfidentialComputeValue := ptr.To(
map[bool]string{
true: "Enabled",
false: "Disabled",
}[*confidentialCompute == gcpv1.ConfidentialComputePolicyEnabled],
)

Expect(fmt.Sprintf("%v", *expectedConfidentialComputeValue)).To(Equal(fmt.Sprintf("%v", *confidentialCompute)))

},
Entry("Confidential Compute enabled", &confidentialComputeEnabled),
Entry("Confidential Compute disabled", &confidentialComputeDisabled),
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be simplified if we don't use fewer pointers

Suggested change
// Define constants as variable for this case to pass values properly
confidentialComputeEnabled := gcpv1.ConfidentialComputePolicyEnabled
confidentialComputeDisabled := gcpv1.ConfidentialComputePolicyDisabled
DescribeTable("should configure Confidential VM correctly", framework.LabelCAPI, framework.LabelDisruptive,
func(confidentialCompute *gcpv1.ConfidentialComputePolicy) {
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
Expect(mapiProviderSpec).ToNot(BeNil())
gcpMachineTemplate = createGCPMachineTemplate(mapiProviderSpec)
gcpMachineTemplate.Spec.Template.Spec.ConfidentialCompute = confidentialCompute
gcpMachineTemplate.Spec.Template.Spec.InstanceType = "n2d-standard-4"
if *confidentialCompute == gcpv1.ConfidentialComputePolicyEnabled {
mapiProviderSpec.OnHostMaintenance = OnHostMaintenanceTerminate
gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = (*gcpv1.HostMaintenancePolicy)(&mapiProviderSpec.OnHostMaintenance)
} else {
mapiProviderSpec.OnHostMaintenance = "Migrate"
gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = (*gcpv1.HostMaintenancePolicy)(&mapiProviderSpec.OnHostMaintenance)
}
Expect(cl.Create(ctx, gcpMachineTemplate)).To(Succeed())
By("Creating a MachineSet for Confidential VM")
machineSet, err = framework.CreateCAPIMachineSet(ctx, cl, framework.NewCAPIMachineSetParams(
"gcp-machineset-confidential-74703",
clusterName,
mapiProviderSpec.Zone,
1,
corev1.ObjectReference{
Kind: "GCPMachineTemplate",
APIVersion: infraAPIVersion,
Name: gcpMachineTemplate.Name,
},
))
Expect(err).ToNot(HaveOccurred(), "Failed to create CAPI MachineSet with Confidential VM configuration")
framework.WaitForCAPIMachinesRunning(ctx, cl, machineSet.Name)
By("Verifying the Confidential VM configuration on the created GCP MachineTemplate")
createdTemplate := &gcpv1.GCPMachineTemplate{}
Expect(cl.Get(framework.GetContext(), client.ObjectKey{
Namespace: framework.ClusterAPINamespace,
Name: gcpMachineTemplate.Name,
}, createdTemplate)).To(Succeed())
expectedConfidentialComputeValue := ptr.To(
map[bool]string{
true: "Enabled",
false: "Disabled",
}[*confidentialCompute == gcpv1.ConfidentialComputePolicyEnabled],
)
Expect(fmt.Sprintf("%v", *expectedConfidentialComputeValue)).To(Equal(fmt.Sprintf("%v", *confidentialCompute)))
},
Entry("Confidential Compute enabled", &confidentialComputeEnabled),
Entry("Confidential Compute disabled", &confidentialComputeDisabled),
)
DescribeTable("should configure Confidential VM correctly", framework.LabelCAPI, framework.LabelDisruptive,
func(confidentialCompute gcpv1.ConfidentialComputePolicy) {
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
Expect(mapiProviderSpec).ToNot(BeNil())
gcpMachineTemplate = createGCPMachineTemplate(mapiProviderSpec)
gcpMachineTemplate.Spec.Template.Spec.ConfidentialCompute = ptr.To(confidentialCompute)
gcpMachineTemplate.Spec.Template.Spec.InstanceType = "n2d-standard-4"
switch confidentialCompute {
case gcpv1.ConfidentialComputePolicyEnabled:
mapiProviderSpec.OnHostMaintenance = OnHostMaintenanceTerminate
gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = ptr.To(gcpv1.HostMaintenancePolicy(mapiProviderSpec.OnHostMaintenance))
case gcpv1.ConfidentialComputePolicyDisabled:
mapiProviderSpec.OnHostMaintenance = "Migrate"
gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = ptr.To(gcpv1.HostMaintenancePolicy(mapiProviderSpec.OnHostMaintenance))
}
Expect(cl.Create(ctx, gcpMachineTemplate)).To(Succeed())
By("Creating a MachineSet for Confidential VM")
machineSet, err = framework.CreateCAPIMachineSet(ctx, cl, framework.NewCAPIMachineSetParams(
"gcp-machineset-confidential-74703",
clusterName,
mapiProviderSpec.Zone,
1,
corev1.ObjectReference{
Kind: "GCPMachineTemplate",
APIVersion: infraAPIVersion,
Name: gcpMachineTemplate.Name,
},
))
Expect(err).ToNot(HaveOccurred(), "Failed to create CAPI MachineSet with Confidential VM configuration")
framework.WaitForCAPIMachinesRunning(ctx, cl, machineSet.Name)
By("Verifying the Confidential VM configuration on the created GCP MachineTemplate")
createdTemplate := &gcpv1.GCPMachineTemplate{}
Expect(cl.Get(framework.GetContext(), client.ObjectKey{
Namespace: framework.ClusterAPINamespace,
Name: gcpMachineTemplate.Name,
}, createdTemplate)).To(Succeed())
Expect(createdTemplate.Spec.Template.Spec.ConfidentialCompute).To(HaveValue(Equal(confidentialCompute)))
},
Entry("Confidential Compute enabled", gcpv1.ConfidentialComputePolicyEnabled),
Entry("Confidential Compute disabled", gcpv1.ConfidentialComputePolicyDisabled),
)

pkg/capi/gcp.go Outdated
Comment on lines 190 to 197
expectedConfidentialComputeValue := ptr.To(
map[bool]string{
true: "Enabled",
false: "Disabled",
}[*confidentialCompute == gcpv1.ConfidentialComputePolicyEnabled],
)

Expect(fmt.Sprintf("%v", *expectedConfidentialComputeValue)).To(Equal(fmt.Sprintf("%v", *confidentialCompute)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure what/why we are testing this? This appears to just be checking the value of the input to the test? Should it not instead be comparing the value from the template itself?

We are creating the CAPI template, so why are we checking the values on the template?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earlier was using the template to compare missed it in latest commit , I will go through the code you suggested , will commit that

var confidentialComputevalue = *createdTemplate.Spec.Template.Spec.ConfidentialCompute
			Expect(fmt.Sprintf("%v", confidentialComputevalue)).To(Equal(fmt.Sprintf("%v", *confidentialCompute)))
		}

confidentialComputeDisabled := gcpv1.ConfidentialComputePolicyDisabled
DescribeTable("should configure Confidential VM correctly", framework.LabelCAPI, framework.LabelDisruptive,
func(confidentialCompute *gcpv1.ConfidentialComputePolicy) {
mapiProviderSpec := getGCPMAPIProviderSpec(cl)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this providerSpec used for? We are setting the onhostmaintenance stuff, but we don't actually apply it to the cluster?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We apply it when ConfidentialCompute is enabled.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see that? You're creating a GCP Machine template, and a GCP MachineSet, I don't see you using a MAPI providerSpec anywhere as you aren't creating MAPI machines?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes Joel you are correct , but populating values for gcpmachinetemplate eg- zone with machineproviderspec.
so I was making changes to confidentialcompute fields and using the rest of the values to make the template similar to machineproviderspec from mapi , this was done on all tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right I see what's going on here, but then why do you modify the mapiProviderSpec after line 150?

Should line 150 come after the switch that updates the MAPI provider spec?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so does making below change is same instead of moving 150 down , I can do below? You feel, it might be redundant code at this moment ? I am not sure , how I reached there 🤔

			switch confidentialCompute {
			case gcpv1.ConfidentialComputePolicyEnabled:
				gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = ptr.To(gcpv1.HostMaintenancePolicy("onHostMaintenance"))
			case gcpv1.ConfidentialComputePolicyDisabled:
				gcpMachineTemplate.Spec.Template.Spec.OnHostMaintenance = ptr.To(gcpv1.HostMaintenancePolicy("Migrate"))
			}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think the switch is redundant. You convert the MAPI provider spec to the GCP Template spec on 150, after that you don't re-use the mapi provider spec so any further changes aren't being considered. I would have expected all that setup to come ahead of the conversion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I try to do that afterwards , it will result in panic due to gcpmachinetemplate being empty ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, my expectation was to move the setting of any of the gcpMachineTemplate into the conversion function createGCPMachineTemplate, I see in most tests you're modifying the gcpMachineTemplate after you've got the result of that function.

Either you need to modify the mapi, or the capi one, if you modify the mapi one, then do that before you pass it into createGCPMachineTemplate and ensure that createGCPMachineTemplate handles all the fields you're setting.

Or remove modifications to mapiProviderSpec after you call createGCPMachineTemplate, those modifications are not being read apart from in the lines directly after them, in which case you may as well cut out the middle step no?

Refractored to follow Table structure for all cases

comment added for disk cases(author/casenumber)

Refractored to use create func effieciently
Refractored confidentialVMs case ( By Joel )

Added test for preemptible and GPU instances

refractor for onHost constant values
@miyadav miyadav force-pushed the gcp-capi-cases-all branch from 0cef15b to e470af1 Compare January 10, 2025 12:04
Added lables and removed comments

e2 instances do not support onHostMaintenance=TERMINATE

Removed GPU case for now

generatename for templates

update to skip clean up if no resources were created
@miyadav miyadav force-pushed the gcp-capi-cases-all branch from e470af1 to 597a7c1 Compare January 13, 2025 13:12
@miyadav miyadav requested a review from JoelSpeed January 13, 2025 13:14
@JoelSpeed
Copy link
Contributor

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 13, 2025
Copy link
Contributor

openshift-ci bot commented Jan 13, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 13, 2025
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD d674806 and 2 for PR HEAD 597a7c1 in total

1 similar comment
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD d674806 and 2 for PR HEAD 597a7c1 in total

@JoelSpeed
Copy link
Contributor

/retest-required

Copy link
Contributor

openshift-ci bot commented Jan 14, 2025

@miyadav: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-openstack-operator 597a7c1 link false /test e2e-openstack-operator
ci/prow/e2e-gcp-capi-techpreview 597a7c1 link false /test e2e-gcp-capi-techpreview
ci/prow/e2e-gcp-operator 597a7c1 link false /test e2e-gcp-operator

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD d674806 and 2 for PR HEAD 597a7c1 in total

@openshift-merge-bot openshift-merge-bot bot merged commit e0af696 into openshift:master Jan 14, 2025
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants