source: trunk/packages/xen-3.1/xen-3.1/tools/xm-test/tests/sedf/04_sedf_slice_upper_neg.py @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

  • Property svn:mime-type set to text/script
File size: 1.2 KB
Line 
1#!/usr/bin/python
2
3# Copyright (C) International Business Machines Corp., 2005
4# Author: Dan Smith <danms@us.ibm.com>
5# Author: Ryan Harper <ryanh@us.ibm.com>
6
7from XmTestLib import *
8
9def get_sedf_params(domain):
10    status, output = traceCommand("xm sched-sedf %s" %(domain.getName()))
11    return (status, output.split('\n')[1].split())
12
13
14domain = XmTestDomain(extraConfig = {"sched":"sedf"})
15
16try:
17    domain.start(noConsole=True)
18except DomainError, e:
19    if verbose:
20        print "Failed to create test domain because:"
21        print e.extra
22    FAIL(str(e))
23
24# get current param values as baseline
25(status, params) = get_sedf_params(domain)
26
27# check rv
28if status != 0:
29    FAIL("Getting sedf parameters return non-zero rv (%d)", status)
30
31# parse out current params
32(name, domid, p, s, l, e, w) = params
33
34# set slice > than current period
35slice  = str(float(p)+1)
36
37opts = "%s -s %s" %(domain.getName(), slice)
38(status, output) = traceCommand("xm sched-sedf %s" %(opts))
39
40# we should see this output from xm
41eyecatcher = "Failed to set sedf parameters"
42
43# check for failure
44if output.find(eyecatcher) >= 0:
45    FAIL("sched-sedf let me set a slice bigger than my period.")
46
47# Stop the domain (nice shutdown)
48domain.stop()
Note: See TracBrowser for help on using the repository browser.