function startVm() {
    return new Promise((resolve, reject) => {
        let proc = child_process.spawn("bots/machine/testvm.py", [testOS], { stdio: ["pipe", "pipe", "inherit"] });
        let buf = "";
        proc.stdout.on("data", data => {
            buf += data.toString();
            if (buf.indexOf("\nRUNNING\n") > 0) {
                let lines = buf.split("\n");
                resolve({ proc: proc, ssh: lines[0], cockpit: lines[1] });
            }
        });
        proc.on("error", err => { throw `Failed to start vm-run: ${err}` });
    });
}
// start virtual machine and return VM object; call vm.proc.kill() to stop it again
start virtual machine and return VM object; call vm.proc.kill() to stop it again
start virtual machine and return VM object ; call vm . proc . kill () to stop it again
function startVm() {
    return new Promise((resolve, reject) => {
        let proc = child_process.spawn("bots/machine/testvm.py", [testOS], { stdio: ["pipe", "pipe", "inherit"] });
        let buf = "";
        proc.stdout.on("data", data => {
            buf += data.toString();
            if (buf.indexOf("\nRUNNING\n") > 0) {
                let lines = buf.split("\n");
                resolve({ proc: proc, ssh: lines[0], cockpit: lines[1] });
            }
        });
        proc.on("error", err => { throw `Failed to start vm-run: ${err}` });
    });
}
function startVm ( ) { return new Promise ( ( resolve , reject ) => { let proc = child_process . spawn ( "bots/machine/testvm.py" , [ testOS ] , { stdio : [ "pipe" , "pipe" , "inherit" ] } ) ; let buf = "" ; proc . stdout . on ( "data" , data => { buf += data . toString ( ) ; if ( buf . indexOf ( "\nRUNNING\n" ) > 0 ) { let lines = buf . split ( "\n" ) ; resolve ( { proc : proc , ssh : lines [ 0 ] , cockpit : lines [ 1 ] } ) ; } } ) ; proc . on ( "error" , err => { throw ` ${ err } ` } ) ; } ) ; }
start virtual machine and return VM object; call vm.proc.kill() to stop it again
start virtual machine and return VM object ; call vm . proc . kill () to stop it again