diff options
author | Paul Stack <public@paulstack.co.uk> | 2017-02-15 23:29:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-15 23:29:05 +0000 |
commit | 90db3fb0ba1aff53f83ece8f5d62f56943ed090e (patch) | |
tree | 0a0eb730ee6a18d683d658d463e3f07b9107d1a4 /resource_statuscaketest_test.go | |
parent | 6ad7af97bbcfa90a6798dd78ae19adfcef179bdc (diff) | |
download | terraform-provider-statuscake-90db3fb0ba1aff53f83ece8f5d62f56943ed090e.tar.gz terraform-provider-statuscake-90db3fb0ba1aff53f83ece8f5d62f56943ed090e.tar.zst terraform-provider-statuscake-90db3fb0ba1aff53f83ece8f5d62f56943ed090e.zip |
provider/statuscake: Add support for Port in statuscake_test (#11966)
Fixes: #11923
This required the upstream library to have a PR accepted
Diffstat (limited to 'resource_statuscaketest_test.go')
-rw-r--r-- | resource_statuscaketest_test.go | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/resource_statuscaketest_test.go b/resource_statuscaketest_test.go index 1def4e3..17940ed 100644 --- a/resource_statuscaketest_test.go +++ b/resource_statuscaketest_test.go | |||
@@ -18,7 +18,7 @@ func TestAccStatusCake_basic(t *testing.T) { | |||
18 | Providers: testAccProviders, | 18 | Providers: testAccProviders, |
19 | CheckDestroy: testAccTestCheckDestroy(&test), | 19 | CheckDestroy: testAccTestCheckDestroy(&test), |
20 | Steps: []resource.TestStep{ | 20 | Steps: []resource.TestStep{ |
21 | resource.TestStep{ | 21 | { |
22 | Config: testAccTestConfig_basic, | 22 | Config: testAccTestConfig_basic, |
23 | Check: resource.ComposeTestCheckFunc( | 23 | Check: resource.ComposeTestCheckFunc( |
24 | testAccTestCheckExists("statuscake_test.google", &test), | 24 | testAccTestCheckExists("statuscake_test.google", &test), |
@@ -29,6 +29,25 @@ func TestAccStatusCake_basic(t *testing.T) { | |||
29 | }) | 29 | }) |
30 | } | 30 | } |
31 | 31 | ||
32 | func TestAccStatusCake_tcp(t *testing.T) { | ||
33 | var test statuscake.Test | ||
34 | |||
35 | resource.Test(t, resource.TestCase{ | ||
36 | PreCheck: func() { testAccPreCheck(t) }, | ||
37 | Providers: testAccProviders, | ||
38 | CheckDestroy: testAccTestCheckDestroy(&test), | ||
39 | Steps: []resource.TestStep{ | ||
40 | { | ||
41 | Config: testAccTestConfig_tcp, | ||
42 | Check: resource.ComposeTestCheckFunc( | ||
43 | testAccTestCheckExists("statuscake_test.google", &test), | ||
44 | testAccTestCheckAttributes("statuscake_test.google", &test), | ||
45 | ), | ||
46 | }, | ||
47 | }, | ||
48 | }) | ||
49 | } | ||
50 | |||
32 | func TestAccStatusCake_withUpdate(t *testing.T) { | 51 | func TestAccStatusCake_withUpdate(t *testing.T) { |
33 | var test statuscake.Test | 52 | var test statuscake.Test |
34 | 53 | ||
@@ -37,14 +56,14 @@ func TestAccStatusCake_withUpdate(t *testing.T) { | |||
37 | Providers: testAccProviders, | 56 | Providers: testAccProviders, |
38 | CheckDestroy: testAccTestCheckDestroy(&test), | 57 | CheckDestroy: testAccTestCheckDestroy(&test), |
39 | Steps: []resource.TestStep{ | 58 | Steps: []resource.TestStep{ |
40 | resource.TestStep{ | 59 | { |
41 | Config: testAccTestConfig_basic, | 60 | Config: testAccTestConfig_basic, |
42 | Check: resource.ComposeTestCheckFunc( | 61 | Check: resource.ComposeTestCheckFunc( |
43 | testAccTestCheckExists("statuscake_test.google", &test), | 62 | testAccTestCheckExists("statuscake_test.google", &test), |
44 | ), | 63 | ), |
45 | }, | 64 | }, |
46 | 65 | ||
47 | resource.TestStep{ | 66 | { |
48 | Config: testAccTestConfig_update, | 67 | Config: testAccTestConfig_update, |
49 | Check: resource.ComposeTestCheckFunc( | 68 | Check: resource.ComposeTestCheckFunc( |
50 | testAccTestCheckExists("statuscake_test.google", &test), | 69 | testAccTestCheckExists("statuscake_test.google", &test), |
@@ -163,3 +182,16 @@ resource "statuscake_test" "google" { | |||
163 | paused = true | 182 | paused = true |
164 | } | 183 | } |
165 | ` | 184 | ` |
185 | |||
186 | const testAccTestConfig_tcp = ` | ||
187 | resource "statuscake_test" "google" { | ||
188 | website_name = "google.com" | ||
189 | website_url = "www.google.com" | ||
190 | test_type = "TCP" | ||
191 | check_rate = 300 | ||
192 | timeout = 10 | ||
193 | contact_id = 12345 | ||
194 | confirmations = 1 | ||
195 | port = 80 | ||
196 | } | ||
197 | ` | ||