forked from irods/python-irodsclient
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more steps toward running run python suite
- Loading branch information
Showing
10 changed files
with
126 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env python | ||
|
||
from getpass import getpass | ||
from irods.password_obfuscation import encode | ||
import json | ||
import os | ||
import sys | ||
from os import chmod | ||
from os.path import expanduser,exists,join | ||
from getopt import getopt | ||
|
||
|
||
home_env_path = expanduser('~/.irods') | ||
env_file_path = join(home_env_path,'irods_environment.json') | ||
auth_file_path = join(home_env_path,'.irodsA') | ||
|
||
|
||
def do_iinit(host, port, user, zone, password): | ||
if not exists(home_env_path): | ||
os.makedirs(home_env_path) | ||
else: | ||
raise RuntimeError('~/.irods already exists') | ||
|
||
with open(env_file_path,'w') as env_file: | ||
json.dump ( { "irods_host": host, | ||
"irods_port": int(port), | ||
"irods_user_name": user, | ||
"irods_zone_name": zone }, env_file, indent=4) | ||
with open(auth_file_path,'w') as auth_file: | ||
auth_file.write(encode(password)) | ||
chmod (auth_file_path,0o600) | ||
|
||
|
||
def get_kv_pairs_from_cmdline(*args): | ||
arglist = list(args) | ||
while arglist: | ||
k = arglist.pop(0) | ||
v = arglist.pop(0) | ||
yield k,v | ||
|
||
|
||
if __name__ == '__main__': | ||
import sys | ||
args = sys.argv[1:] | ||
dct = {k:v for k,v in get_kv_pairs_from_cmdline(*args)} | ||
do_iinit(**dct) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/gawk -f | ||
BEGIN { | ||
SERVER = "/inet/tcp/"ENVIRON["PORT"]"/0/0" | ||
print ARGV[1] " - " strftime() |& SERVER | ||
close(SERVER) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function | ||
import sys, os, time | ||
from socket import * | ||
import getopt | ||
|
||
def try_connect(host,port): | ||
try: | ||
s=socket(AF_INET,SOCK_STREAM) | ||
s.connect((host,port)) | ||
return s | ||
except: | ||
s.close() | ||
return None | ||
|
||
# Options: | ||
# | ||
# -t timeout | ||
# -h host | ||
# -p port | ||
|
||
t = now = time.time() | ||
opts = dict(getopt.getopt(sys.argv[1:],'t:h:p:')[0]) | ||
|
||
host = opts['-h'] | ||
port = int(opts['-p']) | ||
timeout = float(opts['-t']) | ||
|
||
while time.time() < now + timeout: | ||
time.sleep(1) | ||
s = try_connect(host, port) | ||
if s: | ||
print(s.recv(32767).decode('utf-8'),end='') | ||
exit(0) | ||
exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
DIR=$(dirname "$0") | ||
cd "$DIR" | ||
./recv_oneshot -h irods-provider -p 8888 -t 360 | ||
REPO="$(realpath ./repo)" | ||
python -m pip install "$REPO[tests]" | ||
./iinit.py host irods-provider port 1247 user rods password rods zone tempZone | ||
python $REPO/irods/test/runner.py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
DIR=$(dirname "$0") | ||
cd "${DIR}" | ||
echo "python_version=${1}" >.env | ||
echo "repo_external=$(realpath "${DIR}/repo")" >>.env | ||
docker-compose -f harness-docker-compose.yml up -d |