inria IP numbering has changed + merged tweaks from trunk
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 14 Nov 2008 13:35:46 +0000 (13:35 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 14 Nov 2008 13:35:46 +0000 (13:35 +0000)
system/TestNode.py
system/TestPlc.py
system/TestSlice.py
system/config_1vnodes.py
system/config_1vservers.py

index 57806e1..62d49a1 100644 (file)
@@ -179,9 +179,9 @@ class TestNode:
         test_box = self.test_box()
         utils.header("Starting qemu node %s on %s"%(self.name(),test_box.hostname()))
 
-        test_box.run_in_buildname("%s/qemu-bridge-init start >> %s/qemu.log"%(self.nodedir(),self.nodedir()))
+        test_box.run_in_buildname("%s/qemu-bridge-init start >> %s/log.txt"%(self.nodedir(),self.nodedir()))
         # kick it off in background, as it would otherwise hang
-        test_box.run_in_buildname("%s/qemu-start-node 2>&1 >> %s/qemu.log"%(self.nodedir(),self.nodedir()),True)
+        test_box.run_in_buildname("%s/qemu-start-node 2>&1 >> %s/log.txt"%(self.nodedir(),self.nodedir()),True)
 
     def list_qemu (self):
         utils.header("Listing qemu for host %s on box %s"%(self.name(),self.test_box().hostname()))
@@ -201,7 +201,7 @@ class TestNode:
     def gather_qemu_logs (self):
         if not self.is_qemu():
             return True
-        remote_log="%s/qemu.log"%self.nodedir()
+        remote_log="%s/log.txt"%self.nodedir()
         local_log="logs/node.qemu.%s.log"%self.name()
         self.test_box().test_ssh.fetch(remote_log,local_log)
 
index ca70681..76b4de4 100644 (file)
@@ -278,6 +278,8 @@ class TestPlc:
     # (*) the cleanup_tracker method stops all known vservers and removes the tracker file
 
     TRACKER_FILE=os.environ['HOME']+"/running-test-plcs"
+    # how many concurrent plcs are we keeping alive - adjust with the IP pool size
+    TRACKER_KEEP_VSERVERS = 12
 
     def record_tracker (self):
         try:
@@ -300,7 +302,8 @@ class TestPlc:
         print "Recorded %s in running plcs on host %s"%(self.vservername,self.test_ssh.hostname)
         return True
 
-    def free_tracker (self, keep_vservers=3):
+    def free_tracker (self, keep_vservers=None):
+        if not keep_vservers: keep_vservers=TestPlc.TRACKER_KEEP_VSERVERS
         try:
             lines=file(TestPlc.TRACKER_FILE).readlines()
         except:
@@ -394,7 +397,8 @@ class TestPlc:
 
     ### install_rpm 
     def install_rpm(self):
-        return self.run_in_guest("yum -y install myplc-native")==0
+        return self.run_in_guest("yum -y install myplc-native")==0 \
+            and self.run_in_guest("yum -y install noderepo-%s-%s"%(self.options.pldistro,self.options.arch))==0
 
     ### 
     def configure(self):
@@ -593,20 +597,27 @@ class TestPlc:
     def nodes_booted(self):
         return self.do_nodes_booted(minutes=20,gracetime=15)
 
-    def do_nodes_ssh(self,minutes,gracetime,period=15):
+    def do_nodes_ssh(self,minutes,gracetime,period=20):
         # compute timeout
         timeout = datetime.datetime.now()+datetime.timedelta(minutes=minutes)
         graceout = datetime.datetime.now()+datetime.timedelta(minutes=gracetime)
         tocheck = self.all_hostnames()
 #        self.scan_publicKeys(tocheck)
-        utils.header("checking Connectivity on nodes %r"%tocheck)
+        utils.header("checking ssh access to root context on nodes %r"%tocheck)
+        vservername=self.vservername
         while tocheck:
             for hostname in tocheck:
-                # try to ssh in nodes
-                node_test_ssh = TestSsh (hostname,key="/etc/planetlab/root_ssh_key.rsa")
-                success=self.run_in_guest(node_test_ssh.actual_command("hostname"))==0
-                if success:
-                    utils.header('The node %s is sshable -->'%hostname)
+                # try to run 'hostname' in the node
+                # using locally cached keys - assuming we've run testplc.fetch_keys()
+                local_key = "keys/%(vservername)s.rsa"%locals()
+                command = TestSsh (hostname,key=local_key).actual_command("hostname")
+                # don't spam logs - show the command only after the grace period 
+                if datetime.datetime.now() > graceout:
+                    success=utils.system(command)
+                else:
+                    success=os.system(command)
+                if success==0:
+                    utils.header('Successfully entered root@%s'%hostname)
                     # refresh tocheck
                     tocheck.remove(hostname)
                 else:
@@ -615,8 +626,6 @@ class TestPlc:
                     if TestNode.is_real_model(node_spec['node_fields']['model']):
                         utils.header ("WARNING : check ssh access into real node %s - skipped"%hostname)
                        tocheck.remove(hostname)
-                    elif datetime.datetime.now() > graceout:
-                        utils.header("Could not ssh-enter root context on %s"%hostname)
             if  not tocheck:
                 return True
             if datetime.datetime.now() > timeout:
@@ -629,7 +638,7 @@ class TestPlc:
         return True
         
     def nodes_ssh(self):
-        return self.do_nodes_ssh(minutes=30,gracetime=5)
+        return self.do_nodes_ssh(minutes=30,gracetime=10)
     
     @node_mapper
     def init_node (self): pass
index a081496..7d07baf 100644 (file)
@@ -75,7 +75,7 @@ class TestSlice:
                     found=True
         return (found,privatekey)
 
-    def check_slice(self,options,minutes=20,gracetime=6,period=15):
+    def check_slice(self,options,minutes=20,gracetime=4,period=15):
         timeout = datetime.datetime.now()+datetime.timedelta(minutes=minutes)
         graceout = datetime.datetime.now()+datetime.timedelta(minutes=gracetime)
         # locate a key
index 4fdb5d3..2474a75 100644 (file)
@@ -4,7 +4,7 @@ from TestMapper import TestMapper
 from TestPool import TestPool
 
 onelab_plcs_pool = [ 
-    ( 'vnode%02d.inria.fr'%i, '138.96.250.22%d'%i, '02:34:56:00:00:%02d'%i) for i in range(1,10) ]
+    ( 'vnode%02d.inria.fr'%i, '138.96.255.%d'%(220+i), '02:34:56:00:00:%02d'%i) for i in range(1,10) ]
 site_dict = {
     'network_fields:gateway':'138.96.248.250',
     'network_fields:network':'138.96.0.0',
index 05036ad..8713096 100644 (file)
@@ -7,7 +7,7 @@ from TestPool import TestPool
 #    ( 'vplc%02d.inria.fr'%i, '138.96.250.13%d'%i, '02:34:56:00:ee:%02d'%i) for i in range(1,10) ]
 # vplc09 is reserved for a fixed myplc - from 01 to 08
 onelab_plcs_pool = [ 
-    ( 'vplc%02d.inria.fr'%i, '138.96.250.13%d'%i, '02:34:56:00:ee:%02d'%i) for i in range(1,9) ]
+    ( 'vplc%02d.inria.fr'%i, '138.96.255.%d'%(200+i), '02:34:56:00:ee:%02d'%i) for i in range(1,21) ]
 
 def config (plcs,options):