github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/environs/manual/winrmprovisioner/fakewinrm_test.go (about) 1 // Copyright 2016 Canonical Ltd. 2 // Copyright 2016 Cloudbase Solutions SRL 3 // Licensed under the AGPLv3, see LICENCE file for details. 4 5 package winrmprovisioner_test 6 7 import "io" 8 9 const ( 10 winrmListenerAddr = "127.0.0.1" 11 ) 12 13 type fakeWinRM struct { 14 password string 15 fakePing func() error 16 fakeRun func(cmd string, stdout, stderr io.Writer) error 17 secure bool 18 } 19 20 func (f *fakeWinRM) Ping() error { 21 return f.fakePing() 22 } 23 24 func (f *fakeWinRM) Run(cmd string, stdout io.Writer, stderr io.Writer) error { 25 return f.fakeRun(cmd, stdout, stderr) 26 } 27 28 func (f fakeWinRM) Password() string { 29 return f.password 30 } 31 32 func (f fakeWinRM) Secure() bool { 33 return f.secure 34 }