Hello community,

here is the log from the commit of package perl-Net-DNS-Resolver-Mock for 
openSUSE:Factory checked in at 2020-02-22 18:59:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Net-DNS-Resolver-Mock (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Net-DNS-Resolver-Mock.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Net-DNS-Resolver-Mock"

Sat Feb 22 18:59:25 2020 rev:2 rq:774954 version:1.20200215

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Net-DNS-Resolver-Mock/perl-Net-DNS-Resolver-Mock.changes
    2019-04-05 11:55:39.202292179 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-Net-DNS-Resolver-Mock.new.26092/perl-Net-DNS-Resolver-Mock.changes
 2020-02-22 18:59:36.893543596 +0100
@@ -1,0 +2,6 @@
+Sun Feb 16 03:12:24 UTC 2020 -  <timueller+p...@suse.de>
+
+- updated to 1.20200215
+   see /usr/share/doc/packages/perl-Net-DNS-Resolver-Mock/Changes
+
+-------------------------------------------------------------------

Old:
----
  Net-DNS-Resolver-Mock-1.20171219.tar.gz

New:
----
  Net-DNS-Resolver-Mock-1.20200215.tar.gz
  cpanspec.yml

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Net-DNS-Resolver-Mock.spec ++++++
--- /var/tmp/diff_new_pack.qLwBxn/_old  2020-02-22 18:59:38.749547191 +0100
+++ /var/tmp/diff_new_pack.qLwBxn/_new  2020-02-22 18:59:38.749547191 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Net-DNS-Resolver-Mock
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Net-DNS-Resolver-Mock
-Version:        1.20171219
+Version:        1.20200215
 Release:        0
 %define cpan_name Net-DNS-Resolver-Mock
 Summary:        Mock a DNS Resolver object for testing
@@ -25,6 +25,7 @@
 Group:          Development/Libraries/Perl
 Url:            https://metacpan.org/release/%{cpan_name}
 Source0:        
https://cpan.metacpan.org/authors/id/M/MB/MBRADSHAW/%{cpan_name}-%{version}.tar.gz
+Source1:        cpanspec.yml
 BuildArch:      noarch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
@@ -33,6 +34,7 @@
 BuildRequires:  perl(Net::DNS::Question)
 BuildRequires:  perl(Net::DNS::Resolver)
 BuildRequires:  perl(Net::DNS::ZoneFile)
+BuildRequires:  perl(Test::Exception)
 Requires:       perl(Net::DNS::Packet)
 Requires:       perl(Net::DNS::Question)
 Requires:       perl(Net::DNS::Resolver)
@@ -60,7 +62,7 @@
 
 %files -f %{name}.files
 %defattr(-,root,root,755)
-%doc README
+%doc Changes README
 %license LICENSE
 
 %changelog

++++++ Net-DNS-Resolver-Mock-1.20171219.tar.gz -> 
Net-DNS-Resolver-Mock-1.20200215.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-DNS-Resolver-Mock-1.20171219/Changes 
new/Net-DNS-Resolver-Mock-1.20200215/Changes
--- old/Net-DNS-Resolver-Mock-1.20171219/Changes        1970-01-01 
01:00:00.000000000 +0100
+++ new/Net-DNS-Resolver-Mock-1.20200215/Changes        2020-02-15 
16:07:51.000000000 +0100
@@ -0,0 +1,19 @@
+Revision history for Net::DNS::Resolver::Mock
+
+1.20200215 2020-02-15 15:07:49+00:00 UTC
+  - Add missing Changelog
+  - Debugging mode with output via STDERR and method
+
+1.20200214
+  - Add Mocking of Exceptions
+
+1.20171219
+  - Add CNAME lookups
+  - Bugfix PTR lookups
+
+1.20171031
+  - Improve tests
+
+1.20170814
+  - First release
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-DNS-Resolver-Mock-1.20171219/MANIFEST 
new/Net-DNS-Resolver-Mock-1.20200215/MANIFEST
--- old/Net-DNS-Resolver-Mock-1.20171219/MANIFEST       2017-12-19 
05:31:17.000000000 +0100
+++ new/Net-DNS-Resolver-Mock-1.20200215/MANIFEST       2020-02-15 
16:07:51.000000000 +0100
@@ -1,4 +1,5 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest 
v6.010.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest 
v6.012.
+Changes
 LICENSE
 MANIFEST
 META.yml
@@ -7,6 +8,7 @@
 dist.ini
 lib/Net/DNS/Resolver/Mock.pm
 t/00-load.t
+t/01-debug.t
 t/01-test.t
 t/author-critic.t
 t/author-pod-syntax.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-DNS-Resolver-Mock-1.20171219/META.yml 
new/Net-DNS-Resolver-Mock-1.20200215/META.yml
--- old/Net-DNS-Resolver-Mock-1.20171219/META.yml       2017-12-19 
05:31:17.000000000 +0100
+++ new/Net-DNS-Resolver-Mock-1.20200215/META.yml       2020-02-15 
16:07:51.000000000 +0100
@@ -3,12 +3,13 @@
 author:
   - 'Marc Bradshaw <m...@marcbradshaw.net>'
 build_requires:
+  Test::Exception: '0'
   Test::More: '0'
   perl: '5.006'
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 0
-generated_by: 'Dist::Zilla version 6.010, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 
2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -22,5 +23,6 @@
   base: '0'
   strict: '0'
   warnings: '0'
-version: '1.20171219'
-x_serialization_backend: 'YAML::Tiny version 1.70'
+version: '1.20200215'
+x_generated_by_perl: v5.30.1
+x_serialization_backend: 'YAML::Tiny version 1.73'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-DNS-Resolver-Mock-1.20171219/Makefile.PL 
new/Net-DNS-Resolver-Mock-1.20200215/Makefile.PL
--- old/Net-DNS-Resolver-Mock-1.20171219/Makefile.PL    2017-12-19 
05:31:17.000000000 +0100
+++ new/Net-DNS-Resolver-Mock-1.20200215/Makefile.PL    2020-02-15 
16:07:51.000000000 +0100
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker 
v6.010.
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker 
v6.012.
 use strict;
 use warnings;
 
@@ -26,9 +26,10 @@
     "warnings" => 0
   },
   "TEST_REQUIRES" => {
+    "Test::Exception" => 0,
     "Test::More" => 0
   },
