Testcases shouldn't run prematurely from installer script 19/97719/4
authorAkhila Kishore <akhila.kishore@intel.com>
Tue, 29 Oct 2019 22:53:45 +0000 (15:53 -0700)
committerAkhila Kishore <akhila.kishore@intel.com>
Wed, 30 Oct 2019 18:32:21 +0000 (11:32 -0700)
Testing_enabled: true in the installer script, causes
the test cases to run immediately after the playbook even before
the pods are completely up. Causing some of the test cases to fail.
Making sure, the test cases run only after all of playbooks
have finished running. Correcting the identation

Signed-off-by: Akhila Kishore <akhila.kishore@intel.com>
Issue-ID: MULTICLOUD-904
Change-Id: Ieec33f46301d7c8d9cb36ac5f32caefca2981804

kud/hosting_providers/vagrant/installer.sh

index e5138c2..235736e 100755 (executable)
@@ -154,23 +154,19 @@ function install_addons {
     echo "Installing Kubernetes AddOns"
     _install_ansible
     sudo ansible-galaxy install $verbose -r $kud_infra_folder/galaxy-requirements.yml --ignore-errors
-
     ansible-playbook $verbose -i $kud_inventory $kud_playbooks/configure-kud.yml | sudo tee $log_folder/setup-kud.log
-    for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd}; do
+    for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov}; do
         echo "Deploying $addon using configure-$addon.yml playbook.."
         ansible-playbook $verbose -i $kud_inventory $kud_playbooks/configure-${addon}.yml | sudo tee $log_folder/setup-${addon}.log
-        if [[ "${testing_enabled}" == "true" ]]; then
-            pushd $kud_tests
-            bash ${addon}.sh
-            popd
-        fi
     done
-    ansible-playbook $verbose -i $kud_inventory $kud_playbooks/configure-sriov.yml | sudo tee $log_folder/setup-sriov.log
-        if [[ "${testing_enabled}" == "true" ]]; then
+    echo "Run the test cases if testing_enabled is set to true."
+    if [[ "${testing_enabled}" == "true" ]]; then
+        for addon in ${KUD_ADDONS:-virtlet ovn4nfv nfd sriov}; do
             pushd $kud_tests
-            bash sriov.sh
+            bash ${addon}.sh
             popd
-        fi
+        done
+    fi
     echo "Add-ons deployment complete..."
 }