/usr/share/gocode/src/github.com/masterzen/winrm/ntlm_test.go is in golang-github-masterzen-winrm-dev 0.0~git20170601.0.1ca0ba6-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | package winrm
import (
"net/http"
. "gopkg.in/check.v1"
)
func (s *WinRMSuite) TestHttpNTLMRequest(c *C) {
ts, host, port, err := StartTestServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/soap+xml")
w.Write([]byte(response))
}))
c.Assert(err, IsNil)
defer ts.Close()
endpoint := NewEndpoint(host, port, false, false, nil, nil, nil, 0)
params := DefaultParameters
params.TransportDecorator = func() Transporter { return &ClientNTLM{} }
client, err := NewClientWithParameters(endpoint, "test", "test", params)
c.Assert(err, IsNil)
shell, err := client.CreateShell()
c.Assert(err, IsNil)
c.Assert(shell.id, Equals, "67A74734-DD32-4F10-89DE-49A060483810")
}
|