Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve automated testing #24

Closed
pnasrat opened this issue May 18, 2016 · 8 comments
Closed

Improve automated testing #24

pnasrat opened this issue May 18, 2016 · 8 comments

Comments

@pnasrat
Copy link
Contributor

pnasrat commented May 18, 2016

Currently by the looks of it circle just checks the source can compile and build. To support contributor development of greater OS coverage issue #19 it would be nice if there was a simple test cycle that could be run per OS

I'd imagine a shell based test driver that boots the OS - records console output and does some validation would be a simple first step.

I don't want to implement without discussion so please give me feedback if this sounds of use.

@avsm
Copy link
Collaborator

avsm commented May 18, 2016

Most definitely useful! We do need to verify if the CI provider exposes the Hypervisor framework into their VMs though -- experiments on CircleCI have given us both answers. We could also set up a bare metal Mac and host it somewhere, which would give us better control over the base OS as well.

@pnasrat
Copy link
Contributor Author

pnasrat commented May 19, 2016

We can definitely separate the goals - first having repeatable tests manually run (also good!) from CI.

@ijc
Copy link
Collaborator

ijc commented May 23, 2016

I think the issues with CI not exposing support for the Hypervisor framework are largely historical, it's been a long time since we've seen an issue like that in the CI testing of Docker for Mac for example. I suppose they've e.g. updated the software on their whole fleet since we last saw it.

Some sort of simple "1) boot 2) check it looks ok 3) shutdown" test in CI would be really nice for sure. As I hinted in #23 my preference would be for an Alpine based thing, but really at this point anything would be better than nothing (and in any case I'd expect the scripting for "2)" to be where most of the complexity would be).

@pnasrat
Copy link
Contributor Author

pnasrat commented May 23, 2016

Do you have any preferences on approach - eg on adding dependencies to make the testing work (eg bash + expect) or writing a custom test "driver" in C or ocaml.

@ijc
Copy link
Collaborator

ijc commented May 24, 2016

Looks like expect is part of osx (i.e. it's in /usr/bin/expect already on my mac mini) so that seems fine to use (and if it weren't already there I'd see no problem with getting it from brew). ocaml would be fine too.

I'd probably avoid C though for this particular sort of job.

@pnasrat
Copy link
Contributor Author

pnasrat commented Jun 6, 2016

So it looks as if tinycorelinux.net is down today - I started to look at moving to alpine which just seems to distribute a cdrom. I'm asking about on IRC around netboot images.

pnasrat added a commit to pnasrat/hyperkit that referenced this issue Jun 6, 2016
Work towards automated testing moby#24.

Download tinycorelinux from a mirror and patch.

Update hyperkitrun.sh to call script and also explicitly call make if
needed.

Tested commands by using hyperkitrun.sh

Signed-off-by: Pris Nasrat <[email protected]>
@pnasrat
Copy link
Contributor Author

pnasrat commented Jun 6, 2016

Note to self brittle initial test could be

#!/usr/bin/env expect

spawn "./hyperkitrun.sh"
expect "tc@box:~$"
send "sudo halt\r\n";
expect "reboot: System halted"
close

@ijc
Copy link
Collaborator

ijc commented Jun 7, 2016

It's a shame isoinfo isn't available on OSX (even via brew) otherwise getting the kernel+initrd out of the ISO would be fairly easy.

FWIW the proposed expect script looks ok to me.

pnasrat added a commit to pnasrat/hyperkit that referenced this issue Jun 8, 2016
Fixes moby#24

Adds dependency on expect, wired in through Makefile.

The expect script replicates the command from hyperkitrun.sh to prevent
requiring a prompt whilst in expect. The dependecy chain is handled in
the Makefile.

Tested both success and failure using make test - adjusting the timeout
to 1 will give an example fail that propgates up to the make return.

Signed-off-by: Pris Nasrat <[email protected]>
pnasrat added a commit to pnasrat/hyperkit that referenced this issue Jun 9, 2016
Fixes moby#24

Adds dependency on expect, wired in through Makefile.

The expect script replicates the command from hyperkitrun.sh to prevent
requiring a prompt whilst in expect. The dependency chain is handled in
the Makefile.

Tested both success and failure using make test - adjusting the timeout
to 1 will give an example fail that propgates up to the make return.

Signed-off-by: Pris Nasrat <[email protected]>
@ijc ijc closed this as completed in #36 Jun 14, 2016
mat007 pushed a commit to mat007/hyperkit that referenced this issue May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants