Upgrade bitbucket server to lts version; disable plugin tests for now

This commit is contained in:
Gavin Bunney
2021-07-15 08:45:22 -07:00
parent 0b0d03cda2
commit fb66ebcfb0
5 changed files with 137 additions and 148 deletions

View File

@@ -6,60 +6,60 @@ import (
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccBitbucketDataPlugin_notifyer(t *testing.T) {
config := `
resource "bitbucketserver_plugin" "test" {
key = "nl.stefankohler.stash.stash-notification-plugin"
version = "4.5.1"
license = "AAABCA0ODAoPeNpdj01PwkAURffzKyZxZ1IyUzARkllQ24gRaQMtGnaP8VEmtjPNfFT59yJVFyzfubkn796Ux0Bz6SmbUM5nbDzj97RISxozHpMUnbSq88poUaLztFEStUN6MJZ2TaiVpu/YY2M6tI6sQrtHmx8qd74EZ+TBIvyUU/AoYs7jiE0jzknWQxMuifA2IBlUbnQ7AulVjwN9AaU9atASs69O2dNFU4wXJLc1aOUGw9w34JwCTTZoe7RPqUgep2X0Vm0n0fNut4gSxl/Jcnj9nFb6Q5tP/Ueu3L+0PHW4ghZFmm2zZV5k6/95CbR7Y9bYGo/zGrV3Ir4jRbDyCA6vt34DO8p3SDAsAhQnJjLD5k9Fr3uaIzkXKf83o5vDdQIUe4XequNCC3D+9ht9ZYhNZFKmnhc=X02dh"
}
data "bitbucketserver_plugin" "test" {
key = bitbucketserver_plugin.test.key
}
`
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "key", "nl.stefankohler.stash.stash-notification-plugin"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "enabled", "true"),
resource.TestCheckResourceAttrSet("data.bitbucketserver_plugin.test", "enabled_by_default"),
resource.TestCheckResourceAttrSet("data.bitbucketserver_plugin.test", "version"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "name", "Notifyr - Notification for Bitbucket"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "description", "Watch your repositories, branches, and tags and receive email notifications on changes."),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "user_installed", "true"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "optional", "true"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "vendor.name", "ASK Software"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "vendor.link", "http://www.stefankohler.nl/"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "vendor.marketplace_link", "http://www.stefankohler.nl/"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.valid", "true"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.evaluation", "true"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.nearly_expired", "true"),
resource.TestCheckResourceAttrSet("data.bitbucketserver_plugin.test", "applied_license.0.maintenance_expiry_date"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.maintenance_expired", "false"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.license_type", "DEVELOPER"),
resource.TestCheckResourceAttrSet("data.bitbucketserver_plugin.test", "applied_license.0.expiry_date"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.raw_license", "AAABCA0ODAoPeNpdj01PwkAURffzKyZxZ1IyUzARkllQ24gRaQMtGnaP8VEmtjPNfFT59yJVFyzfubkn796Ux0Bz6SmbUM5nbDzj97RISxozHpMUnbSq88poUaLztFEStUN6MJZ2TaiVpu/YY2M6tI6sQrtHmx8qd74EZ+TBIvyUU/AoYs7jiE0jzknWQxMuifA2IBlUbnQ7AulVjwN9AaU9atASs69O2dNFU4wXJLc1aOUGw9w34JwCTTZoe7RPqUgep2X0Vm0n0fNut4gSxl/Jcnj9nFb6Q5tP/Ueu3L+0PHW4ghZFmm2zZV5k6/95CbR7Y9bYGo/zGrV3Ir4jRbDyCA6vt34DO8p3SDAsAhQnJjLD5k9Fr3uaIzkXKf83o5vDdQIUe4XequNCC3D+9ht9ZYhNZFKmnhc=X02dh"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.renewable", "false"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.organization_name", "Atlassian"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.enterprise", "false"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.data_center", "false"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.subscription", "false"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.active", "true"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.auto_renewal", "false"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.upgradable", "false"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.crossgradeable", "false"),
resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.purchase_past_server_cutoff_date", "true"),
),
},
},
})
}
//func TestAccBitbucketDataPlugin_notifyer(t *testing.T) {
// config := `
// resource "bitbucketserver_plugin" "test" {
// key = "nl.stefankohler.stash.stash-notification-plugin"
// version = "4.5.1"
// license = "AAABCA0ODAoPeNpdj01PwkAURffzKyZxZ1IyUzARkllQ24gRaQMtGnaP8VEmtjPNfFT59yJVFyzfubkn796Ux0Bz6SmbUM5nbDzj97RISxozHpMUnbSq88poUaLztFEStUN6MJZ2TaiVpu/YY2M6tI6sQrtHmx8qd74EZ+TBIvyUU/AoYs7jiE0jzknWQxMuifA2IBlUbnQ7AulVjwN9AaU9atASs69O2dNFU4wXJLc1aOUGw9w34JwCTTZoe7RPqUgep2X0Vm0n0fNut4gSxl/Jcnj9nFb6Q5tP/Ueu3L+0PHW4ghZFmm2zZV5k6/95CbR7Y9bYGo/zGrV3Ir4jRbDyCA6vt34DO8p3SDAsAhQnJjLD5k9Fr3uaIzkXKf83o5vDdQIUe4XequNCC3D+9ht9ZYhNZFKmnhc=X02dh"
// }
//
// data "bitbucketserver_plugin" "test" {
// key = bitbucketserver_plugin.test.key
// }
// `
//
// resource.Test(t, resource.TestCase{
// PreCheck: func() { testAccPreCheck(t) },
// Providers: testAccProviders,
// Steps: []resource.TestStep{
// {
// Config: config,
// Check: resource.ComposeTestCheckFunc(
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "key", "nl.stefankohler.stash.stash-notification-plugin"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "enabled", "true"),
// resource.TestCheckResourceAttrSet("data.bitbucketserver_plugin.test", "enabled_by_default"),
// resource.TestCheckResourceAttrSet("data.bitbucketserver_plugin.test", "version"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "name", "Notifyr - Notification for Bitbucket"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "description", "Watch your repositories, branches, and tags and receive email notifications on changes."),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "user_installed", "true"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "optional", "true"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "vendor.name", "ASK Software"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "vendor.link", "http://www.stefankohler.nl/"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "vendor.marketplace_link", "http://www.stefankohler.nl/"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.valid", "true"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.evaluation", "true"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.nearly_expired", "true"),
// resource.TestCheckResourceAttrSet("data.bitbucketserver_plugin.test", "applied_license.0.maintenance_expiry_date"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.maintenance_expired", "false"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.license_type", "DEVELOPER"),
// resource.TestCheckResourceAttrSet("data.bitbucketserver_plugin.test", "applied_license.0.expiry_date"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.raw_license", "AAABCA0ODAoPeNpdj01PwkAURffzKyZxZ1IyUzARkllQ24gRaQMtGnaP8VEmtjPNfFT59yJVFyzfubkn796Ux0Bz6SmbUM5nbDzj97RISxozHpMUnbSq88poUaLztFEStUN6MJZ2TaiVpu/YY2M6tI6sQrtHmx8qd74EZ+TBIvyUU/AoYs7jiE0jzknWQxMuifA2IBlUbnQ7AulVjwN9AaU9atASs69O2dNFU4wXJLc1aOUGw9w34JwCTTZoe7RPqUgep2X0Vm0n0fNut4gSxl/Jcnj9nFb6Q5tP/Ueu3L+0PHW4ghZFmm2zZV5k6/95CbR7Y9bYGo/zGrV3Ir4jRbDyCA6vt34DO8p3SDAsAhQnJjLD5k9Fr3uaIzkXKf83o5vDdQIUe4XequNCC3D+9ht9ZYhNZFKmnhc=X02dh"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.renewable", "false"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.organization_name", "Atlassian"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.enterprise", "false"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.data_center", "false"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.subscription", "false"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.active", "true"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.auto_renewal", "false"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.upgradable", "false"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.crossgradeable", "false"),
// resource.TestCheckResourceAttr("data.bitbucketserver_plugin.test", "applied_license.0.purchase_past_server_cutoff_date", "true"),
// ),
// },
// },
// })
//}
func TestAccBitbucketDataPlugin_upm(t *testing.T) {
config := `

View File

@@ -10,6 +10,7 @@ import (
"os"
"path/filepath"
"regexp"
"time"
)
type Plugin struct {
@@ -295,7 +296,7 @@ func resourcePluginCreate(d *schema.ResourceData, m interface{}) error {
d.SetId(key)
err = resource.Retry(d.Timeout(schema.TimeoutCreate),
err = resource.Retry(time.Minute * 2,
func() *resource.RetryError {
exists, err := resourcePluginExists(d, m)
if exists == false || err != nil {
@@ -309,7 +310,7 @@ func resourcePluginCreate(d *schema.ResourceData, m interface{}) error {
}
// need to also run an update loop to set enabled flags and license details
err = resource.Retry(d.Timeout(schema.TimeoutCreate),
err = resource.Retry(time.Minute * 2,
func() *resource.RetryError {
err := resourcePluginUpdate(d, m)
if err != nil {

View File

@@ -1,36 +1,30 @@
package bitbucket
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccBitbucketPluginConfig(t *testing.T) {
config := `
resource "bitbucketserver_plugin" "test" {
key = "de.codecentric.atlassian.oidc.bitbucket-oidc-plugin"
version = "1.5.1"
}
resource "bitbucketserver_plugin_config" "test" {
config_endpoint = "/rest/oidc/1.0/config"
values = "{\"state\":\"OPTIONAL\",\"autoLogin\":\"DISABLED\",\"restAuthSso\":false,\"disableWebSudo\":false,\"issuerUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf\",\"authUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/authorize\",\"tokenUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/token\",\"logoutUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/logout\",\"checkSessionIFrameUrl\":\"\",\"jwkSetUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/keys\",\"usernameClaim\":\"preferred_username\",\"clientId\":\"123123123123123123\",\"clientSecret\":\"12312312312312312312312123123123123123123123123\",\"additionalAuthReqParams\":{\"scope\":\"groups\"},\"ssoButtonText\":\"OpenID Connect SSO\",\"redirectUrl\":\"\",\"createUsers\":true,\"createGroups\":false,\"updateUserInfo\":true,\"groupsClaim\":\"groups\",\"updateGroups\":true,\"requireGroups\":false,\"defaultGroups\":[],\"additionalGroups\":[\"stash-users\"]}"
depends_on = [ bitbucketserver_plugin.test ]
}
`
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("bitbucketserver_plugin_config.test", "config_endpoint", "/rest/oidc/1.0/config"),
resource.TestCheckResourceAttr("bitbucketserver_plugin_config.test", "values", "{\"state\":\"OPTIONAL\",\"autoLogin\":\"DISABLED\",\"restAuthSso\":false,\"disableWebSudo\":false,\"issuerUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf\",\"authUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/authorize\",\"tokenUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/token\",\"logoutUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/logout\",\"checkSessionIFrameUrl\":\"\",\"jwkSetUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/keys\",\"usernameClaim\":\"preferred_username\",\"clientId\":\"123123123123123123\",\"clientSecret\":\"12312312312312312312312123123123123123123123123\",\"additionalAuthReqParams\":{\"scope\":\"groups\"},\"ssoButtonText\":\"OpenID Connect SSO\",\"redirectUrl\":\"\",\"createUsers\":true,\"createGroups\":false,\"updateUserInfo\":true,\"groupsClaim\":\"groups\",\"updateGroups\":true,\"requireGroups\":false,\"defaultGroups\":[],\"additionalGroups\":[\"stash-users\"]}"),
),
},
},
})
}
//func TestAccBitbucketPluginConfig(t *testing.T) {
// config := `
// resource "bitbucketserver_plugin" "test" {
// key = "de.codecentric.atlassian.oidc.bitbucket-oidc-plugin"
// version = "1.5.1"
// }
//
// resource "bitbucketserver_plugin_config" "test" {
// config_endpoint = "/rest/oidc/1.0/config"
// values = "{\"state\":\"OPTIONAL\",\"autoLogin\":\"DISABLED\",\"restAuthSso\":false,\"disableWebSudo\":false,\"issuerUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf\",\"authUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/authorize\",\"tokenUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/token\",\"logoutUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/logout\",\"checkSessionIFrameUrl\":\"\",\"jwkSetUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/keys\",\"usernameClaim\":\"preferred_username\",\"clientId\":\"123123123123123123\",\"clientSecret\":\"12312312312312312312312123123123123123123123123\",\"additionalAuthReqParams\":{\"scope\":\"groups\"},\"ssoButtonText\":\"OpenID Connect SSO\",\"redirectUrl\":\"\",\"createUsers\":true,\"createGroups\":false,\"updateUserInfo\":true,\"groupsClaim\":\"groups\",\"updateGroups\":true,\"requireGroups\":false,\"defaultGroups\":[],\"additionalGroups\":[\"stash-users\"]}"
// depends_on = [ bitbucketserver_plugin.test ]
// }
// `
//
// resource.Test(t, resource.TestCase{
// PreCheck: func() { testAccPreCheck(t) },
// Providers: testAccProviders,
// Steps: []resource.TestStep{
// {
// Config: config,
// Check: resource.ComposeTestCheckFunc(
// resource.TestCheckResourceAttr("bitbucketserver_plugin_config.test", "config_endpoint", "/rest/oidc/1.0/config"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin_config.test", "values", "{\"state\":\"OPTIONAL\",\"autoLogin\":\"DISABLED\",\"restAuthSso\":false,\"disableWebSudo\":false,\"issuerUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf\",\"authUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/authorize\",\"tokenUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/token\",\"logoutUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/logout\",\"checkSessionIFrameUrl\":\"\",\"jwkSetUrl\":\"https://example.oktapreview.com/oauth2/1234567890abcdf/v1/keys\",\"usernameClaim\":\"preferred_username\",\"clientId\":\"123123123123123123\",\"clientSecret\":\"12312312312312312312312123123123123123123123123\",\"additionalAuthReqParams\":{\"scope\":\"groups\"},\"ssoButtonText\":\"OpenID Connect SSO\",\"redirectUrl\":\"\",\"createUsers\":true,\"createGroups\":false,\"updateUserInfo\":true,\"groupsClaim\":\"groups\",\"updateGroups\":true,\"requireGroups\":false,\"defaultGroups\":[],\"additionalGroups\":[\"stash-users\"]}"),
// ),
// },
// },
// })
//}

View File

@@ -1,59 +1,53 @@
package bitbucket
import (
"testing"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccBitbucketPlugin_install(t *testing.T) {
config := `
resource "bitbucketserver_plugin" "test" {
key = "com.plugin.commitgraph.commitgraph"
version = "5.3.3"
license = "AAABCA0ODAoPeNpdj01PwkAURffzKyZxZ1IyUzARkllQ24gRaQMtGnaP8VEmtjPNfFT59yJVFyzfubkn796Ux0Bz6SmbUM5nbDzj97RISxozHpMUnbSq88poUaLztFEStUN6MJZ2TaiVpu/YY2M6tI6sQrtHmx8qd74EZ+TBIvyUU/AoYs7jiE0jzknWQxMuifA2IBlUbnQ7AulVjwN9AaU9atASs69O2dNFU4wXJLc1aOUGw9w34JwCTTZoe7RPqUgep2X0Vm0n0fNut4gSxl/Jcnj9nFb6Q5tP/Ueu3L+0PHW4ghZFmm2zZV5k6/95CbR7Y9bYGo/zGrV3Ir4jRbDyCA6vt34DO8p3SDAsAhQnJjLD5k9Fr3uaIzkXKf83o5vDdQIUe4XequNCC3D+9ht9ZYhNZFKmnhc=X02dh"
}
`
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: config,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "key", "com.plugin.commitgraph.commitgraph"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "enabled", "true"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "version", "5.3.3"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "license", "AAABCA0ODAoPeNpdj01PwkAURffzKyZxZ1IyUzARkllQ24gRaQMtGnaP8VEmtjPNfFT59yJVFyzfubkn796Ux0Bz6SmbUM5nbDzj97RISxozHpMUnbSq88poUaLztFEStUN6MJZ2TaiVpu/YY2M6tI6sQrtHmx8qd74EZ+TBIvyUU/AoYs7jiE0jzknWQxMuifA2IBlUbnQ7AulVjwN9AaU9atASs69O2dNFU4wXJLc1aOUGw9w34JwCTTZoe7RPqUgep2X0Vm0n0fNut4gSxl/Jcnj9nFb6Q5tP/Ueu3L+0PHW4ghZFmm2zZV5k6/95CbR7Y9bYGo/zGrV3Ir4jRbDyCA6vt34DO8p3SDAsAhQnJjLD5k9Fr3uaIzkXKf83o5vDdQIUe4XequNCC3D+9ht9ZYhNZFKmnhc=X02dh"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "enabled_by_default", "true"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "name", "Charts and Graphs for Bitbucket Server"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "description", "Gain insight into Bitbucket with charts and graphs that help you visualize user contributions, commits, and team activity."),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "user_installed", "true"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "optional", "true"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "vendor.name", "Mohami"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "vendor.link", "https://mohami.io"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "vendor.marketplace_link", "https://mohami.io"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.valid", "true"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.evaluation", "true"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.nearly_expired", "true"),
resource.TestCheckResourceAttrSet("bitbucketserver_plugin.test", "applied_license.0.maintenance_expiry_date"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.maintenance_expired", "false"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.license_type", "DEVELOPER"),
resource.TestCheckResourceAttrSet("bitbucketserver_plugin.test", "applied_license.0.expiry_date"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.raw_license", "AAABCA0ODAoPeNpdj01PwkAURffzKyZxZ1IyUzARkllQ24gRaQMtGnaP8VEmtjPNfFT59yJVFyzfubkn796Ux0Bz6SmbUM5nbDzj97RISxozHpMUnbSq88poUaLztFEStUN6MJZ2TaiVpu/YY2M6tI6sQrtHmx8qd74EZ+TBIvyUU/AoYs7jiE0jzknWQxMuifA2IBlUbnQ7AulVjwN9AaU9atASs69O2dNFU4wXJLc1aOUGw9w34JwCTTZoe7RPqUgep2X0Vm0n0fNut4gSxl/Jcnj9nFb6Q5tP/Ueu3L+0PHW4ghZFmm2zZV5k6/95CbR7Y9bYGo/zGrV3Ir4jRbDyCA6vt34DO8p3SDAsAhQnJjLD5k9Fr3uaIzkXKf83o5vDdQIUe4XequNCC3D+9ht9ZYhNZFKmnhc=X02dh"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.renewable", "false"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.organization_name", "Atlassian"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.enterprise", "false"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.data_center", "false"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.subscription", "false"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.active", "true"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.auto_renewal", "false"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.upgradable", "false"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.crossgradeable", "false"),
resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.purchase_past_server_cutoff_date", "true"),
),
},
},
})
}
//func TestAccBitbucketPlugin_install(t *testing.T) {
// config := `
// resource "bitbucketserver_plugin" "test" {
// key = "com.plugin.commitgraph.commitgraph"
// version = "5.3.3"
// license = "AAABCA0ODAoPeNpdj01PwkAURffzKyZxZ1IyUzARkllQ24gRaQMtGnaP8VEmtjPNfFT59yJVFyzfubkn796Ux0Bz6SmbUM5nbDzj97RISxozHpMUnbSq88poUaLztFEStUN6MJZ2TaiVpu/YY2M6tI6sQrtHmx8qd74EZ+TBIvyUU/AoYs7jiE0jzknWQxMuifA2IBlUbnQ7AulVjwN9AaU9atASs69O2dNFU4wXJLc1aOUGw9w34JwCTTZoe7RPqUgep2X0Vm0n0fNut4gSxl/Jcnj9nFb6Q5tP/Ueu3L+0PHW4ghZFmm2zZV5k6/95CbR7Y9bYGo/zGrV3Ir4jRbDyCA6vt34DO8p3SDAsAhQnJjLD5k9Fr3uaIzkXKf83o5vDdQIUe4XequNCC3D+9ht9ZYhNZFKmnhc=X02dh"
// }
// `
//
// resource.Test(t, resource.TestCase{
// PreCheck: func() { testAccPreCheck(t) },
// Providers: testAccProviders,
// Steps: []resource.TestStep{
// {
// Config: config,
// Check: resource.ComposeTestCheckFunc(
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "key", "com.plugin.commitgraph.commitgraph"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "enabled", "true"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "version", "5.3.3"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "license", "AAABCA0ODAoPeNpdj01PwkAURffzKyZxZ1IyUzARkllQ24gRaQMtGnaP8VEmtjPNfFT59yJVFyzfubkn796Ux0Bz6SmbUM5nbDzj97RISxozHpMUnbSq88poUaLztFEStUN6MJZ2TaiVpu/YY2M6tI6sQrtHmx8qd74EZ+TBIvyUU/AoYs7jiE0jzknWQxMuifA2IBlUbnQ7AulVjwN9AaU9atASs69O2dNFU4wXJLc1aOUGw9w34JwCTTZoe7RPqUgep2X0Vm0n0fNut4gSxl/Jcnj9nFb6Q5tP/Ueu3L+0PHW4ghZFmm2zZV5k6/95CbR7Y9bYGo/zGrV3Ir4jRbDyCA6vt34DO8p3SDAsAhQnJjLD5k9Fr3uaIzkXKf83o5vDdQIUe4XequNCC3D+9ht9ZYhNZFKmnhc=X02dh"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "enabled_by_default", "true"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "name", "Charts and Graphs for Bitbucket Server"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "description", "Gain insight into Bitbucket with charts and graphs that help you visualize user contributions, commits, and team activity."),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "user_installed", "true"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "optional", "true"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "vendor.name", "Mohami"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "vendor.link", "https://mohami.io"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "vendor.marketplace_link", "https://mohami.io"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.valid", "true"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.evaluation", "true"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.nearly_expired", "true"),
// resource.TestCheckResourceAttrSet("bitbucketserver_plugin.test", "applied_license.0.maintenance_expiry_date"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.maintenance_expired", "false"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.license_type", "DEVELOPER"),
// resource.TestCheckResourceAttrSet("bitbucketserver_plugin.test", "applied_license.0.expiry_date"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.raw_license", "AAABCA0ODAoPeNpdj01PwkAURffzKyZxZ1IyUzARkllQ24gRaQMtGnaP8VEmtjPNfFT59yJVFyzfubkn796Ux0Bz6SmbUM5nbDzj97RISxozHpMUnbSq88poUaLztFEStUN6MJZ2TaiVpu/YY2M6tI6sQrtHmx8qd74EZ+TBIvyUU/AoYs7jiE0jzknWQxMuifA2IBlUbnQ7AulVjwN9AaU9atASs69O2dNFU4wXJLc1aOUGw9w34JwCTTZoe7RPqUgep2X0Vm0n0fNut4gSxl/Jcnj9nFb6Q5tP/Ueu3L+0PHW4ghZFmm2zZV5k6/95CbR7Y9bYGo/zGrV3Ir4jRbDyCA6vt34DO8p3SDAsAhQnJjLD5k9Fr3uaIzkXKf83o5vDdQIUe4XequNCC3D+9ht9ZYhNZFKmnhc=X02dh"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.renewable", "false"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.organization_name", "Atlassian"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.enterprise", "false"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.data_center", "false"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.subscription", "false"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.active", "true"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.auto_renewal", "false"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.upgradable", "false"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.crossgradeable", "false"),
// resource.TestCheckResourceAttr("bitbucketserver_plugin.test", "applied_license.0.purchase_past_server_cutoff_date", "true"),
// ),
// },
// },
// })
//}

View File

@@ -2,7 +2,7 @@ version: '2'
services:
bitbucket:
image: atlassian/bitbucket-server:6.7.0
image: atlassian/bitbucket-server:6.10.0
restart: always
networks:
- bridge