Commit e1a35a6a authored by Gao, Shang's avatar Gao, Shang
Browse files

adding test file for olcf_get_globus_tokens

parent 3a6d7c77
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -84,8 +84,8 @@ class crossbowGlobus(crossbowBase):
                 user_agent='crossbow',token_file='refresh-tokens.json'):
        
        self.client_id = '18270179-b498-4032-9187-ca646d6e29af'
        self.cadesdtn = 'e6bcd4fa-ac1b-11e6-9aee-22000a1e3b52'
        self.crossbowdtn = '586dc9b6-189a-11e7-bb9f-22000b9a448b'
        #self.cadesdtn = 'e6bcd4fa-ac1b-11e6-9aee-22000a1e3b52'
        self.cadesdtn = '586dc9b6-189a-11e7-bb9f-22000b9a448b'

        try:
            # if we already have tokens, load and use them
+19 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ import paramiko
import getpass
from scp import SCPClient
import time
from crossbowGlobus import crossbowGlobus

class crossbowOlcf(object):

@@ -29,10 +30,27 @@ class crossbowOlcf(object):
        time.sleep(1)
        ssh_stdin, ssh_stdout, ssh_stderr = \
                self.ssh.exec_command("qsub %s" % (olcf_path+pbs_script))
        ssh_stdout.readlines()
        print ssh_stdout.readlines()
        
    def scp(self):
        pass
        
    def get_globus_tokens(self,olcf_path='./'):

        #clone crossbow repo        
        ssh_stdin, ssh_stdout, ssh_stderr = \
            self.ssh.exec_command("cd %s; if [ ! -d crossbow ]; \
                                   then git clone https://code.ornl.gov/v33/crossbow.git; cd crossbow;\
                                   else cd crossbow/; git pull; fi" % olcf_path)
        print ssh_stdout.readlines()
        
        time.sleep(5)
        
        #get tokens
        ssh_stdin, ssh_stdout, ssh_stderr = \
            self.ssh.exec_command("cd crossbow; python test.py")
        print ssh_stdout.readlines()
        
if __name__ == "__main__":
    olcf = crossbowOlcf('rhea')
    olcf.get_globus_tokens()

crossbow/test.py

0 → 100644
+1 −0
Original line number Diff line number Diff line
print "hello world"