def setup_vm(): global vm_proc, termserv_proc info('Starting up VM') sh('bhyveload -m ${RAM_SIZE} -d ${OBJDIR}/test-root.ufs ${VM_NAME}') vm_proc = sh_spawn( 'bhyve -m ${RAM_SIZE} -A -H -P', '-s 0:0,hostbridge', '-s 1:0,virtio-net,${tapdev}', '-s 2:0,ahci-hd,${OBJDIR}/test-root.ufs', '-s 3:0,ahci-hd,${OBJDIR}/test-swap.bin', '-s 31,lpc -l com1,${CONSOLE_MASTER}', '${VM_NAME}' ) pid = vm_proc.pid logfile = objdir(e('logs/bhyve.${pid}.log')) info('Starting telnet server on port {0}', e('${TELNET_PORT}')) info('Console log file is {0}', logfile) termserv_proc = sh_spawn( 'python', '${BUILD_TOOLS}/terminal-server.py', '-l ${logfile}', '-c ${CONSOLE_SLAVE}', '-p ${TELNET_PORT}' ) on_abort(shutdown_vm)
def do_run(): info('Starting up VM for testing') vm_proc = sh_spawn( 'bhyve -m ${MEMSIZE} -c ${CORES} -A -H -P', '-s 3:0,ahci-hd,${destdir}/boot.img', '-s 4:0,ahci-hd,${destdir}/hd1.img', '-s 5:0,ahci-hd,${destdir}/hd2.img', '-s 6:0,virtio-net,${tapdev}', '-s 7:0,fbuf,tcp=5900,w=1024,h=768', '-s 31,lpc', '-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd', '${VM_NAME}') ready.wait() time.sleep(60) info('VM middleware is ready') proc = subprocess.Popen([ e('${venvdir}/bin/python'), e('${BUILD_ROOT}/tests/freenas/main.py'), '-a', e('${FREENAS_IP}'), '-u', 'root', '-p', 'abcd1234' ]) proc.wait() vm_proc.terminate() vm_proc.wait()
def run(): global poudriere_proc poudriere_proc = sh_spawn('poudriere -e ${POUDRIERE_ROOT}/etc bulk -w -J', str(makejobs), '-f', portslist, '-j ${jailname} -p p', detach=True) poudriere_proc.wait()
def setup_vm(): global vm_proc, termserv_proc info('Starting up VM') sh('bhyveload -m ${RAM_SIZE} -d ${OBJDIR}/test-root.ufs ${VM_NAME}') vm_proc = sh_spawn('bhyve -m ${RAM_SIZE} -A -H -P', '-s 0:0,hostbridge', '-s 1:0,virtio-net,${tapdev}', '-s 2:0,ahci-hd,${OBJDIR}/test-root.ufs', '-s 3:0,ahci-hd,${OBJDIR}/test-swap.bin', '-s 31,lpc -l com1,${CONSOLE_MASTER}', '${VM_NAME}') pid = vm_proc.pid logfile = objdir(e('logs/bhyve.${pid}.log')) info('Starting telnet server on port {0}', e('${TELNET_PORT}')) info('Console log file is {0}', logfile) termserv_proc = sh_spawn('python', '${BUILD_TOOLS}/terminal-server.py', '-l ${logfile}', '-c ${CONSOLE_SLAVE}', '-p ${TELNET_PORT}') on_abort(shutdown_vm)
def run(): global poudriere_proc poudriere_proc = sh_spawn('poudriere -e ${POUDRIERE_ROOT}/etc bulk -w -J', str(makejobs), '-f', portslist, '-j ${jailname} -p p', detach=True) poudriere_proc.wait() if poudriere_proc.returncode != 0: error('Ports build failed')
def do_install(): info('Starting up VM for unattended install') vm_proc = sh_spawn( 'bhyve -m ${MEMSIZE} -c ${CORES} -A -H -P', '-s 3:0,ahci-hd,${destdir}/boot.img', '-s 4:0,ahci-hd,${destdir}/hd1.img', '-s 5:0,ahci-hd,${destdir}/hd2.img', '-s 6:0,ahci-cd,${isopath}', '-s 7:0,virtio-net,${tapdev}', '-s 8:0,fbuf,tcp=5900,w=1024,h=768', '-s 31,lpc', '-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd', '${VM_NAME}') try: vm_proc.wait(timeout=3600) except subprocess.TimeoutExpired: fail('Install timed out after 1 hour')