get rid of sequels of vs-based boxes
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 29 Jan 2014 20:18:34 +0000 (21:18 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 29 Jan 2014 20:18:34 +0000 (21:18 +0100)
use virsh lxc-enter-namespace instead of ssh to talk to TestPlc

system/LocalSubstrate.inria.py
system/Substrate.py
system/TestPlc.py

index c9573cf..a5a39eb 100755 (executable)
@@ -18,18 +18,10 @@ class OnelabSubstrate (Substrate):
    def test_box_spec (self):
       return 'testmaster'
 
-   # the build boxes we use 
-   def build_vs_boxes_spec (self):
-      return []
-
    # the experimental lxc-based build box
    def build_lxc_boxes_spec (self):
       return [ 'liquid', 'reed', 'velvet' ]
 
-   # the vs-capable box for PLCs
-   def plc_vs_boxes_spec (self):
-      return [ ]
-
    # the lxc-capable box for PLCs
    def plc_lxc_boxes_spec (self):
       return [ 
index 304373e..0f89b05 100644 (file)
@@ -1031,16 +1031,14 @@ class Options: pass
 
 class Substrate:
 
-    def __init__ (self, plcs_on_vs=False, plcs_on_lxc=True):
+    def __init__ (self):
         self.options=Options()
         self.options.dry_run=False
         self.options.verbose=False
         self.options.reboot=False
         self.options.soft=False
         self.test_box = TestBox (self.test_box_spec())
-        self.build_vs_boxes = [ BuildVsBox(h) for h in self.build_vs_boxes_spec() ]
         self.build_lxc_boxes = [ BuildLxcBox(h) for h in self.build_lxc_boxes_spec() ]
-        self.plc_vs_boxes = [ PlcVsBox (h,m) for (h,m) in self.plc_vs_boxes_spec ()]
         self.plc_lxc_boxes = [ PlcLxcBox (h,m) for (h,m) in self.plc_lxc_boxes_spec ()]
         self.qemu_boxes = [ QemuBox (h,m) for (h,m) in self.qemu_boxes_spec ()]
         self._sensed=False
@@ -1048,20 +1046,13 @@ class Substrate:
         self.vplc_pool = Pool (self.vplc_ips(),"for vplcs",self)
         self.vnode_pool = Pool (self.vnode_ips(),"for vnodes",self)
         
-        self.rescope (plcs_on_vs=plcs_on_vs, plcs_on_lxc=plcs_on_lxc)
-
-    # which plc boxes are we interested in ?
-    def rescope (self, plcs_on_vs, plcs_on_lxc):
-        self.build_boxes = self.build_vs_boxes + self.build_lxc_boxes
-        self.plc_boxes=[]
-        if plcs_on_vs: self.plc_boxes += self.plc_vs_boxes
-        if plcs_on_lxc: self.plc_boxes += self.plc_lxc_boxes
+        self.build_boxes = self.build_lxc_boxes
+        self.plc_boxes = self.plc_lxc_boxes
         self.default_boxes = self.plc_boxes + self.qemu_boxes
         self.all_boxes = self.build_boxes + [ self.test_box ] + self.plc_boxes + self.qemu_boxes
 
     def summary_line (self):
         msg  = "["
-        msg += " %d vp"%len(self.plc_vs_boxes)
         msg += " %d xp"%len(self.plc_lxc_boxes)
         msg += " %d tried plc boxes"%len(self.plc_boxes)
         msg += "]"
@@ -1363,8 +1354,6 @@ class Substrate:
                            help='dry run mode')
         (self.options,args)=parser.parse_args()
 
-        self.rescope (plcs_on_vs=True, plcs_on_lxc=True)
-
         boxes=args
         if self.options.testbox: boxes += [self.test_box]
         if self.options.builds: boxes += self.build_boxes
index 35c6722..9756156 100644 (file)
@@ -244,7 +244,7 @@ class TestPlc:
 
     #command gets run in the plc's vm
     def host_to_guest(self,command):
-        return "virsh -c lxc:/// lxc-enter-namespace %s %s" %(self.vservername,command)
+        return "virsh -c lxc:/// lxc-enter-namespace %s /bin/bash -c '%s'" %(self.vservername,command)
 #        return "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null %s %s"%(self.vserverip,command)
     
     # this /vservers thing is legacy...