Skip to content

Commit

Permalink
Merge branch 'master' into desktop_file_and_icons
Browse files Browse the repository at this point in the history
  • Loading branch information
wstephenson committed Apr 17, 2018
2 parents 3f7ae73 + 776591a commit b5b7d3f
Show file tree
Hide file tree
Showing 26 changed files with 1,519 additions and 50 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
doc
coverage
rmt.pot
.idea/*
27 changes: 8 additions & 19 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2018-02-26 13:22:06 +0100 using RuboCop version 0.52.1.
# on 2018-04-04 15:19:02 +0200 using RuboCop version 0.52.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
Metrics/CyclomaticComplexity:
Max: 11

# Offense count: 2
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 60

# Offense count: 1
Metrics/PerceivedComplexity:
Max: 14
# Configuration parameters: Max.
RSpec/ExampleLength:
Exclude:
- 'spec/features/**/*'
- 'spec/rmt/ssl/certificate_generator_spec.rb'
- 'spec/rmt/wizard_ssl_page_spec.rb'

# Offense count: 105
# Offense count: 207
# Configuration parameters: .
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
EnforcedStyle: receive

# Offense count: 2
Style/MultipleComparison:
Exclude:
- 'src/lib/rmt/wizard_maria_db_page.rb'
- 'src/lib/rmt/wizard_scc_page.rb'
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,48 @@ docker build -t yast-rmt-image .
docker run -it yast-rmt-image rspec
```

### Package
### Package

The package gets built for SLE15 here: https://build.opensuse.org/package/show/systemsmanagement:SCC:RMT/yast2-rmt
The package gets built for SLE 15 and openSUSE Leap 15 here:
https://build.opensuse.org/package/show/systemsmanagement:SCC:RMT/yast2-rmt

You can use:

```bash
rake osc:commit
```

to commit the current version to OBS.


#### Submit Requests to openSUSE Factory and SLES

To get a maintenance request accepted, each changelog entry needs to reference a bug or feature
request with `bsc#123` or `fate#123`.

##### Factory First

To submit a request to openSUSE Factory, issue this commands in the console:

```bash
osc sr systemsmanagement:SCC:RMT yast2-rmt openSUSE:Factory --no-cleanup
```


##### Internal Build Service

To make the initial submit for a new SLES version:

```bash
osc -A https://api.suse.de sr Devel:SCC:RMT yast2-rmt SUSE:SLE-15:GA --no-cleanup
```

To submit the updated package as a maintenance update to released SLES versions:

```bash
osc -A https://api.suse.de mr Devel:SCC:RMT yast2-rmt SUSE:SLE-15:GA:Update --no-cleanup
```

