def setUp(self): # setup logger self.LOG = Log.Logger("tsi.testing") self.config = {'tsi.testing': True, 'tsi.switch_uid': False} TSI.setup_defaults(self.config) self.bss = BSS.BSS() self.bss.init(self.config, self.LOG)
def setUp(self): self.LOG = Log.Logger("tsi.testing") self.config = { 'tsi.my_addr': 'localhost', 'tsi.my_port': 14433, 'tsi.njs_machine': 'localhost', 'tsi.njs_port': None }
def setUp(self): self.LOG = Log.Logger("tsi.testing") self.bss = lsf.BSS.BSS() self.config = {'tsi.testing': True, # mock submit cmd 'tsi.submit_cmd': "echo 1234.server" } TSI.setup_defaults(self.config) self.bss.init(self.config, self.LOG)
def setUp(self): self.LOG = Log.Logger("tsi.testing") self.bss = slurm.BSS.BSS() self.config = { 'tsi.testing': True, # mock submit/alloc cmds 'tsi.submit_cmd': "echo 'Submitted batch job 1234'", 'tsi.alloc_cmd': "echo 'salloc: Granted job allocation 115463'" } TSI.setup_defaults(self.config) self.bss.init(self.config, self.LOG)
def setUp(self): self.LOG = Log.Logger("tsi.testing") self.config = {} self.config = {'tsi.testing': True} self.config['tsi.switch_uid'] = False self.config['tsi.acl'] = {} self.config['tsi.getfacl'] = "getfacl" self.config['tsi.setfacl'] = "setfacl" try: os.mkdir("/tmp/test_TSI_ACL") except: pass
def setUp(self): self.LOG = Log.Logger("tsi.testing") self.config = {} self.config['tsi.my_addr'] = 'localhost' self.config['tsi.my_port'] = 14433 self.config['tsi.njs_machine'] = 'localhost' self.config['tsi.njs_port'] = 24433 self.config['tsi.keystore'] = 'tests/certs/tsi-key-plain.pem' self.config['tsi.keypass'] = '******' self.config['tsi.certificate'] = 'tests/certs/tsi-cert.pem' self.config['tsi.truststore'] = 'tests/certs/tsi-truststore.pem' self.config['tsi.allowed_dns'] = [ SSL.convert_dn('CN=TSI,O=UNICORE,C=EU') ]
def setUp(self): # setup logger self.LOG = Log.Logger("tsi.testing") self.config = {} self.config['tsi.my_addr'] = 'localhost' self.config['tsi.my_port'] = 14433 self.config['tsi.njs_machine'] = 'localhost' self.config['tsi.njs_port'] = 24433 self.config['tsi.keystore'] = 'tests/certs/tsi-key-plain.pem' self.config['tsi.keypass'] = '******' self.config['tsi.certificate'] = 'tests/certs/tsi-cert.pem' self.config['tsi.truststore'] = 'tests/certs/tsi-truststore.pem' self.config['tsi.allowed_dn.1'] = 'CN=Foo,C=DE' self.config['tsi.allowed_dn.2'] = 'CN=Bar,C=EU'
def test_RunMain(self): config = "tests/conf/tsi.properties" pid = os.fork() if pid == 0: # child, this is the TSI shepherd process TSI.main(["TSI", config]) else: # parent, this is the fake XNJS LOG = Log.Logger("fake-xnjs") time.sleep(2) client_config = TSI.read_config_file(config, LOG) # connect to the server host = client_config['tsi.my_addr'] port = int(client_config['tsi.my_port']) tsi = socket.create_connection((host, port)) LOG.info("CLIENT: Connected to %s:%s" % (host, port)) host = client_config['tsi.njs_machine'] port = int(client_config['tsi.njs_port']) tsi.sendall(b'newtsiprocess 24433') LOG.info("CLIENT: waiting for callback on %s:%s" % (host, port)) server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server.bind((host, port)) server.listen(2) (command, (_, _)) = server.accept() (data, (_, _)) = server.accept() test_msg = b'#TSI_PING\nENDOFMESSAGE\n' LOG.info("CLIENT: connected, sending test message: %s" % test_msg) command.sendall(test_msg) reply = command.recv(1024) print(reply) # send shutdown and cleanup LOG.info("CLIENT: shutdown") tsi.sendall(b'shutdown') command.close() data.close() tsi.close() server.close() os.kill(pid, signal.SIGKILL)
def setUp(self): self.LOG = Log.Logger("tsi.testing")
def setUp(self): self.LOG = Log.Logger("tsi.testing", verbose=True, use_syslog=False)
def setUp(self): self.LOG = Log.Logger("tsi.testing", use_syslog=False) self.file_name = "tests/conf/tsi.properties"
def setUp(self): self.LOG = Log.Logger("tsi.testing") self.file_name = "tests/conf/tsi.properties"
def setUp(self): self.LOG = Log.Logger("tsi.testing", use_syslog=False) self.config = {'tsi.testing': True, "tsi.switch_uid": False} TSI.setup_defaults(self.config) BecomeUser.initialize(self.config, self.LOG)