veyron/shell/lib/shell_test.sh: mechanism to enable running shell tests under security agent
veyron/services/mgmt/binary/binaryd/test.sh: exemplify the mechanism on the binary service shell test.
To avoid boilerplate in every test that needs credentials managed by the
security agent, we introduce the enable_agent function, which under the covers
(when called in the parent invocation of the script) runs the script itself
under the agent; and (when called in the child invocation) sets up the vrun
command and lets the rest of the script run.
The only thing a test.sh needs to do is embed this line after sourcing
shell_test.sh:
enable_agent "$@"
This should make it easy to transition existing test.sh scripts to using agent.
Change-Id: Ia0ee11fd8023cb0f8864231cf87c1e380d756302
1 file changed