~rogpeppe/juju-core/438-local-instance-Addresses

« back to all changes in this revision

Viewing changes to provider/null/environ_test.go

[r=axwalk],[bug=1234125] provider/null: fix intermittent test failure

Also, in environs/sshstorage (related to test failure):
capture command output in case of outer ssh/bash command
failure.

Fixes #1234125

https://codereview.appspot.com/14315044/

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
}
101
101
 
102
102
func (s *environSuite) TestEnvironBootstrapStorager(c *gc.C) {
103
 
        const sshScript = "#!/bin/sh\necho JUJU-RC: $RC"
 
103
        var sshScript = `
 
104
#!/bin/bash
 
105
if [ "$*" = "hostname -- bash" ]; then
 
106
    # We're executing bash inside ssh. Wait
 
107
    # for input to be written before exiting.
 
108
    head -n 1 > /dev/null
 
109
fi
 
110
exec 0<&- # close stdin
 
111
echo JUJU-RC: $RC
 
112
`[1:]
104
113
        bin := c.MkDir()
105
114
        ssh := filepath.Join(bin, "ssh")
106
115
        err := ioutil.WriteFile(ssh, []byte(sshScript), 0755)