-
Notifications
You must be signed in to change notification settings - Fork 43
cli: add a new option -cmd option for executing given command to proc… #151
Conversation
PTAL @AkihiroSuda |
@mitake Thank you a lot and LGTM. How about making the cmd to a non-option argument? e.g.
|
log.Critical("failed to StartProcess: %s", err) | ||
return 1 | ||
} | ||
procState, err := proc.Wait() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait()
blocks until the process exits. https://golang.org/pkg/os/#Process.Wait
So you don't need this Wait()
@AkihiroSuda thanks for your comment. I updated this PR, PTAL. The updated version has a mechanism for detecting end of target process. |
return 1 | ||
} | ||
|
||
pid = cmd.Process.Pid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pid
seems never used because it is overwritten in L96
@AkihiroSuda updated for the latest comments, thanks for pointing. PTAL. |
@mitake LGTM, thanks! |
but CI is failing.. https://travis-ci.org/osrg/namazu/builds/133052785
|
…ess inspector This commit adds a new option -cmd to process inspector. With this option, we don't need to start execution of target before inspection. Below is an example: $ sudo nmz inspectors proc -watch-interval 100ms -autopilot\ dirichlet.toml -cmd "./integration.test -test.v -test.run TestIssue2746\$ -test.count 1000"
updated for the CI problem |
merging, thank you a lot! |
…ess inspector
This commit adds a new option -cmd to process inspector. With this
option, we don't need to start execution of target before
inspection. Below is an example:
$ sudo nmz inspectors proc -watch-interval 100ms -autopilot
dirichlet.toml -cmd "./integration.test -test.v -test.run TestIssue2746$ -test.count 1000"