14291: Change instance type to a supported one, add SetTags test
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 28 Feb 2019 15:16:22 +0000 (10:16 -0500)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 28 Feb 2019 15:16:22 +0000 (10:16 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

lib/cloud/ec2/ec2_test.go

index ab6c6b597b399af717d0b18f7d0f546c25d846e5..e76ec724c149c55883406fec0ad3cfc06e38f327 100644 (file)
@@ -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 {