def VM_SSH(name): """open a shell to a virtual machine Open an SSH session to a running virtual machine. """ vm = VM.find(name) if not vm.running(): raise fail("VM is not running: {}", vm.name) vm.forward(22) host = "linux-vm" if vm.system == 'windows': host = "windows-vm" with env(debug=True): exe("ssh -F %s %s" % (CTL_DIR + "/ssh_config", host))
def CLIENT(engine, name=None): """start a native database client Run `cogs client <engine> [<name>]` to start a native database client on a regression database. If the database name is not specified, the client is started with administrative rights against the default database. To get a list of supported engines and databases, run: `cogs help createdb` """ command = make_client(engine, name) with env(debug=True): exe(command)
def exe_regress(command): # Run `pbbt test/regress.yaml <command>`. variables = make_variables() with env(debug=True): exe(env.pbbt_path + " test/regress.yaml -E test/regress.py " + variables + command)
def exe_htsql_ctl(command, environ=None): # Execute `htsql-ctl <command>`. with env(debug=True): exe(env.ctl_path + " " + command, environ=environ)
def LINT(): """detect errors in the source code with PyFlakes""" with env(debug=True): exe("pyflakes src/cogs")
def PURGE_TEST(): """purge stale output records from regression tests""" with env(debug=True): exe("pbbt test/input.yaml test/output.yaml -q --train --purge")
def TRAIN(): """run regression tests in the train mode""" with env(debug=True): exe("pbbt test/input.yaml test/output.yaml --train")
def TEST(): """run regression tests""" with env(debug=True): exe("pbbt test/input.yaml test/output.yaml -q")