Skip to content

Handle tests in containers better#3186

Merged
ptoscano merged 1 commit intomainfrom
mhorky/test-container-detection
Jan 3, 2023
Merged

Handle tests in containers better#3186
ptoscano merged 1 commit intomainfrom
mhorky/test-container-detection

Conversation

@m-horky
Copy link
Contributor

@m-horky m-horky commented Dec 19, 2022

When tests were run in container, without having sub-man packages installed, two things happened:

  • Container detection kicked in and prevented CPProvider from being created. NOTE: rhsm/unit/test_config.py::InContainerTests do not inherit from fixture.py::SubManFixture and are not affected by this patch.

  • TCP handshake was attempted by opening a connection. Because the connection requires RHSM certificates to be installed on the system, this step crashed, when subscription-manager-rhsm-certificates (e.g., /etc/rhsm/ca/ directory) was not present.

When tests were run in container, without having sub-man packages
installed, two things happened:

- Container detection kicked in and prevented CPProvider from being
  created.
  NOTE: rhsm/unit/test_config.py::InContainerTests do not inherit from
  fixture.py::SubManFixture and are not affected by this patch.

- TCP handshake was attempted by opening a connection. Because the
  connection requires RHSM certificates to be installed on the system,
  this step crashed, when subscription-manager-rhsm-certificates (e.g.,
  /etc/rhsm/ca/ directory) was not present.
@cnsnyder cnsnyder requested review from a team and ptoscano and removed request for a team December 19, 2022 10:15
Copy link
Contributor

@ptoscano ptoscano left a comment

Choose a reason for hiding this comment

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

<Homer> Woo-Hoo!

@ptoscano ptoscano merged commit d992540 into main Jan 3, 2023
@ptoscano ptoscano deleted the mhorky/test-container-detection branch January 3, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants