Project

General

Profile

root / branches / 1.1 / tests / test_simul_pricing.py @ 806

1
from haizea.core.leases import Lease
2
from common import *
3

    
4
def get_config():
5
    c = load_configfile("base_config_simulator.conf")
6
    c.add_section("pricing")
7
    return c
8
   
9
def test_pricing1():
10
    c = get_config()
11
    c.set("scheduling", "policy-pricing", "free")
12
    h = load_tracefile(c, "price1.lwf")
13
    h.start()
14
    verify_done(h, [1])
15

    
16
def test_pricing2():
17
    c = get_config()
18
    c.set("scheduling", "policy-pricing", "constant")
19
    c.set("pricing", "rate", "0.10")        
20
    h = load_tracefile(c, "price1.lwf")
21
    h.start()
22
    verify_done(h, [1])
23
    
24
def test_pricing3():
25
    c = get_config()
26
    c.set("scheduling", "policy-pricing", "constant")
27
    c.set("pricing", "rate", "1.00")        
28
    h = load_tracefile(c, "price2.lwf")
29
    h.start()
30
    verify_rejected_by_user(h, [1])
31
    
32
def test_pricing_surcharge():
33
    c = get_config()
34
    c.set("scheduling", "mapper", "deadline")
35
    c.set("scheduling", "policy-preemption", "deadline")
36
    c.set("scheduling", "suspension", "all")
37
    c.set("scheduling", "policy-pricing", "constant")
38
    c.set("pricing", "rate", "0.10")        
39
    h = load_tracefile(c, "pricedeadline.lwf")
40
    h.start()
41
    verify_done(h, [1])