Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smooth output audio_only_timecode_control typo #29917

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ func channelEncoderSettingsSchema() *schema.Schema {
Optional: true,
Computed: true,
},
"audio_only_timecodec_control": {
"audio_only_timecode_control": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Expand All @@ -1105,7 +1105,7 @@ func channelEncoderSettingsSchema() *schema.Schema {
Computed: true,
},
"event_id": {
Type: schema.TypeInt,
Type: schema.TypeString,
Optional: true,
Computed: true,
},
Expand Down
133 changes: 133 additions & 0 deletions internal/service/medialive/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,66 @@ func TestAccMediaLiveChannel_UDP_outputSettings(t *testing.T) {
})
}

func TestAccMediaLiveChannel_MsSmooth_outputSettings(t *testing.T) {
ctx := acctest.Context(t)
if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

var channel medialive.DescribeChannelOutput
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_medialive_channel.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
acctest.PreCheck(ctx, t)
acctest.PreCheckPartitionHasService(t, names.MediaLiveEndpointID)
testAccChannelsPreCheck(ctx, t)
},
ErrorCheck: acctest.ErrorCheck(t, names.MediaLiveEndpointID),
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories,
CheckDestroy: testAccCheckChannelDestroy(ctx),
Steps: []resource.TestStep{
{
Config: testAccChannelConfig_msSmoothOutputSettings(rName),
Check: resource.ComposeTestCheckFunc(
testAccCheckChannelExists(ctx, resourceName, &channel),
resource.TestCheckResourceAttrSet(resourceName, "channel_id"),
resource.TestCheckResourceAttr(resourceName, "channel_class", "STANDARD"),
resource.TestCheckResourceAttr(resourceName, "name", rName),
resource.TestCheckResourceAttrSet(resourceName, "role_arn"),
resource.TestCheckResourceAttr(resourceName, "input_specification.0.codec", "AVC"),
resource.TestCheckResourceAttr(resourceName, "input_specification.0.input_resolution", "HD"),
resource.TestCheckResourceAttr(resourceName, "input_specification.0.maximum_bitrate", "MAX_20_MBPS"),
resource.TestCheckTypeSetElemNestedAttrs(resourceName, "input_attachments.*", map[string]string{
"input_attachment_name": "example-input1",
}),
resource.TestCheckTypeSetElemNestedAttrs(resourceName, "destinations.*", map[string]string{
"id": rName,
}),
resource.TestCheckResourceAttr(resourceName, "encoder_settings.0.timecode_config.0.source", "EMBEDDED"),
resource.TestCheckTypeSetElemNestedAttrs(resourceName, "encoder_settings.0.audio_descriptions.*", map[string]string{
"audio_selector_name": rName,
"name": rName,
}),
resource.TestCheckTypeSetElemNestedAttrs(resourceName, "encoder_settings.0.video_descriptions.*", map[string]string{
"name": "test-video-name",
}),
resource.TestCheckTypeSetElemNestedAttrs(resourceName, "encoder_settings.0.output_groups.0.outputs.0.output_settings.0.ms_smooth_output_settings.*", map[string]string{
"name_modifier": rName,
}),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"start_channel"},
},
},
})
}

func TestAccMediaLiveChannel_audioDescriptions_codecSettings(t *testing.T) {
ctx := acctest.Context(t)
if testing.Short() {
Expand Down Expand Up @@ -861,6 +921,79 @@ resource "aws_medialive_channel" "test" {
`, rName))
}

func testAccChannelConfig_msSmoothOutputSettings(rName string) string {
return acctest.ConfigCompose(
testAccChannelBaseConfig(rName),
testAccChannelBaseMultiplexConfig(rName),
fmt.Sprintf(`
resource "aws_medialive_channel" "test" {
name = %[1]q
channel_class = "STANDARD"
role_arn = aws_iam_role.test.arn

input_specification {
codec = "AVC"
input_resolution = "HD"
maximum_bitrate = "MAX_20_MBPS"
}

input_attachments {
input_attachment_name = "example-input1"
input_id = aws_medialive_input.test.id
}

destinations {
id = %[1]q

settings {
url = "http://localhost:8000/path"
}

settings {
url = "http://localhost:8001/path"
}
}

encoder_settings {
timecode_config {
source = "EMBEDDED"
}

video_descriptions {
name = "test-video-name"
}

audio_descriptions {
audio_selector_name = %[1]q
name = %[1]q
}

output_groups {
output_group_settings {
ms_smooth_group_settings {
audio_only_timecode_control = "USE_CONFIGURED_CLOCK"
destination {
destination_ref_id = %[1]q
}
}
}

outputs {
output_name = "test-output-name"
video_description_name = "test-video-name"
audio_description_names = [%[1]q]
output_settings {
ms_smooth_output_settings {
name_modifier = %[1]q
}
}
}
}
}
}
`, rName))
}

func testAccChannelConfig_m2tsSettings(rName string) string {
return acctest.ConfigCompose(
testAccChannelBaseConfig(rName),
Expand Down