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

Add the dut command from linuxboot #125

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

rminnich
Copy link
Member

@rminnich rminnich commented Aug 2, 2022

It is much easier to bring dut into cpu than have 2 repos.
Further, dut is not a combined cpu and cpud; it is useful
to have this illustrative use of the cpu package.

Signed-off-by: Ronald G. Minnich [email protected]

It is much easier to bring dut into cpu than have 2 repos.
Further, dut is not a combined cpu and cpud; it is useful
to have this illustrative use of the cpu package.

Also, dut is changed so that it will be able to work with
different kinds of networks, although vsock support
will likely require special handling.

Signed-off-by: Ronald G. Minnich <[email protected]>
- only call reboot if uinit returned with an error
- convert all host + port (2 strings) uses to standard go addr:port usage
- add dut to the TESTCPU command to ease testing
- when starting cpu, do not block on it

These changes support a usage model where dut starts on the device,
and the test manager has it start up a cpu service. At that point,
dut is no longer needed and can exit. The reboot-on-exit model no
longer makes sense.

Signed-off-by: Ronald G. Minnich <[email protected]>
Copy link
Collaborator

@brho brho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i haven't looked at the actual code yet - comments just on the Doc and method of operation stuff.

// modes
// dut currently supports 3 modes.
//
// The first, default, mode, is "device". In device mode, dut makes an http connection
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this "In device mode, DUT makes" vs dut makes? or dut on DUT makes?

also, should the DUT start the RPC server before calling back to the host? if you do it as written, there's a window of time where the host dut could call back to the DUT, but the service isn't ready yet. if you time it poorly, you'll get stuck in tcp limbo or something.

//
// The third mode is "cpu". dut will direct the DUT to start a cpu service, and block until
// it exits. Flags for this service:
// pubkey: name of the public key file
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a nice Go way to use the same parameters as the cpud command? e.g. right now cpud has pubkey == -pk. and of course -net for vsock.

not sure if we can have a package struct that is the expected configuration, etc, so that we don't have two copies of all the args and parsing that cpud expects. as an added bonus, we wouldn't have different names for the same arg either.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have common flags in the client/ package? probably.

// by the Reboot service. Tester can be useful, run by a shell script in a for loop, for
// ensure reboot is reliable.
//
// The third mode is "cpu". dut will direct the DUT to start a cpu service, and block until
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regarding "block until" - i might want the host dut command to return once the cpud service is running. i.e. "the CPU RPC is complete when i know the server is running", and not "when the server has exited".

this will help me with vmapp, where i can block until i know cpud is fully listening.

@@ -0,0 +1,66 @@
// dut manages Devices Under Test (a.k.a. DUT) from a host.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a copy of the cmds/dut/doc.go. from glancing at the Changed Files, it looks like dut/ and cmds/dut/ are the same. not sure which one you want to keep.

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

Successfully merging this pull request may close these issues.

2 participants