{"id":20158193,"url":"https://github.com/r0x0d/redhat-interview","last_synced_at":"2025-09-21T10:32:18.169Z","repository":{"id":103624344,"uuid":"401893251","full_name":"r0x0d/redhat-interview","owner":"r0x0d","description":"RHEL Migrations Interview","archived":false,"fork":false,"pushed_at":"2024-12-24T02:50:39.000Z","size":12,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-24T03:39:48.459Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/r0x0d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-01T01:30:37.000Z","updated_at":"2024-04-22T16:52:53.000Z","dependencies_parsed_at":"2024-12-24T03:37:56.192Z","dependency_job_id":"b9af623d-3d15-4603-b8b4-e781b8d35ec5","html_url":"https://github.com/r0x0d/redhat-interview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r0x0d%2Fredhat-interview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r0x0d%2Fredhat-interview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r0x0d%2Fredhat-interview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/r0x0d%2Fredhat-interview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/r0x0d","download_url":"https://codeload.github.com/r0x0d/redhat-interview/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233747054,"owners_count":18723824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T23:49:15.714Z","updated_at":"2025-09-21T10:32:12.856Z","avatar_url":"https://github.com/r0x0d.png","language":"Python","readme":"# Introduction\n\nThis is a simple code implementation for the Software Engineering - RHEL Migrations interview, it's intended to run on any rpm-based operating system, such as: Fedora, CentOS, RHEL, etc...\n\nThis code aims to get the current kernel versions installed on a running machine, it uses the `dnf` API to get metadata information about those packages and print them in a simple format to the stdout. \n\n# Getting the kernel version on your system\n\nTo run the script and check the installed versions, you can simple run the following command in any terminal you like.\n\n```bash\n$ python redhat_interview/main.py\n```\n\nOr, if you prefer, you could use `make` to run the same exactly command.\n\n```bash\n$ make # Same as the command above\n```\n\nFor default, we use `python` as the executable choice when running the `make` command, and it depends on wether you have `python2` or `python3` linked as `python` in your current system. \n\nAlso, there is a recording showing the output of the above command being ran in my own machine.\n[![asciicast](https://asciinema.org/a/3TBTGdzXFnPwC8zpTChD1HHeo.svg)](https://asciinema.org/a/3TBTGdzXFnPwC8zpTChD1HHeo)\n\nAs a counter example, this is a record of the above command being ran with python2 (I don't have the `python2-dnf` pacakge installed on my machine) and failling immediatly as it cannot recognize the `dnf` module being imported.\n\n[![asciicast](https://asciinema.org/a/xvAQXgm6f47JOyW69avXQX9ri.svg)](https://asciinema.org/a/xvAQXgm6f47JOyW69avXQX9ri) \n\n\n# Common problems found during the development\n\nWhile I was trying to implement a test case using `virtualenv` and `pytest` I found out that the newly generated `virtualenv` couldn't see the outside libraries in my machine (thus, the `python3-dnf` wasn't loaded for the `dnf` module use). I don't known if this is a common case or a misconfiguration by my side, but the workaround I got was making a `Dockerfile` for `CentOS` and `Fedora` to run the tests on. Those images are intended to run inside the `Github Actions` pipeline, but can be executed on any local machine with `Docker` installed too.\n\nIn the next section is covered on how to the tests are ran, and how to run then locally. \n\n# Running the tests\n\nThe tests are ran primarly in the `Gtihub Actions` pipeline CI with the help of a customized `Dockerfile` build, that will install the necessary packages and the right pip requirements. Besides the pipeline, the same commands can be ran in a local environment, such as the following:\n\nThe command below is used to build and run the docker container for the `CentOS Linux 8`.\n\n```bash\n$ docker build -f dockerfiles/centos8.Dockerfile -t centos-tests:latest \n$ docker run centos-tests:latest make test\n```\n\nAnd for the `Fedora Linux 34`, this is the equivalent command.\n\n```bash\n$ docker build -f dockerfiles/fedora34.Dockerfile -t fedora-tests:latest \n$ docker run fedora-tests:latest make test\n```\n\n# Additional stuff\n\nThis project was developed on a running `Fedora Linux 34` in my personal laptop.\n\nBuild information as follows: \n\n```\n[r0x0d@fedora rhel-migrations-interview]$ uname -a\nLinux fedora 5.13.12-200.fc34.x86_64 #1 SMP Wed Aug 18 13:27:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux\n```\n\nAnd the list of kernels installed on my machine based on the command `rpm -q kernel` as follows: \n\n```\n[r0x0d@fedora rhel-migrations-interview]$ rpm -q kernel\nkernel-5.12.15-300.fc34.x86_64\nkernel-5.12.17-300.fc34.x86_64\nkernel-5.13.4-200.fc34.x86_64\nkernel-5.13.6-200.fc34.x86_64\nkernel-5.13.8-200.fc34.x86_64\nkernel-5.13.9-200.fc34.x86_64\nkernel-5.13.10-200.fc34.x86_64\nkernel-5.13.12-200.fc34.x86_64\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr0x0d%2Fredhat-interview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fr0x0d%2Fredhat-interview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fr0x0d%2Fredhat-interview/lists"}