|
|
|
|
@ -232,3 +232,23 @@ func TestRunConfigPrepare_TemporaryKeyPairName(t *testing.T) {
|
|
|
|
|
t.Fatal("keypair name does not match")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestRunConfigPrepare_TenancySpot(t *testing.T) {
|
|
|
|
|
c := testConfig()
|
|
|
|
|
c.Tenancy = "dedicated"
|
|
|
|
|
c.SpotPrice = "1"
|
|
|
|
|
|
|
|
|
|
if err := c.Prepare(nil); len(err) != 1 {
|
|
|
|
|
t.Fatal("Should error if non-default tenancy and spot price are both set")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestRunConfigPrepare_TenancySpotDefault(t *testing.T) {
|
|
|
|
|
c := testConfig()
|
|
|
|
|
c.Tenancy = "default"
|
|
|
|
|
c.SpotPrice = "1"
|
|
|
|
|
|
|
|
|
|
if err := c.Prepare(nil); len(err) != 0 {
|
|
|
|
|
t.Fatal("Should not error if tenancy is set to default with spot price")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|