def test_port_status_check(self): # ssh port self.assertFalse(util.check_port_status("google.com")) # ssh port self.assertTrue(util.check_port_status("research.cs.colorado.edu")) # http port self.assertTrue(util.check_port_status("google.com",80,2)) # wrong domain self.assertFalse(util.check_port_status("Idonotexistwallah.wrong")) # wrong ip self.assertFalse(util.check_port_status("256.256.256.256"))
def test_port_status_check(self): # ssh port self.assertFalse(util.check_port_status("google.com")) # ssh port self.assertTrue(util.check_port_status("research.cs.colorado.edu")) # http port self.assertTrue(util.check_port_status("google.com", 80, 2)) # wrong domain self.assertFalse(util.check_port_status("Idonotexistwallah.wrong")) # wrong ip self.assertFalse(util.check_port_status("256.256.256.256"))
def deploy_software(self): ssh_priv_key = self.config.globals.ssh_priv_key ssh_username = self.config.globals.ssh_username ssh_timeout = int(self.config.globals.ssh_timeout) reservations = list() not_available = 0 for cloud in self.clouds: for instance in cloud.get_all_floating_ips(): if self.database.check_benchmark(self.benchmark.name, instance.instance_id): if not check_port_status(instance.ip, 22, ssh_timeout): LOG.error("Deploy_software: the port 22 is not " "available right now. please try it later") continue cmds = list() cmds.append("wget %s" % (self.url)) cmds.append("sudo apt-get update") cmds.append("sudo apt-get install unzip") cmds.append("unzip BioPerf.zip") cmds.append("sed -i 's/read BIOPERF/#read " "BIOPERF/g' install-BioPerf.sh") cmds.append("./install-BioPerf.sh") for c in cmds: command = RemoteCommand(instance.ip, ssh_priv_key, c) command_return = command.execute() if command_return != 0: LOG.error("Deploy_software: " + command.stdout) LOG.error("Deploy_software error: " + command.stderr)
def deploy_software(self): ssh_priv_key = self.config.globals.ssh_priv_key ssh_username = self.config.globals.ssh_username ssh_timeout = int(self.config.globals.ssh_timeout) reservations = list() not_available = 0; if self.reservations: reservations = self.reservations else: for cloud in self.clouds: reservations = cloud.conn.get_all_instances() for reservation in reservations: for instance in reservation.instances: if self.database.check_benchmark(self.benchmark.name, instance.id): if not check_port_status(instance.ip_address, 22, ssh_timeout): LOG.error("Deploy_software: the port 22 is not available right now. please try it later") continue cmds = list() cmds.append("wget %s" % (self.url)) #cmds.append("apt-get update") #cmds.append("apt-get install unzip") cmds.append("unzip BioPerf.zip") cmds.append("sed -i 's/read BIOPERF/#read BIOPERF/g' install-BioPerf.sh") cmds.append("./install-BioPerf.sh") for c in cmds: command = RemoteCommand(instance.public_dns_name, ssh_priv_key, c) command_return = command.execute() if command_return !=0: LOG.error("Deploy_software: "+command.stdout) LOG.error("Deploy_software error: "+command.stderr)
def deploy_software(self): ssh_priv_key = self.config.globals.ssh_priv_key ssh_username = self.config.globals.ssh_username ssh_timeout = int(self.config.globals.ssh_timeout) reservations = list() not_available = 0; if self.reservations: reservations = self.reservations else: for cloud in self.clouds: reservations = cloud.conn.get_all_instances() for reservation in reservations: for instance in reservation.instances: if self.database.check_benchmark(self.benchmark.name, instance.id): if not check_port_status(instance.ip_address, 22, ssh_timeout): LOG.error("Deploy_software: the port 22 is not available right now. please try it later") continue cmds = list() cmds.append("rm -rf ~/*") cmds.append("wget %s" % (self.url)) cmds.append("apt-get update") cmds.append("apt-get install unzip") cmds.append("unzip BioPerf.zip") cmds.append("sed -i 's/read BIOPERF/#read BIOPERF/g' install-BioPerf.sh") cmds.append("./install-BioPerf.sh") cmds.append("wget ftp://ftp.cc.gatech.edu/pub/people/bader/BioPerf/swissprot.tar.gz") cmds.append("tar -xvf swissprot.tar.gz") cmds.append("mv Swissprot/* .") cmds.append("wget ftp://ftp.cc.gatech.edu/pub/people/bader/BioPerf/Pfam") cmds.append("wget ftp://ftp.cc.gatech.edu/pub/people/bader/BioPerf/nr") cmds.append("sed -i '10 i\DATABASES=~/' ~/.profile") cmds.append("sed -i '10 i\export DATABASES' ~/.profile") cmds.append("sed -i '5c input='y'' ~/BioPerf/Scripts/Run-scripts/CleanOutputs.sh") cmds.append("sed -i '21c #' ~/BioPerf/Scripts/Run-scripts/run-bioperf.sh") cmds.append("sed -i '26c #' ~/BioPerf/Scripts/Run-scripts/run-bioperf.sh") cmds.append("sed -i '10c arch='X'' ~/BioPerf/Scripts/Run-scripts/run-bioperf.sh") cmds.append("sed -i '71c input3='A'' ~/BioPerf/Scripts/Run-scripts/run-bioperf.sh") cmds.append('''sed -i "659c ch='Y';" ./BioPerf/Source-codes/Phylip/src/promlk.c''') cmds.append("sed -i '/scanf/c //' ./BioPerf/Source-codes/Phylip/src/promlk.c") cmds.append("cd ./BioPerf/Source-codes/Phylip/src;make promlk;cd ~") cmds.append("mv ./BioPerf/Source-codes/Phylip/src/promlk ./BioPerf/Binaries/x86-Binaries/Phylip") for c in cmds: command = RemoteCommand(instance.public_dns_name, ssh_priv_key, c) command_return = command.execute() if command_return !=0: LOG.error("Deploy_software: "+command.stdout) LOG.error("Deploy_software error: "+command.stderr)