Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2-iscsi-client for openSUSE:Factory checked in at 2021-03-08 15:14:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-iscsi-client (Old) and /work/SRC/openSUSE:Factory/.yast2-iscsi-client.new.2378 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-iscsi-client" Mon Mar 8 15:14:41 2021 rev:133 rq:876554 version:4.3.3 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-iscsi-client/yast2-iscsi-client.changes 2020-08-14 13:08:48.165198162 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-iscsi-client.new.2378/yast2-iscsi-client.changes 2021-03-08 15:15:31.249860124 +0100 @@ -1,0 +2,6 @@ +Wed Mar 3 09:32:29 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Add the 'iface' element to the AutoYaST schema (bsc#1182193). +- 4.3.3 + +------------------------------------------------------------------- Old: ---- yast2-iscsi-client-4.3.2.tar.bz2 New: ---- yast2-iscsi-client-4.3.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-iscsi-client.spec ++++++ --- /var/tmp/diff_new_pack.uHdOya/_old 2021-03-08 15:15:31.929860649 +0100 +++ /var/tmp/diff_new_pack.uHdOya/_new 2021-03-08 15:15:31.933860651 +0100 @@ -1,7 +1,7 @@ # # spec file for package yast2-iscsi-client # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,20 +12,21 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: yast2-iscsi-client -Version: 4.3.2 +Version: 4.3.3 Release: 0 Summary: YaST2 - iSCSI Client Configuration License: GPL-2.0-only Group: System/YaST -Url: https://github.com/yast/yast-iscsi-client +URL: https://github.com/yast/yast-iscsi-client Source0: %{name}-%{version}.tar.bz2 +BuildRequires: yast2-packager # Yast2::Systemd::Socket BuildRequires: docbook-xsl-stylesheets BuildRequires: libxslt ++++++ yast2-iscsi-client-4.3.2.tar.bz2 -> yast2-iscsi-client-4.3.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/.github/workflows/ci.yml new/yast2-iscsi-client-4.3.3/.github/workflows/ci.yml --- old/yast2-iscsi-client-4.3.2/.github/workflows/ci.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-iscsi-client-4.3.3/.github/workflows/ci.yml 2021-03-03 15:05:07.000000000 +0100 @@ -0,0 +1,83 @@ + +# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions + +name: CI + +on: [push, pull_request] + +jobs: + Tests: + runs-on: ubuntu-latest + container: registry.opensuse.org/yast/head/containers/yast-ruby:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v2 + + # just for easier debugging... + - name: Inspect Installed Packages + run: rpm -qa | sort + + - name: Unit Tests + run: rake test:unit + # enable code coverage reporting + env: + COVERAGE: 1 + + # send the coverage report to coveralls.io + - name: Coveralls Report + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + Rubocop: + runs-on: ubuntu-latest + container: registry.opensuse.org/yast/head/containers/yast-ruby:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Rubocop + run: rake check:rubocop + + Package: + runs-on: ubuntu-latest + container: registry.opensuse.org/yast/head/containers/yast-ruby:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Package Build + run: yast-ci-ruby -o package + + Yardoc: + runs-on: ubuntu-latest + container: registry.opensuse.org/yast/head/containers/yast-ruby:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v2 + + - name: Yardoc + # FIXME: you can just run "yardoc" if "check:doc" task is too strict... + run: rake check:doc + + # downloading the Docker image takes some time so bundling several fast + # checks into one job avoids that overhead + Checks: + runs-on: ubuntu-latest + container: registry.opensuse.org/yast/head/containers/yast-ruby:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v2 + + - name: POT Check + run: rake check:pot diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/.travis.yml new/yast2-iscsi-client-4.3.3/.travis.yml --- old/yast2-iscsi-client-4.3.2/.travis.yml 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,11 +0,0 @@ -sudo: required -language: bash -services: - - docker - -before_install: - - docker build -t yast-iscsi-client-image . -script: - # the "yast-travis-ruby" script is included in the base yastdevel/ruby image - # see https://github.com/yast/docker-yast-ruby/blob/master/yast-travis-ruby - - docker run -it --privileged -e TRAVIS=1 -e TRAVIS_JOB_ID="$TRAVIS_JOB_ID" yast-iscsi-client-image yast-travis-ruby diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/Dockerfile new/yast2-iscsi-client-4.3.3/Dockerfile --- old/yast2-iscsi-client-4.3.2/Dockerfile 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/Dockerfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -FROM registry.opensuse.org/yast/head/containers/yast-ruby:latest -COPY . /usr/src/app - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/README.md new/yast2-iscsi-client-4.3.3/README.md --- old/yast2-iscsi-client-4.3.2/README.md 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/README.md 2021-03-03 15:05:07.000000000 +0100 @@ -1,5 +1,8 @@ # YaST - The iSCSI Client Module # -[](https://travis-ci.org/yast/yast-iscsi-client) -[](https://ci.opensuse.org/view/Yast/job/yast-iscsi-client-master/) - +[]( +https://github.com/yast/yast-iscsi-client/actions?query=branch%3Amaster) +[]( +https://ci.opensuse.org/view/Yast/job/yast-yast-iscsi-client-master/) +[](https://coveralls.io/r/yast/yast-iscsi-client?branch=master) +[](http://inch-ci.org/github/yast/yast-iscsi-client) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/package/yast2-iscsi-client.changes new/yast2-iscsi-client-4.3.3/package/yast2-iscsi-client.changes --- old/yast2-iscsi-client-4.3.2/package/yast2-iscsi-client.changes 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/package/yast2-iscsi-client.changes 2021-03-03 15:05:07.000000000 +0100 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Mar 3 09:32:29 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Add the 'iface' element to the AutoYaST schema (bsc#1182193). +- 4.3.3 + +------------------------------------------------------------------- Mon Aug 10 15:54:00 CEST 2020 - sch...@suse.de - AutoYaST: Added supplements: autoyast(iscsi-client) into the spec file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/package/yast2-iscsi-client.spec new/yast2-iscsi-client-4.3.3/package/yast2-iscsi-client.spec --- old/yast2-iscsi-client-4.3.2/package/yast2-iscsi-client.spec 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/package/yast2-iscsi-client.spec 2021-03-03 15:05:07.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-iscsi-client -Version: 4.3.2 +Version: 4.3.3 Release: 0 Summary: YaST2 - iSCSI Client Configuration Group: System/YaST @@ -26,6 +26,7 @@ Source0: %{name}-%{version}.tar.bz2 +BuildRequires: yast2-packager # Yast2::Systemd::Socket BuildRequires: yast2 >= 4.1.3 BuildRequires: yast2 >= 2.23.15 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/src/autoyast-rnc/iscsi-client.rnc new/yast2-iscsi-client-4.3.3/src/autoyast-rnc/iscsi-client.rnc --- old/yast2-iscsi-client-4.3.2/src/autoyast-rnc/iscsi-client.rnc 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/src/autoyast-rnc/iscsi-client.rnc 2021-03-03 15:05:07.000000000 +0100 @@ -13,14 +13,15 @@ element listentry { MAP, ( - element authmethod { STRING }? & - element password { STRING }? & + element authmethod { STRING }? & + element password { STRING }? & element password_in { STRING }? & element portal { STRING }? & element startup { STRING }? & element target { STRING }? & element username { STRING }? & - element username_in { STRING }? + element username_in { STRING }? & + element iface { STRING }? ) }* }? & diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/src/modules/IscsiClient.rb new/yast2-iscsi-client-4.3.3/src/modules/IscsiClient.rb --- old/yast2-iscsi-client-4.3.2/src/modules/IscsiClient.rb 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/src/modules/IscsiClient.rb 2021-03-03 15:05:07.000000000 +0100 @@ -297,9 +297,9 @@ # Saves service status (start mode and starts/stops the service) # # @note For AutoYaST and for command line actions, it uses the old way for - # backward compatibility, see {IscsiClientLib#setServiceStatus}. When the + # backward compatibility, see {IscsiClientLibClass#setServiceStatus}. When the # service is configured by using the UI, it directly saves the service, see - # {Yast2::SystemService#save}. + # Yast2::SystemService#save. def save_status if Mode.auto || Mode.commandline IscsiClientLib.setServiceStatus diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/src/modules/IscsiClientLib.rb new/yast2-iscsi-client-4.3.3/src/modules/IscsiClientLib.rb --- old/yast2-iscsi-client-4.3.2/src/modules/IscsiClientLib.rb 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/src/modules/IscsiClientLib.rb 2021-03-03 15:05:07.000000000 +0100 @@ -758,8 +758,8 @@ # Check whether iSCSI nodes are equal # - # @param [Hash] iSCSI node values as hash - # @param [Hash] iSCSI node values as hash + # @param n1 [Hash] iSCSI node values as hash + # @param n2 [Hash] iSCSI node values as hash # # @return [Bool] nodes are equal? # @@ -786,7 +786,7 @@ # Checks whether iSCSI session (values provided as hash) is iBFT session # - # @param [Hash] iSCSI node values as hash + # @param node_info [Hash] iSCSI node values as hash # @return [Bool] is iSCSI session booted from firmware? # def iBFT?(node_info) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/test/Makefile.am new/yast2-iscsi-client-4.3.3/test/Makefile.am --- old/yast2-iscsi-client-4.3.2/test/Makefile.am 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/test/Makefile.am 2021-03-03 15:05:07.000000000 +0100 @@ -1,8 +1,6 @@ TESTS = \ - ipEqual_spec.rb \ - saveConfig_spec.rb \ - ScanDiscovered_spec.rb \ - getiBFT_spec.rb + iscsi_client_lib_test.rb \ + iscsi_client_test.rb TEST_EXTENSIONS = .rb RB_LOG_COMPILER = rspec diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/test/ScanDiscovered_spec.rb new/yast2-iscsi-client-4.3.3/test/ScanDiscovered_spec.rb --- old/yast2-iscsi-client-4.3.2/test/ScanDiscovered_spec.rb 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/test/ScanDiscovered_spec.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,86 +0,0 @@ -#!/usr/bin/env rspec -require_relative "../src/modules/IscsiClientLib" - -describe Yast::IscsiClientLibClass do - before :each do - @iscsilib = Yast::IscsiClientLibClass.new - @iscsilib.main - end - - describe "#ScanDiscovered for iscsiadm -m session -P 1" do - context "with Current Portal: and Persistent Portal: differ" do - it "returns list of connected targets with IPs of Persistent Portal" do - expect(@iscsilib.ScanDiscovered( - ["Target: iqn.2013-10.de.suse:test_file1", - "\tCurrent Portal: 10.13.67.182:3260,1", - "\tPersistent Portal: 10.120.66.182:3260,1", - "\t\t**********", - "\t\tInterface:", - "\t\t**********", - "\t\tIface Name: default", - "\t\tIface Transport: tcp", - "\t\tIface Initiatorname: iqn.1996-04.de.suse:01:19eacab02a1d", - "\t\tIface IPaddress: <empty>", - "\t\tIface HWaddress: <empty>", - "\t\tIface Netdev: <empty>", - "\t\tSID: 1", - "\t\tiSCSI Connection State: TRANSPORT WAIT", - "\t\tiSCSI Session State: FREE", - "\t\tInternal iscsid Session State: REOPEN", "", - "Target: iqn.2013-10.de.suse:test_file2", - "\tCurrent Portal: [2620:113:80c0:890:e051:56:73c7:9171]:3260,1", - "\tPersistent Portal: [2620:113:80c0:8080:e051:f9ea:73c7:9171]:3260,1", - "\t\t**********", - "\t\tInterface:", - "\t\t**********", - "\t\tIface Name: default", - "\t\tIface Transport: tcp", - "\t\tIface Initiatorname: iqn.1996-04.de.suse:01:19eacab02a1d", - "\t\tIface IPaddress: <empty>", - "\t\tIface HWaddress: <empty>", - "\t\tIface Netdev: <empty>", - "\t\tSID: 1", - "\t\tiSCSI Connection State: TRANSPORT WAIT", - "\t\tiSCSI Session State: FREE", - "\t\tInternal iscsid Session State: REOPEN", ""] - )).to eq( - ["10.120.66.182:3260 iqn.2013-10.de.suse:test_file1 default", - "[2620:113:80c0:8080:e051:f9ea:73c7:9171]:3260 iqn.2013-10.de.suse:test_file2 default"] - ) - end - end - end - - describe "#ScanDiscovered for iscsiadm -m node -P 1" do - context "with Portal:" do - it "returns list of discovered targets with IPs of Portal" do - expect(@iscsilib.ScanDiscovered( - ["Target: iqn.2013-10.de.suse:test_file2", - "\tPortal: [fe80::a00:27ff:fe1b:a7fe]:3260,1", - "\t\tIface Name: default", - "Target: iqn.2013-10.de.suse:test_file2", - "\tPortal: [2620:113:80c0:8080:e051:f9ea:73c7:9171]:3260,1", - "\t\tIface Name: default", - "Target: iqn.2013-10.de.suse:test_file2", - "\tPortal: 10.120.66.182:3260,1", - "Target: iqn.2013-10.de.suse:test_file2", - "\tPortal: [2620:113:80c0:8080:a00:27ff:fe1b:a7fe]:3260,1", - "Target: iqn.2018-06.de.suse.zeus:01", - "\tPortal: 192.168.20.20:3260,2", - "\t\tIface Name: default", - "\tPortal: 192.168.10.20:3260,1", - "\t\tIface Name: default"] - )). to eq( - [ - "[2620:113:80c0:8080:e051:f9ea:73c7:9171]:3260 iqn.2013-10.de.suse:test_file2 default", - "10.120.66.182:3260 iqn.2013-10.de.suse:test_file2 default", - "[2620:113:80c0:8080:a00:27ff:fe1b:a7fe]:3260 iqn.2013-10.de.suse:test_file2 default", - "192.168.20.20:3260 iqn.2018-06.de.suse.zeus:01 default", - "192.168.10.20:3260 iqn.2018-06.de.suse.zeus:01 default" - ] - ) - end - end - end - -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/test/getiBFT_spec.rb new/yast2-iscsi-client-4.3.3/test/getiBFT_spec.rb --- old/yast2-iscsi-client-4.3.2/test/getiBFT_spec.rb 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/test/getiBFT_spec.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,64 +0,0 @@ -#!/usr/bin/env rspec -require_relative "../src/modules/IscsiClientLib" - -describe Yast::IscsiClientLibClass do - - before :each do - @iscsilib = Yast::IscsiClientLibClass.new - @iscsilib.main - end - - describe "#getiBFT" do - context "when filtering output of 'iscsiadm -m fw'" do - it "returns data in form of a map " do - allow(Yast::Arch).to receive(:architecture).and_return("x86_64") - allow(@iscsilib).to receive(:getFirmwareInfo) - .and_return("# BEGIN RECORD 2.0-872\n"\ - "iface.bootproto = STATIC\n"\ - "iface.transport_name = tcp\n"\ - "iface.hwaddress = 00:00:c9:b1:bc:7f\n"\ - "iface.initiatorname = iqn.2011-05.com.emulex:eraptorrfshoneport1\n"\ - "iface.ipaddress = 2620:0113:80c0:8000:000c:0000:0000:04dc\n"\ - "node.conn[0].address = 172.0.21.6\n"\ - "node.conn[0].port = 3260\n"\ - "node.name = iqn.1986-03.com.ibm:sn.135061874\n"\ - "# END RECORD\n") - - ibft_data = @iscsilib.getiBFT - - expect(ibft_data).to eq( - "iface.bootproto" => "STATIC", - "iface.hwaddress" => "00:00:c9:b1:bc:7f", - "iface.initiatorname" => "iqn.2011-05.com.emulex:eraptorrfshoneport1", - "iface.transport_name" => "tcp", - "iface.ipaddress" => "2620:0113:80c0:8000:000c:0000:0000:04dc", - "node.conn[0].address" => "172.0.21.6", - "node.conn[0].port" => "3260", - "node.name" => "iqn.1986-03.com.ibm:sn.135061874" - ) - end - end - - context "when could not get list of targets from firmware" do - it "returns an empty map " do - allow(Yast::Arch).to receive(:architecture).and_return("x86_64") - allow(@iscsilib).to receive(:getFirmwareInfo).and_return("") - - ibft_data = @iscsilib.getiBFT - - expect(ibft_data).to eq({}) - end - end - - context "when not on x86 hardware" do - it "returns an empty map " do - allow(Yast::Arch).to receive(:architecture).and_return("s390_64") - - ibft_data = @iscsilib.getiBFT - - expect(ibft_data).to eq({}) - end - end - - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/test/ipEqual_spec.rb new/yast2-iscsi-client-4.3.3/test/ipEqual_spec.rb --- old/yast2-iscsi-client-4.3.2/test/ipEqual_spec.rb 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/test/ipEqual_spec.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,103 +0,0 @@ -#!/usr/bin/env rspec -require_relative "../src/modules/IscsiClientLib" - -describe Yast::IscsiClientLibClass do - - before :each do - @iscsilib = Yast::IscsiClientLibClass.new - @iscsilib.main - end - - describe "#ipEqual" do - context "with IPv4 arguments not matching" do - it "returns false" do - expect(@iscsilib.ipEqual?("213:23:", "...")).to eq(false) - end - end - context "with equal IPv4 addresses (without port)" do - it "returns true" do - expect(@iscsilib.ipEqual?("10.10.10.1", "10.10.10.1")).to eq(true) - end - end - context "with equal IPv4 addresses and equal port" do - it "returns true" do - expect(@iscsilib.ipEqual?("10.10.10.1:345", "10.10.10.1:345")).to eq(true) - end - end - context "with equal IPv4 addresses and different ports" do - it "returns false" do - expect(@iscsilib.ipEqual?("10.10.10.1:345", "10.10.10.1:500")).to eq(false) - end - end - context "with invalid IPv6 arguments" do - it "returns false" do - expect(@iscsilib.ipEqual?("[213:23:]", "...")).to eq(false) - end - end - context "with invalid IPv6 arguments not matching" do - it "returns false" do - expect(@iscsilib.ipEqual?("[???]", "[***]")).to eq(false) - end - end - context "with 2 empty arguments" do - it "returns false" do - expect(@iscsilib.ipEqual?("", "")).to eq(false) - end - end - context "with empty argument session IP" do - it "returns false" do - expect(@iscsilib.ipEqual?("", "10.10.10.1:500")).to eq(false) - end - end - context "with empty argument current IP" do - it "returns false" do - expect(@iscsilib.ipEqual?("[2620:0113:1c0:8080:4ec:544a:000d:3d62]", "")).to eq(false) - end - end - context "with nil arguments" do - it "returns false" do - expect(@iscsilib.ipEqual?(nil, nil)).to eq(false) - end - end - context "with one nil argument" do - it "returns false" do - expect(@iscsilib.ipEqual?(nil, "10.10.10.1:500")).to eq(false) - end - end - context "with equal (but different string) and valid IPv6 arguments (without port)" do - it "returns true" do - expect(@iscsilib.ipEqual?("[2620:0113:1c0:8080:4ec:544a:000d:3d62]", - "[2620:113:1c0:8080:4ec:544a:d:3d62]")).to eq(true) - end - end - context "with equal (same string) and valid IPv6 arguments (without port)" do - it "returns true" do - expect(@iscsilib.ipEqual?("[2620:113:1c0:8080:4ec:544a:000d:3d62]", - "[2620:113:1c0:8080:4ec:544a:d:3d62]")).to eq(true) - end - end - context "with equal (but different string) and valid IPv6 arguments and equal ports" do - it "returns true" do - expect(@iscsilib.ipEqual?("[0020:0113:80c0:8080:0:544a:3b9d:3d62]:456", - "[20:113:80c0:8080::544a:3b9d:3d62]:456")).to eq(true) - end - end - context "with equal (different string, one abbreviated) valid IPv6 arguments" do - it "returns true" do - expect(@iscsilib.ipEqual?("[::1]", "[0:0:0:0:0:0:0:1]")).to eq(true) - end - end - context "with equal (but different string) IPv6 arguments and different ports" do - it "returns false" do - expect(@iscsilib.ipEqual?("[2620:0113:80c0:8080:54ec:004a:3b9d:3d62]:456", - "[2620:113:80c0:8080:54ec:4a:3b9d:3d62]:4")).to eq(false) - end - end - context "with equal (same string) IPv6 arguments and different ports" do - it "returns false" do - expect(@iscsilib.ipEqual?("[2620:113:80c0:8080:54ec:544a:3b9d:3d62]:456", - "[2620:113:80c0:8080:54ec:544a:3b9d:3d62]:4")).to eq(false) - end - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/test/iscsi_client_lib_test.rb new/yast2-iscsi-client-4.3.3/test/iscsi_client_lib_test.rb --- old/yast2-iscsi-client-4.3.2/test/iscsi_client_lib_test.rb 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/test/iscsi_client_lib_test.rb 2021-03-03 15:05:07.000000000 +0100 @@ -1,10 +1,14 @@ #!/usr/bin/env rspec require_relative "test_helper" -require_relative "../src/modules/IscsiClientLib" +Yast.import "IscsiClientLib" -describe Yast::IscsiClientLibClass do - subject { described_class.new } +describe Yast::IscsiClientLib do + subject { described_class } + + before do + subject.main + end describe "#getServiceStatus" do before do @@ -98,4 +102,522 @@ subject.autoyastWrite end end + + describe "#ipEqual" do + context "with IPv4 arguments not matching" do + it "returns false" do + expect(subject.ipEqual?("213:23:", "...")).to eq(false) + end + end + context "with equal IPv4 addresses (without port)" do + it "returns true" do + expect(subject.ipEqual?("10.10.10.1", "10.10.10.1")).to eq(true) + end + end + context "with equal IPv4 addresses and equal port" do + it "returns true" do + expect(subject.ipEqual?("10.10.10.1:345", "10.10.10.1:345")).to eq(true) + end + end + context "with equal IPv4 addresses and different ports" do + it "returns false" do + expect(subject.ipEqual?("10.10.10.1:345", "10.10.10.1:500")).to eq(false) + end + end + context "with invalid IPv6 arguments" do + it "returns false" do + expect(subject.ipEqual?("[213:23:]", "...")).to eq(false) + end + end + context "with invalid IPv6 arguments not matching" do + it "returns false" do + expect(subject.ipEqual?("[???]", "[***]")).to eq(false) + end + end + context "with 2 empty arguments" do + it "returns false" do + expect(subject.ipEqual?("", "")).to eq(false) + end + end + context "with empty argument session IP" do + it "returns false" do + expect(subject.ipEqual?("", "10.10.10.1:500")).to eq(false) + end + end + context "with empty argument current IP" do + it "returns false" do + expect(subject.ipEqual?("[2620:0113:1c0:8080:4ec:544a:000d:3d62]", "")).to eq(false) + end + end + context "with nil arguments" do + it "returns false" do + expect(subject.ipEqual?(nil, nil)).to eq(false) + end + end + context "with one nil argument" do + it "returns false" do + expect(subject.ipEqual?(nil, "10.10.10.1:500")).to eq(false) + end + end + context "with equal (but different string) and valid IPv6 arguments (without port)" do + it "returns true" do + expect(subject.ipEqual?("[2620:0113:1c0:8080:4ec:544a:000d:3d62]", + "[2620:113:1c0:8080:4ec:544a:d:3d62]")).to eq(true) + end + end + context "with equal (same string) and valid IPv6 arguments (without port)" do + it "returns true" do + expect(subject.ipEqual?("[2620:113:1c0:8080:4ec:544a:000d:3d62]", + "[2620:113:1c0:8080:4ec:544a:d:3d62]")).to eq(true) + end + end + context "with equal (but different string) and valid IPv6 arguments and equal ports" do + it "returns true" do + expect(subject.ipEqual?("[0020:0113:80c0:8080:0:544a:3b9d:3d62]:456", + "[20:113:80c0:8080::544a:3b9d:3d62]:456")).to eq(true) + end + end + context "with equal (different string, one abbreviated) valid IPv6 arguments" do + it "returns true" do + expect(subject.ipEqual?("[::1]", "[0:0:0:0:0:0:0:1]")).to eq(true) + end + end + context "with equal (but different string) IPv6 arguments and different ports" do + it "returns false" do + expect(subject.ipEqual?("[2620:0113:80c0:8080:54ec:004a:3b9d:3d62]:456", + "[2620:113:80c0:8080:54ec:4a:3b9d:3d62]:4")).to eq(false) + end + end + context "with equal (same string) IPv6 arguments and different ports" do + it "returns false" do + expect(subject.ipEqual?("[2620:113:80c0:8080:54ec:544a:3b9d:3d62]:456", + "[2620:113:80c0:8080:54ec:544a:3b9d:3d62]:4")).to eq(false) + end + end + end + + describe "#getConfig,#saveConfig,#oldConfig" do + let(:etc_iscsid_all) { Yast::Path.new ".etc.iscsid.all" } + let(:etc_iscsid) { Yast::Path.new ".etc.iscsid" } + let(:read_data) do + { + "comment" => "", + "file" => -1, + "kind" => "section", + "name" => "", + "type" => -1, + "value" => [ + { + "comment" => "#\n" \ + "# Open-iSCSI default configuration.\n" \ + "# Could be located at /etc/iscsid.conf or ~/.iscsid.conf\n" \ + "#\n", + "kind" => "value", + "name" => "node.active_cnx", + "type" => 1, + "value" => "1" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.startup", + "type" => 1, + "value" => "manual" + }, + { + "comment" => "#node.session.auth.username = dima\n#node.session.auth.password = aloha\n", + "kind" => "value", + "name" => "node.session.timeo.replacement_timeout", + "type" => 1, + "value" => "120" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.err_timeo.abort_timeout", + "type" => 1, + "value" => "10" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.err_timeo.reset_timeout", + "type" => 1, + "value" => "30" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.InitialR2T", + "type" => 1, + "value" => "No" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.ImmediateData", + "type" => 1, + "value" => "Yes" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.FirstBurstLength", + "type" => 1, + "value" => "262144" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.MaxBurstLength", + "type" => 1, + "value" => "16776192" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.DefaultTime2Wait", + "type" => 1, + "value" => "0" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.DefaultTime2Retain", + "type" => 1, + "value" => "0" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.MaxConnections", + "type" => 1, + "value" => "0" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.cnx[0].iscsi.HeaderDigest", + "type" => 1, + "value" => "None" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.cnx[0].iscsi.DataDigest", + "type" => 1, + "value" => "None" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.cnx[0].iscsi.MaxRecvDataSegmentLength", + "type" => 1, + "value" => "65536" + } + ] + } + end + + let(:written_data) do + { + "comment" => "", + "file" => -1, + "kind" => "section", + "name" => "", + "type" => -1, + "value" => [ + { + "comment" => "#\n# Open-iSCSI default configuration.\n# Could be located at /etc/iscsid.conf or ~/.iscsid.conf\n#\n", + "kind" => "value", + "name" => "node.active_cnx", + "type" => 1, + "value" => "1" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.startup", + "type" => 1, + "value" => "manual" + }, + { + "comment" => "#node.session.auth.username = dima\n#node.session.auth.password = aloha\n", + "kind" => "value", + "name" => "node.session.timeo.replacement_timeout", + "type" => 1, + "value" => "120" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.err_timeo.abort_timeout", + "type" => 1, + "value" => "10" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.err_timeo.reset_timeout", + "type" => 1, + "value" => "30" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.InitialR2T", + "type" => 1, + "value" => "No" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.ImmediateData", + "type" => 1, + "value" => "Yes" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.FirstBurstLength", + "type" => 1, + "value" => "262144" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.MaxBurstLength", + "type" => 1, + "value" => "16776192" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.DefaultTime2Wait", + "type" => 1, + "value" => "0" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.DefaultTime2Retain", + "type" => 1, + "value" => "0" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.session.iscsi.MaxConnections", + "type" => 1, + "value" => "0" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.cnx[0].iscsi.HeaderDigest", + "type" => 1, + "value" => "None" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.cnx[0].iscsi.DataDigest", + "type" => 1, + "value" => "None" + }, + { + "comment" => "", + "kind" => "value", + "name" => "node.cnx[0].iscsi.MaxRecvDataSegmentLength", + "type" => 1, + "value" => "65536" + }, + { + "comment" => "", + "kind" => "value", + "name" => "discovery.sendtargets.auth.authmethod", + "type" => 1, + "value" => "CHAP" + }, + { + "comment" => "", + "kind" => "value", + "name" => "discovery.sendtargets.auth.username_in", + "type" => 1, + "value" => "incuser" + }, + { + "comment" => "", + "kind" => "value", + "name" => "discovery.sendtargets.auth.password_in", + "type" => 1, + "value" => "incpass" + }, + { + "comment" => "", + "kind" => "value", + "name" => "discovery.sendtargets.auth.username", + "type" => 1, + "value" => "outuser" + }, + { + "comment" => "", + "kind" => "value", + "name" => "discovery.sendtargets.auth.password", + "type" => 1, + "value" => "outpass" + } + ] + } + end + + it "mimics a legacy test" do + allow(Yast::SCR).to receive(:Read) + .with(etc_iscsid_all).and_return(read_data) + expect(subject.getConfig).to eq(read_data.fetch("value")) + + expect(Yast::SCR).to receive(:Write) + .with(etc_iscsid_all, written_data).and_return(true) + expect(Yast::SCR).to receive(:Write) + .with(etc_iscsid, nil).and_return(true) + expect(subject.saveConfig("incuser", "incpass", "outuser", "outpass")) + .to eq(nil) + + expect(Yast::SCR).to receive(:Write) + .with(etc_iscsid_all, read_data).and_return(true) + expect(Yast::SCR).to receive(:Write) + .with(etc_iscsid, nil).and_return(true) + expect(subject.oldConfig).to eq(nil) + end + end + + describe "#ScanDiscovered for iscsiadm -m session -P 1" do + context "with Current Portal: and Persistent Portal: differ" do + it "returns list of connected targets with IPs of Persistent Portal" do + expect(subject.ScanDiscovered( + ["Target: iqn.2013-10.de.suse:test_file1", + "\tCurrent Portal: 10.13.67.182:3260,1", + "\tPersistent Portal: 10.120.66.182:3260,1", + "\t\t**********", + "\t\tInterface:", + "\t\t**********", + "\t\tIface Name: default", + "\t\tIface Transport: tcp", + "\t\tIface Initiatorname: iqn.1996-04.de.suse:01:19eacab02a1d", + "\t\tIface IPaddress: <empty>", + "\t\tIface HWaddress: <empty>", + "\t\tIface Netdev: <empty>", + "\t\tSID: 1", + "\t\tiSCSI Connection State: TRANSPORT WAIT", + "\t\tiSCSI Session State: FREE", + "\t\tInternal iscsid Session State: REOPEN", "", + "Target: iqn.2013-10.de.suse:test_file2", + "\tCurrent Portal: [2620:113:80c0:890:e051:56:73c7:9171]:3260,1", + "\tPersistent Portal: [2620:113:80c0:8080:e051:f9ea:73c7:9171]:3260,1", + "\t\t**********", + "\t\tInterface:", + "\t\t**********", + "\t\tIface Name: default", + "\t\tIface Transport: tcp", + "\t\tIface Initiatorname: iqn.1996-04.de.suse:01:19eacab02a1d", + "\t\tIface IPaddress: <empty>", + "\t\tIface HWaddress: <empty>", + "\t\tIface Netdev: <empty>", + "\t\tSID: 1", + "\t\tiSCSI Connection State: TRANSPORT WAIT", + "\t\tiSCSI Session State: FREE", + "\t\tInternal iscsid Session State: REOPEN", ""] + )).to eq( + ["10.120.66.182:3260 iqn.2013-10.de.suse:test_file1 default", + "[2620:113:80c0:8080:e051:f9ea:73c7:9171]:3260 iqn.2013-10.de.suse:test_file2 default"] + ) + end + end + end + + describe "#ScanDiscovered for iscsiadm -m node -P 1" do + context "with Portal:" do + it "returns list of discovered targets with IPs of Portal" do + expect(subject.ScanDiscovered( + ["Target: iqn.2013-10.de.suse:test_file2", + "\tPortal: [fe80::a00:27ff:fe1b:a7fe]:3260,1", + "\t\tIface Name: default", + "Target: iqn.2013-10.de.suse:test_file2", + "\tPortal: [2620:113:80c0:8080:e051:f9ea:73c7:9171]:3260,1", + "\t\tIface Name: default", + "Target: iqn.2013-10.de.suse:test_file2", + "\tPortal: 10.120.66.182:3260,1", + "Target: iqn.2013-10.de.suse:test_file2", + "\tPortal: [2620:113:80c0:8080:a00:27ff:fe1b:a7fe]:3260,1", + "Target: iqn.2018-06.de.suse.zeus:01", + "\tPortal: 192.168.20.20:3260,2", + "\t\tIface Name: default", + "\tPortal: 192.168.10.20:3260,1", + "\t\tIface Name: default"] + )). to eq( + [ + "[2620:113:80c0:8080:e051:f9ea:73c7:9171]:3260 iqn.2013-10.de.suse:test_file2 default", + "10.120.66.182:3260 iqn.2013-10.de.suse:test_file2 default", + "[2620:113:80c0:8080:a00:27ff:fe1b:a7fe]:3260 iqn.2013-10.de.suse:test_file2 default", + "192.168.20.20:3260 iqn.2018-06.de.suse.zeus:01 default", + "192.168.10.20:3260 iqn.2018-06.de.suse.zeus:01 default" + ] + ) + end + end + end + + describe "#getiBFT" do + context "when filtering output of 'iscsiadm -m fw'" do + it "returns data in form of a map " do + allow(Yast::Arch).to receive(:architecture).and_return("x86_64") + allow(subject).to receive(:getFirmwareInfo) + .and_return("# BEGIN RECORD 2.0-872\n"\ + "iface.bootproto = STATIC\n"\ + "iface.transport_name = tcp\n"\ + "iface.hwaddress = 00:00:c9:b1:bc:7f\n"\ + "iface.initiatorname = iqn.2011-05.com.emulex:eraptorrfshoneport1\n"\ + "iface.ipaddress = 2620:0113:80c0:8000:000c:0000:0000:04dc\n"\ + "node.conn[0].address = 172.0.21.6\n"\ + "node.conn[0].port = 3260\n"\ + "node.name = iqn.1986-03.com.ibm:sn.135061874\n"\ + "# END RECORD\n") + + ibft_data = subject.getiBFT + + expect(ibft_data).to eq( + "iface.bootproto" => "STATIC", + "iface.hwaddress" => "00:00:c9:b1:bc:7f", + "iface.initiatorname" => "iqn.2011-05.com.emulex:eraptorrfshoneport1", + "iface.transport_name" => "tcp", + "iface.ipaddress" => "2620:0113:80c0:8000:000c:0000:0000:04dc", + "node.conn[0].address" => "172.0.21.6", + "node.conn[0].port" => "3260", + "node.name" => "iqn.1986-03.com.ibm:sn.135061874" + ) + end + end + + context "when could not get list of targets from firmware" do + it "returns an empty map " do + allow(Yast::Arch).to receive(:architecture).and_return("x86_64") + allow(subject).to receive(:getFirmwareInfo).and_return("") + + ibft_data = subject.getiBFT + + expect(ibft_data).to eq({}) + end + end + + context "when not on x86 hardware" do + it "returns an empty map " do + allow(Yast::Arch).to receive(:architecture).and_return("s390_64") + + ibft_data = subject.getiBFT + + expect(ibft_data).to eq({}) + end + end + + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/test/iscsi_client_test.rb new/yast2-iscsi-client-4.3.3/test/iscsi_client_test.rb --- old/yast2-iscsi-client-4.3.2/test/iscsi_client_test.rb 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/test/iscsi_client_test.rb 2021-03-03 15:05:07.000000000 +0100 @@ -36,14 +36,14 @@ allow(Yast::Progress).to receive(:New) allow(Yast::Progress).to receive(:NextStage) allow(Yast::Confirm).to receive(:MustBeRoot).and_return(true) - allow(Yast::NetworkService).to receive(:RunnungNetworkPopup).and_return(true) + allow(Yast::NetworkService).to receive(:RunningNetworkPopup).and_return(true) allow(Yast::Builtins).to receive(:sleep) allow(Yast::Builtins).to receive(:y2milestone) allow(Yast::IscsiClientLib).to receive(:getiBFT).and_return(true) allow(Yast::IscsiClientLib).to receive(:checkInitiatorName).and_return(true) allow(Yast::IscsiClientLib).to receive(:autoLogOn) - allow(Yast::IscsiClientLib).to receive(:readSession).and_return(true) + allow(Yast::IscsiClientLib).to receive(:readSessions).and_return(true) allow(Yast::Mode).to receive(:auto) { auto } allow(Yast::Mode).to receive(:commandline) { commandline } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/test/saveConfig_spec.rb new/yast2-iscsi-client-4.3.3/test/saveConfig_spec.rb --- old/yast2-iscsi-client-4.3.2/test/saveConfig_spec.rb 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/test/saveConfig_spec.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,305 +0,0 @@ -#!/usr/bin/env rspec -require_relative "../src/modules/IscsiClientLib" - -describe Yast::IscsiClientLibClass do - subject do - @iscsilib = Yast::IscsiClientLibClass.new - @iscsilib.main - @iscsilib - end - - describe "#getConfig,#saveConfig,#oldConfig" do - let(:etc_iscsid_all) { Yast::Path.new ".etc.iscsid.all" } - let(:etc_iscsid) { Yast::Path.new ".etc.iscsid" } - let(:read_data) do - { - "comment" => "", - "file" => -1, - "kind" => "section", - "name" => "", - "type" => -1, - "value" => [ - { - "comment" => "#\n" \ - "# Open-iSCSI default configuration.\n" \ - "# Could be located at /etc/iscsid.conf or ~/.iscsid.conf\n" \ - "#\n", - "kind" => "value", - "name" => "node.active_cnx", - "type" => 1, - "value" => "1" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.startup", - "type" => 1, - "value" => "manual" - }, - { - "comment" => "#node.session.auth.username = dima\n#node.session.auth.password = aloha\n", - "kind" => "value", - "name" => "node.session.timeo.replacement_timeout", - "type" => 1, - "value" => "120" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.err_timeo.abort_timeout", - "type" => 1, - "value" => "10" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.err_timeo.reset_timeout", - "type" => 1, - "value" => "30" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.InitialR2T", - "type" => 1, - "value" => "No" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.ImmediateData", - "type" => 1, - "value" => "Yes" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.FirstBurstLength", - "type" => 1, - "value" => "262144" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.MaxBurstLength", - "type" => 1, - "value" => "16776192" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.DefaultTime2Wait", - "type" => 1, - "value" => "0" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.DefaultTime2Retain", - "type" => 1, - "value" => "0" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.MaxConnections", - "type" => 1, - "value" => "0" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.cnx[0].iscsi.HeaderDigest", - "type" => 1, - "value" => "None" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.cnx[0].iscsi.DataDigest", - "type" => 1, - "value" => "None" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.cnx[0].iscsi.MaxRecvDataSegmentLength", - "type" => 1, - "value" => "65536" - } - ] - } - end - - let(:written_data) do - { - "comment" => "", - "file" => -1, - "kind" => "section", - "name" => "", - "type" => -1, - "value" => [ - { - "comment" => "#\n# Open-iSCSI default configuration.\n# Could be located at /etc/iscsid.conf or ~/.iscsid.conf\n#\n", - "kind" => "value", - "name" => "node.active_cnx", - "type" => 1, - "value" => "1" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.startup", - "type" => 1, - "value" => "manual" - }, - { - "comment" => "#node.session.auth.username = dima\n#node.session.auth.password = aloha\n", - "kind" => "value", - "name" => "node.session.timeo.replacement_timeout", - "type" => 1, - "value" => "120" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.err_timeo.abort_timeout", - "type" => 1, - "value" => "10" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.err_timeo.reset_timeout", - "type" => 1, - "value" => "30" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.InitialR2T", - "type" => 1, - "value" => "No" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.ImmediateData", - "type" => 1, - "value" => "Yes" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.FirstBurstLength", - "type" => 1, - "value" => "262144" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.MaxBurstLength", - "type" => 1, - "value" => "16776192" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.DefaultTime2Wait", - "type" => 1, - "value" => "0" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.DefaultTime2Retain", - "type" => 1, - "value" => "0" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.session.iscsi.MaxConnections", - "type" => 1, - "value" => "0" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.cnx[0].iscsi.HeaderDigest", - "type" => 1, - "value" => "None" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.cnx[0].iscsi.DataDigest", - "type" => 1, - "value" => "None" - }, - { - "comment" => "", - "kind" => "value", - "name" => "node.cnx[0].iscsi.MaxRecvDataSegmentLength", - "type" => 1, - "value" => "65536" - }, - { - "comment" => "", - "kind" => "value", - "name" => "discovery.sendtargets.auth.authmethod", - "type" => 1, - "value" => "CHAP" - }, - { - "comment" => "", - "kind" => "value", - "name" => "discovery.sendtargets.auth.username_in", - "type" => 1, - "value" => "incuser" - }, - { - "comment" => "", - "kind" => "value", - "name" => "discovery.sendtargets.auth.password_in", - "type" => 1, - "value" => "incpass" - }, - { - "comment" => "", - "kind" => "value", - "name" => "discovery.sendtargets.auth.username", - "type" => 1, - "value" => "outuser" - }, - { - "comment" => "", - "kind" => "value", - "name" => "discovery.sendtargets.auth.password", - "type" => 1, - "value" => "outpass" - } - ] - } - end - - it "mimics a legacy test" do - allow(Yast::SCR).to receive(:Read) - .with(etc_iscsid_all).and_return(read_data) - expect(subject.getConfig).to eq(read_data.fetch("value")) - - expect(Yast::SCR).to receive(:Write) - .with(etc_iscsid_all, written_data).and_return(true) - expect(Yast::SCR).to receive(:Write) - .with(etc_iscsid, nil).and_return(true) - expect(subject.saveConfig("incuser", "incpass", "outuser", "outpass")) - .to eq(nil) - - expect(Yast::SCR).to receive(:Write) - .with(etc_iscsid_all, read_data).and_return(true) - expect(Yast::SCR).to receive(:Write) - .with(etc_iscsid, nil).and_return(true) - expect(subject.oldConfig).to eq(nil) - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-iscsi-client-4.3.2/test/test_helper.rb new/yast2-iscsi-client-4.3.3/test/test_helper.rb --- old/yast2-iscsi-client-4.3.2/test/test_helper.rb 2020-08-12 12:04:25.000000000 +0200 +++ new/yast2-iscsi-client-4.3.3/test/test_helper.rb 2021-03-03 15:05:07.000000000 +0100 @@ -11,6 +11,14 @@ RSpec.configure do |c| c.extend Yast::I18n # available in context/describe c.include Yast::I18n + c.mock_with :rspec do |mocks| + # If you misremember a method name both in code and in tests, + # will save you. + # https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/verifying-doubles/partial-doubles + # + # With graceful degradation for RSpec 2 + mocks.verify_partial_doubles = true if mocks.respond_to?(:verify_partial_doubles=) + end end if ENV["COVERAGE"] @@ -19,15 +27,24 @@ add_filter "/test/" end + src_location = File.expand_path("../src", __dir__) # track all ruby files under src - SimpleCov.track_files("#{srcdir}/**/*.rb") + SimpleCov.track_files("#{src_location}/**/*.rb") + + # additionally use the LCOV format for on-line code coverage reporting at CI + if ENV["CI"] || ENV["COVERAGE_LCOV"] + require "simplecov-lcov" + + SimpleCov::Formatter::LcovFormatter.config do |c| + c.report_with_single_file = true + # this is the default Coveralls GitHub Action location + # https://github.com/marketplace/actions/coveralls-github-action + c.single_report_path = "coverage/lcov.info" + 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 + SimpleCov::Formatter::LcovFormatter ] end end