Skip to content

Conversation

@hehe7318
Copy link
Contributor

@hehe7318 hehe7318 commented Nov 5, 2025

Description of changes

  • Ensure known_hosts path exists to avoid 'cat' command returning non-zero exit when testing in ADC region

Tests

  • Test passed in commercial on rhel8 and AL2023

Checklist

  • Make sure you are pointing to the right branch.
  • If you're creating a patch for a branch other than develop add the branch name as prefix in the PR title (e.g. [release-3.6]).
  • Check all commits' messages are clear, describing what and why vs how.
  • Make sure to have added unit tests or integration tests to cover the new/modified code.
  • Check if documentation is impacted by this change.

Please review the guidelines for contributing and Pull Request Instructions.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@hehe7318 hehe7318 requested review from a team as code owners November 5, 2025 17:44
@hehe7318 hehe7318 added skip-changelog-update Disables the check that enforces changelog updates in PRs 3.x labels Nov 5, 2025
@hehe7318 hehe7318 changed the title [IntegTest][Release-3.14] Ensure known_hosts path exists to avoid 'cat' command returning non-zero exit when testing in ADC region [IntegTest][Release-3.14] Fix test_dcv in ADC regions by ensuring known_hosts path exists to avoid cat command failure Nov 5, 2025

node_ip = cluster.get_login_node_public_ip() if use_login_node else cluster.head_node_ip

# add ssh key to jenkins user known hosts file to avoid ssh keychecking prompt
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we removing this comment. It seems we are still adding the ssh key to the known hosts file. So I think it is important to keep this information.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Delete it by mistake, I have added it back.

result = subprocess.check_output("cat {0}".format(host_keys_file), shell=True)
logging.info(f"New content of known hosts file {host_keys_file}: {result}")

try:
Copy link
Contributor

Choose a reason for hiding this comment

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

This is repeated logic that is not the most readable. I think it would be helpful to create a function like _get_known_hosts_content.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@hgreebe
Copy link
Contributor

hgreebe commented Nov 5, 2025

Did you run the test_dcv integration test in commercial to ensure this does not introduce any issues? If you did, I recommend adding that to the description.

I would especially recommend running it with AL2023 because that was the OS that made us have to look into the known_hosts file.

@hehe7318
Copy link
Contributor Author

hehe7318 commented Nov 5, 2025

Did you run the test_dcv integration test in commercial to ensure this does not introduce any issues? If you did, I recommend adding that to the description.

I would especially recommend running it with AL2023 because that was the OS that made us have to look into the known_hosts file.

Test ongoing

@hehe7318 hehe7318 merged commit 722736f into aws:release-3.14 Nov 5, 2025
24 checks passed
hehe7318 added a commit to hehe7318/aws-parallelcluster that referenced this pull request Nov 5, 2025
…wn_hosts path exists to avoid cat command failure (aws#7085)

Ensure known_hosts path exists to avoid 'cat' command returning non-zero exit when testing in ADC region
hehe7318 added a commit to hehe7318/aws-parallelcluster that referenced this pull request Nov 5, 2025
…wn_hosts path exists to avoid cat command failure (aws#7085)

Ensure known_hosts path exists to avoid 'cat' command returning non-zero exit when testing in ADC region
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x skip-changelog-update Disables the check that enforces changelog updates in PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants