-
Task
-
Resolution: Done-Errata
-
Normal
-
0.26
-
False
-
False
-
-
2022-Q4
The current internet connection check we have defined in the system_info.py only checks for the google dns on port 53, and that might not be sufficient for a robust check at all.
After noticing that some integration tests started failing after running them from the Red Hat Office in Brno, we understood that this specific combination might be blocked by some DNS firewall rule set in the network.
And thus, on a cabal session, we decided to change it a bit to instead of checking for the Google public DNS, we will actually check for some DNS that we use during the conversion to determinate if the machine has an active internet connection or not.
Points of contact for this task
Notes
- Link for the comment from the Cabal Session: https://docs.google.com/document/d/1NuxBeubdb7Ib7cby3IoHMcQPVmoVgHkjaa0ErfejAbQ/edit?disco=AAAAa00f7ew
- For this task, we may not need the use of the socket library any more, instead, we probably can use the urllib library.
- Some questions that may arise when implementing this feature
- Do we require more than one DNS to actually validate that the internet connection is really up? If not, can we guarantee that with just one DNS, for example, the redhat.com?
- Should we hardcode the DNS names in the code, or try to read the repo files from the user system?
Acceptance Criteria
- Change the current implementation of the internet checking from a socket connection to the Google DNS to make a request to a pre-defined URL, for example: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi/server/7/7Server/x86_64/os/repodata/repomd.xml
- Stretch goal: Make a request to all URLs convert2rhel access during the conversion
- if this stretch goal is not met, create a follow-up Jira issue for that
- Stretch goal: Make a request to all URLs convert2rhel access during the conversion
- Download and verify the content of the file returned from the pre-defined URL. In the above case, it's an XML file containing some repo information.
- Log more debug information in the exception handling so that we know what happened during the check (originally RHELC-632)
- Change the unit test that is already present here.
- Write an integration test to assert that the code is behaving as expected. We can use dnsmasq to fool the code to think that the DNS is not accessible.
- Example setup that changes dnsmasq config