test/api.sh: use 'ec2-user' to log into RHEL-9 AMI images

The RHEL-8.5 and RHEL-9.0 `ami` images are now based on the official
RHEL EC2 images. As a result, they use a different default user -
`ec2-user`.

Fix the `api.sh` test case to use the correct user when testing RHEL-9
`ami` images.

Fix #1632

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2021-08-24 14:31:19 +02:00 committed by Tom Gundersen
parent e8c3fb94f0
commit 03127ded43

View file

@ -383,7 +383,11 @@ fi
case $(set +x; . /etc/os-release; echo "$ID-$VERSION_ID") in
"rhel-9.0")
DISTRO="rhel-90"
SSH_USER="cloud-user"
if [[ "$CLOUD_PROVIDER" == "$CLOUD_PROVIDER_AWS" ]]; then
SSH_USER="ec2-user"
else
SSH_USER="cloud-user"
fi
;;
"rhel-8.5")
DISTRO="rhel-85"