-
Notifications
You must be signed in to change notification settings - Fork 39.4k
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
Add GCE PD tests for windows cluster #74990
Conversation
@jingxu97: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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/test-infra repository. |
@jingxu97: PR needs rebase. 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/test-infra repository. |
b716b10
to
9a8eb48
Compare
9a8eb48
to
9f0576a
Compare
test/e2e/storage/drivers/in_tree.go
Outdated
"ext3", | ||
"ext4", | ||
"xfs", | ||
"ntfs", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't want this for linux?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ntfs is still here, we should remove it right?
@@ -386,7 +387,7 @@ func (t StorageClassTest) TestDynamicProvisioning() *v1.PersistentVolume { | |||
// This is a common test that can be called from a StorageClassTest.PvCheck. | |||
func PVWriteReadSingleNodeCheck(client clientset.Interface, claim *v1.PersistentVolumeClaim, volume *v1.PersistentVolume, node NodeSelection) { | |||
By(fmt.Sprintf("checking the created volume is writable and has the PV's mount options on node %+v", node)) | |||
command := "echo 'hello world' > /mnt/test/data" | |||
command := "sleep 120; echo 'hello world' > /mnt/test/data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this for debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
@@ -435,7 +436,7 @@ func PVMultiNodeCheck(client clientset.Interface, claim *v1.PersistentVolumeClai | |||
}() | |||
|
|||
By(fmt.Sprintf("checking the created volume is writable and has the PV's mount options on node %+v", node)) | |||
command := "echo 'hello world' > /mnt/test/data" | |||
command := "sleep 120; echo 'hello world' > /mnt/test/data" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
var securityContext *v1.PodSecurityContext | ||
var nodeSelector map[string]string | ||
var image string | ||
if !NodeOSDistroIs("windows") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we wrap some of these methods into util functions instead of having to replace them in every test case?
Like: getSecurityContext
, getTestImage
, generateWriteCmd
, generateReadCommand
, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For getSecurityContext, getTestImage etc, I think it works well to put into a util function. But for generate different commands it is hard because there are many different commands used in the test and hard to generalize into a few functions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the commands, is there a general pattern that the tests are doing?
Like if the test is trying to write a file, can we have a general writeCmd(filename, content)
method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I made a few utility functions to address this issue. Thanks!
test/e2e/framework/volume_util.go
Outdated
"while(1) {cat /opt/0/index.html ; sleep 2 ; ls /opt/; sleep 2}", | ||
} | ||
fileCheckCommand = "powershell /c type" | ||
nodeSelector = map[string]string{"beta.kubernetes.io/os": "windows"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be set in gce pd driver config instead of in the test case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
test/e2e/framework/volume_util.go
Outdated
@@ -460,31 +480,40 @@ func TestVolumeClient(client clientset.Interface, config VolumeTestConfig, fsGro | |||
} | |||
clientPod, err := podsNamespacer.Create(clientPod) | |||
if err != nil { | |||
By(fmt.Sprint("failed to creat pod ", err)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging messages should use Logf() instead of By()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
bc119ba
to
dd50c89
Compare
@@ -1134,6 +1144,9 @@ func (g *gcePdDriver) GetDriverInfo() *testsuites.DriverInfo { | |||
|
|||
func (g *gcePdDriver) SkipUnsupportedTest(pattern testpatterns.TestPattern) { | |||
framework.SkipUnlessProviderIs("gce", "gke") | |||
if pattern.FeatureTag == "sig-windows" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you will need to add a check like this for the CSI GCE PD driver config here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jingxu97, msau42 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 |
dd50c89
to
17ab4a2
Compare
test/e2e/storage/drivers/csi.go
Outdated
@@ -461,6 +461,9 @@ func (g *gcePDExternalCSIDriver) SkipUnsupportedTest(pattern testpatterns.TestPa | |||
if pattern.FsType == "xfs" { | |||
framework.SkipUnlessNodeOSDistroIs("ubuntu", "custom") | |||
} | |||
if pattern.FeatureTag == "sig-windows" { | |||
framework.SkipUnlessNodeOSDistroIs("windows") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to skip entirely if it's windows since the CSI driver doesn't support it? Also, it's a little confusing, but there are two gcepd CSI drivers defined here, so this should go in both. (I eventually want to remove both pd csi driver definitions, tracked in #70258)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. fixed. Thanks!
17ab4a2
to
f46c179
Compare
/lgtm |
This PR is the first one to add a few GCE PD tests for windows cluster. Will add more tests in later PRs
f46c179
to
18be0a4
Compare
/lgtm |
} | ||
if framework.NodeOSDistroIs("windows") { | ||
config.ClientNodeSelector = map[string]string{ | ||
"beta.kubernetes.io/os": "windows", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also check kubernetes.io/os": "windows"
We've promoted the labels to GA
This PR is the first one to add a few GCE PD tests for windows cluster. Will
add more tests in later PRs