NOLookup
view release on metacpan or search on metacpan
t/04test_rdap.t view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More 'no_plan';
use Encode;
use NOLookup::RDAP::RDAPLookup
qw / $RDAP_LOOKUP_ERR_NO_MATCH $RDAP_LOOKUP_ERR_FORBIDDEN /;
# Use ipv4 only sockets for easier config
#use IO::Socket::SSL 'inet4';
use Data::Dumper;
$Data::Dumper::Indent=1;
require_ok('NOLookup::RDAP::RDAPLookup');
my $debug = 0;
my %ehandles;
my %rhandles;
my %identities;
my %ns_handles;
my %ns_names;
my %ns_ips;
my (%iptested, %idtested, %ehtested, %nsntested, %nsniptested, %dnnsntested);
# A test domain that need to be registered.
my @doms = (
qw/
norid.no
/
);
#############
#
# Test pass 1):
# - Test lowest layer access. This access is open for the world.
# - The tests are should be successful if rate limiting is not
# trigged.
#
# Test pass 2):
# - Test basic auth layer access for 'registrar' layer.
# Access uses a username and a password, and requires configuration
# granted for the calling ip-address, username and password.
# - The tests are activated and should be successful if
# $ENV{RDAP_REGISTRAR_BASIC_AUTH_USER} is set along with
# $ENV{RDAP_REGISTRAR_BASIC_AUTH_PASSWORD} and if the rate
# limiting is not trigged.
#
# Test pass 3):
# - Test basic auth layer access for 'registry' layer.
# Access uses a username and a password, and requires configuration
# granted for the calling ip-address, username and password.
# - The tests are activated and should be successful if
# $ENV{RDAP_REGISTRY_BASIC_AUTH_USER} is set along with
# $ENV{RDAP_REGISTRY_BASIC_AUTH_PASSWORD} and and if the rate
# limiting is not trigged.
#
############
my $service_url = $ENV{RDAP_SERVICE_URL} || 'https://rdap.test.norid.no';
unless ($service_url) {
ok(1, "No service URL set, aborting tests");
}
ok(1, "Testing towards service: $service_url");
my $test_secret;
( run in 0.465 second using v1.01-cache-2.11-cpan-6aa56a78535 )