bonding nodes should not use plain-bootstrapfs as we don't install it
[tests.git] / system / TestBonding.py
index 9f4c432..0a2747c 100644 (file)
@@ -49,6 +49,7 @@ def onelab_bonding_spec (buildname):
 
 ####################
 import os, os.path
+import socket
 
 import utils
 from TestSsh import TestSsh
@@ -86,15 +87,17 @@ class TestBonding(object):
         return "{pldistro}-{fcdistro}-{arch}".format(**self.bonding_spec)
         
     #################### provisioning
+    # store only hostname so it's either to set this manually
     def persistent_name(self):
         return "arg-bonding-{}".format(self.bonding_spec['buildname'])
     def persistent_store(self):
         with open(self.persistent_name(),'w') as f:
-            f.write("{} {}\n".format(self.vnode_hostname, self.vnode_ip))
+            f.write("{}\n".format(self.vnode_hostname))
     def persistent_load(self):
         try:
             with open(self.persistent_name()) as f:
-                self.vnode_hostname, self.vnode_ip = f.read().strip().split()
+                self.vnode_hostname = f.read().strip().split()[0]
+                self.vnode_ip = socket.gethostbyname(self.vnode_hostname)
             return True
         except:
             return False
@@ -107,7 +110,7 @@ class TestBonding(object):
         if self.persistent_load():
             print("Re-using bonding nodes attributes from {}".format(self.persistent_name()))
         else:
-            print("Could not load bonding nodes attributes from {}".format(self.persistent_name()))
+            print("Sensing for an avail. IP (Could not load from {})".format(self.persistent_name()))
             vnode_pool = self.substrate.vnode_pool
             vnode_pool.sense()
             try:
@@ -119,12 +122,16 @@ class TestBonding(object):
             except:
                 raise Exception("Cannot provision bonding node")
 
+        print("Bonding on node {} - {}".format(self.vnode_hostname, self.vnode_ip))
+
         # implement the node on another IP
         node_spec['node_fields']['hostname'] = self.vnode_hostname
         node_spec['interface_fields']['ip'] = self.vnode_ip
         # with the node flavour that goes with bonding plc
         for tag in ['arch', 'fcdistro', 'pldistro']:
             node_spec['tags'][tag] = self.bonding_spec[tag]
+        # do not use plain bootstrapfs
+        del node_spec['tags']['plain-bootstrapfs']
 
     #################### steps
     def init_partial(self):