Skip to content

Commit

Permalink
end-to-end tests exercising CSI topology
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Feb 25, 2022
1 parent 792504b commit d3d56d6
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
8 changes: 6 additions & 2 deletions e2e/csi/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,14 @@ func volumeRegister(volID, volFilePath, createOrRegister string) error {
}

// hack off the first line to replace with our unique ID
var re = regexp.MustCompile(`(?m)^id ".*"`)
volspec := re.ReplaceAllString(string(content),
var idRegex = regexp.MustCompile(`(?m)^id ".*"`)
volspec := idRegex.ReplaceAllString(string(content),
fmt.Sprintf("id = \"%s\"", volID))

var nameRegex = regexp.MustCompile(`(?m)^name ".*"`)
volspec = nameRegex.ReplaceAllString(volspec,
fmt.Sprintf("name = \"%s\"", volID))

go func() {
defer stdin.Close()
io.WriteString(stdin, volspec)
Expand Down
13 changes: 12 additions & 1 deletion e2e/csi/input/ebs-volume0.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
id = "ebs-vol[0]"
name = "this-is-a-test-0" # CSIVolumeName tag
name = "idempotency-token" # CSIVolumeName tag, must be idempotent
type = "csi"
plugin_id = "aws-ebs0"

Expand All @@ -19,3 +19,14 @@ capability {
parameters {
type = "gp2"
}

topology_request {
required {
topology {
segments {
# this zone should match the one set in e2e/terraform/variables.tf
"topology.ebs.csi.aws.com/zone" = "us-east-1b"
}
}
}
}
13 changes: 12 additions & 1 deletion e2e/csi/input/ebs-volume1.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
id = "ebs-vol[1]"
name = "this-is-a-test-1" # CSIVolumeName tag
name = "idempotency-token" # CSIVolumeName tag
type = "csi"
plugin_id = "aws-ebs0"

Expand All @@ -19,3 +19,14 @@ capability {
parameters {
type = "gp2"
}

topology_request {
required {
topology {
segments {
# this zone should match the one set in e2e/terraform/variables.tf
"topology.ebs.csi.aws.com/zone" = "us-east-1b"
}
}
}
}
2 changes: 1 addition & 1 deletion e2e/csi/input/plugin-aws-ebs-controller.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ job "plugin-aws-ebs-controller" {
driver = "docker"

config {
image = "amazon/aws-ebs-csi-driver:v0.9.0"
image = "public.ecr.aws/ebs-csi-driver/aws-ebs-csi-driver:v1.5.1"

args = [
"controller",
Expand Down
2 changes: 1 addition & 1 deletion e2e/csi/input/plugin-aws-ebs-nodes.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ job "plugin-aws-ebs-nodes" {
driver = "docker"

config {
image = "amazon/aws-ebs-csi-driver:v0.9.0"
image = "public.ecr.aws/ebs-csi-driver/aws-ebs-csi-driver:v1.5.1"

args = [
"node",
Expand Down
2 changes: 1 addition & 1 deletion e2e/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ variable "region" {

variable "availability_zone" {
description = "The AWS availability zone to deploy to."
default = "us-east-1a"
default = "us-east-1b"
}

variable "instance_type" {
Expand Down

0 comments on commit d3d56d6

Please sign in to comment.