You can check the status of your requests [here](https://build.opensuse.org/package/requests/systemsmanagement:SCC:RMT/yast2-rmt) and [here](https://build.suse.de/package/requests/Devel:SCC:RMT/yast2-rmt).

After your requests got accepted, they still have to pass maintenance testing before they get released to customers. You can check their progress at [maintenance.suse.de](https://maintenance.suse.de/search/?q=yast2-rmt). If you still need help, the maintenance team can be reached at [[email protected]]([email protected]) or #maintenance on irc.suse.de.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Yast::Tasks.configuration do |conf|
conf.obs_project = 'systemsmanagement:SCC:RMT'
# Default target for osc:build
conf.obs_target = 'openSUSE_Factory'
conf.skip_license_check = [ %r{^Gemfile\.lock$}, %r{rmt\.desktop} ]
conf.skip_license_check = [ %r{^Gemfile\.lock$}, %r{rmt\.desktop} , %r{rmt.*\.cnf\.erb$} ]
end

# This is required, because `yast-travis-ruby` binary calls `rake test:unit`
Expand Down
6 changes: 6 additions & 0 deletions package/yast2-rmt.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Apr 3 08:16:37 UTC 2018 - [email protected]

- version 0.0.3
- Add setup steps for SSL certificate generation (fate#325115)

-------------------------------------------------------------------
Mon Mar 5 15:12:56 UTC 2018 - [email protected]

Expand Down
5 changes: 3 additions & 2 deletions package/yast2-rmt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@


Name: yast2-rmt
Version: 0.0.2
Version: 0.0.3
Release: 0
BuildArch: noarch

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: %{name}-%{version}.tar.bz2

Requires: rmt-server
Requires: rmt-server >= 0.0.5
Requires: yast2
Requires: yast2-ruby-bindings

Expand Down Expand Up @@ -64,6 +64,7 @@ rake install DESTDIR="%{buildroot}"
%dir %{yast_dir}/theme/current/icons
%dir %{yast_dir}/theme/current/icons/*
%{yast_dir}/theme/current/icons/*/yast-rmt.png
%{yast_dir}/data/rmt

%doc COPYING
%doc README.md
Expand Down
55 changes: 55 additions & 0 deletions spec/rmt/execute_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) 2018 SUSE LLC.
# All Rights Reserved.

# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 or 3 of the GNU General
# Public License as published by the Free Software Foundation.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, contact SUSE LLC.

# To contact SUSE about this file by physical or electronic mail,
# you may find current contact information at www.suse.com

require 'rmt/execute'

Yast.import 'Report'

describe RMT::Execute do
describe '.on_target' do
let(:exit_double) { instance_double(Process::Status) }

it 'executes the command' do
expect(described_class).to receive(:on_target!)
described_class.on_target
end

it 'shows an error message when an exception ocurrs' do
expect(exit_double).to receive(:exitstatus).and_return(255)
expect(described_class).to receive(:on_target!).and_raise(Cheetah::ExecutionFailed.new('command', exit_double, '', 'Something went wrong'))
expect(Yast::Report).to receive(:Error)
described_class.on_target
end
end

describe '.on_target!' do
let(:chroot) { '/tmp' }

it 'appends chroot and runs command when args item is not a hash' do
expect(Yast::WFM).to receive(:scr_root).and_return(chroot)
expect(Cheetah).to receive(:run).with('cmd', { chroot: chroot })
described_class.on_target!('cmd')
end

it 'appends chroot and runs command when args item is a hash' do
expect(Yast::WFM).to receive(:scr_root).and_return(chroot)
expect(Cheetah).to receive(:run).with('cmd', { foo: 'bar', chroot: chroot })
described_class.on_target!('cmd', { foo: 'bar' })
end
end
end
64 changes: 64 additions & 0 deletions spec/rmt/ssl/alternative_common_name_dialog_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright (c) 2018 SUSE LLC.
# All Rights Reserved.

# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 or 3 of the GNU General
# Public License as published by the Free Software Foundation.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, contact SUSE LLC.

# To contact SUSE about this file by physical or electronic mail,
# you may find current contact information at www.suse.com

require 'rmt/ssl/alternative_common_name_dialog'

Yast.import 'Report'

describe RMT::SSL::AlternativeCommonNameDialog do
subject(:dialog) { described_class.new }

describe '#dialog_content' do
it 'creates the UI elements' do
expect(Yast::Term).to receive(:new).exactly(22).times
dialog.dialog_content
end
end

describe '#user_input' do
it 'sets focus and waits for user input' do
expect(Yast::UI).to receive(:SetFocus).with(Id(:alt_name))
expect_any_instance_of(UI::Dialog).to receive(:user_input)
dialog.user_input
end
end

describe '#ok_handler' do
context 'when the alt name field is empty' do
let(:alt_name) { '' }

it 'reports an error' do
expect(Yast::UI).to receive(:QueryWidget).with(Id(:alt_name), :Value).and_return(alt_name)
expect(Yast::UI).to receive(:SetFocus).with(Id(:alt_name))
expect(Yast::Report).to receive(:Error).with('Alternative common name must not be empty.')
expect(dialog).not_to receive(:finish_dialog)
dialog.ok_handler
end
end

context 'when the alt name field is not empty' do
let(:alt_name) { 'example.org' }

it 'finishes the dialog and returns the alt name' do
expect(Yast::UI).to receive(:QueryWidget).with(Id(:alt_name), :Value).and_return(alt_name)
expect(dialog).to receive(:finish_dialog).with(alt_name)
dialog.ok_handler
end
end
end
end
Loading

0 comments on commit b5b7d3f

Please sign in to comment.