示例#1
0
def index():
    if request.method == 'POST':
        name = request.form['name']
        new_user = User(name=name, public_key=create_key(),
                        private_key=create_key(), balance=100)
        db.session.add(new_user)
        db.session.commit()
        return redirect('/')
    else:
        return render_template('index.html')
示例#2
0
def create_user():
    if request.method == 'POST':
        name = request.form['name']
        new_user = User(name=name, public_key=create_key(),
                        private_key=create_key(), balance=100)
        db.session.add(new_user)
        db.session.commit()
        return redirect('/create/')
    else:
        all_users = User.query.order_by(User.id).all()
        return render_template('create.html', users=all_users)
示例#3
0
update = {update}
dev_test = {dev_test}
"""

cfg_file = open("auto_config.py", 'w')
cfg_file.writelines(cfg_content)
cfg_file.close()

from functions import setup_ssh_agent, create_key, add_ssh_key, get_file
from functions import SSH_TEST
# Setup ssh agent before starting test.
setup_ssh_agent()
if os.path.isdir(dotsshPath) is False:
    os.makedirs(dotsshPath)
if os.path.exists(keyPath) is False:
    create_key(keyPath)
add_ssh_key(keyPath)

f = open(keyPath + '.pub', 'r')
Key = f.readlines()[0].rstrip()

cfg_file = open("auto_config.py", 'a')
cfg_file.writelines(f'sshKey = "{Key}"\n')
cfg_file.close()

call([
    f"pytest-{version}", "-v", "-o", "junit_family=xunit2", "--junitxml",
    'results/api_v2_tests_result.xml', f"api2/{testName}"
])

# get useful logs
示例#4
0
keyPath = "%s"
results_xml = "%s"
""" % (passwd, ip, api, interface, localHome, disk, keyPath, results_xml)

cfg_file = open("auto_config.py", 'w')
cfg_file.writelines(cfg_content)
cfg_file.close()

from functions import setup_ssh_agent, create_key, add_ssh_key

# Setup ssh agent befor starting test.
setup_ssh_agent()
if path.isdir(dotsshPath) is False:
    makedirs(dotsshPath)
if path.exists(keyPath) is False:
    create_key(keyPath)
add_ssh_key(keyPath)

f = open(keyPath + '.pub', 'r')
Key = f.readlines()[0].rstrip()

cfg_file = open("auto_config.py", 'a')
cfg_file.writelines('sshKey = "%s"\n' % Key)
cfg_file.close()


def get_tests():
    rv = []
    skip_tests = []

    if api == '1.0':