Skip to content

Commit

Permalink
test: log configuration setting
Browse files Browse the repository at this point in the history
OTT-6942
  • Loading branch information
thatsddr committed Jan 10, 2025
1 parent ed0f4f6 commit 0a45802
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions awsmt/resource_channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,29 @@ func TestAccChannelResourceRunning(t *testing.T) {
})
}

func TestAccChannelResourceLoggingConfiguration(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
Steps: []resource.TestStep{
{
Config: logConfigChannel(true),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("awsmt_channel.test", "enable_as_run_logs", "true"),
resource.TestCheckResourceAttr("data.awsmt_channel.test", "enable_as_run_logs", "true"),
),
},
{
Config: logConfigChannel(false),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttr("awsmt_channel.test", "enable_as_run_logs", "false"),
resource.TestCheckResourceAttr("data.awsmt_channel.test", "enable_as_run_logs", "false"),
),
},
},
})
}

func TestAccChannelValuesNotFlickering(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -306,6 +329,34 @@ func hlsChannel(mw_s string) string {
`, mw_s)
}

func logConfigChannel(enable bool) string {
return fmt.Sprintf(`
resource "awsmt_channel" "test" {
name = "test"
channel_state = "RUNNING"
enable_as_run_logs = %[1]v
outputs = [{
manifest_name = "default"
source_group = "default"
hls_playlist_settings = {
ad_markup_type = ["DATERANGE"]
manifest_window_seconds = "60"
}
}]
playback_mode = "LOOP"
tier = "BASIC"
tags = {"Environment": "dev"}
}
data "awsmt_channel" "test" {
name = awsmt_channel.test.name
}
output "channel_out" {
value = data.awsmt_channel.test
}
`, enable)
}

func standardTierChannel() string {
return `resource "awsmt_vod_source" "test" {
http_package_configurations = [{
Expand Down

0 comments on commit 0a45802

Please sign in to comment.