From: Daniel Stekloff Subject: [PATCH][XM-TEST] Fix test 11_create_concurrent_pos.py for HVM - Bug 562 Date: Thu, 09 Mar 2006 20:55:00 -0800 Message-ID: <1141966500.4355.55.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-jcJ0miOAOI3k2R6F3vA1" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel , Ewan Mellor Cc: Dan Smith , Ricardo C Gonzalez List-Id: xen-devel@lists.xenproject.org --=-jcJ0miOAOI3k2R6F3vA1 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi, This patch fixes test 11_create_concurrent_pos.py for HVM. It finds out the number of possible loop devices configured on the system and uses that as a max number of HVM domains that can be started concurrently. This is a partial fix for Bug 562. Thanks, Dan --=-jcJ0miOAOI3k2R6F3vA1 Content-Disposition: attachment; filename=xmtest-fix-11_create-hvm.patch Content-Type: text/x-patch; name=xmtest-fix-11_create-hvm.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User stekloff@elm3b216.beaverton.ibm.com # Node ID 4f5961d0f3236e9ee983e99bc9f287acaeba8de7 # Parent 3ea1c6118fc27e8383ed3169ab6009026505b168 Fix test 11_create_concurrent_ps.py for HVM domains. HVM can only load as many disk.img domains as there are loop devices. Added a small function to get number of loop devices to be used as a max for number of concurrent domains the test launches. Signed-off-by: Daniel Stekloff diff -r 3ea1c6118fc2 -r 4f5961d0f323 tools/xm-test/lib/XmTestLib/Test.py --- a/tools/xm-test/lib/XmTestLib/Test.py Fri Mar 10 00:08:59 2006 +++ b/tools/xm-test/lib/XmTestLib/Test.py Fri Mar 10 04:55:50 2006 @@ -32,6 +32,7 @@ import select import signal import re +import glob TEST_PASS = 0 TEST_FAIL = 255 @@ -184,7 +185,16 @@ domain.destroy() return False - + +# +# We currently can only load as many concurrent HVM domains as loop +# devices, need to find how many devices the system has. +def getMaxHVMDomains(): + nodes = glob.glob("/dev/loop*") + maxd = len(nodes) + + return maxd + if __name__ == "__main__": diff -r 3ea1c6118fc2 -r 4f5961d0f323 tools/xm-test/tests/create/11_create_concurrent_pos.py --- a/tools/xm-test/tests/create/11_create_concurrent_pos.py Fri Mar 10 00:08:59 2006 +++ b/tools/xm-test/tests/create/11_create_concurrent_pos.py Fri Mar 10 04:55:50 2006 @@ -8,8 +8,14 @@ import time import random -MIN_DOMS = 10 -MAX_DOMS = 50 +if ENABLE_HVM_SUPPORT: + MAX_DOMS = getMaxHVMDomains() + if MAX_DOMS > 50: + MAX_DOMS = 50 +else: + MAX_DOMS = 50 + +MIN_DOMS = 5 MEM_PER_DOM = 24 domains = [] --=-jcJ0miOAOI3k2R6F3vA1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-jcJ0miOAOI3k2R6F3vA1--