test: subscribe only RHEL instances

GitLab CI passes secrets to all jobs. Thus, we need to make sure that
only RHEL is being subscribed.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2021-03-26 07:41:29 +01:00 committed by Ondřej Budai
parent 5fd2ad2337
commit d28c41b844
2 changed files with 2 additions and 2 deletions

View file

@ -58,7 +58,7 @@ EOF
source /etc/os-release
ARCH=$(uname -m)
if [[ -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
if [[ $ID == "rhel" && $VERSION_ID == "8.3" && -n "${RHN_REGISTRATION_SCRIPT:-}" ]] && ! sudo subscription-manager status; then
greenprint "Registering RHEL"
sudo chmod +x "$RHN_REGISTRATION_SCRIPT"
sudo "$RHN_REGISTRATION_SCRIPT"