Skip to content

Commit

Permalink
tkg-windows test rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
rajguptavm committed Nov 4, 2024
1 parent c5c1d04 commit bff6339
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/e2e/e2e_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ const (
evacMModeType = "evacuateAllData"
fcdName = "BasicStaticFCD"
fileSizeInMb = int64(2048)
filePathPod = "/mnt/volume1/Pod.html"
filePathPod1 = "/mnt/volume1/Pod1.html"
filePathPod2 = "/mnt/volume1/Pod2.html"
filePathFsType = "/mnt/volume1/fstype"
fullSyncFss = "trigger-csi-fullsync"
gcNodeUser = "vmware-system-user"
Expand Down
18 changes: 16 additions & 2 deletions tests/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4348,14 +4348,28 @@ func createDeployment(ctx context.Context, client clientset.Interface, replicas
podLabels map[string]string, nodeSelector map[string]string, namespace string,
pvclaims []*v1.PersistentVolumeClaim, command string, isPrivileged bool, image string) (*appsv1.Deployment, error) {
if len(command) == 0 {
command = "trap exit TERM; while true; do sleep 1; done"
if windowsEnv {
command = windowsExecCmd
} else {
command = "trap exit TERM; while true; do sleep 1; done"
}
}
deploymentSpec := getDeploymentSpec(ctx, client, replicas, podLabels, nodeSelector, namespace,
pvclaims, command, isPrivileged, image)
if windowsEnv {
var commands []string
if (len(command) == 0) || (command == execCommand) {
commands = []string{windowsExecCmd}
} else if command == execRWXCommandPod {
commands = []string{windowsExecRWXCommandPod}
} else if command == execRWXCommandPod1 {
commands = []string{windowsExecRWXCommandPod1}
} else {
commands = []string{command}
}
deploymentSpec.Spec.Template.Spec.Containers[0].Image = windowsImageOnMcr
deploymentSpec.Spec.Template.Spec.Containers[0].Command = []string{"Powershell.exe"}
deploymentSpec.Spec.Template.Spec.Containers[0].Args = []string{"-Command", command}
deploymentSpec.Spec.Template.Spec.Containers[0].Args = commands
}
deployment, err := client.AppsV1().Deployments(namespace).Create(ctx, deploymentSpec, metav1.CreateOptions{})
if err != nil {
Expand Down

0 comments on commit bff6339

Please sign in to comment.