From 544ad965e6d0a8f75268d2daea3a4c8c2748490c Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Thu, 28 Feb 2019 10:16:22 -0500 Subject: [PATCH] 14291: Change instance type to a supported one, add SetTags test Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- lib/cloud/ec2/ec2_test.go | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/cloud/ec2/ec2_test.go b/lib/cloud/ec2/ec2_test.go index ab6c6b597b..e76ec724c1 100644 --- a/lib/cloud/ec2/ec2_test.go +++ b/lib/cloud/ec2/ec2_test.go @@ -58,7 +58,7 @@ func GetInstanceSet() (cloud.InstanceSet, cloud.ImageID, arvados.Cluster, error) InstanceTypes: arvados.InstanceTypeMap(map[string]arvados.InstanceType{ "tiny": arvados.InstanceType{ Name: "tiny", - ProviderType: "m1.small", + ProviderType: "t2.micro", VCPUs: 1, RAM: 4000000000, Scratch: 10000000000, @@ -67,7 +67,7 @@ func GetInstanceSet() (cloud.InstanceSet, cloud.ImageID, arvados.Cluster, error) }, "tiny-with-extra-scratch": arvados.InstanceType{ Name: "tiny", - ProviderType: "m1.small", + ProviderType: "t2.micro", VCPUs: 1, RAM: 4000000000, Scratch: 10000000000, @@ -77,7 +77,7 @@ func GetInstanceSet() (cloud.InstanceSet, cloud.ImageID, arvados.Cluster, error) }, "tiny-preemptible": arvados.InstanceType{ Name: "tiny", - ProviderType: "m1.small", + ProviderType: "t2.micro", VCPUs: 1, RAM: 4000000000, Scratch: 10000000000, @@ -171,6 +171,22 @@ func (*EC2InstanceSetSuite) TestCreatePreemptible(c *check.C) { } +func (*EC2InstanceSetSuite) TestTagInstances(c *check.C) { + ap, _, _, err := GetInstanceSet() + if err != nil { + c.Fatal("Error making provider", err) + } + + l, err := ap.Instances(nil) + c.Assert(err, check.IsNil) + + for _, i := range l { + tg := i.Tags() + tg["TestTag2"] = "123 test tag 2" + c.Check(i.SetTags(tg), check.IsNil) + } +} + func (*EC2InstanceSetSuite) TestListInstances(c *check.C) { ap, _, _, err := GetInstanceSet() if err != nil { -- 2.39.5