Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Side by Side Diff: worker/uniter/uniter_test.go

Issue 57590043: Fix the proxy env vars in the uniter.
Patch Set: Created 11 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « provider/local/environprovider_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package uniter_test 4 package uniter_test
5 5
6 import ( 6 import (
7 "bytes" 7 "bytes"
8 "crypto/sha256" 8 "crypto/sha256"
9 "encoding/hex" 9 "encoding/hex"
10 "fmt" 10 "fmt"
(...skipping 1957 matching lines...) Expand 10 before | Expand all | Expand 10 after
1968 "ftp-proxy": s.Ftp, 1968 "ftp-proxy": s.Ftp,
1969 }) 1969 })
1970 c.Assert(err, gc.IsNil) 1970 c.Assert(err, gc.IsNil)
1971 err = ctx.st.SetEnvironConfig(cfg, old) 1971 err = ctx.st.SetEnvironConfig(cfg, old)
1972 c.Assert(err, gc.IsNil) 1972 c.Assert(err, gc.IsNil)
1973 // wait for the new values... 1973 // wait for the new values...
1974 expected := (osenv.ProxySettings)(s) 1974 expected := (osenv.ProxySettings)(s)
1975 for attempt := coretesting.LongAttempt.Start(); attempt.Next(); { 1975 for attempt := coretesting.LongAttempt.Start(); attempt.Next(); {
1976 if ctx.uniter.GetProxyValues() == expected { 1976 if ctx.uniter.GetProxyValues() == expected {
1977 // Also confirm that the values were specified for the e nvironment. 1977 // Also confirm that the values were specified for the e nvironment.
1978 » » » c.Assert(os.Getenv("http-proxy"), gc.Equals, expected.Ht tp) 1978 » » » c.Assert(os.Getenv("http_proxy"), gc.Equals, expected.Ht tp)
1979 » » » c.Assert(os.Getenv("HTTP-PROXY"), gc.Equals, expected.Ht tp) 1979 » » » c.Assert(os.Getenv("HTTP_PROXY"), gc.Equals, expected.Ht tp)
1980 » » » c.Assert(os.Getenv("https-proxy"), gc.Equals, expected.H ttps) 1980 » » » c.Assert(os.Getenv("https_proxy"), gc.Equals, expected.H ttps)
1981 » » » c.Assert(os.Getenv("HTTPS-PROXY"), gc.Equals, expected.H ttps) 1981 » » » c.Assert(os.Getenv("HTTPS_PROXY"), gc.Equals, expected.H ttps)
1982 » » » c.Assert(os.Getenv("ftp-proxy"), gc.Equals, expected.Ftp ) 1982 » » » c.Assert(os.Getenv("ftp_proxy"), gc.Equals, expected.Ftp )
1983 » » » c.Assert(os.Getenv("FTP-PROXY"), gc.Equals, expected.Ftp ) 1983 » » » c.Assert(os.Getenv("FTP_PROXY"), gc.Equals, expected.Ftp )
1984 return 1984 return
1985 } 1985 }
1986 } 1986 }
1987 c.Fatal("settings didn't get noticed by the uniter") 1987 c.Fatal("settings didn't get noticed by the uniter")
1988 } 1988 }
1989 1989
1990 type runCommands []string 1990 type runCommands []string
1991 1991
1992 func (cmds runCommands) step(c *gc.C, ctx *context) { 1992 func (cmds runCommands) step(c *gc.C, ctx *context) {
1993 commands := strings.Join(cmds, "\n") 1993 commands := strings.Join(cmds, "\n")
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2059 type verifyNoFile struct { 2059 type verifyNoFile struct {
2060 filename string 2060 filename string
2061 } 2061 }
2062 2062
2063 func (verify verifyNoFile) step(c *gc.C, ctx *context) { 2063 func (verify verifyNoFile) step(c *gc.C, ctx *context) {
2064 c.Assert(verify.filename, jc.DoesNotExist) 2064 c.Assert(verify.filename, jc.DoesNotExist)
2065 // Wait a short time and check again. 2065 // Wait a short time and check again.
2066 time.Sleep(coretesting.ShortWait) 2066 time.Sleep(coretesting.ShortWait)
2067 c.Assert(verify.filename, jc.DoesNotExist) 2067 c.Assert(verify.filename, jc.DoesNotExist)
2068 } 2068 }
OLDNEW
« no previous file with comments | « provider/local/environprovider_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b