From owner-freebsd-testing@freebsd.org Mon Mar 12 15:43:53 2018 Return-Path: Delivered-To: freebsd-testing@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F39DF50184 for ; Mon, 12 Mar 2018 15:43:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F301681BF2 for ; Mon, 12 Mar 2018 15:43:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x234.google.com with SMTP id e64-v6so12015186ita.5 for ; Mon, 12 Mar 2018 08:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=emcJtpFu2IR/apdiZDRGI+zgKOJIpyFnvnLEh/svCi4=; b=QjIrmAATlUzKdbZxfRwTesLnbJkqDy3rq+1NL3S01a6DdP8pro5KUGAURRcqiJp8Qt PwMlkZS1+9nO+VBqgCfCtAm2J0dMCWd5QbVL0j+Tedoj8PnnHNZfDDdAXsjpeKN7r16i TqE9TnSbIpO/IDtp3uZG0JkcD/2PVkXGxlLWpb5AZvfGPfZRXobTH6v6MhEoWMFoXdeD /pPLNszOOrzFX4RhtwOC2neVIjD6/nAq39VBXmPeYs6kA5ydNRR4uhKVorrbNsOaC0NV NwKPi62Sprl2KoGa+e6AygFFh3XzXVaJl3hmpmXXLRimXC72koTXGGHaj4r09P5JWQdt +JYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:subject:message-id :mime-version:content-disposition:user-agent; bh=emcJtpFu2IR/apdiZDRGI+zgKOJIpyFnvnLEh/svCi4=; b=iCwqHJFDdf7OSQq87lJVtNT5rySpJFM7ErP9wmkUeyyPOkxHq/bGPI1G9l5U/2x+hY mlzIcvoMQR/HjRpVR+8WZuoxIlS38QBsne6rfRVfNK56t1Dqlid2aTJTkfjk/20hkzH5 8lYcoxpHPhnfU0v8md2jvcMRgQY6iAoFEX4Dq7/JYwTBc7f/HTB4JT3szpl5DMXht0nW 8O8TEU5bz9BOGPYkAtCB/L/2HxHOSlsdnUDZn3bDMv5IFuofvcawCEa/y0dKTDJMxiNG OH1DjU08wH+oZXzEmw/irn10nmseEVGru4/0kEBooKoSzdUoQLBLfo0wy5fUhB3MMfJR 2B/w== X-Gm-Message-State: AElRT7GG/rXe6hh6R2XN7ag90qeJHhP7wx+gXEiDExI/ZL4q6LD6RTn6 HRCVQpB7oGwEkPn199iBoM3ywA== X-Google-Smtp-Source: AG47ELsXBTDM1ctFdYgRgh+mnOO7y2Qm8Y6yI9dY1uSmpsuy1u9EMpDpjQVIZtFG8QRFigCFSUsGNQ== X-Received: by 10.36.84.79 with SMTP id t76mr9014751ita.47.1520869431888; Mon, 12 Mar 2018 08:43:51 -0700 (PDT) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id k6sm5104170ioc.75.2018.03.12.08.43.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Mar 2018 08:43:50 -0700 (PDT) Sender: Mark Johnston Date: Mon, 12 Mar 2018 11:43:46 -0400 From: Mark Johnston To: freebsd-testing@FreeBSD.org Subject: automatically provisioning a bhyve test VM Message-ID: <20180312154346.GA97195@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: freebsd-testing@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Testing on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Mar 2018 15:43:53 -0000 Hi, I have some tests for FreeBSD's kernel dump code that I'd like to make more robust. They use bhyve to test a variety of combinations of kernel dump configurations: e.g., full dump vs. minidump, encryption, compression, dump device block size, etc.. Each test triggers a kernel panic and dump, and upon reboot opens the dump in kgdb, in the VM, to get some confidence that the dump is valid. I use sysutils/vm-bhyve to simplify some aspects of VM management, and that works pretty well. I use some hacks to configure networking for the VM, and this is the part that I don't like. The tests run on the host and use ssh to run commands in the VM. For this to work, I need to hardcode an IP for the guest and for the bridge to which the guest's tap interface is connected, which of course only works if those IPs aren't already somehow in use by the host. I'd prefer something that makes zero assumptions about the host and just provides the bare minimum needed to establish a private communication channel to run commands on the guest (which includes getting the output and exit status of said commands). Ideally this would still involve assigning private IPv4 addresses to each side since I'd like to expand my test suite to cover netdump, which makes it possible for a panicking kernel to transmit a dump to a remote host. Does anyone have any suggestions for a more elegant way to go about this? Does anyone else automatically provision and tear down bhyve VMs as part of a test suite?