From eda242623b8328eaa717095cc3ed45460905fb19 Mon Sep 17 00:00:00 2001 From: Alexander Todorov Date: Fri, 30 Nov 2018 11:19:25 +0200 Subject: [PATCH] Teach AWS test to distinguish between RHEL and Fedora (cherry picked from commit ab048947cb96d833b690c4de5b6a9902df3b0f9c) --- tests/cli/test_build_and_deploy_aws.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/cli/test_build_and_deploy_aws.sh b/tests/cli/test_build_and_deploy_aws.sh index 3a4a70ef..96bef886 100755 --- a/tests/cli/test_build_and_deploy_aws.sh +++ b/tests/cli/test_build_and_deploy_aws.sh @@ -178,9 +178,15 @@ __EOF__ rlPhaseEnd rlPhaseStartTest "Verify EC2 instance" - # verify we can login as ec2-user into that instance and maybe some other details + # cloud-init default config differs between RHEL and Fedora + # and ami.ks will create ec2-user only on RHEL + CLOUD_USER="ec2-user" + if [ -f "/etc/fedora-release" ]; then + CLOUD_USER="fedora" + fi - rlRun -t -c "ssh -oStrictHostKeyChecking=no ec2-user@$IP_ADDRESS 'cat /etc/redhat-release'" + # verify we can login into that instance and maybe some other details + rlRun -t -c "ssh -oStrictHostKeyChecking=no $CLOUD_USER@$IP_ADDRESS 'cat /etc/redhat-release'" rlPhaseEnd rlPhaseStartCleanup