-  "VERSION" => "1.20171219",
+  "VERSION" => "1.20200215",
   "test" => {
     "TESTS" => "t/*.t"
   }
@@ -40,6 +41,7 @@
   "Net::DNS::Question" => 0,
   "Net::DNS::Resolver" => 0,
   "Net::DNS::ZoneFile" => 0,
+  "Test::Exception" => 0,
   "Test::More" => 0,
   "base" => 0,
   "strict" => 0,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-DNS-Resolver-Mock-1.20171219/README 
new/Net-DNS-Resolver-Mock-1.20200215/README
--- old/Net-DNS-Resolver-Mock-1.20171219/README 2017-12-19 05:31:17.000000000 
+0100
+++ new/Net-DNS-Resolver-Mock-1.20200215/README 2020-02-15 16:07:51.000000000 
+0100
@@ -27,6 +27,27 @@
 
       Reads the zone data from the supplied string
 
+    die_on ( $Name, $Type, $Error )
+
+      Die with $Error for a query of $Name and $Type
+
+    enable_debug ()
+
+      Once set, the resolver will write any lookups received to STDERR and
+      will be available via the following methods
+
+    disble_debug ()
+
+      Disable debugging
+
+    clear_debug ()
+
+      Clear the debugging list
+
+    get_debug ()
+
+      Returns a list of debugging entries
+
 DEPENDENCIES
 
       Net::DNS::Resolver
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-DNS-Resolver-Mock-1.20171219/dist.ini 
new/Net-DNS-Resolver-Mock-1.20200215/dist.ini
--- old/Net-DNS-Resolver-Mock-1.20171219/dist.ini       2017-12-19 
05:31:17.000000000 +0100
+++ new/Net-DNS-Resolver-Mock-1.20200215/dist.ini       2020-02-15 
16:07:51.000000000 +0100
@@ -22,6 +22,7 @@
 location=build
 
 [OurPkgVersion]
+[NextRelease]
 
 [PodSyntaxTests]
 [Test::Perl::Critic]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Net-DNS-Resolver-Mock-1.20171219/lib/Net/DNS/Resolver/Mock.pm 
