diff options
| -rw-r--r-- | rumba/ssh_support.py | 8 | ||||
| -rw-r--r-- | rumba/testbeds/jfed.py | 40 | 
2 files changed, 37 insertions, 11 deletions
| diff --git a/rumba/ssh_support.py b/rumba/ssh_support.py index eff837d..d9be604 100644 --- a/rumba/ssh_support.py +++ b/rumba/ssh_support.py @@ -81,10 +81,6 @@ def ssh_connect(hostname, port, username, password, time_out, proxy_server):              ssh_client.connect(hostname, port, username, password,                                 look_for_keys=True, timeout=time_out, sock=proxy)              return ssh_client -        except (paramiko.ssh_exception.SSHException, EOFError): -            retry += 1 -            logger.error('Failed to connect to host, retrying: ' + -                         str(retry) + '/' + str(max_retries) + ' retries')          except paramiko.ssh_exception.BadHostKeyException:              retry += 1              logger.error(hostname + ' has a mismatching entry in ' + @@ -92,6 +88,10 @@ def ssh_connect(hostname, port, username, password, time_out, proxy_server):              logger.error('If you are sure this is not a man in the ' +                           'middle attack, edit that file to remove the ' +                           'entry and then hit return to try again.') +        except (paramiko.ssh_exception.SSHException, EOFError): +            retry += 1 +            logger.error('Failed to connect to host, retrying: ' + +                         str(retry) + '/' + str(max_retries) + ' retries')              input('Hit Enter when ready')      if retry == max_retries:          raise SSHException('Failed to connect to host') diff --git a/rumba/testbeds/jfed.py b/rumba/testbeds/jfed.py index 3235ca2..c79b1aa 100644 --- a/rumba/testbeds/jfed.py +++ b/rumba/testbeds/jfed.py @@ -55,7 +55,7 @@ class Testbed(mod.Testbed):                               username,                               passwd,                               proj_name, -                             http_proxy="https://proxy.atlantis.ugent.be:8080") +                             http_proxy=None)          self.auth_name = authority          self.cert_file = cert_file          self.exp_hours = exp_hours @@ -67,7 +67,10 @@ class Testbed(mod.Testbed):          if "exogeni" in authority:              self.authority = "urn:publicid:IDN+" + authority + "+authority+am" -        else: +        elif "wall" in authority: +            self.authority = "urn:publicid:IDN+" + authority + "+authority+cm" +            self.http_proxy="https://proxy.atlantis.ugent.be:8080" +        elif "cloudlab" in authority:              self.authority = "urn:publicid:IDN+" + authority + "+authority+cm"          if use_physical_machines is None: @@ -201,12 +204,9 @@ class Testbed(mod.Testbed):      def swap_in(self, experiment):          self.create_rspec(experiment) +        auth_name_r = self.auth_name.replace(".", "-") +          for node in experiment.nodes: -            auth_name_r = self.auth_name.replace(".", "-") -            node.ssh_config.hostname = \ -                node.name + "." + self.exp_name + "." + \ -                auth_name_r + "." + self.auth_name -            node.ssh_config.proxy_server = "bastion.test.iminds.be"              node.ssh_config.username = self.username              node.ssh_config.password = self.password @@ -220,6 +220,14 @@ class Testbed(mod.Testbed):                           "-P", self.password,                           "-e", self.exp_hours]) +        if "exogeni" in self.auth_name: +            subprocess.call(["java", "-jar", self.jfed_jar, +                             "manifest", "-S", self.proj_name, +                             "-s", self.exp_name, +                             "-p", self.cert_file, +                             "--manifest", self.manifest, +                             "-P", self.password]) +          rspec = xml.parse(self.manifest)          xml_nodes = rspec.getElementsByTagName("node") @@ -239,6 +247,24 @@ class Testbed(mod.Testbed):              if not got:                  logger.error("Not found node %s", n_name) +            hostname=None +            if "wall" in self.auth_name: +                hostname = node_n.name + "." + self.exp_name + "." + \ +                           auth_name_r + "." + self.auth_name +                node_n.ssh_config.proxy_server = "bastion.test.iminds.be" + +            if "cloudlab" in self.auth_name: +                hostname = node_n.name + "." + self.exp_name + "." + \ +                           auth_name_r + "." + self.auth_name + +            if "exogeni" in self.auth_name: +                for services_node in xml_node.getElementsByTagName("services"): +                    for login_node in services_node.getElementsByTagName("login"): +                        hostname = login_node.getAttribute("hostname") +                        break + +            node_n.ssh_config.hostname = hostname +              for intf in intfs:                  aux_mac_address = intf.getAttribute("mac_address")                  mac = ":".join( | 
