[haizea-commit] r567 - trunk/tests

haizea-commit at mailman.cs.uchicago.edu haizea-commit at mailman.cs.uchicago.edu
Thu Feb 12 18:04:39 CST 2009


Author: borja
Date: 2009-02-12 18:04:37 -0600 (Thu, 12 Feb 2009)
New Revision: 567

Added:
   trunk/tests/base_config_opennebula.conf
   trunk/tests/one-threeleases.db
   trunk/tests/one-twoleases.db
   trunk/tests/onevm
   trunk/tests/test_opennebula.py
Modified:
   trunk/tests/common.py
Log:
Added automated OpenNebula tests

Added: trunk/tests/base_config_opennebula.conf
===================================================================
--- trunk/tests/base_config_opennebula.conf	                        (rev 0)
+++ trunk/tests/base_config_opennebula.conf	2009-02-13 00:04:37 UTC (rev 567)
@@ -0,0 +1,39 @@
+# ============================= #
+#                               #
+#      OPENNEBULA OPTIONS       #
+#                               #
+# ============================= #
+
+[opennebula]
+db: one.db
+onevm: onevm
+wakeup-interval: 10
+non-schedulable-interval: 10
+stop-when-no-more-leases: True
+dry-run: True
+
+# ============================= #
+#                               #
+#         OTHER OPTIONS         #
+#       (see sample.conf        #
+#       for description)        #
+#                               #
+# ============================= #
+
+[general]
+loglevel: VDEBUG
+mode: opennebula
+datafile: /var/tmp/haizea/results.dat
+lease-deployment: unmanaged
+lease-failure-handling: exit
+
+[scheduling]
+backfilling: aggressive
+suspension: all
+migration: False
+transfer: none
+suspendresume-exclusion: local
+shutdown-time: 10
+enactment-overhead: 0
+suspend-rate: 32
+resume-rate: 32
\ No newline at end of file

Modified: trunk/tests/common.py
===================================================================
--- trunk/tests/common.py	2009-02-13 00:04:10 UTC (rev 566)
+++ trunk/tests/common.py	2009-02-13 00:04:37 UTC (rev 567)
@@ -1,18 +1,25 @@
 import ConfigParser
+import os
+import shutil
 
 from haizea.resourcemanager.configfile import HaizeaConfig
 from haizea.resourcemanager.rm import ResourceManager
 
-class BaseSimulatorTest(object):
+class BaseTest(object):
     def __init__(self):
         pass
-    
+
     def load_configfile(self, configfile):
         file = open (configfile, "r")
         c = ConfigParser.ConfigParser()
         c.readfp(file)
         return c
 
+
+class BaseSimulatorTest(BaseTest):
+    def __init__(self):
+        pass
+
     def set_tracefile(self, tracefile):
         self.config.set("tracefile", "tracefile", tracefile)
 
@@ -59,4 +66,16 @@
     def test_wait(self):
         self.set_tracefile("wait.lwf")
         rm = ResourceManager(HaizeaConfig(self.config))
-        rm.start()
\ No newline at end of file
+        rm.start()
+        
+        
+class BaseOpenNebulaTest(BaseTest):
+    def __init__(self):
+        pass
+
+    def do_test(self, db):
+        shutil.copyfile(db, "one.db")
+        rm = ResourceManager(HaizeaConfig(self.config))
+        rm.start()
+        os.remove("one.db")
+

Added: trunk/tests/one-threeleases.db
===================================================================
(Binary files differ)


Property changes on: trunk/tests/one-threeleases.db
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/tests/one-twoleases.db
===================================================================
(Binary files differ)


Property changes on: trunk/tests/one-twoleases.db
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/tests/onevm
===================================================================
--- trunk/tests/onevm	                        (rev 0)
+++ trunk/tests/onevm	2009-02-13 00:04:37 UTC (rev 567)
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+if [ $1 = "deploy" ];
+then
+    echo "Deploying VM"
+elif [ $1 = "shutdown" ];
+then
+    echo "Shutting down VM"
+elif [ $1 = "suspend" ];
+then
+    echo "Suspending VM"
+    vid=$2
+    sqlite3 one.db "UPDATE vm_pool SET state=5 where oid=$vid"
+elif [ $1 = "resume" ];
+then
+    echo "Resuming VM"
+    vid=$2
+    sqlite3 one.db "UPDATE vm_pool SET state=3 where oid=$vid"
+fi
\ No newline at end of file

Added: trunk/tests/test_opennebula.py
===================================================================
--- trunk/tests/test_opennebula.py	                        (rev 0)
+++ trunk/tests/test_opennebula.py	2009-02-13 00:04:37 UTC (rev 567)
@@ -0,0 +1,11 @@
+from common import BaseOpenNebulaTest
+
+class TestOpenNebula(BaseOpenNebulaTest):
+    def __init__(self):
+        self.config = self.load_configfile("base_config_opennebula.conf")
+   
+    def test_twoleases(self):
+        self.do_test("one-twoleases.db")          
+        
+    def test_threeleases(self):
+        self.do_test("one-threeleases.db")
\ No newline at end of file



More information about the Haizea-commit mailing list