Tony Breeds
2006-Oct-20 03:22 UTC
[Xen-devel] [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests
Fix Memory assumptions in the create tests. Use the architecture specified idea of minimum memory. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> --- tools/xm-test/tests/create/11_create_concurrent_pos.py | 2 - tools/xm-test/tests/create/12_create_concurrent_stress_pos.py | 11 +++++++-- tools/xm-test/tests/create/14_create_blockroot_pos.py | 11 ++------- tools/xm-test/tests/create/15_create_smallmem_pos.py | 4 +-- tools/xm-test/tests/create/16_create_smallmem_neg.py | 12 +++++----- 5 files changed, 21 insertions(+), 19 deletions(-) --- a/tools/xm-test/tests/create/11_create_concurrent_pos.py Thu Oct 19 17:01:02 2006 +1000 +++ b/tools/xm-test/tests/create/11_create_concurrent_pos.py Thu Oct 19 17:02:40 2006 +1000 @@ -16,7 +16,7 @@ else: MAX_DOMS = 50 MIN_DOMS = 5 -MEM_PER_DOM = 24 +MEM_PER_DOM = minSafeMem() domains = [] console = [] diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/12_create_concurrent_stress_pos.py --- a/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py Thu Oct 19 17:01:02 2006 +1000 +++ b/tools/xm-test/tests/create/12_create_concurrent_stress_pos.py Thu Oct 19 17:02:40 2006 +1000 @@ -8,10 +8,17 @@ import time import time DOMS=5 -MEM=32 +MEM=minSafeMem() DUR=60 domains = [] + +free_mem = int(getInfo("free_memory")) +NUM_DOMS = int(free_mem / MEM) + +if NUM_DOMS < DOMS: + SKIP("Need %i MB of RAM to start %i@%iMB domains! (%i MB avail)" % + (DOMS * MEM, DOMS, MEM, free_mem)) for i in range(0,DOMS): dom = XmTestDomain(extraConfig={"memory" : MEM}) @@ -44,7 +51,7 @@ for d, c in domains: if verbose: print "Testing domain %s..." % d.getName() - + run = c.runCmd("ls") if run["return"] != 0: diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/14_create_blockroot_pos.py --- a/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu Oct 19 17:01:02 2006 +1000 +++ b/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu Oct 19 17:02:40 2006 +1000 @@ -18,17 +18,12 @@ rdpath = getRdPath() # print "Using %s" % output if ENABLE_HVM_SUPPORT: - domain = XmTestDomain(name="14_create_blockroot") + config = None else: - config = {"memory" : "64", - "root" : "/dev/hda1", - "name" : "14_create_blockroot", - "kernel" : getDefaultKernel(), + config = {"root" : "/dev/hda1", "disk" : "file:%s/initrd.img,hda1,w" % rdpath } - domConfig = XenConfig() - domConfig.setOpts(config) - domain = XenDomain(name=domConfig.getOpt("name"), config=domConfig) +domain = XmTestDomain(name="14_create_blockroot", extraConfig=config) try: console = domain.start() diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/15_create_smallmem_pos.py --- a/tools/xm-test/tests/create/15_create_smallmem_pos.py Thu Oct 19 17:01:02 2006 +1000 +++ b/tools/xm-test/tests/create/15_create_smallmem_pos.py Thu Oct 19 17:02:40 2006 +1000 @@ -5,8 +5,8 @@ from XmTestLib import * -# 32MBs is the default lower limit for creating domains, it should work -MEM = 32 +# Create a domain with the minimum memory allocation +MEM = minSafeMem() domain = XmTestDomain(extraConfig={"memory": MEM, "extra" :"mem=%iM" % MEM}) diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/16_create_smallmem_neg.py --- a/tools/xm-test/tests/create/16_create_smallmem_neg.py Thu Oct 19 17:01:02 2006 +1000 +++ b/tools/xm-test/tests/create/16_create_smallmem_neg.py Thu Oct 19 17:02:40 2006 +1000 @@ -3,11 +3,11 @@ # Copyright (C) International Business Machines Corp., 2005 # Author: Dan Smith <danms@us.ibm.com> +import re from XmTestLib import * -# This is under the default lower limit of 32 and we expect this test -# to fail. 16MBs isn''t enough for the -xen kernel. -MEM = 16 +# Create a domaain without enough memory. +MEM = minSafeMem() - 1 domain = XmTestDomain(extraConfig={"memory": MEM, "extra" :"mem=%iM" % MEM}) @@ -16,13 +16,13 @@ try: console = domain.start() console.runCmd("ls") except DomainError, e: - FAIL("Unable to start a domain with %i MB" % MEM) + if not re.search(''^Error: Domain memory must be at least \d+ KB'', e.extra): + FAIL("Unable to start a domain with %i MB" % MEM) except ConsoleError, e: if e.reason == RUNAWAY: print "Domain with %i MB has runaway console as expected" % MEM - else: - print "Starting a domain with %i MB failed as expected" % MEM else: FAIL("Starting a console with %i MB passed, expected test to fail" % MEM) +print "Starting a domain with %i MB failed as expected" % MEM domain.destroy() _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ewan Mellor
2006-Oct-23 10:55 UTC
Re: [Xen-devel] [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests
On Fri, Oct 20, 2006 at 01:22:31PM +1000, Tony Breeds wrote:> Fix Memory assumptions in the create tests. > > Use the architecture specified idea of minimum memory. > > Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> > --- > > [Snip] > > diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/16_create_smallmem_neg.py > --- a/tools/xm-test/tests/create/16_create_smallmem_neg.py Thu Oct 19 17:01:02 2006 +1000 > +++ b/tools/xm-test/tests/create/16_create_smallmem_neg.py Thu Oct 19 17:02:40 2006 +1000 > @@ -3,11 +3,11 @@ > # Copyright (C) International Business Machines Corp., 2005 > # Author: Dan Smith <danms@us.ibm.com> > > +import re > from XmTestLib import * > > -# This is under the default lower limit of 32 and we expect this test > -# to fail. 16MBs isn''t enough for the -xen kernel. > -MEM = 16 > +# Create a domaain without enough memory. > +MEM = minSafeMem() - 1I''m not convinced by this one. Just because 32 MiB is known to be safe, that doesn''t mean that 31 MiB will cause the domain to crash. The 16 MiB value is deliberately _far_ too small, so that the OOM killer kicks in, and the console runaway is detected. I don''t want this test to intermittently succeed, even if it is a negative test -- it makes the results hard to analyse. Is the 16 MiB value a problem for PPC, or were you deliberately trying to test that 63 MiB failed on that platform? We could add another arch-specific option -- tooLittleMem() or something -- or we could just leave this value at 16 MiB. Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Tony Breeds
2006-Oct-23 23:45 UTC
Re: [Xen-devel] [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests
On Mon, Oct 23, 2006 at 11:55:22AM +0100, Ewan Mellor wrote:> I''m not convinced by this one. Just because 32 MiB is known to be safe, that > doesn''t mean that 31 MiB will cause the domain to crash. The 16 MiB value is > deliberately _far_ too small, so that the OOM killer kicks in, and the console > runaway is detected.Okay, that makes more sense.> I don''t want this test to intermittently succeed, even if it is a negative > test -- it makes the results hard to analyse. > > Is the 16 MiB value a problem for PPC, or were you deliberately trying to test > that 63 MiB failed on that platform?PPC will fail for any memory value < 64M, so 16 or 63 makes little difference. I probably should haev said this in the commit message but I changed this test to use minSafeMem() to be consistent with the other changes I made.> We could add another arch-specific option -- tooLittleMem() or something -- or > we could just leave this value at 16 MiB.Okay leaving it set at 16MiB, is probably the right thing. If we get to a state the an architecture or OS needs to vary it we can look at something like tooLittleMem() then. Yours Tony linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/ Jan 15-20 2007 The Australian Linux Technical Conference! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ewan Mellor
2006-Oct-24 13:54 UTC
Re: [Xen-devel] [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests
On Tue, Oct 24, 2006 at 09:45:36AM +1000, Tony Breeds wrote:> Okay leaving it set at 16MiB, is probably the right thing. If we get to > a state the an architecture or OS needs to vary it we can look at > something like tooLittleMem() then.OK, I''ve taken the most of the patch, but with the 16MiB low limit left in. What''s this bit though (I haven''t taken this yet)? diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/14_create_blockroot_pos.py --- a/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu Oct 19 17:01:02 2006 +1000 +++ b/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu Oct 19 17:02:40 2006 +1000 @@ -18,17 +18,12 @@ rdpath = getRdPath() # print "Using %s" % output if ENABLE_HVM_SUPPORT: - domain = XmTestDomain(name="14_create_blockroot") + config = None else: - config = {"memory" : "64", - "root" : "/dev/hda1", - "name" : "14_create_blockroot", - "kernel" : getDefaultKernel(), + config = {"root" : "/dev/hda1", "disk" : "file:%s/initrd.img,hda1,w" % rdpath } - domConfig = XenConfig() - domConfig.setOpts(config) - domain = XenDomain(name=domConfig.getOpt("name"), config=domConfig) +domain = XmTestDomain(name="14_create_blockroot", extraConfig=config) try: console = domain.start() Ewan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Tony Breeds
2006-Oct-24 23:50 UTC
Re: [Xen-devel] [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests
On Tue, Oct 24, 2006 at 02:54:16PM +0100, Ewan Mellor wrote:> OK, I''ve taken the most of the patch, but with the 16MiB low limit left in.Great.> What''s this bit though (I haven''t taken this yet)?Essentially the XenDomain class does not respect the arch defaults where as XmTestDomain does. This part of the patch forces both HVM and non-HVM tests to use XmTestDomain. With appropriate changes to the extraConfig arg. On PPC we need to use the arch defaults to get the console setup correctly. I chose not to include the arch defaults in XenDomain as this gives us flexibility for the future.> diff -r 69035d8a5f2a -r 2854ceda351e tools/xm-test/tests/create/14_create_blockroot_pos.py > --- a/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu Oct 19 17:01:02 2006 +1000 > +++ b/tools/xm-test/tests/create/14_create_blockroot_pos.py Thu Oct 19 17:02:40 2006 +1000 > @@ -18,17 +18,12 @@ rdpath = getRdPath() > # print "Using %s" % output > > if ENABLE_HVM_SUPPORT: > - domain = XmTestDomain(name="14_create_blockroot") > + config = None > else: > - config = {"memory" : "64", > - "root" : "/dev/hda1", > - "name" : "14_create_blockroot", > - "kernel" : getDefaultKernel(), > + config = {"root" : "/dev/hda1", > "disk" : "file:%s/initrd.img,hda1,w" % rdpath > } > - domConfig = XenConfig() > - domConfig.setOpts(config) > - domain = XenDomain(name=domConfig.getOpt("name"), config=domConfig) > +domain = XmTestDomain(name="14_create_blockroot", extraConfig=config) > > try: > console = domain.start()Yours Tony linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/ Jan 15-20 2007 The Australian Linux Technical Conference! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Tony Breeds
2006-Oct-25 01:16 UTC
Re: [Xen-devel] [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests
On Wed, Oct 25, 2006 at 09:50:08AM +1000, Tony Breeds wrote:> > if ENABLE_HVM_SUPPORT: > > - domain = XmTestDomain(name="14_create_blockroot") > > + config = NoneOn a differernt note does block-attch/detach work on HVM? I see: --- if ENABLE_HVM_SUPPORT: SKIP("Block-attch not supported on HVM domains") --- in some of the block-* tests? Yours Tony linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/ Jan 15-20 2007 The Australian Linux Technical Conference! _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Tony Breeds
2006-Oct-31 02:16 UTC
[XenPPC] Re: [Xen-devel] [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests
On Tue, Oct 24, 2006 at 02:54:16PM +0100, Ewan Mellor wrote:> OK, I''ve taken the most of the patch, but with the 16MiB low limit left in. > What''s this bit though (I haven''t taken this yet)?Hi Ewan, What are the outstanding issues with this patch? I''m keen to get it merged if you''re happy with it. Yours Tony linux.conf.au http://linux.conf.au/ || http://lca2007.linux.org.au/ Jan 15-20 2007 The Australian Linux Technical Conference! _______________________________________________ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel
Ewan Mellor
2006-Nov-01 15:54 UTC
[XenPPC] Re: [Xen-devel] [PATCH 10/10][TOOLS][XM-TEST] Fix Memory assumptions in the create tests
On Tue, Oct 31, 2006 at 01:16:03PM +1100, Tony Breeds wrote:> On Tue, Oct 24, 2006 at 02:54:16PM +0100, Ewan Mellor wrote: > > > OK, I''ve taken the most of the patch, but with the 16MiB low limit left in. > > What''s this bit though (I haven''t taken this yet)? > > Hi Ewan, > What are the outstanding issues with this patch? I''m keen to > get it merged if you''re happy with it.Nothing wrong with it -- I just forgot about it. Applied now. Thanks, Ewan. _______________________________________________ Xen-ppc-devel mailing list Xen-ppc-devel@lists.xensource.com http://lists.xensource.com/xen-ppc-devel