Skip to content

Instantly share code, notes, and snippets.

@hugelgupf
Created October 1, 2019 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugelgupf/a1c08699ea2dc8f5c20ee485a0c75da5 to your computer and use it in GitHub Desktop.
Save hugelgupf/a1c08699ea2dc8f5c20ee485a0c75da5 to your computer and use it in GitHub Desktop.
q, cleanup := vmtest.QEMUTest(t, &vmtest.Options{
BuildOpts: uroot.Opts{
Commands: uroot.BusyBoxCmds(
"github.com/u-root/u-root/cmds/core/init",
"github.com/u-root/u-root/cmds/core/kexec",
),
ExtraFiles: []string{
"/tmp/multibootKernel:kernel",
},
},
Uinit: []string{
`kexec -l kernel -e -d --module="/kernel foo=bar" --module="/bbin/bb"`,
},
QEMUOpts: qemu.Options{
SerialOutput: &serial,
},
})
defer cleanup()
if err := q.Expect(`"status": "ok"`); err != nil {
t.Logf(string(serial.Bytes()))
t.Fatalf(`expected '"status": "ok"', got error: %v`, err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment