[haizea-commit] r558 - in trunk: . tests
haizea-commit at mailman.cs.uchicago.edu
haizea-commit at mailman.cs.uchicago.edu
Thu Jan 29 17:11:07 CST 2009
Author: borja
Date: 2009-01-29 17:11:04 -0600 (Thu, 29 Jan 2009)
New Revision: 558
Added:
trunk/tests/
trunk/tests/base_config_simulator.conf
trunk/tests/preemption.lwf
trunk/tests/preemption_prematureend.lwf
trunk/tests/test_simulator.py
Log:
Added some basic automated testing (with py.test)
Added: trunk/tests/base_config_simulator.conf
===================================================================
--- trunk/tests/base_config_simulator.conf (rev 0)
+++ trunk/tests/base_config_simulator.conf 2009-01-29 23:11:04 UTC (rev 558)
@@ -0,0 +1,42 @@
+[general]
+loglevel: VDEBUG
+mode: simulated
+lease-preparation: unmanaged
+datafile: /var/tmp/haizea/results.dat
+
+[simulation]
+clock: simulated
+starttime: 2006-11-25 13:00:00
+nodes: 2
+resources: CPU,2;Mem,2048;Net (in),100;Net (out),100;Disk,20000
+imagetransfer-bandwidth: 100
+#status-message-interval: 15
+
+[scheduling]
+shutdown-time: 0
+suspendresume-exclusion: local
+#wakeup-interval: 60
+backfilling: aggressive
+# backfilling-reservations: 4
+enactment-overhead: 2
+override-suspend-time: 0
+suspension: all
+suspend-rate: 32
+resume-rate: 32
+migration: True
+what-to-migrate: mem+disk
+
+
+[deploy-imagetransfer]
+transfer-mechanism: multicast
+avoid-redundant-transfers: True
+diskimage-reuse: none
+diskimage-cache-size: 20480
+
+
+[tracefile]
+tracefile: /home/borja/Eclipse Workspace/haizea/tests/preemption.lwf
+#imagefile: /usr/share/haizea/traces/sample.images
+#injectionfile: /usr/share/haizea/traces/multi/inj1.lwf
+#bootshutdown-overhead: 20
+#runtime-overhead: 5
Added: trunk/tests/preemption.lwf
===================================================================
--- trunk/tests/preemption.lwf (rev 0)
+++ trunk/tests/preemption.lwf 2009-01-29 23:11:04 UTC (rev 558)
@@ -0,0 +1,6 @@
+# Name: PREEMPT
+# Description: A simple trace where an AR lease
+# preempts a best-effort lease that is already
+# running.
+0 -1 3600 3600 4 1 1024 0 foobar.img 1024
+0 1800 1800 1800 2 1 1024 0 foobar.img 1024
\ No newline at end of file
Added: trunk/tests/preemption_prematureend.lwf
===================================================================
--- trunk/tests/preemption_prematureend.lwf (rev 0)
+++ trunk/tests/preemption_prematureend.lwf 2009-01-29 23:11:04 UTC (rev 558)
@@ -0,0 +1,5 @@
+# Name: PREEMPT-PREMATUREEND
+# Description: Same as PREEMPT, but with
+# premature end time for the best-effort lease.
+0 -1 3600 2700 1 1 1024 0 foobar.img 1024
+900 1800 900 900 4 1 1024 0 foobar.img 1024
\ No newline at end of file
Added: trunk/tests/test_simulator.py
===================================================================
--- trunk/tests/test_simulator.py (rev 0)
+++ trunk/tests/test_simulator.py 2009-01-29 23:11:04 UTC (rev 558)
@@ -0,0 +1,23 @@
+import ConfigParser
+
+from haizea.resourcemanager.configfile import HaizeaConfig
+from haizea.resourcemanager.rm import ResourceManager
+
+
+def load_configfile(configfile, tracefile):
+ file = open (configfile, "r")
+ c = ConfigParser.ConfigParser()
+ c.readfp(file)
+ c.set("tracefile", "tracefile", tracefile)
+ cfg = HaizeaConfig(c)
+ return cfg
+
+def test_preemption():
+ config = load_configfile("base_config_simulator.conf", "preemption.lwf")
+ rm = ResourceManager(config)
+ rm.start()
+
+def test_preemption_prematureend():
+ config = load_configfile("base_config_simulator.conf", "preemption_prematureend.lwf")
+ rm = ResourceManager(config)
+ rm.start()
\ No newline at end of file
More information about the Haizea-commit
mailing list