new/Net-DNS-Resolver-Mock-1.20200215/lib/Net/DNS/Resolver/Mock.pm
--- old/Net-DNS-Resolver-Mock-1.20171219/lib/Net/DNS/Resolver/Mock.pm   
2017-12-19 05:31:17.000000000 +0100
+++ new/Net-DNS-Resolver-Mock-1.20200215/lib/Net/DNS/Resolver/Mock.pm   
2020-02-15 16:07:51.000000000 +0100
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.20171219'; # VERSION
+our $VERSION = '1.20200215'; # VERSION
 
 use base 'Net::DNS::Resolver';
 
@@ -11,6 +11,44 @@
 use Net::DNS::Question;
 use Net::DNS::ZoneFile;
 
+my $die_on = {};
+{
+    my @_debug_output;
+    sub enable_debug {
+        my ( $self ) = @_;
+        $self->{_mock_debug} = 1;
+        $self->_add_debug( "Net::DNS::Resolver::Mock Debugging enabled" );
+        return;
+    }
+    sub disable_debug {
+        my ( $self ) = @_;
+        $self->clear_debug();
+        delete $self->{_mock_debug};
+        return;
+    }
+    sub _add_debug {
+        my ( $self, $debug ) = @_;
+        push @_debug_output, $debug;
+        warn $debug;
+        return;
+    }
+    sub clear_debug {
+        my ( $self ) = @_;
+        @_debug_output = ();
+        return;
+    }
+    sub get_debug {
+        my ( $self ) = @_;
+        return @_debug_output;
+    }
+}
+
+sub die_on {
+    my ( $self, $name, $type, $error ) = @_;
+    $die_on->{ "$name $type" } = $error;
+    return;
+}
+
 sub zonefile_read {
     my ( $self, $zonefile ) = @_;
     $self->{ 'zonefile' } = Net::DNS::ZoneFile->read( $zonefile );
@@ -26,6 +64,12 @@
 sub send {
     my ( $self, $name, $type ) = @_;
 
+    $self->_add_debug( "DNS Lookup '$name' '$type'" ) if $self->{_mock_debug};
+
+    if ( exists ( $die_on->{ "$name $type" } ) ) {
+        die $die_on->{ "$name $type" };
+    }
+
     $name =~ s/\.$//;
 
     my $FakeZone = $self->{ 'zonefile' };
@@ -101,6 +145,27 @@
 
 Reads the zone data from the supplied string
 
+=item die_on ( $Name, $Type, $Error )
+
+Die with $Error for a query of $Name and $Type
+
+=item enable_debug ()
+
+Once set, the resolver will write any lookups received to STDERR
+and will be available via the following methods
+
+=item disble_debug ()
+
+Disable debugging
+
+=item clear_debug ()
+
+Clear the debugging list
+
+=item get_debug ()
+
+Returns a list of debugging entries
+
 =back
 
 =head1 DEPENDENCIES
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-DNS-Resolver-Mock-1.20171219/t/01-debug.t 
new/Net-DNS-Resolver-Mock-1.20200215/t/01-debug.t
--- old/Net-DNS-Resolver-Mock-1.20171219/t/01-debug.t   1970-01-01 
01:00:00.000000000 +0100
+++ new/Net-DNS-Resolver-Mock-1.20200215/t/01-debug.t   2020-02-15 
16:07:51.000000000 +0100
@@ -0,0 +1,57 @@
+#!perl
+use 5.006;
+use strict;
+use warnings FATAL => 'all';
+use Test::More;
+use Test::Exception;
+
+use Net::DNS::Resolver::Mock;
+
+plan tests => 10;
+
+{
+    my $ZoneData = join( "\n",
+        'example.com 3600 A 1.2.3.4',
+    );
+
+    my $Resolver = Net::DNS::Resolver::Mock->new();
+    $Resolver->zonefile_parse( $ZoneData );
+
+    my $Reply;
+
+    $Reply = $Resolver->query( 'google.com', 'A' );
+    is( defined( $Reply ), '', 'Missing entry returns nothing' );
+
+    my @Debug = $Resolver->get_debug;
+    is_deeply ( \@Debug, [], 'Disabled debugging does not log' );
+
+    $Resolver->enable_debug;
+
+    $Reply = $Resolver->query( 'google.com', 'A' );
+    is( defined( $Reply ), '', 'Missing entry returns nothing' );
+
+    @Debug = $Resolver->get_debug;
+    is_deeply ( \@Debug, [ "Net::DNS::Resolver::Mock Debugging enabled", "DNS 
Lookup 'google.com' 'A'" ], 'Enabled debugging logs' );
+
+    $Reply = $Resolver->query( 'google.com.au', 'TXT' );
+    is( defined( $Reply ), '', 'Missing entry returns nothing' );
+
+    @Debug = $Resolver->get_debug;
+    is_deeply ( \@Debug, [ "Net::DNS::Resolver::Mock Debugging enabled", "DNS 
Lookup 'google.com' 'A'", "DNS Lookup 'google.com.au' 'TXT'" ], 'Enabled 
debugging logs' );
+
+    $Reply = $Resolver->query( 'google.com.au', 'TXT' );
+    is( defined( $Reply ), '', 'Missing entry returns nothing' );
+
+    @Debug = $Resolver->get_debug;
+    is_deeply ( \@Debug, [ "Net::DNS::Resolver::Mock Debugging enabled", "DNS 
Lookup 'google.com' 'A'", "DNS Lookup 'google.com.au' 'TXT'", "DNS Lookup 
'google.com.au' 'TXT'" ], 'Enabled debugging logs' );
+
+    $Resolver->disable_debug;
+
+    $Reply = $Resolver->query( 'google.com', 'A' );
+    is( defined( $Reply ), '', 'Missing entry returns nothing' );
+
+    @Debug = $Resolver->get_debug;
+    is_deeply ( \@Debug, [], 'Disabled debugging does not log' );
+
+}
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Net-DNS-Resolver-Mock-1.20171219/t/01-test.t 
new/Net-DNS-Resolver-Mock-1.20200215/t/01-test.t
--- old/Net-DNS-Resolver-Mock-1.20171219/t/01-test.t    2017-12-19 
05:31:17.000000000 +0100
+++ new/Net-DNS-Resolver-Mock-1.20200215/t/01-test.t    2020-02-15 
16:07:51.000000000 +0100
@@ -3,10 +3,11 @@
 use strict;
 use warnings FATAL => 'all';
 use Test::More;
+use Test::Exception;
 
 use Net::DNS::Resolver::Mock;
 
-plan tests => 19;
+plan tests => 20;
 
 {
     my $Resolver = Net::DNS::Resolver::Mock->new();
@@ -64,5 +65,8 @@
     $Reply = $Resolver->query( 'cnameptr.example.com.', 'PTR' );
     is( ref $Reply->{ 'answer' }->[0], 'Net::DNS::RR::PTR', 'New::DNS::RR::PTR 
object returned' );
     is( $Reply->{ 'answer' }->[0]->rdatastr(), 'reverse.example.com.', 
'Correct Address returned' );;
+
+    $Resolver->die_on( 'cnameptr.example.com.', 'PTR', 'Die Test' );;
+    dies_ok( sub{ $Resolver->query( 'cnameptr.example.com.', 'PTR' ) }, 'Dies 
ok' );
 }
 

++++++ cpanspec.yml ++++++
---
#description_paragraphs: 3
#description: |-
#  override description from CPAN
#summary: override summary from CPAN
#no_testing: broken upstream
#sources:
#  - source1
#  - source2
#patches:
#  foo.patch: -p1
#  bar.patch:
#preamble: |-
# BuildRequires:  gcc-c++
#post_prep: |-
# hunspell=`pkg-config --libs hunspell | sed -e 's,-l,,; s,  *,,g'`
# sed -i -e "s,hunspell-X,$hunspell," t/00-prereq.t Makefile.PL 
#post_build: |-
# rm unused.files
#post_install: |-
# sed on %{name}.files
#license: SUSE-NonFree
#skip_noarch: 1
#custom_build: |-
#./Build build flags=%{?_smp_mflags} --myflag
#custom_test: |-
#startserver && make test
#ignore_requires: Bizarre::Module

Reply via email to