Skip to content

[docker-test] Add release-image–based containerized integration tests with TLS modes#143

Merged
dean-amar merged 9 commits into
hyperledger:mainfrom
dean-amar:release-image-integration-test
Oct 20, 2025
Merged

[docker-test] Add release-image–based containerized integration tests with TLS modes#143
dean-amar merged 9 commits into
hyperledger:mainfrom
dean-amar:release-image-integration-test

Conversation

@dean-amar

@dean-amar dean-amar commented Sep 21, 2025

Copy link
Copy Markdown
Contributor

Type of change

  • Test update

Description

  • Add release-image–based containerized integration tests with different TLS modes.
  • Add support for multi-SAN server TLS credential creation.
  • Align configuration names.
  • Move common Docker utils to utils/test.

Additional details

The integration test runs each service in a separate Docker container and establishes connections between them with different TLS modes.
For now, we load TLS certificates into the mock-orderer container, even though it doesn’t support them yet (a future PR will add support).
We also need to align the config/template names, which will be addressed in a separate PR.

Related issues

                 Add release-image–based containerized integration tests with different TLS modes.
                 Add support for multi-SAN server TLS credential creation.
                 Align configuration names.
                 Move common Docker utils to utils/test.

Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
@dean-amar dean-amar marked this pull request as ready for review September 25, 2025 10:40

@liran-funaro liran-funaro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good overall. Please address the comments,

Comment thread cmd/config/app_config_test.go Outdated
Comment thread cmd/config/samples/coordinator.yaml Outdated
Comment thread cmd/config/samples/coordinator.yaml Outdated
Comment thread docker/test/common.go Outdated
return fmt.Sprintf("%s_%s_%s", containerPrefixName, node, tlsMode)
}

func assembleBinds(t *testing.T, serverCredsPath, clientCredsPath string, additionalBinds ...string) []string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assembleBinds() is always called with the following pattern, where the intermediate variables (serverCredsPath, clientCredsPath) are only used for the input of assembleBinds().

	_, serverCredsPath := params.credsFactory.CreateServerCredentials(t, params.tlsMode, params.node)
	require.NotEmpty(t, serverCredsPath)
	_, clientCredsPath := params.credsFactory.CreateClientCredentials(t, params.tlsMode)
	require.NotEmpty(t, clientCredsPath)

    [...]

    assembleBinds(t,
		serverCredsPath,
		clientCredsPath,
        fmt.Sprintf("%s.yaml:/%s.yaml",
			filepath.Join(mustGetWD(t), localConfigPath, params.node), configPath,
		)
		fmt.Sprintf("%s:/%s", params.configBlockPath, filepath.Join(containerConfigPath, genBlockFile)),
	)

Thus, assembleBinds() should contain all this logic internally.

@dean-amar dean-amar Oct 16, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can embed all of the logic into assembleBinds. However, when we try to bind a config file that doesn’t exist (as happens when we enable assembleBind for the db or orderer containers), Docker automatically creates directories with those names in the specified path (on the host).

To avoid that, we can move the following code into assembleBinds:

_, serverCredsPath := params.credsFactory.CreateServerCredentials(t, params.tlsMode, params.node)
require.NotEmpty(t, serverCredsPath)
_, clientCredsPath := params.credsFactory.CreateClientCredentials(t, params.tlsMode)
require.NotEmpty(t, clientCredsPath)

and then pass any differing binds as additional binds.

}

// mustGetWD returns the current working directory.
func mustGetWD(t *testing.T) string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: This can be embedded into assembleBinds().

@dean-amar dean-amar Oct 16, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted and explained in the comment above.

dean-amar and others added 2 commits October 16, 2025 15:10
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
Comment thread cmd/config/samples/sidecar.yaml Outdated
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
@dean-amar dean-amar merged commit fd184e0 into hyperledger:main Oct 20, 2025
19 of 20 checks passed
@dean-amar dean-amar deleted the release-image-integration-test branch March 17, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[committer] containerized TLS test [integration-test] add integration test for release images

2 participants