Permalink
Browse files

Merge branch 'SLE-12-GA'

Conflicts:
	.travis.yml
	README.md
	package/yast2-proxy.spec
	test/test_helper.rb
  • Loading branch information...
mvidner committed Jun 12, 2015
2 parents 68d741c + e45c44c commit c1e05e225bca71ab71a6321b28aa468bd00876a8
Showing with 72 additions and 46 deletions.
  1. +1 −0 .coveralls.yml
  2. +1 −0 .gitignore
  3. +2 −2 .travis.yml
  4. +1 −1 README.md
  5. +7 −0 package/yast2-proxy.changes
  6. +1 −1 package/yast2-proxy.spec
  7. +0 −4 src/include/proxy/dialogs.rb
  8. +5 −38 src/modules/Proxy.rb
  9. +25 −0 test/test_helper.rb
  10. +29 −0 test/write_test.rb
View
@@ -0,0 +1 @@
service_name: travis-ci
View
@@ -12,6 +12,7 @@ config.status
config.sub
configure
configure.ac
/coverage/
depcomp
install-sh
*.pot
View
@@ -5,12 +5,12 @@ before_install:
# disable rvm, use system Ruby
- rvm reset
- wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh
- sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2" -g "rspec:2.14.1 yast-rake gettext"
- sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2" -g "rspec:2.14.1 yast-rake gettext simplecov coveralls"
script:
- rake check:syntax
- rake check:pot
- COVERAGE=1 rake test:unit
- make -f Makefile.cvs
- make
- sudo make install
- make check
View
@@ -2,4 +2,4 @@
[![Travis Build](https://travis-ci.org/yast/yast-proxy.svg?branch=master)](https://travis-ci.org/yast/yast-proxy)
[![Jenkins Build](http://img.shields.io/jenkins/s/https/ci.opensuse.org/yast-proxy-master.svg)](https://ci.opensuse.org/view/Yast/job/yast-proxy-master/)
[![Coverage Status](https://img.shields.io/coveralls/yast/yast-proxy.svg)](https://coveralls.io/r/yast/yast-proxy?branch=master)
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jun 11 12:01:30 UTC 2015 - mvidner@suse.com
- Fixed the last change not to crash with "internal error in
WriteCurlrc" when installing with a proxy (boo#929868).
- 3.1.5
-------------------------------------------------------------------
Thu Apr 9 15:35:53 UTC 2015 - mvidner@suse.com
View
@@ -17,7 +17,7 @@
Name: yast2-proxy
Version: 3.1.4
Version: 3.1.5
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -536,7 +536,6 @@ def ProxyMainDialog(standalone)
HSpacing(5)
)
# if(standalone == true)
Wizard.SetContentsButtons(
caption,
contents,
@@ -547,9 +546,6 @@ def ProxyMainDialog(standalone)
Wizard.SetNextButton(:next, Label.OKButton)
Wizard.SetAbortButton(:abort, Label.CancelButton)
Wizard.HideBackButton
# else
# Wizard::SetContentsButtons(caption, contents, help,
# Label::BackButton(), Label::OKButton());
# #103841, relaxed. now avoiding only quotes
# #337048 allow using space as well
View
@@ -1,17 +1,10 @@
# encoding: utf-8
# File: modules/Proxy.ycp
# Package: Network configuration
# Summary: Proxy data
# Authors: Michal Svec <msvec@suse.cz>
#
# $Id$
#
# Configures FTP and HTTP proxies via sysconfig & SuSEconfig
# and /root/.curlrc (for YOU)
require "yast"
module Yast
# Configures FTP and HTTP proxies via sysconfig
# and /root/.curlrc (for YOU)
class ProxyClass < Module
def main
textdomain "proxy"
@@ -107,13 +100,6 @@ def Read
end
end
# Read /root/.wgetrc
# YOU uses curl(1)
# user = SCR::Read(.root.wgetrc.proxy_user);
# if(user == nil) user = "";
# pass = SCR::Read(.root.wgetrc.proxy_passwd);
# if(pass == nil) pass = "";
true
end
@@ -136,9 +122,9 @@ def EscapeForCurlrc(s)
def WriteCurlrc
proxyuser = nil
if @user != ""
if @user && !@user.empty?
proxyuser = @user
proxyuser = @user + ":" + @pass if @pass != ""
proxyuser << ":" << @pass if @pass && !@pass.empty?
end
options = {
@@ -207,12 +193,6 @@ def Write
#user can't relogin in installation and update, do not show the msg then (bnc#486037, bnc#543469)
ProxyFinishPopup(true) if Mode.normal
# Update /root/.wgetrc
# YOU uses curl(1)
# SCR::Write(.root.wgetrc.proxy_user, user);
# SCR::Write(.root.wgetrc.proxy_passwd, pass);
# SCR::Write(.root.wgetrc, nil);
@modified = false
true
@@ -470,20 +450,7 @@ def Summary
""
)
)
]
# Summary text * /
# Summary::Device(sformat(_("No Proxy Domains: %1"), no) + "\n<br>" +
# "<p>" + ( user == "" ?
# /* Summary text * /
# _("Proxy user name is not set.") :
# /* Summary text * /
# sformat(_("Proxy User Name: %1"), user)) +
# "<br>" + ( pass == "" ?
# /* Summary text * /
# _("Proxy password is not set.") :
# /* Summary text * /
# _("Proxy password is set.")) ];
]
end
Summary.DevicesList(ret)
View
@@ -3,3 +3,28 @@
ENV["Y2DIR"] = y2dirs.unshift(srcdir).join(":")
require "yast/rspec"
if ENV["COVERAGE"]
require "simplecov"
SimpleCov.configure do
# Don't measure the tests themselves. We should have named them /spec/.
add_filter "/test/"
end
SimpleCov.start
# for coverage we need to load all ruby files
src_location = File.expand_path("../../src", __FILE__)
# note that clients/ are excluded because they run too eagerly by design
Dir["#{src_location}/{include,modules}/**/*.rb"].each do |f|
require_relative f
end
# use coveralls for on-line code coverage reporting at Travis CI
if ENV["TRAVIS"]
require "coveralls"
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
end
end
View
@@ -48,6 +48,35 @@
expect(subject.WriteCurlrc).to be true
end
it "writes proxy settings, and a comment, when proxy is enabled via InstallInfConvertor" do
subject.Import({ "enabled" => true,
"http_proxy" => "proxy.example.org:3128",
"proxy_user" => nil,
"proxy_password" => nil })
expect(Yast::SCR).to receive(:Write).
with(path_matching(/^\.root\.curlrc\..*\."comment"/), /Changed/).
once.and_return true
expect(Yast::SCR).to receive(:Write).
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
expect(Yast::SCR).to receive(:Write).
with(path(".root.curlrc"), nil).
once.and_return true
expect(subject.WriteCurlrc).to be true
end
it "writes a no-proxy setting" do
subject.Import({ "enabled" => true,
"http_proxy" => "proxy.example.org:3128",

0 comments on commit c1e05e2

Please sign in to comment.