Permalink
Browse files

Write --noproxy to curlrc (bsc#923788).

  • Loading branch information...
mvidner committed Apr 23, 2015
1 parent 7302ee6 commit c4bc43c4e0fa875e12cc59f7a4f6a97f845e77da
Showing with 23 additions and 1 deletion.
  1. +3 −1 src/modules/Proxy.rb
  2. +20 −0 test/write_test.rb
View
@@ -144,7 +144,9 @@ def WriteCurlrc
options = {
"--proxy-user" => proxyuser,
# bnc#305163
"--proxy" => @http
"--proxy" => @http,
# bsc#923788
"--noproxy" => @no
}
# proxy is used, write /root/.curlrc
View
@@ -33,6 +33,10 @@
with(path(".root.curlrc.\"--proxy\""), "proxy.example.org:3128").
once.and_return true
expect(Yast::SCR).to receive(:Write).
with(path(".root.curlrc.\"--noproxy\""), "localhost").
once.and_return true
allow(Yast::SCR).to receive(:Write).
with(path_matching(/^\.root\.curlrc/), nil).
and_return true
@@ -44,6 +48,22 @@
expect(subject.WriteCurlrc).to be true
end
it "writes a no-proxy setting" do
subject.Import({ "enabled" => true,
"http_proxy" => "proxy.example.org:3128",
"no_proxy" => "example.org,example.com,localhost" })
expect(Yast::SCR).to receive(:Write).
with(path(".root.curlrc.\"--noproxy\""),
"example.org,example.com,localhost").
once.and_return true
allow(Yast::SCR).to receive(:Write).
with(path_matching(/^\.root\.curlrc/), anything).
and_return true
expect(subject.WriteCurlrc).to be true
end
it "escapes user name" do
subject.Import({ "enabled" => true,
"http_proxy" => "proxy.example.org:3128",

0 comments on commit c4bc43c

Please sign in to comment.