From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Burns Subject: [PATCH][KVM-AUTOTEST] Check exit status of custom install script and fail if script failed. Date: Wed, 20 May 2009 16:38:51 -0400 Message-ID: <1242851931-8492-2-git-send-email-mburns@redhat.com> References: <1242851931-8492-1-git-send-email-mburns@redhat.com> Cc: dhuff@redhat.com, ulublin@redhat.com, Mike Burns To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([66.187.233.31]:54648 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754839AbZETUix (ORCPT ); Wed, 20 May 2009 16:38:53 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n4KKcs3d027513 for ; Wed, 20 May 2009 16:38:54 -0400 In-Reply-To: <1242851931-8492-1-git-send-email-mburns@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Mike Burns --- client/tests/kvm_runtest_2/kvm_install.py | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm_runtest_2/kvm_install.py b/client/tests/kvm_runtest_2/kvm_install.py index ebd8b7d..392ef0c 100755 --- a/client/tests/kvm_runtest_2/kvm_install.py +++ b/client/tests/kvm_runtest_2/kvm_install.py @@ -90,7 +90,12 @@ def run_kvm_install(test, params, env): kvm_log.info("Adding KVM_INSTALL_%s to Environment" % (k)) os.putenv("KVM_INSTALL_%s" % (k), str(params[k])) kvm_log.info("Running " + script + " to install kvm") - os.system("cd %s; %s" % (test.bindir, script)) + install_result = os.system("cd %s; %s" % (test.bindir, script)) + if os.WEXITSTATUS(install_result) != 0: + message = "Custom Script encountered an error" + kvm_log.error(message) + raise error.TestError, message + kvm_log.info("Completed %s" % (script)) # invalid installation mode -- 1.5.5.6