Disable network and close conn on embedtest

This commit is contained in:
Chad Retz 2018-09-21 12:11:37 -05:00
parent 8ba66edb0c
commit 781510e18d
1 changed files with 2 additions and 1 deletions

View File

@ -37,7 +37,7 @@ func runTor(args ...string) error {
}
func testEmbedConn() error {
process, err := tor035.NewCreator().New(context.Background())
process, err := tor035.NewCreator().New(context.Background(), "--DisableNetwork", "1")
if err != nil {
return fmt.Errorf("Failed creating process: %v", err)
}
@ -51,6 +51,7 @@ func testEmbedConn() error {
}
controlConn := control.NewConn(textproto.NewConn(embedConn))
info, err := controlConn.GetInfo("version")
controlConn.Close()
if err != nil {
return fmt.Errorf("Failed getting version: %v", err)
}